feat: 增加通知Provider和Jenkins自动同步
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user