Compare commits
2 Commits
0dbeef7cd9
...
35fddbfcbc
| Author | SHA1 | Date | |
|---|---|---|---|
| 35fddbfcbc | |||
| 15211509a6 |
+2
-3
@@ -32,7 +32,6 @@ FRONTEND_URL=https://cloud.example.com
|
||||
MAX_UPLOAD_SIZE_MB=500
|
||||
|
||||
# OnlyOffice Document Server (optional)
|
||||
# Oeffentliche HTTPS-URL unter der OnlyOffice im Browser erreichbar ist
|
||||
# Eigene Subdomain mit HTTPS, z.B. https://office.example.com
|
||||
# JWT wird automatisch vom JWT_SECRET_KEY oben verwendet
|
||||
ONLYOFFICE_URL=
|
||||
# Muss mit JWT_SECRET im OnlyOffice-Container uebereinstimmen
|
||||
ONLYOFFICE_JWT_SECRET=
|
||||
|
||||
@@ -121,32 +121,22 @@ Let's Encrypt Zertifikat erstellen:
|
||||
certbot --nginx -d cloud.example.com
|
||||
```
|
||||
|
||||
### OnlyOffice Document Server (optional)
|
||||
### OnlyOffice Document Server
|
||||
|
||||
Fuer die Bearbeitung von Word, Excel und PowerPoint Dateien direkt im Browser.
|
||||
Fuer die Bearbeitung von Word, Excel und PowerPoint Dateien direkt im Browser. OnlyOffice benoetigt eine eigene Subdomain mit HTTPS.
|
||||
|
||||
**1. docker-compose.yml - OnlyOffice-Service aktivieren:**
|
||||
|
||||
```yaml
|
||||
# In docker-compose.yml auskommentieren:
|
||||
onlyoffice:
|
||||
image: onlyoffice/documentserver:latest
|
||||
environment:
|
||||
- JWT_ENABLED=true
|
||||
- JWT_SECRET=${ONLYOFFICE_JWT_SECRET}
|
||||
volumes:
|
||||
- ./data/onlyoffice/logs:/var/log/onlyoffice
|
||||
- ./data/onlyoffice/data:/var/www/onlyoffice/Data
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
**2. .env - OnlyOffice konfigurieren:**
|
||||
**1. .env - OnlyOffice URL setzen:**
|
||||
|
||||
```bash
|
||||
ONLYOFFICE_URL=https://office.example.com
|
||||
ONLYOFFICE_JWT_SECRET=ein-sicheres-secret-hier
|
||||
```
|
||||
|
||||
Das JWT-Secret wird automatisch vom `JWT_SECRET_KEY` verwendet - kein extra Secret noetig.
|
||||
|
||||
**2. docker-compose.yml - OnlyOffice-Service aktivieren:**
|
||||
|
||||
Der OnlyOffice-Service ist in der `docker-compose.yml` bereits vorbereitet. Er nutzt den gleichen `JWT_SECRET_KEY` aus der `.env`.
|
||||
|
||||
**3. Nginx - Eigene Subdomain fuer OnlyOffice:**
|
||||
|
||||
```nginx
|
||||
@@ -167,12 +157,14 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
**4. Starten:**
|
||||
|
||||
```bash
|
||||
certbot --nginx -d office.example.com
|
||||
docker-compose up -d
|
||||
docker-compose up --build -d
|
||||
```
|
||||
|
||||
**Ohne OnlyOffice** werden Office-Dateien in einer einfachen Vorschau angezeigt (nur Lesen). **Mit OnlyOffice** erhaelt man einen vollwertigen Editor (wie Google Docs).
|
||||
**Ohne OnlyOffice** (`ONLYOFFICE_URL` leer) werden Office-Dateien in einer einfachen Vorschau angezeigt. **Mit OnlyOffice** erhaelt man einen vollwertigen Editor (wie Google Docs).
|
||||
|
||||
## Verwendung
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ def onlyoffice_config(file_id):
|
||||
}
|
||||
|
||||
# Sign with JWT if secret is set
|
||||
jwt_secret = os.environ.get('ONLYOFFICE_JWT_SECRET', '')
|
||||
jwt_secret = os.environ.get('JWT_SECRET_KEY', '')
|
||||
if jwt_secret:
|
||||
import jwt as pyjwt
|
||||
config['config']['token'] = pyjwt.encode(config['config'], jwt_secret, algorithm='HS256')
|
||||
|
||||
@@ -155,7 +155,6 @@ def get_settings():
|
||||
'system_email_from': AppSettings.get('system_email_from', ''),
|
||||
'onlyoffice_url': os.environ.get('ONLYOFFICE_URL', ''),
|
||||
'onlyoffice_configured': bool(os.environ.get('ONLYOFFICE_URL', '')),
|
||||
'onlyoffice_jwt_set': bool(os.environ.get('ONLYOFFICE_JWT_SECRET', '')),
|
||||
}), 200
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ services:
|
||||
- "8080:80"
|
||||
environment:
|
||||
- JWT_ENABLED=true
|
||||
- JWT_SECRET=${ONLYOFFICE_JWT_SECRET}
|
||||
- JWT_SECRET=${JWT_SECRET_KEY}
|
||||
volumes:
|
||||
- ./data/onlyoffice/logs:/var/log/onlyoffice
|
||||
- ./data/onlyoffice/data:/var/www/onlyoffice/Data
|
||||
|
||||
@@ -95,15 +95,15 @@
|
||||
<code>{{ onlyofficeUrl }}</code>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="label">JWT Secret:</span>
|
||||
<Tag :value="onlyofficeJwtSet ? 'Gesetzt' : 'Fehlt!'" :severity="onlyofficeJwtSet ? 'success' : 'danger'" />
|
||||
<span class="label">JWT:</span>
|
||||
<span>Nutzt JWT_SECRET_KEY aus .env</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="restore-instructions" style="margin-top: 1rem">
|
||||
<strong>Konfiguration ueber <code>.env</code>:</strong>
|
||||
<pre style="background: var(--p-surface-100); padding: 0.75rem; border-radius: 4px; font-size: 0.85rem; margin: 0.5rem 0">ONLYOFFICE_URL=https://office.deine-domain.de
|
||||
ONLYOFFICE_JWT_SECRET=dein-secret-hier</pre>
|
||||
<pre style="background: var(--p-surface-100); padding: 0.75rem; border-radius: 4px; font-size: 0.85rem; margin: 0.5rem 0">ONLYOFFICE_URL=https://office.deine-domain.de</pre>
|
||||
<p class="hint">JWT wird automatisch vom <code>JWT_SECRET_KEY</code> verwendet - kein extra Secret noetig.</p>
|
||||
<strong>Setup-Schritte:</strong>
|
||||
<ol>
|
||||
<li>In <code>docker-compose.yml</code> den <code>onlyoffice</code>-Service aktivieren</li>
|
||||
@@ -551,7 +551,6 @@ const smtpForm = ref({
|
||||
const smtpPasswordSet = ref(false)
|
||||
const onlyofficeConfigured = ref(false)
|
||||
const onlyofficeUrl = ref('')
|
||||
const onlyofficeJwtSet = ref(false)
|
||||
const smtpTesting = ref(false)
|
||||
|
||||
// Backup & Restore
|
||||
@@ -661,7 +660,6 @@ async function loadSettings() {
|
||||
smtpPasswordSet.value = res.data.system_smtp_password_set
|
||||
onlyofficeConfigured.value = res.data.onlyoffice_configured
|
||||
onlyofficeUrl.value = res.data.onlyoffice_url || ''
|
||||
onlyofficeJwtSet.value = res.data.onlyoffice_jwt_set
|
||||
} catch { /* first load, defaults */ }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user