From dc9e45f133c36215f3d24db765e22e4eaae8109d Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Sun, 30 Mar 2025 13:14:32 +0530 Subject: [PATCH] add policyMode setting --- packages/conf/DittoConf.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/conf/DittoConf.ts b/packages/conf/DittoConf.ts index 59a3fde4..c48619f9 100644 --- a/packages/conf/DittoConf.ts +++ b/packages/conf/DittoConf.ts @@ -368,6 +368,11 @@ export class DittoConf { return this.env.get('DITTO_POLICY') || path.join(this.dataDir, 'policy.ts'); } + get policyMode(): string { + if (Deno.env.get("DITTO_CUSTOM_POLICY") === "1") return "script"; + return "event"; + } + /** Absolute path to the data directory used by Ditto. */ get dataDir(): string { return this.env.get('DITTO_DATA_DIR') || path.join(Deno.cwd(), 'data');