Merge branch 'canary' into feat/shared-ssh

This commit is contained in:
Mauricio Siu
2024-07-26 01:14:55 -06:00
committed by GitHub
21 changed files with 253 additions and 427 deletions

View File

@@ -33,3 +33,28 @@ export const sshKeyUpdate = sshKeyCreate.pick({
});
export const sshKeyType = z.enum(["rsa", "ed25519"]).optional();
export const domain = z
.object({
host: z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9\.-]*\.[a-zA-Z]{2,}$/, {
message: "Invalid hostname",
}),
path: z.string().min(1).optional(),
port: z
.number()
.min(1, { message: "Port must be at least 1" })
.max(65535, { message: "Port must be 65535 or below" })
.optional(),
https: z.boolean().optional(),
certificateType: z.enum(["letsencrypt", "none"]).optional(),
})
.superRefine((input, ctx) => {
if (input.https && !input.certificateType) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ["certificateType"],
message: "Required",
});
}
});