Harden backend, add permanent identification cache, self-bootstrapping deploy
- Extract auth/storage into src/core/security.py and src/services/storage.py, scope library/discovery/social routes to the authenticated user - Add IdentifiedTrack cache table keyed by audio fingerprint so repeat uploads of the same song skip Shazam/AcoustID/Gemini identification entirely; enable sqlite WAL mode so cache reads don't stall behind unrelated writes - Add Alembic migrations (baseline schema + identified_tracks) - Add pytest-mock to requirements.txt - was missing despite being used throughout the existing test suite via the mocker fixture - Rewrite deploy/scripts/deploy.sh to self-bootstrap a bare prod server (system packages, repo clone, venv, .env from CI-supplied secrets, systemd unit sync) and restart services on every deploy - Add .gitlab-ci.yml: test stage runs on dev/main pushes, deploy_prod runs only on main and SSHes into prod to trigger deploy.sh Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
Showing
alembic.ini
0 → 100644
alembic/README
0 → 100644
alembic/env.py
0 → 100644
alembic/script.py.mako
0 → 100644
This diff is collapsed.
deploy/scripts/deploy.sh
0 → 100755
main.py
deleted
100644 → 0
| ... | @@ -14,5 +14,8 @@ sqlalchemy>=2.0.0 | ... | @@ -14,5 +14,8 @@ sqlalchemy>=2.0.0 |
| httpx>=0.27.0 | httpx>=0.27.0 | ||
| python-multipart>=0.0.9 | python-multipart>=0.0.9 | ||
| pytest>=8.0.0 | pytest>=8.0.0 | ||
| pytest-mock>=3.14.0 | |||
| pyrogram>=2.0.106 | pyrogram>=2.0.106 | ||
| tgcrypto>=1.2.5 | tgcrypto>=1.2.5 | ||
| pyjwt>=2.8.0 | |||
| alembic>=1.13.0 |
This diff is collapsed.
src/core/security.py
0 → 100644
src/services/storage.py
0 → 100644
Please
register
or
sign in
to comment