add policyMode setting

This commit is contained in:
Siddharth Singh 2025-03-30 13:31:58 +05:30
parent 7cb643d1e4
commit b0036a3d28
No known key found for this signature in database

View file

@ -368,9 +368,8 @@ export class DittoConf {
return this.env.get('DITTO_POLICY') || path.join(this.dataDir, 'policy.ts'); return this.env.get('DITTO_POLICY') || path.join(this.dataDir, 'policy.ts');
} }
get policyMode(): string { get policyMode(): "script" | "event" {
if (Deno.env.get("DITTO_CUSTOM_POLICY") === "1") return "script"; return this.env.get("DITTO_CUSTOM_POLICY") ? "script" : "event";
return "event";
} }
/** Absolute path to the data directory used by Ditto. */ /** Absolute path to the data directory used by Ditto. */