Skip to content

Let manual-install use WOPI URLs internal to the Docker network#7897

Draft
Fs00 wants to merge 3 commits into
nextcloud:mainfrom
Fs00:manual-internal-wopi
Draft

Let manual-install use WOPI URLs internal to the Docker network#7897
Fs00 wants to merge 3 commits into
nextcloud:mainfrom
Fs00:manual-internal-wopi

Conversation

@Fs00

@Fs00 Fs00 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

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:

  • the occ richdocuments:activate-config command 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.
  • the Apache container internal hostname wasn't being resolved in the manual-install because the name of the Docker network was being automatically determined by Docker Compose using the parent folder name. By specifying the expected name of the network in the compose file, the behavior is now consistent with the mastercontainer setup.

@Fs00 Fs00 force-pushed the manual-internal-wopi branch from f797288 to 71f91cd Compare April 13, 2026 08:18
@szaimen szaimen added 3. to review Waiting for reviews enhancement New feature or request labels Apr 13, 2026
@szaimen szaimen added this to the next milestone Apr 13, 2026

@szaimen szaimen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This single change would be fine from my pov

@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 13, 2026
@szaimen szaimen removed this from the next milestone Apr 13, 2026
@Fs00

Fs00 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

@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?
Would it be possible to find a way to make this an exception for the Helm chart then? I'm thinking of a container env variable for the Collabora WOPI URL that is set differently for the Helm chart, but let me know your opinion 🙏

@szaimen

szaimen commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

AFAIK helm does not have the concept of docker networks, that is why it won't work...

@Fs00 Fs00 marked this pull request as draft April 15, 2026 07:07
@Fs00 Fs00 force-pushed the manual-internal-wopi branch from 71f91cd to beeffe1 Compare April 18, 2026 18:32
Fs00 added 3 commits April 19, 2026 00:11
Signed-off-by: Fs00 <francescosaltori@gmail.com>
Signed-off-by: Fs00 <francescosaltori@gmail.com>
Signed-off-by: Fs00 <francescosaltori@gmail.com>
@Fs00 Fs00 force-pushed the manual-internal-wopi branch from d81bc89 to bb5c832 Compare April 18, 2026 22:12
@Fs00 Fs00 changed the title Fix manual-install to use WOPI URLs internal to the Docker network Let manual-install use WOPI URLs internal to the Docker network Apr 19, 2026
@Fs00

Fs00 commented Apr 19, 2026

Copy link
Copy Markdown
Contributor Author

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).
To make the latter scenario work as it did before, the Collabora WOPI URL falls back to https://{COLLABORA_DOMAIN} when it's unset.
@szaimen Please let me know your feedback!


COLLABORA_WOPI_URL=${COLLABORA_WOPI_URL:=https://$COLLABORA_DOMAIN}
php /var/www/html/occ config:app:set richdocuments wopi_url --value="$COLLABORA_WOPI_URL"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

@Fs00 Fs00 marked this pull request as ready for review April 20, 2026 12:17
fi
set +x
# Remove richdcoumentscode if it should be incorrectly installed
# Remove richdocumentscode should it be incorrectly installed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this logic. Maybe you need to rename COLLABORA_DOMAIN to COLLABORA_HOST further below

@Fs00 Fs00 Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +20 to +25
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably best to restucture this a bit. Something like:

Suggested change
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[@]}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah yours looks definitely better, I'm not very proficient in Bash scripting 😅

Comment thread php/containers.json
"ONLYOFFICE_ENABLED=%ONLYOFFICE_ENABLED%",
"COLLABORA_ENABLED=%COLLABORA_ENABLED%",
"COLLABORA_HOST=nextcloud-aio-collabora",
"COLLABORA_DOMAIN=%NC_DOMAIN%",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"COLLABORA_DOMAIN=%NC_DOMAIN%",
"COLLABORA_HOST=nextcloud-aio-collabora",

@szaimen szaimen added this to the next milestone Apr 27, 2026
@szaimen szaimen modified the milestones: v13.0.0, next, v13.0.1 Apr 30, 2026
@Fs00

Fs00 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants