Commit Graph

16 Commits

Author SHA1 Message Date
Fringg
784616b349 refactor: replace universal_migration.py with Alembic
Remove the 7,791-line universal_migration.py and 16 incomplete individual
Alembic migrations. Replace with a single initial schema migration using
Base.metadata.create_all(checkfirst=True).

Changes:
- Add programmatic Alembic runner (app/database/migrations.py) with
  auto-stamp logic for existing databases transitioning from
  universal_migration
- Extract ensure_default_web_api_token() to web_api_token_service.py
- Extract sync_postgres_sequences() to database.py with SQL injection
  prevention via _quote_ident()
- Add HMAC token hashing support with backward-compatible dual-hash
  fallback and automatic rehashing
- Remove dead init_db() function and unused imports
- Add Makefile targets: migrate, migration, migrate-stamp, migrate-history
- Fix fileConfig() destroying structlog config (disable_existing_loggers)
- Remove duplicate migrations/alembic/alembic.ini with credentials
- Add script.py.mako template for future migration generation
- Update startup flow: alembic upgrade → sync sequences → ensure token
- Harden database.py: ParamSpec for retry decorator, safe URL logging,
  echo='debug' mode, execute_with_retry validation
- Update documentation references

31 files changed, 302 insertions(+), 9,226 deletions(-)
2026-02-18 08:10:20 +03:00
Egor
479b9bc384 Add telegram id support for promo offers 2025-12-05 09:56:03 +03:00
gy9vin
cfdc829f48 update 2025-11-07 22:24:43 +03:00
Egor
9fe7d0592f Expose unified health status alongside admin API 2025-11-06 18:02:08 +03:00
Egor
30ec07f7fe Avoid loading poll responses in list endpoint 2025-10-24 09:39:39 +03:00
Egor
fa3ed3af81 Add system log endpoints to admin API 2025-10-24 09:20:34 +03:00
Egor
5f316f85b3 feat: expose monitoring logs through web api 2025-10-24 09:06:08 +03:00
Egor
a2cb7527f8 feat(api): add promo offers endpoints and docs 2025-10-06 04:27:21 +03:00
Egor
9c1ca5b748 Ensure default web API token stays in sync with settings 2025-09-28 06:16:13 +03:00
Egor
4bc1c402e9 feat: document remnawave endpoints in swagger 2025-09-28 05:09:24 +03:00
Egor
1e14a0919f Revert "Add Remnawave component management API" 2025-09-28 04:56:33 +03:00
Egor
c10e34ad43 Add Remnawave component management API 2025-09-28 04:53:01 +03:00
Egor
8d5e2037d3 Revert "Replace ReDoc docs with Scalar UI" 2025-09-28 04:30:38 +03:00
Egor
870ee2fb66 Replace ReDoc docs with Scalar UI 2025-09-28 04:27:43 +03:00
Egor
3e3385d1eb docs: explain enabling swagger ui 2025-09-28 04:20:28 +03:00
Egor
abf1f53218 Add web admin API schemas and docs 2025-09-26 05:37:08 +03:00