refactor: OnlyOffice Konfiguration nur ueber .env, nicht Admin-GUI
OnlyOffice URL und JWT Secret kommen jetzt ausschliesslich aus der .env Datei (Umgebungsvariablen), nicht mehr aus der Admin-GUI: - ONLYOFFICE_URL und ONLYOFFICE_JWT_SECRET in .env setzen - docker-compose liest das gleiche Secret fuer den OnlyOffice-Container - Eine Quelle der Wahrheit, kein Sync zwischen .env und DB noetig Admin-GUI zeigt jetzt nur noch den Status an: - Konfiguriert / Nicht konfiguriert (Tag) - Aktuelle URL - JWT Secret gesetzt / Fehlt (Tag) - Setup-Anleitung mit .env Beispiel Behebt: "Sicherheitstoken nicht korrekt" wenn OnlyOffice laeuft aber JWT Secret nicht uebereinstimmt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -330,7 +330,7 @@ def onlyoffice_config(file_id):
|
||||
if err:
|
||||
return err
|
||||
|
||||
oo_url = AppSettings.get('onlyoffice_url', os.environ.get('ONLYOFFICE_URL', ''))
|
||||
oo_url = os.environ.get('ONLYOFFICE_URL', '')
|
||||
if not oo_url:
|
||||
return jsonify({'error': 'OnlyOffice nicht konfiguriert', 'available': False}), 200
|
||||
|
||||
@@ -381,7 +381,7 @@ def onlyoffice_config(file_id):
|
||||
}
|
||||
|
||||
# Sign with JWT if secret is set
|
||||
jwt_secret = AppSettings.get('onlyoffice_jwt_secret', '')
|
||||
jwt_secret = os.environ.get('ONLYOFFICE_JWT_SECRET', '')
|
||||
if jwt_secret:
|
||||
import jwt as pyjwt
|
||||
config['config']['token'] = pyjwt.encode(config['config'], jwt_secret, algorithm='HS256')
|
||||
@@ -448,7 +448,7 @@ def onlyoffice_callback():
|
||||
@token_required
|
||||
def onlyoffice_status():
|
||||
"""Check if OnlyOffice is available."""
|
||||
oo_url = AppSettings.get('onlyoffice_url', os.environ.get('ONLYOFFICE_URL', ''))
|
||||
oo_url = os.environ.get('ONLYOFFICE_URL', '')
|
||||
return jsonify({
|
||||
'available': bool(oo_url),
|
||||
'url': oo_url,
|
||||
|
||||
Reference in New Issue
Block a user