add policyMode setting

This commit is contained in:
Siddharth Singh 2025-03-30 13:14:32 +05:30
parent 28de904e8f
commit dc9e45f133
No known key found for this signature in database

View file

@ -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');