mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
do not create a default policy spec in get controller
This commit is contained in:
parent
ca1c0a8240
commit
42f581d350
2 changed files with 2 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { type AppController } from '@/app.ts';
|
||||
import { createPolicyEvent } from '@/utils/policies/mod.ts';
|
||||
import { DEFAULT_POLICY_SPEC, policyRegistry } from '@/utils/policies/mod.ts';
|
||||
import { policyRegistry } from '@/utils/policies/mod.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const adminListPoliciesController: AppController = (c) => {
|
||||
|
|
@ -27,9 +27,7 @@ export const adminCurrentPolicyController: AppController = async (c) => {
|
|||
}]).then((events) => events[0]);
|
||||
|
||||
if (current) return c.json({ spec: JSON.parse(current.content) });
|
||||
|
||||
await relay.event(await createPolicyEvent(conf, DEFAULT_POLICY_SPEC));
|
||||
return c.json({ spec: DEFAULT_POLICY_SPEC });
|
||||
return c.json({ spec: { policies: [] } });
|
||||
};
|
||||
|
||||
const PolicySpecSchema = z.object({
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ export const DEFAULT_POLICY_SPEC: PolicySpec = {
|
|||
policies: [
|
||||
{ 'name': 'SizePolicy' },
|
||||
{ 'name': 'HellthreadPolicy' },
|
||||
{ 'name': 'HashtagPolicy', 'params': { 'hashtags': ['NSFW', 'explicit', 'violence', 'cp', 'porn'] } },
|
||||
{ 'name': 'ReplyBotPolicy' },
|
||||
{ 'name': 'AntiDuplicationPolicy' },
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue