Skip to content

Commit c046dda

Browse files
committed
Fix OnlyOffice connection script to match working configuration
The script now uses the exact same settings as the working web UI request: - Set storageUrl to empty (not NEXTCLOUD_URL) - Set verify_peer_off to false instead of true - Clear documentserverInternal - Disable JWT when not configured - Clear jwt_header to use defaults - Set demo to false This resolves connection issues where OnlyOffice could not download documents from Nextcloud.
1 parent 7a3ceea commit c046dda

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

nextcloud.env.example

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,13 @@ POSTGRES_PASSWORD=183284b2f9e41c1f
1212
REDIS_HOST=nextcloud-redis
1313

1414
# OnlyOffice Document Server Configuration
15+
# The public URL of your OnlyOffice Document Server (where Nextcloud connects to)
1516
ONLYOFFICE_SERVER_URL=https://office.deine-domain.de
16-
ONLYOFFICE_JWT_SECRET=DeinJWTSecretHier
17+
18+
# JWT Secret for secure communication (optional but recommended)
19+
ONLYOFFICE_JWT_SECRET=
20+
21+
# IMPORTANT: Storage URL - The URL where OnlyOffice can reach your Nextcloud
22+
# This should be the public HTTPS URL of your Nextcloud installation
23+
# Example: NEXTCLOUD_URL=https://share.merian-schule.de
24+
# If OnlyOffice and Nextcloud are on the same server, use the public URL

onlyoffice_connect.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,32 @@ fi
6464
log "📝 Setze Document Server URL: $ONLYOFFICE_SERVER_URL"
6565
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice DocumentServerUrl --value="$ONLYOFFICE_SERVER_URL"
6666

67-
# Configure JWT Secret if provided
67+
# Configure JWT Secret if provided (matching curl which has secret empty)
6868
if [ -n "$ONLYOFFICE_JWT_SECRET" ]; then
6969
log "🔐 Setze JWT Secret..."
7070
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice jwt_secret --value="$ONLYOFFICE_JWT_SECRET"
71-
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice jwt_header --value="AuthorizationJwt"
7271
else
73-
warning "⚠️ Kein JWT Secret gesetzt - Verbindung könnte unsicher sein!"
72+
log "Deaktiviere JWT Secret (matching working curl request)..."
73+
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice jwt_secret --value=""
7474
fi
7575

76-
# Additional OnlyOffice configuration for better stability
76+
# Additional OnlyOffice configuration - matching the working curl request
7777
log "⚙️ Konfiguriere OnlyOffice-Einstellungen..."
7878

79-
# Set timeout values
80-
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice timeout --value="600"
79+
# Clear internal document server URL (leave empty like in curl)
80+
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice documentserverInternal --value=""
8181

82-
# Enable verification peer (SSL)
83-
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice verify_peer_off --value=""
82+
# Clear storage URL (leave empty like in curl)
83+
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice StorageUrl --value=""
8484

85-
# Set storage URL if different from main URL
86-
if [ -n "$NEXTCLOUD_URL" ]; then
87-
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice StorageUrl --value="$NEXTCLOUD_URL"
88-
fi
85+
# Set verify_peer_off to false (matching curl: verifyPeerOff=false)
86+
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice verify_peer_off --value="false"
87+
88+
# Clear JWT header (leave default)
89+
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice jwt_header --value=""
90+
91+
# Disable demo mode (matching curl: demo=false)
92+
docker exec --user www-data nextcloud-fpm /var/www/html/occ config:app:set onlyoffice demo --value="false"
8993

9094
# Test the connection
9195
log "🔗 Teste Verbindung zum Document Server..."

0 commit comments

Comments
 (0)