Merge branch 'main' into feat/cloud-load-balance

This commit is contained in:
Fu Diwei 2024-10-31 09:14:57 +08:00
commit be495839b6
13 changed files with 76 additions and 32 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>" # IP0.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>

View File

@ -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,

View File

@ -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;
};

View File

@ -1 +1 @@
export const version = "Certimate v0.2.9";
export const version = "Certimate v0.2.11";

View File

@ -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",

View File

@ -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 名称",

View File

@ -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>

View File

@ -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} />

View File

@ -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;

View File

@ -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} />