mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
feat(api): add env toggles for automatic phone flagging (#2927)
This commit is contained in:
@@ -277,6 +277,10 @@ function defaultConfig(): MasterConfig {
|
||||
},
|
||||
abuse_policy: {
|
||||
inbound_phone_country_codes: [],
|
||||
phone_flagging: {
|
||||
enabled: true,
|
||||
exempt_country_codes: [],
|
||||
},
|
||||
phone_verification: {
|
||||
inbound_required_prefixes: [],
|
||||
},
|
||||
|
||||
@@ -341,6 +341,10 @@ export interface MasterConfig {
|
||||
};
|
||||
abuse_policy: {
|
||||
inbound_phone_country_codes: Array<string>;
|
||||
phone_flagging: {
|
||||
enabled: boolean;
|
||||
exempt_country_codes: Array<string>;
|
||||
};
|
||||
phone_verification: {
|
||||
inbound_required_prefixes: Array<string>;
|
||||
};
|
||||
|
||||
@@ -464,6 +464,8 @@ describe('ConfigLoader', () => {
|
||||
FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL: 'https://status.example/history',
|
||||
FLUXER_INSTANCE_SETUP_CONFIGURED: 'true',
|
||||
FLUXER_ABUSE_INBOUND_PHONE_COUNTRY_CODES: 'AA,BB',
|
||||
FLUXER_ABUSE_PHONE_FLAGGING_ENABLED: 'false',
|
||||
FLUXER_ABUSE_PHONE_FLAGGING_EXEMPT_COUNTRY_CODES: 'CC,DD',
|
||||
FLUXER_ABUSE_PHONE_INBOUND_REQUIRED_PREFIXES: '+101,+202',
|
||||
FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ENABLED: 'true',
|
||||
FLUXER_ABUSE_DIRECT_CONTACT_SPAM_COUNTRY_CODES: 'AA,BB',
|
||||
@@ -492,6 +494,10 @@ describe('ConfigLoader', () => {
|
||||
expect(config.instance.setup.configured).toBe(true);
|
||||
expect(config.instance.abuse_policy).toEqual({
|
||||
inbound_phone_country_codes: ['AA', 'BB'],
|
||||
phone_flagging: {
|
||||
enabled: false,
|
||||
exempt_country_codes: ['CC', 'DD'],
|
||||
},
|
||||
phone_verification: {
|
||||
inbound_required_prefixes: ['+101', '+202'],
|
||||
},
|
||||
|
||||
@@ -369,6 +369,14 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
|
||||
path: ['instance', 'abuse_policy', 'inbound_phone_country_codes'],
|
||||
parse: parseCsv,
|
||||
},
|
||||
FLUXER_ABUSE_PHONE_FLAGGING_ENABLED: {
|
||||
path: ['instance', 'abuse_policy', 'phone_flagging', 'enabled'],
|
||||
parse: parseBoolean,
|
||||
},
|
||||
FLUXER_ABUSE_PHONE_FLAGGING_EXEMPT_COUNTRY_CODES: {
|
||||
path: ['instance', 'abuse_policy', 'phone_flagging', 'exempt_country_codes'],
|
||||
parse: parseCsv,
|
||||
},
|
||||
FLUXER_ABUSE_PHONE_INBOUND_REQUIRED_PREFIXES: {
|
||||
path: ['instance', 'abuse_policy', 'phone_verification', 'inbound_required_prefixes'],
|
||||
parse: parseCsv,
|
||||
|
||||
Reference in New Issue
Block a user