fix: Client-Upload akzeptiert SECRET_KEY oder JWT_SECRET_KEY + Download in Settings
Upload-Auth: - Akzeptiert jetzt sowohl SECRET_KEY als auch JWT_SECRET_KEY (BUILD_UPLOAD_TOKEN in Entwicklungs-.env kann einer von beiden sein) Settings-View: - Zeigt verfuegbare Desktop/Mobile Clients zum Download an (nur wenn mindestens ein Client vorhanden) - Pro Client: Name, Dateiname, Download-Button .env.example: - Klarere Kommentare: "SECRET_KEY oder JWT_SECRET_KEY des Zielservers" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,11 +26,13 @@ def _clients_dir():
|
||||
|
||||
def _verify_build_token():
|
||||
"""Verify the build upload token from header or query param."""
|
||||
expected = os.environ.get('SECRET_KEY', '')
|
||||
if not expected:
|
||||
return False
|
||||
token = request.headers.get('X-Build-Token', '') or request.args.get('build_token', '')
|
||||
return token == expected
|
||||
if not token:
|
||||
return False
|
||||
# Accept SECRET_KEY or JWT_SECRET_KEY
|
||||
secret = os.environ.get('SECRET_KEY', '')
|
||||
jwt_secret = os.environ.get('JWT_SECRET_KEY', '')
|
||||
return token == secret or token == jwt_secret
|
||||
|
||||
|
||||
# --- Public: list available clients ---
|
||||
|
||||
Reference in New Issue
Block a user