Commit Graph

788 Commits

Author SHA1 Message Date
Fringg
116c8453bb feat: block registration with disposable email addresses
Add DisposableEmailService that fetches ~72k disposable email domains
from github.com/disposable/disposable-email-domains into an in-memory
frozenset with 24h auto-refresh via asyncio background task.

Integrated into three email entry points in cabinet auth routes:
- POST /email/register (link email to Telegram account)
- POST /email/register/standalone (standalone email registration)
- POST /email/change (change existing email)

Controlled by DISPOSABLE_EMAIL_CHECK_ENABLED setting (default: true).
Falls back to allowing all emails if domain list fetch fails.
2026-02-07 00:34:11 +03:00
Fringg
c4794db1dd feat: add TRIAL_DISABLED_FOR setting to disable trial by user type
New setting allows granular control over trial availability:
- none: trial available for all (default)
- email: trial disabled for email users
- telegram: trial disabled for telegram users
- all: trial disabled for everyone

Enforced in bot handlers, cabinet API, and miniapp routes.
Automatically appears in admin panel as dropdown via CHOICES.
2026-02-07 00:19:25 +03:00
Fringg
966a599c2c fix: enforce blacklist via middleware instead of per-handler checks
Add BlacklistMiddleware for aiogram that blocks all message/callback/pre_checkout
from blacklisted users globally. Add blacklist check to cabinet API dependency.
Fix case-insensitive username matching. Remove 10 redundant manual checks from handlers.
2026-02-06 15:48:21 +03:00
Egor
02eca28bc0 Merge pull request #2534 from BEDOLAGA-DEV/feat/version-notification-redesign
feat(notifications): redesign version update notification
2026-02-05 07:32:46 +03:00
Fringg
3f7ca7be3a feat(notifications): redesign version update notification
- Add GitHub Markdown to Telegram HTML converter utility
- Place release description in blockquote expandable
- Auto-truncate description to fit 4096 char message limit
- Clean compact layout with clickable version link
- Convert markdown headers, bold, italic, code, links, strikethrough
2026-02-05 07:29:55 +03:00
Fringg
992a5cb97f fix(autopay): add 6h cooldown for insufficient balance notifications
- Use Redis key with 6h TTL to prevent notification spam on each monitoring cycle
- Fallback to sending notification if Redis is unavailable
- Key auto-expires when user tops up balance and autopay succeeds
2026-02-05 07:17:25 +03:00
Egor
3d94e63c3c Merge pull request #2532 from BEDOLAGA-DEV/fix/daily-tariff-autopay
fix(autopay): exclude daily subscriptions from global autopay
2026-02-05 07:12:03 +03:00
Fringg
b9352a5bd5 fix(autopay): exclude daily subscriptions from global autopay
- Skip daily tariff subscriptions in monitoring autopay cycle
- Filter daily subscriptions in get_subscriptions_for_autopay CRUD
- Block autopay menu and toggle for daily tariffs in bot handler
- Reject autopay enable for daily subscriptions in Cabinet API (HTTP 400)
- Reject autopay enable for daily subscriptions in MiniApp API (HTTP 400)
2026-02-05 07:10:52 +03:00
Fringg
13ebfdb5c4 fix(broadcast): stabilize mass broadcast for 100k+ users
- Add real-time progress bar with updates every 500 msgs / 5 sec
- Fix Telegram rate limiting: batch=25, delay=1.0s (~25 msg/sec)
- Add global flood_wait_until to prevent semaphore slot starvation
- Add parse_mode=HTML for web API broadcasts
- Separate error handling for FloodWait, Forbidden, BadRequest
- Convert ORM objects to scalars before long broadcast operations
- Add email recipients dataclass to prevent detached ORM state
2026-02-05 07:10:43 +03:00
Fringg
b8682adbbf fix(broadcast): resolve SQLAlchemy connection closed errors during long broadcasts
- Extract scalar values from ORM objects before long operations
- Create fresh DB sessions for persist operations with retry mechanism
- Replace ORM User objects with telegram_id integers in broadcast loops
- Update .gitignore to exclude Python cache, IDE files, and local configs

Fixes: InterfaceError "connection is closed" and MissingGreenlet errors
during mass message broadcasts
2026-02-05 05:42:31 +03:00
Egor
c6a5e0d4be Add files via upload 2026-02-04 04:50:38 +03:00
Egor
afb4f162d0 Update admin_notification_service.py 2026-02-04 03:55:59 +03:00
Egor
bd1a0d4a4e Update wata.py 2026-02-04 03:05:22 +03:00
Egor
bf72e81d55 Update promocode_service.py 2026-02-04 02:06:13 +03:00
Egor
bb4f496b21 Add files via upload 2026-02-03 03:50:33 +03:00
Egor
47c1de1cc8 Add files via upload 2026-02-03 03:50:05 +03:00
Egor
03875b593e Add files via upload 2026-02-03 03:38:14 +03:00
Egor
06224d798d Add files via upload 2026-02-03 03:37:43 +03:00
Egor
4941fe9469 Update cloudpayments.py 2026-02-03 03:31:48 +03:00
Egor
39742499b8 Update cloudpayments.py 2026-02-03 03:27:53 +03:00
Egor
7eb302aab0 Update cloudpayments.py 2026-02-03 03:23:23 +03:00
Egor
0adc7145a1 Update user_service.py 2026-02-03 03:14:39 +03:00
Egor
4f1c14fda0 Update blocked_users_service.py 2026-02-02 03:18:46 +03:00
Egor
caeafc7abd Update blocked_users_service.py 2026-02-02 03:10:27 +03:00
Egor
3e873a05a4 Update blocked_users_service.py 2026-02-02 02:56:58 +03:00
Egor
f3851b9ecc Update blocked_users_service.py 2026-02-02 02:53:10 +03:00
Egor
8780ae9407 Update blocked_users_service.py 2026-02-02 02:49:23 +03:00
Egor
c1792f487a Add files via upload 2026-02-02 02:46:03 +03:00
Egor
c70ddfe157 Update startup_notification_service.py 2026-02-02 02:20:41 +03:00
Egor
6cc48d2872 Update startup_notification_service.py 2026-02-02 02:05:28 +03:00
Egor
9fc31c25b2 Update startup_notification_service.py 2026-02-02 02:00:01 +03:00
Egor
62500a6369 Update startup_notification_service.py 2026-02-02 01:34:40 +03:00
Egor
60724a0354 Update startup_notification_service.py 2026-02-02 01:05:30 +03:00
Egor
6b1e78f990 Update maintenance_service.py 2026-02-02 00:55:56 +03:00
Egor
ce822ead2b Update maintenance_service.py 2026-02-02 00:51:13 +03:00
Egor
e606c1d4d5 Update startup_notification_service.py 2026-02-02 00:50:51 +03:00
Egor
5a878239f3 Add files via upload 2026-02-02 00:49:29 +03:00
Egor
bb8e5bb6ca Update admin_notification_service.py 2026-02-02 00:26:53 +03:00
Egor
f9be0e6315 Update admin_notification_service.py 2026-02-02 00:17:20 +03:00
Egor
9e56c56528 Update admin_notification_service.py 2026-02-02 00:11:28 +03:00
gy9vin
551112d2d9 make fix 2026-02-01 14:41:45 +03:00
gy9vin
f581b10e19 fix 2026-02-01 11:23:42 +03:00
gy9vin
1ae6ea18b7 Merge branch 'main' of https://github.com/Gy9vin/remnawave-bedolaga-telegram-bot 2026-02-01 11:18:59 +03:00
gy9vin
bea6c02d89 kassa ai 2026-02-01 11:18:54 +03:00
Mikhail
153083d791 Merge branch 'main' into main 2026-02-01 11:11:23 +03:00
Egor
418d329b75 Update subscription_auto_purchase_service.py 2026-01-31 20:45:55 +03:00
Egor
c30e22e1b1 Update subscription_auto_purchase_service.py 2026-01-31 19:50:03 +03:00
Egor
1371f21d17 Update subscription_auto_purchase_service.py 2026-01-31 19:40:18 +03:00
Egor
8d3bedefb0 Update broadcast_service.py 2026-01-31 17:49:30 +03:00
Egor
b258715cc1 Update broadcast_service.py 2026-01-31 17:45:59 +03:00