mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(api): archive and schedule automated message deletion (#3231)
This commit is contained in:
1 parent
f4e545e090
commit
e26c8c870d
13 files changed
+365
-120
No files matched your search
@@ -102,6 +102,7 @@ function defaultConfig(): MasterConfig {
|
||||
headers_timeout_ms: 30_000,
|
||||
request_timeout_ms: 120_000,
|
||||
max_inflight_requests: 512,
|
||||
automated_message_deletion_delay_days: 7,
|
||||
ip_ban_exempt_ips: [],
|
||||
donation_proxy_key: '',
|
||||
trusted_callers: [],
|
||||
@@ -604,6 +605,12 @@ function normalizeConfig(config: MasterConfig): MasterConfig {
|
||||
validateReplyToEmail(config.integrations.email.reply_to_email);
|
||||
normalizeAppOriginAliases(config);
|
||||
assertIntegerInRange(config.services.api.max_inflight_requests, 'FLUXER_API_MAX_INFLIGHT_REQUESTS', 1, 100_000);
|
||||
assertIntegerInRange(
|
||||
config.services.api.automated_message_deletion_delay_days,
|
||||
'FLUXER_API_AUTOMATED_MESSAGE_DELETION_DELAY_DAYS',
|
||||
1,
|
||||
365,
|
||||
);
|
||||
assertIntegerInRange(config.services.api.headers_timeout_ms, 'FLUXER_API_HEADERS_TIMEOUT_MS', 1_000, 3_600_000);
|
||||
assertIntegerInRange(config.services.api.request_timeout_ms, 'FLUXER_API_REQUEST_TIMEOUT_MS', 1_000, 3_600_000);
|
||||
assertIntegerInRange(config.domain.public_port, 'FLUXER_PUBLIC_PORT', 1, 65_535);
|
||||
|
||||
@@ -88,6 +88,7 @@ export interface MasterConfig {
|
||||
headers_timeout_ms: number;
|
||||
request_timeout_ms: number;
|
||||
max_inflight_requests: number;
|
||||
automated_message_deletion_delay_days: number;
|
||||
ip_ban_exempt_ips: Array<string>;
|
||||
donation_proxy_key: string;
|
||||
trusted_callers: Array<{
|
||||
|
||||
@@ -20,6 +20,7 @@ const API_SETTINGS_NOT_FORWARDED: Record<string, string> = {
|
||||
FLUXER_TEST_MODE_ENABLED: 'test and development only',
|
||||
FLUXER_TEST_HARNESS_TOKEN: 'test and development only',
|
||||
FLUXER_VALIDATE_RESPONSES: 'test and development only',
|
||||
FLUXER_API_AUTOMATED_MESSAGE_DELETION_DELAY_DAYS: 'automated account actions run only on the hosted service',
|
||||
...Object.fromEntries(
|
||||
['MONTHLY', 'YEARLY', 'GIFT_1_MONTH', 'GIFT_1_YEAR'].flatMap((slot) =>
|
||||
['USD', 'EUR', 'BRL', 'DKK', 'INR', 'NOK', 'PLN', 'SEK', 'TRY'].map((currency) => [
|
||||
|
||||
@@ -71,6 +71,10 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
|
||||
FLUXER_API_HEADERS_TIMEOUT_MS: {path: ['services', 'api', 'headers_timeout_ms'], parse: parseInteger},
|
||||
FLUXER_API_REQUEST_TIMEOUT_MS: {path: ['services', 'api', 'request_timeout_ms'], parse: parseInteger},
|
||||
FLUXER_API_MAX_INFLIGHT_REQUESTS: {path: ['services', 'api', 'max_inflight_requests'], parse: parseInteger},
|
||||
FLUXER_API_AUTOMATED_MESSAGE_DELETION_DELAY_DAYS: {
|
||||
path: ['services', 'api', 'automated_message_deletion_delay_days'],
|
||||
parse: parseInteger,
|
||||
},
|
||||
FLUXER_API_IP_BAN_EXEMPT_IPS: {path: ['services', 'api', 'ip_ban_exempt_ips'], parse: parseCsv},
|
||||
FLUXER_API_DONATION_PROXY_KEY: {path: ['services', 'api', 'donation_proxy_key']},
|
||||
FLUXER_API_TRUSTED_CALLERS: {path: ['services', 'api', 'trusted_callers'], parse: parseJsonArray},
|
||||
|
||||
Reference in new issue
Block a user