Cleanup: remove unused code, add CI/CD workflow
Some checks failed
Deploy Backend / deploy (push) Failing after 2m30s
Some checks failed
Deploy Backend / deploy (push) Failing after 2m30s
- Remove flask-sse, Redis (unused) - Remove ImageService, file_utils (unused) - Remove /download-posters route (frontend handles download client-side) - Remove LETTERBOXD_API_URL, secure_filename (dead imports) - Fix duplicate TMDBService instantiation - Simplify config.py (remove REDIS_URL) - Fix gunicorn user home dir for control socket - Add .gitignore for __pycache__ - Add .gitea/workflows/deploy.yml for tag-based CI/CD
This commit is contained in:
9
main.py
9
main.py
@@ -2,7 +2,6 @@ import os
|
||||
from flask import Flask
|
||||
from flask_cors import CORS
|
||||
from src.api.routes import api_bp
|
||||
from flask_sse import sse
|
||||
from config import config
|
||||
|
||||
|
||||
@@ -13,18 +12,18 @@ def create_app():
|
||||
"http://localhost:3000",
|
||||
"http://127.0.0.1:3000"
|
||||
]
|
||||
frontend_url = os.environ.get("FRONTEND_URL")
|
||||
if frontend_url:
|
||||
origins.append(frontend_url)
|
||||
CORS(app, supports_credentials=True, origins=origins)
|
||||
|
||||
|
||||
env = os.environ.get('FLASK_ENV', 'default')
|
||||
|
||||
if env == "production":
|
||||
app.config.update(SESSION_COOKIE_SAMESITE="None", SESSION_COOKIE_SECURE=True)
|
||||
else:
|
||||
app.config.update(SESSION_COOKIE_SAMESITE="Lax", SESSION_COOKIE_SECURE=False)
|
||||
|
||||
app.config.from_object(config[env])
|
||||
|
||||
app.register_blueprint(sse, url_prefix='/stream')
|
||||
app.register_blueprint(api_bp, url_prefix='/api')
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user