richdocuments
richdocuments copied to clipboard
APP generates wrong URL
Describe the bug Since Nextcloud APP version 3.7.19 (NC 20.0.9 and 20.8.1) in combination with Collabora Online - Built-in CODE Server 6.4.705 it's not possible to open documents over a public domain. The richdocuments app generates a URL for the local address of the server.
To Reproduce Steps to reproduce the behavior:
- Install NC 20.0.9 with Collabora Online v 3.7.19 and Collabora Online - Built-in CODE Server 6.4.705
- Create or open a file (don't care if a document, table or presentation)
- The document doesn't open -> F12 tools show a url with local ip instead of the FQND
- Additional read value of public_wopi_url from cli -> /occ config:app:get richdocuments public_wopi_url
- See the variable with local IP instead of FQND. "wopi_url" has the FQND.
Expected behavior The public_wopi_url should have the FQND instead of the local IP of the server. Documents should open propertly.
Screenshots
If applicable, add screenshots to help explain your problem.
Client details:
- OS: Linux Mint 20.1
- Browser Firefox, Chrome, Chromium
- Version 87.0, 90.0.4430.72, 89.0.4389.128
- Device: Desktop
Server details
Operating system: Ubuntu 20.04.2 LTS
Web server: Apache
Database: Mysql 8
PHP version: 7.4
Nextcloud version: 20.9
Version of the richdocuments app 3.7.19
Version of Collabora Online 6.4.705
Can you tell how you installed the richdocumentscode app in the beginning? Was it through CLI? Do you have an overwrite.cli.url set in your config.php?
Hi @juliushaertl,
i can reproduce the bug.
My setup:
This is my docker-compose running on a docker server:
version: '3.7'
services:
# Database
mariadb:
image: mariadb:latest
container_name: nextcloud_test_db
command: --transaction-isolation=READ-COMMITTED --log-bin=ROW --innodb_read_only_compressed=OFF
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./data/nextcloud-db:/var/lib/mysql
restart: unless-stopped
environment:
- TZ=UTC
- MYSQL_INITDB_SKIP_TZINFO=1
env_file:
- mariadbadmin.env
- mariadb.env
# Redis
redis:
image: redis:alpine
container_name: nextcloud_test_redis
restart: unless-stopped
volumes:
- ./data/nextcloud-redis:/var/lib/redis
command: redis-server --requirepass TEST
# Nextcloud Web
nextcloud:
depends_on:
- redis
- mariadb
image: nextcloud:stable-apache
container_name: nextcloud_test
volumes:
- ./data/nextcloud-www:/var/www/html
- ./data/nextcloud-data:/mnt/nextcloud-data
networks:
- default
- traefik_proxy
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextcloud-test.rule=Host(`cloud-test.internal.example.com`)"
- "traefik.http.routers.nextcloud-test.entrypoints=websecure"
- "traefik.http.routers.nextcloud-test.tls.certresolver=dnschallenge"
- "traefik.http.routers.nextcloud-test.tls=true"
- "traefik.http.routers.nextcloud-test.service=nextcloud-test"
- "traefik.http.services.nextcloud-test.loadbalancer.server.port=80"
- "traefik.http.routers.nextcloud-test.middlewares=nextcloud-test-dav"
- "traefik.http.middlewares.nextcloud-test-dav.replacepathregex.regex=^/.well-known/ca(l|rd)dav"
- "traefik.http.middlewares.nextcloud-test-dav.replacepathregex.replacement=/remote.php/dav/"
- "traefik.docker.network=traefik_proxy"
environment:
REDIS_HOST: redis
REDIS_HOST_PASSWORD: TEST
MYSQL_HOST: mariadb
NEXTCLOUD_DATA_DIR: /mnt/nextcloud-data
NEXTCLOUD_TRUSTED_DOMAINS: cloud-test.internal.example.com
TRUSTED_PROXIES: traefik
OVERWRITEHOST: cloud-test.example.com
OVERWRITEPROTOCOL: https
env_file:
- mariadb.env
- smtp.env
# Nextcloud cron
cron:
depends_on:
- mariadb
- redis
image: nextcloud:stable-apache
container_name: nextcloud_test_cron
restart: unless-stopped
volumes:
- ./data/nextcloud-www:/var/www/html
- ./data/nextcloud-data:/mnt/nextcloud-data
entrypoint: /cron.sh
networks:
traefik_proxy:
external:
name: traefik_proxy
In the config.php
i changed 'overwrite.cli.url' => 'https://cloud-test.example.com',
This is the config for the app richdocumentscode:
php occ config:app:get richdocuments wopi_url
is set to: https://cloud-test.example.com/custom_apps/richdocumentscode/proxy.php?req=
and
php occ config:app:get richdocuments public_wopi_url
is set to https://cloud-test.internal.example.com/custom_apps/richdocumentscode/proxy.php?req=
The install is just docker-compose up -d
and click next > next in the web ui.
Did you initially setup/install richdocumentscode + richdocuments while connected via http://<ip_address> by chance?
What happens if you either change the wopi_url/public_wopi_url from the command-line or change/re-save settings under Admin settings->Office?
The public_wopi_url gets populated I think from the Capabilities returned via `https://<domain.tld>/<apps_dir>/richdocumentscode/proxy.php?req=/hosting/discovery
Though there could be other possibilities too.