feat: 增加通知Provider和Jenkins自动同步

This commit is contained in:
湛兮
2026-06-11 21:07:54 +08:00
parent caec5a618d
commit 163f411485
14 changed files with 568 additions and 31 deletions
+11
View File
@@ -34,6 +34,15 @@ const booleanFromEnv = z.preprocess((value) => {
return false;
}, z.boolean().default(false));
const positiveIntegerFromEnv = (defaultValue: number) =>
z.preprocess((value) => {
if (value === undefined || value === null || value === '') {
return undefined;
}
return value;
}, z.coerce.number().int().positive().default(defaultValue));
export const envSchema = z.object({
NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),
PORT: z.coerce.number().int().positive().default(4300),
@@ -46,6 +55,8 @@ export const envSchema = z.object({
JENKINS_BASE_URL: optionalUrl,
JENKINS_USERNAME: optionalString,
JENKINS_API_TOKEN: optionalString,
JENKINS_AUTO_SYNC_ENABLED: booleanFromEnv,
JENKINS_AUTO_SYNC_INTERVAL_MS: positiveIntegerFromEnv(30000),
GITEA_BASE_URL: optionalUrl,
GITEA_TOKEN: optionalString,
GITEA_WEBHOOK_SECRET: optionalString,