fix(telemetry): avoid generic disable flag

This commit is contained in:
saltbo
2026-06-08 14:08:32 -04:00
parent 1a6a77435b
commit 48b82cc804
8 changed files with 4 additions and 36 deletions
-6
View File
@@ -16,7 +16,6 @@ export interface ScheduledEnv {
ZPAN_PUBLIC_ORIGIN?: string
ZPAN_INSTANCE_ID?: string
ZPAN_TELEMETRY_ALLOW_IP?: string
ZPAN_TELEMETRY_DISABLED?: string
[key: string]: unknown
}
@@ -27,10 +26,6 @@ function envAllowsIp(value: string | undefined): boolean {
return !['0', 'false', 'no', 'off'].includes(value?.trim().toLowerCase() ?? '')
}
function envDisablesTelemetry(value: string | undefined): boolean {
return ['1', 'true', 'yes', 'on'].includes(value?.trim().toLowerCase() ?? '')
}
export async function handleScheduled(event: ScheduledTrigger, env: ScheduledEnv): Promise<void> {
const platform = createCloudflarePlatform(env)
const cloudBaseUrl = env.ZPAN_CLOUD_URL ?? ZPAN_CLOUD_URL_DEFAULT
@@ -47,7 +42,6 @@ export async function handleScheduled(event: ScheduledTrigger, env: ScheduledEnv
configuredInstanceId: env.ZPAN_INSTANCE_ID,
siteUrl: env.ZPAN_PUBLIC_ORIGIN ?? env.BETTER_AUTH_URL,
allowIp: envAllowsIp(env.ZPAN_TELEMETRY_ALLOW_IP),
disabled: envDisablesTelemetry(env.ZPAN_TELEMETRY_DISABLED),
},
cron: event.cron,
trigger: 'scheduled',