215 Commits

Author SHA1 Message Date
Ilay
449a2ff79e merge pull request #96 from snoups/dev v0.7.5 2026-04-10 17:30:31 +05:00
Ilay
55e0934dd1 refactor: inline proxy variable in bot provider 2026-04-10 17:27:46 +05:00
Ilay
b9d552d73c fix: clarify inline mode warning message 2026-04-10 17:19:42 +05:00
Ilay
583fcaafec Merge branch 'pr/93' into dev 2026-04-10 12:10:48 +05:00
Ilay
942dd3e550 fix: add missing return statements after redirect to Subscription.MAIN
- added return {} in duration, payment_method and confirm getters after dialog_manager.start
- added return in on_duration_select and on_payment_method_select handlers after dialog_manager.start
- fixed migration 0020 file extension (.py was missing)
2026-04-10 11:50:27 +05:00
lie-must-die
56271de5f5 Refactor bot session to use proxy directly 2026-04-09 20:16:57 +03:00
Ilay
db27181366 chore: update uv.lock 2026-04-09 12:04:13 +05:00
Ilay
9664d7e199 fix: broadcast close button, webhook response, FreeKassa nonce and misc fixes
- added get_close_notification_button helper and CLOSE_BUTTON_ID constant
- added close button as a selectable option in broadcast button picker
- renamed get_goto_buttons to get_broadcast_buttons
- fixed webhook endpoint: moved gateway.build_webhook_response out of finally block
- re-enabled YooKassa webhook verification
- fixed FreeKassa nonce: switched to time.time_ns() for strict monotonicity
- fixed FreeKassa currency: use .upper() instead of .value
- fixed system stats getter: use stats.memory.used instead of active, cpu.cores instead of physical_cores
- fixed node traffic_limit: pass None instead of 0 to i18n_format_bytes_to_unit
- added as_payload to UserDevicesUpdatedEvent and SubscriptionRevokedEvent with user keyboard
- added session.close() in UnitOfWork __aexit__
- added python-multipart dependency
- added DOCS constant, updated update keyboard links to docs instead of GitHub README
- bumped version 0.7.5
2026-04-09 08:50:45 +05:00
Ilay
292724489b merge pull request #92 from snoups/dev v0.7.4 2026-04-08 00:37:45 +05:00
Ilay
01eb1bd6d2 feat: improve user editor buttons 2026-04-08 00:36:02 +05:00
Ilay
d9b3e1bed3 feat: purchase discount management and discount type display improvements
- added SetUserPurchaseDiscount and ToggleUserTrialAvailable use cases
- added separate personal and purchase discount screens in user editor
- added trial availability toggle button in user editor
- added is_bot_blocked and is_trial_available fields to user getter
- fixed discount calculation: now uses max(personal, purchase) instead of or-chain
- added is_largest_discount_personal and get_effective_discount helpers to PricingService
- added discount type indicator on subscription screens (personal vs purchase)
- updated payment method button to show final_amount with free indicator for 100% discount
- reset purchase_discount to 0 after successful subscription purchase
- fixed translator: strip empty lines left by !empty! placeholder
- temporarily disabled YooKassa webhook verification
2026-04-07 22:59:03 +05:00
Ilay
bbec2547a4 feat: Remnawave version compatibility check and warning notification
- added REMNAWAVE_MIN_VERSION and REMNAWAVE_MAX_VERSION constants
- added version check in try_connection: raises if panel version < min, warns if >= max
- added retry logic (3 attempts with 5s delay) in try_connection
- added RemnawaveVersionWarningEvent with admin notification on version mismatch
- added error handling for GitHub API in update check task
- bumped remnapy to b712d1d
2026-04-07 19:01:56 +05:00
Ilay
c9fcce739b merge branch 'pr/90' into dev 2026-04-07 17:38:00 +05:00
Ilay
f5c47c7e88 merge pull request #88 from lie-must-die/dev
fix(yookassa): add retry logic for ConnectError on payment creation
2026-04-07 08:27:51 +05:00
Ilay
129cdc9a15 merge pull request #89 from lie-must-die/patch-2
fix(roles): fix admin deletion logic and button visibility
2026-04-07 08:25:00 +05:00
Ilay
71f5a0bb6a feat: role management hardening, subscription stats fixes and misc improvements
- added permission checks to SetUserRole: own role change, OWNER protection, role hierarchy enforcement
- fixed GetAdmins canEdit condition: actor.role > target.role instead of target.role > actor.role
- fixed subscription stats queries: added join with User on current_subscription_id to count only current subscriptions
- fixed count_total_trials to count distinct users instead of total trial subscriptions
- added transactions ordering by created_at desc in get_by_user, removed manual reversed() in getter
- increased menu button text and plan name max length from 16 to 32 characters
- fixed pricing: amount normalization to avoid scientific notation
- fixed delete_commands: now called even when setup_commands is disabled
- fixed update check: removed redundant None check for last_notified_version
- added IMPORTER permission to ProcessImportFile use case
- fixed decode_responses: moved to ConnectionPool instead of Redis client
- updated banner docs: added global fallback step and clearer locale resolution order
- renamed custom.ftl example keys from c- to custom- prefix
- bumped version to 0.7.4
2026-04-07 08:22:11 +05:00
Ilay
6ccaf0ffb7 feat: support MONTH_ROLLING traffic strategy and remnawave 2.7.x
- added MONTH_ROLLING traffic reset strategy with subscription creation date support
- added migration 0020: add MONTH_ROLLING value to plan_traffic_limit_strategy enum
- updated get_traffic_reset_delta to accept optional subscription_created_at for MONTH_ROLLING
- passed subscription.created_at to get_traffic_reset_delta in menu getter and show_reason handler
- added MONTH_ROLLING translation in utils.ftl and messages.ftl
- bumped remnapy to 10e5c95 (2.7.x)
- fixed ram_used_percent: fallback to 0 if memory.active is None
- fixed delete_device return type cast to int
- bumped version to 0.7.4
2026-04-05 23:00:48 +05:00
lie-must-die
4f2c9c6b45 Add SOCKS5 proxy options to .env.example
Added optional SOCKS5 proxy configuration for Telegram API access.
2026-04-04 17:49:52 +03:00
lie-must-die
03e845c1e3 Implement SOCKS5 proxy support for Bot
Added support for SOCKS5 proxy in Bot initialization.
2026-04-04 17:46:57 +03:00
lie-must-die
b536c06e20 Add optional proxy_url to BotConfig
Added optional proxy_url attribute to BotConfig.
2026-04-04 17:46:11 +03:00
lie-must-die
a1a99cd44d Added aiohttp-socks dependency 2026-04-04 17:44:55 +03:00
lie-must-die
e32fce5b28 Fix role comparison logic in _is_deletable method 2026-04-04 00:30:17 +03:00
lie-must-die
03efe86f80 Fix condition for button visibility in dialog.py 2026-04-04 00:26:25 +03:00
lie-must-die
e115f4d730 fix(yookassa): add retry logic for ConnectError on payment creation
Intermittent DNS resolution failures (gaierror -3) caused payment
creation requests to YooKassa API to fail immediately with ConnectError.

Added retry loop in `handle_create_payment` with exponential backoff:
- 3 attempts total
- Delay between attempts: 1s, 2s, 3s
- Only ConnectError is retried; HTTP and parse errors fail fast as before
2026-04-03 19:07:05 +03:00
Ilay
11d59ab594 merge pull request #81 from snoups/dev v0.7.3 2026-03-29 09:19:48 +05:00
Ilay
ad3751a8eb fix: mark old subscription as DELETED instead of DISABLED on purchase and cleanup type ignore
- changed old subscription status from DISABLED to DELETED when purchasing a new one
- removed unnecessary type: ignore comment for subscription_url
- bumped version to 0.7.3
2026-03-29 09:13:03 +05:00
Ilay
5cf9d4ca09 fix: subscription stats, plan flow error handling and misc fixes
- added total_disabled and total_limited fields to SubscriptionStatsDto and PlanSubStatsDto
- fixed is_unlimited condition: changed or_ to and_ in subscription stats query
- excluded DELETED subscriptions from stats queries
- fixed PlanSubStatsDto field names: total_subs/active_subs/expired_subs → total/total_active/total_expired
- replaced raise ValueError with redirect to Subscription.MAIN when PlanDto missing in dialog data
- replaced raise ValueError with redirect to Subscription.MAIN when plan not found on selection
- fixed migration 0019: added explicit COMMIT/BEGIN, fixed invalid menu button payloads
- fixed broadcast text-too-long translation: $max_limit variable reference
- fixed user_name_clean: strip remaining HTML special chars
- added limit=50 to get_recent_registered_users call
- bumped remnapy to f442fb6
- minor import cleanups across multiple files
2026-03-29 08:53:34 +05:00
Ilay
7aa7f2c61c merge pull request #77 from snoups/dev v0.7.2 2026-03-27 08:35:43 +05:00
Ilay
c5f150e9b7 fix: temporarily disable webhook verification in MulenPay 2026-03-27 08:34:35 +05:00
Ilay
0e20c410a6 merge pull request #76 from snoups/dev 2026-03-27 08:31:03 +05:00
Ilay
1191cec4ee refactor: introduce Deeplink enum and add invite deeplink handler
- added Deeplink enum with build_url, with_prefix and with_underscore helpers
- replaced DEEPLINK_PREFIX, REFERRAL_PREFIX, PLAN_PREFIX constants with Deeplink enum
- added on_goto_invite handler for ?start=invite deeplink
2026-03-27 08:19:19 +05:00
Ilay
7788986ee4 fix: broad fixes across payments, events, UI and error handling
- renamed gateway settings DTOs to proper casing (YooKassa, YooMoney, CryptoPay, RoboKassa)
- added migration 0019: remove CryptoPay secret_key field and set owner role
- added separate SubscriptionExpiredAgoEvent, fixed EXPIRED_24_HOURS_AGO handling
- fixed UserFirstConnectionEvent event key and added as_payload method with user redirect keyboard
- added MenuEditorInvalidPayloadError with validation in ConfirmMenuButtonChanges
- added rules_getter and channel_getter with current values display in access dialog
- added back-to-plans button on payment method and confirm screens
- fixed subscription getter: null check for raw_plan before retort.load
- fixed has_device_limit: now accounts for device_limit == 0 (to show devices button when device limit is unlimited)
- fixed broadcast preview check for empty content
- fixed error middleware: handle TelegramForbiddenError and show unknown error notification
- fixed plan-not-found: use i18n notifier instead of raw message.answer
- fixed currency serialization via .value in MulenPay, UrlPay, Wata, PayMaster, CryptoPay
- fixed MulenPay amount formatting via Decimal.quantize
- fixed duplicate update available notification
- refactored Makefile: split run/migration/migrate targets into local and prod variants
- bumped version to 0.7.2
2026-03-27 02:56:44 +05:00
Ilay
b9e9abc23d merge pull request #75 from snoups/dev v0.7.1 2026-03-25 23:43:45 +05:00
Ilay
a325a65e07 feat: bump version to 0.7.1 and refactor bot state management
- update project version to 0.7.1
- centralize bot metadata handling (groups, privacy, inline) in BotService
- implement startup check and warning for disabled inline mode
- simplify lifespan logic by offloading bot info retrieval to the service
- improve banner logging with structured bot state information
2026-03-25 23:32:55 +05:00
Ilay
4a4b2cceb8 fix: improve infrastructure config, resolve sdk bugs and refactor gateway settings
- update .env.example with comprehensive documentation and optional variables
- fix version formatting and add revoked subscription translation
- implement get_referrals_with_payment_count for accurate invite statistics
- refactor payment gateway configuration to use dynamic type loading via retort
- adjust yookassa settings types and remove deprecated platega gateway
- set delete user device permission to public
- fix missing keyword arguments in sdk and interactor calls
- simplify localelist validation and migrate point withdrawal to notifier service
2026-03-25 23:13:05 +05:00
Ilay
9037b62149 merge pull request #70 from snoups/dev
refactor: enhance infrastructure stability and fix circular imports
v0.7.0
2026-03-24 23:54:51 +05:00
Ilay
72dbc3f850 refactor: enhance infrastructure stability and fix circular imports
- update postgres and valkey healthchecks to include default values and password support
- switch valkey startup command to shell script for conditional authentication
- change production database port mapping from 6767 to 5001
- resolve circular imports in user events by localizing keyboard imports
- refactor LocaleList to robustly validate both native lists and csv strings
2026-03-24 23:51:39 +05:00
Ilay
d8ca46f4f3 merge pull request #69 from snoups/dev 2026-03-24 23:18:14 +05:00
Ilay
fe9f562c3e build: install git in Dockerfile builder stage 2026-03-24 23:15:21 +05:00
Ilay
c2160399f7 fix: subscription events payload and trial handling
- fixed subscription events to include proper payload with actions
- added keyboards for buy and renew actions in notifications
- fixed trial handling in subscription events
- added is_trial to SubscriptionExpiredEvent and SubscriptionExpiresEvent
- fixed Remnawave webhook to pass is_trial in events
2026-03-24 22:59:18 +05:00
Ilay
2833c26b7e fix: correct i18n key for all-devices-deleted notification and show panel version in header
- fixed typo in i18n key: all-delete → all-deleted
- added panel version display in RemnaWave dashboard header
2026-03-24 22:41:13 +05:00
Ilay
09b4ffee90 refactor: simplify metadata fetch in system getter 2026-03-24 21:08:30 +05:00
Ilay
199d382831 chore: replace README with docs link, pin remnapy to commit, minor fixes
- replaced README content with link to external docs (en + ru)
- cleaned up .env.example by removing optional commented variables
- pinned remnapy source to specific commit rev instead of tag
- added panel version display via get_metadata in system getter with fallback
- skipped update check for dev builds in update task
2026-03-24 15:44:00 +05:00
Ilay
68969a0ac6 feat: add SubscriptionRevokedEvent and resolve external squad name in profile
- added SubscriptionRevokedEvent with notification type USER_REVOKED_SUBSCRIPTION
- added revoked event translation in events.ftl
- refactored _process_status to use sync instead of manual status update
- added REVOKED event handling in RemnaWebhookService
- resolved external squad name via API instead of showing raw UUID
- fixed first_connected_at and last_connected_at field names in subscription getter
- fixed formatted_internal_squads and formatted_external_squad to return Optional[str]
- added is_trial field to UserFirstConnectionEvent
- updated devices message to conditionally show hint based on device count
- changed default platform icon from 📟 to 📱
2026-03-24 08:54:31 +05:00
Ilay
54c7af40b6 merge pull request #65 from lie-must-die/feat/devices-management
feat: redesign devices management page
2026-03-24 00:24:35 +05:00
Ilay
831c7ddb48 chore: bump remnapy from 2.3.3 to 2.6.3 and pin version
- updated remnapy dependency from >=2.3.3 to ==2.6.3
- updated uv.lock with new package hashes and URLs
2026-03-24 00:22:47 +05:00
Ilay
ec9c0f5588 refactor: extract device and subscription management into use cases
- added DeleteUserAllDevices and ReissueSubscription use cases
- replaced inline device/subscription logic in handlers with use case calls
- switched delete-all and reissue buttons from Button to Start with state navigation
- removed on_device_delete_all_request and on_reissue_subscription_request handlers
- refactored get_platform_icon to handle None platform with default icon
- updated device notification strings to use italic formatting
2026-03-24 00:21:57 +05:00
Ilay
96ecdf5d40 chore: enable taskiq scheduler in local compose and fix tasks glob pattern
- uncommented and enabled taskiq scheduler service in docker-compose.local.yml
- fixed tasks-pattern glob to use *.py in all compose files
- sorted imports in menu dialog
2026-03-23 21:42:05 +05:00
lie-must-die
6ac5b09de0 feat: redesign devices management page 2026-03-23 00:22:57 +03:00
Ilay
9a9c44440e feat: add devices management window in main menu dialog
- added devices window with list of user devices and delete button
- added devices_getter and on_device_delete imports
- registered devices window in Dialog router
- reduced Redis lock TTL from 3600 to 600 for import and sync handlers
2026-03-23 00:43:26 +05:00