feat: expose Telegram anti-flood settings

This commit is contained in:
3252a8
2026-06-05 11:38:42 +03:00
parent fd1edf38b5
commit 728599c882
8 changed files with 490 additions and 1 deletions
@@ -6030,6 +6030,243 @@
"id": "system",
"order": 12,
"fields": [
{
"key": "TELEGRAM_DROP_NON_PRIVATE_UPDATES",
"type": "bool",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Drop non-private Telegram updates",
"description": "Drops group/channel messages and callbacks before DB-backed middleware runs.",
"i18n_label_key": "admin_settings_field_telegram_drop_non_private_updates_label",
"i18n_description_key": "admin_settings_field_telegram_drop_non_private_updates_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_ENABLED",
"type": "bool",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Telegram anti-flood enabled",
"description": "Enables soft per-user limits for extreme Telegram update floods.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_enabled_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_enabled_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_WINDOW_SECONDS",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Anti-flood window",
"description": "Rolling window, in seconds, used by all Telegram anti-flood buckets.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_window_seconds_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_window_seconds_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 1,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_MAX_UPDATES_PER_WINDOW",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "All updates limit",
"description": "Maximum total Telegram updates from one actor during the window. 0 disables this bucket.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_max_updates_per_window_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_max_updates_per_window_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_MESSAGE_MAX_PER_WINDOW",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Messages limit",
"description": "Maximum message updates from one actor during the window. 0 disables this bucket.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_message_max_per_window_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_message_max_per_window_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_CALLBACK_MAX_PER_WINDOW",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Button callbacks limit",
"description": "Maximum callback-query updates from one actor during the window. 0 disables this bucket.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_callback_max_per_window_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_callback_max_per_window_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_INLINE_MAX_PER_WINDOW",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Inline queries limit",
"description": "Maximum inline-query updates from one actor during the window. 0 disables this bucket.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_inline_max_per_window_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_inline_max_per_window_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_START_MAX_PER_WINDOW",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "/start limit",
"description": "Maximum /start messages from one actor during the window. 0 disables this bucket.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_start_max_per_window_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_start_max_per_window_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ANTIFLOOD_EXPENSIVE_CALLBACK_MAX_PER_WINDOW",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Expensive callbacks limit",
"description": "Maximum payment, trial, promo and account-changing callbacks from one actor during the window. 0 disables this bucket.",
"i18n_label_key": "admin_settings_field_telegram_antiflood_expensive_callback_max_per_window_label",
"i18n_description_key": "admin_settings_field_telegram_antiflood_expensive_callback_max_per_window_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_ACTION_COOLDOWN_ENABLED",
"type": "bool",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Action cooldowns enabled",
"description": "Deduplicates repeated payment and trial button presses from the same user.",
"i18n_label_key": "admin_settings_field_telegram_action_cooldown_enabled_label",
"i18n_description_key": "admin_settings_field_telegram_action_cooldown_enabled_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_PAYMENT_CALLBACK_COOLDOWN_SECONDS",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Payment callback cooldown",
"description": "Seconds to suppress an exact repeated payment callback from the same user. 0 disables this cooldown.",
"i18n_label_key": "admin_settings_field_telegram_payment_callback_cooldown_seconds_label",
"i18n_description_key": "admin_settings_field_telegram_payment_callback_cooldown_seconds_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEGRAM_TRIAL_CALLBACK_COOLDOWN_SECONDS",
"type": "int",
"section": "system",
"section_order": 12,
"subsection": "telegram_antiflood",
"label": "Trial callback cooldown",
"description": "Seconds to suppress an exact repeated trial activation callback from the same user. 0 disables this cooldown.",
"i18n_label_key": "admin_settings_field_telegram_trial_callback_cooldown_seconds_label",
"i18n_description_key": "admin_settings_field_telegram_trial_callback_cooldown_seconds_description",
"i18n_subsection_key": "admin_settings_subsection_telegram_antiflood",
"i18n_placeholder_key": null,
"placeholder": "",
"optional": true,
"secret": false,
"min": 0,
"value": "",
"overridden": false,
"updated_at": null
},
{
"key": "TELEMETRY_ENABLED",
"type": "bool",