mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-19 09:51:55 +08:00
Merge branch 'main' into feat/cloud-load-balance
This commit is contained in:
commit
be495839b6
@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Certimate - Your Trusted SSL Automation Partner</title>
|
||||
</head>
|
||||
<body class="bg-background">
|
||||
<body class="bg-background" style="pointer-events: auto !important">
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
|
@ -195,7 +195,16 @@ const AccessEditDialog = ({ trigger, op, data, className }: AccessEditProps) =>
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog onOpenChange={setOpen} open={open} modal={false}>
|
||||
<Dialog
|
||||
onOpenChange={(openState) => {
|
||||
if (openState) {
|
||||
document.body.style.pointerEvents = "auto";
|
||||
}
|
||||
setOpen(openState);
|
||||
}}
|
||||
open={open}
|
||||
modal={false}
|
||||
>
|
||||
<DialogTrigger asChild className={cn(className)}>
|
||||
{trigger}
|
||||
</DialogTrigger>
|
||||
|
@ -179,7 +179,12 @@ const DeployEditDialog = ({ trigger, deployConfig, onSave }: DeployEditDialogPro
|
||||
>
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger>{trigger}</DialogTrigger>
|
||||
<DialogContent className="dark:text-stone-200">
|
||||
<DialogContent
|
||||
className="dark:text-stone-200"
|
||||
onInteractOutside={(event) => {
|
||||
event.preventDefault();
|
||||
}}
|
||||
>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("domain.deployment.tab")}</DialogTitle>
|
||||
<DialogDescription></DialogDescription>
|
||||
|
@ -199,6 +199,37 @@ $binding = Get-WebBinding -Name "$siteName" -Protocol "https" -Port $port -IPAdd
|
||||
# 绑定 SSL 证书
|
||||
$binding.AddSslCertificate($thumbprint, "My")
|
||||
# 删除目录下的证书文件
|
||||
Remove-Item -Path "$pfxPath" -Force
|
||||
`.trim();
|
||||
});
|
||||
setDeploy(newData);
|
||||
}
|
||||
break;
|
||||
|
||||
case "binding_netsh":
|
||||
{
|
||||
const newData = produce(data, (draft) => {
|
||||
draft.config ??= {};
|
||||
draft.config.shell = "powershell";
|
||||
draft.config.command = `
|
||||
# 请将以下变量替换为实际值
|
||||
$pfxPath = "<your-pfx-path>" # PFX 文件路径
|
||||
$pfxPassword = "<your-pfx-password>" # PFX 密码
|
||||
$ipaddr = "<your-binding-ip>" # 绑定 IP,“0.0.0.0”表示所有 IP 绑定,可填入域名。
|
||||
$port = "<your-binding-port>" # 绑定端口
|
||||
|
||||
$addr = $ipaddr + ":" + $port
|
||||
|
||||
# 导入证书到本地计算机的个人存储区
|
||||
$cert = Import-PfxCertificate -FilePath "$pfxPath" -CertStoreLocation Cert:\\LocalMachine\\My -Password (ConvertTo-SecureString -String "$pfxPassword" -AsPlainText -Force) -Exportable
|
||||
# 获取 Thumbprint
|
||||
$thumbprint = $cert.Thumbprint
|
||||
# 检测端口是否绑定证书,如绑定则删除绑定
|
||||
$isExist = netsh http show sslcert ipport=$addr
|
||||
if ($isExist -like "*$addr*"){ netsh http delete sslcert ipport=$addr }
|
||||
# 绑定到端口
|
||||
netsh http add sslcert ipport=$addr certhash=$thumbprint
|
||||
# 删除目录下的证书文件
|
||||
Remove-Item -Path "$pfxPath" -Force
|
||||
`.trim();
|
||||
});
|
||||
@ -425,6 +456,9 @@ Remove-Item -Path "$pfxPath" -Force
|
||||
<DropdownMenuItem onClick={() => handleUsePresetScript("binding_iis")}>
|
||||
{t("domain.deployment.form.shell_preset_scripts.option.binding_iis.label")}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => handleUsePresetScript("binding_netsh")}>
|
||||
{t("domain.deployment.form.shell_preset_scripts.option.binding_netsh.label")}
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
|
@ -79,11 +79,11 @@ const DeployToTencentCOS = () => {
|
||||
});
|
||||
|
||||
const regionSchema = z.string().regex(/^ap-[a-z]+$/, {
|
||||
message: t("domain.deployment.form.cos_region.placeholder"),
|
||||
message: t("domain.deployment.form.tencent_cos_region.placeholder"),
|
||||
});
|
||||
|
||||
const bucketSchema = z.string().regex(/^.+-\d+$/, {
|
||||
message: t("domain.deployment.form.cos_bucket.placeholder"),
|
||||
message: t("domain.deployment.form.tencent_cos_bucket.placeholder"),
|
||||
});
|
||||
|
||||
return (
|
||||
@ -97,7 +97,7 @@ const DeployToTencentCOS = () => {
|
||||
onChange={(e) => {
|
||||
const temp = e.target.value;
|
||||
|
||||
const resp = bucketSchema.safeParse(temp);
|
||||
const resp = regionSchema.safeParse(temp);
|
||||
if (!resp.success) {
|
||||
setError({
|
||||
...error,
|
||||
|
@ -26,7 +26,13 @@ export type NotifyChannels = {
|
||||
mail?: NotifyChannelMail;
|
||||
};
|
||||
|
||||
export type NotifyChannel = NotifyChannelDingTalk | NotifyChannelLark | NotifyChannelTelegram | NotifyChannelWebhook | NotifyChannelServerChan | NotifyChannelMail;
|
||||
export type NotifyChannel =
|
||||
| NotifyChannelDingTalk
|
||||
| NotifyChannelLark
|
||||
| NotifyChannelTelegram
|
||||
| NotifyChannelWebhook
|
||||
| NotifyChannelServerChan
|
||||
| NotifyChannelMail;
|
||||
|
||||
export type NotifyChannelDingTalk = {
|
||||
accessToken: string;
|
||||
@ -60,8 +66,8 @@ export type NotifyChannelMail = {
|
||||
receiverAddresses: string;
|
||||
smtpHostAddr: string;
|
||||
smtpHostPort: string;
|
||||
username:string;
|
||||
password:string;
|
||||
username: string;
|
||||
password: string;
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
|
@ -1 +1 @@
|
||||
export const version = "Certimate v0.2.9";
|
||||
export const version = "Certimate v0.2.11";
|
||||
|
@ -146,6 +146,7 @@
|
||||
"domain.deployment.form.shell_preset_scripts.trigger": "Use Preset Scripts",
|
||||
"domain.deployment.form.shell_preset_scripts.option.reload_nginx.label": "Bash - Reload Nginx",
|
||||
"domain.deployment.form.shell_preset_scripts.option.binding_iis.label": "PowerShell - Binding IIS",
|
||||
"domain.deployment.form.shell_preset_scripts.option.binding_netsh.label": "PowerShell - Binding netsh(Windows)",
|
||||
"domain.deployment.form.k8s_namespace.label": "Namespace",
|
||||
"domain.deployment.form.k8s_namespace.placeholder": "Please enter namespace",
|
||||
"domain.deployment.form.k8s_secret_name.label": "Secret Name",
|
||||
|
@ -143,6 +143,7 @@
|
||||
"domain.deployment.form.shell_preset_scripts.trigger": "使用预设脚本",
|
||||
"domain.deployment.form.shell_preset_scripts.option.reload_nginx.label": "Bash - 重启 nginx",
|
||||
"domain.deployment.form.shell_preset_scripts.option.binding_iis.label": "PowerShell - 导入并绑定到 IIS(需管理员权限)",
|
||||
"domain.deployment.form.shell_preset_scripts.option.binding_netsh.label": "PowerShell - 导入并绑定到netsh(需管理员权限)",
|
||||
"domain.deployment.form.k8s_namespace.label": "命名空间",
|
||||
"domain.deployment.form.k8s_namespace.placeholder": "请输入 K8S 命名空间",
|
||||
"domain.deployment.form.k8s_secret_name.label": "Secret 名称",
|
||||
|
@ -117,7 +117,9 @@ const Access = () => {
|
||||
className="flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm"
|
||||
key={access.id}
|
||||
>
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-center">{access.name}</div>
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-start">
|
||||
<div className="pr-3 truncate">{access.name}</div>
|
||||
</div>
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2">
|
||||
<img src={accessProvidersMap.get(access.configType)?.icon} className="w-6" />
|
||||
<div>{t(accessProvidersMap.get(access.configType)?.name || "")}</div>
|
||||
|
@ -180,13 +180,8 @@ const Dashboard = () => {
|
||||
key={deployment.id}
|
||||
className="flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm"
|
||||
>
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-center">
|
||||
{deployment.expand.domain?.domain.split(";").map((domain: string) => (
|
||||
<>
|
||||
{domain}
|
||||
<br />
|
||||
</>
|
||||
))}
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex flex-col items-start">
|
||||
{deployment.expand.domain?.domain.split(";").map((domain: string) => <div className="pr-3 truncate w-full">{domain}</div>)}
|
||||
</div>
|
||||
<div className="sm:w-24 w-full pt-1 sm:pt-0 flex items-center">
|
||||
<DeployState deployment={deployment} />
|
||||
|
@ -201,12 +201,9 @@ const Home = () => {
|
||||
className="flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm"
|
||||
key={domain.id}
|
||||
>
|
||||
<div className="sm:w-36 w-full pt-1 sm:pt-0 flex items-center truncate">
|
||||
{domain.domain.split(";").map((item) => (
|
||||
<>
|
||||
{item}
|
||||
<br />
|
||||
</>
|
||||
<div className="sm:w-36 w-full pt-1 sm:pt-0 flex flex-col items-start">
|
||||
{domain.domain.split(";").map((domain: string) => (
|
||||
<div className="pr-3 truncate w-full">{domain}</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="sm:w-40 w-full pt-1 sm:pt-0 flex items-center">
|
||||
@ -340,4 +337,3 @@ const Home = () => {
|
||||
};
|
||||
|
||||
export default Home;
|
||||
|
||||
|
@ -75,13 +75,8 @@ const History = () => {
|
||||
key={deployment.id}
|
||||
className="flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm"
|
||||
>
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-center">
|
||||
{deployment.expand.domain?.domain.split(";").map((domain: string) => (
|
||||
<>
|
||||
{domain}
|
||||
<br />
|
||||
</>
|
||||
))}
|
||||
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-start flex-col">
|
||||
{deployment.expand.domain?.domain.split(";").map((domain: string) => <div className="pr-3 truncate w-full">{domain}</div>)}
|
||||
</div>
|
||||
<div className="sm:w-24 w-full pt-1 sm:pt-0 flex items-center">
|
||||
<DeployState deployment={deployment} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user