Let manual-install use WOPI URLs internal to the Docker network#7897
Let manual-install use WOPI URLs internal to the Docker network#7897Fs00 wants to merge 3 commits into
Conversation
f797288 to
71f91cd
Compare
szaimen
left a comment
There was a problem hiding this comment.
Hi, this change will unfortunately not work in the case of the helm chart deployment: https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart which is the main reason why we kept the behaviour like that for the manual-install...
|
|
||
| networks: | ||
| default: | ||
| name: nextcloud-aio |
There was a problem hiding this comment.
This single change would be fine from my pov
|
@szaimen Can you elaborate on why this change would not work for the Helm chart deployment? I'm not familiar with Kubernetes, but I guess it doesn't support containers talking to each other in the same Docker network like in Docker Compose? |
|
AFAIK helm does not have the concept of docker networks, that is why it won't work... |
71f91cd to
beeffe1
Compare
Signed-off-by: Fs00 <francescosaltori@gmail.com>
Signed-off-by: Fs00 <francescosaltori@gmail.com>
Signed-off-by: Fs00 <francescosaltori@gmail.com>
d81bc89 to
bb5c832
Compare
|
I have reworked my approach: now the Collabora WOPI URL and callback URL are configurable via environment variables of the NextCloud container, so that they can be easily configured for the manual-install and excluded in the Helm chart (let me know if I did that correctly, I wasn't able to test the Helm chart update script on my PC due to an error with Kompose). |
|
|
||
| COLLABORA_WOPI_URL=${COLLABORA_WOPI_URL:=https://$COLLABORA_DOMAIN} | ||
| php /var/www/html/occ config:app:set richdocuments wopi_url --value="$COLLABORA_WOPI_URL" | ||
|
|
There was a problem hiding this comment.
I really would have liked to configure the callback URL here too, but the richdocuments:activate-config command resets the callback URL when it's called without the callback-url parameter...
| fi | ||
| set +x | ||
| # Remove richdcoumentscode if it should be incorrectly installed | ||
| # Remove richdocumentscode should it be incorrectly installed |
There was a problem hiding this comment.
Please keep this logic. Maybe you need to rename COLLABORA_DOMAIN to COLLABORA_HOST further below
There was a problem hiding this comment.
I've renamed the COLLABORA_HOST variable because I think that the previous name doesn't reflect its usage anymore.
Now the variable it's used merely to construct the fallback for the WOPI URL when the latter is unset (mainly for compatibility with the Helm chart) and for determining the IP address of the Collabora domain, and thus the name COLLABORA_DOMAIN.
Given that now we have a dedicated env variable for the WOPI URL, why do we need the extra logic? It seems unnecessary and potentially confusing to me, but maybe there is some edge case I'm not seeing.
| ACTIVATE_CONFIG_COMMAND="php /var/www/html/occ richdocuments:activate-config" | ||
| if [ -n "$COLLABORA_WOPI_CALLBACK_URL" ]; then | ||
| $ACTIVATE_CONFIG_COMMAND --callback-url="$COLLABORA_WOPI_CALLBACK_URL" | ||
| else | ||
| $ACTIVATE_CONFIG_COMMAND | ||
| fi |
There was a problem hiding this comment.
probably best to restucture this a bit. Something like:
| ACTIVATE_CONFIG_COMMAND="php /var/www/html/occ richdocuments:activate-config" | |
| if [ -n "$COLLABORA_WOPI_CALLBACK_URL" ]; then | |
| $ACTIVATE_CONFIG_COMMAND --callback-url="$COLLABORA_WOPI_CALLBACK_URL" | |
| else | |
| $ACTIVATE_CONFIG_COMMAND | |
| fi | |
| COLLABORA_ACTIVATE_CONFIG_ARGS=() | |
| if [ -n "$COLLABORA_WOPI_CALLBACK_URL" ]; then | |
| COLLABORA_ACTIVATE_CONFIG_ARGS=(--callback-url="$COLLABORA_WOPI_CALLBACK_URL") | |
| fi | |
| php /var/www/html/occ richdocuments:activate-config "${COLLABORA_ACTIVATE_CONFIG_ARGS[@]}" |
There was a problem hiding this comment.
Yeah yours looks definitely better, I'm not very proficient in Bash scripting 😅
| "ONLYOFFICE_ENABLED=%ONLYOFFICE_ENABLED%", | ||
| "COLLABORA_ENABLED=%COLLABORA_ENABLED%", | ||
| "COLLABORA_HOST=nextcloud-aio-collabora", | ||
| "COLLABORA_DOMAIN=%NC_DOMAIN%", |
There was a problem hiding this comment.
| "COLLABORA_DOMAIN=%NC_DOMAIN%", | |
| "COLLABORA_HOST=nextcloud-aio-collabora", |
|
It's been a while, but before getting back to work to get this in a mergeable state I have a few questions:
@szaimen let me know :) |
I've realized that my AIO manual installation was still using the public domain as the WOPI URL for Collabora instead of the Docker internal hostname of the Apache container (what the mastercontainer setup does since #6676).
Two changes were needed to make this work on the manual setup:
occ richdocuments:activate-configcommand differed between the mastercontainer and manual install: the former used the one defined in containers.json (which specified the internal WOPI URLs), while the latter used the one found in run-exec-commands.sh script of the NextCloud AIO container.I've moved the command with the correct parameters in the latter script file, to make it consistent with both setups and to prevent potential future differences.