Add COLLABORA_EXTRA_HOSTS option

Signed-off-by: Keith Wansbrough <keithw@lochan.org>
This commit is contained in:
Keith Wansbrough 2025-12-30 18:32:40 +00:00
parent 15fa3be655
commit f9198b4ab2
4 changed files with 17 additions and 0 deletions

View file

@ -22,6 +22,7 @@ services:
# APACHE_ADDITIONAL_NETWORK: frontend_net # (Optional) Connect the apache container to an additional docker network. Needed when behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) running in a different docker network on same server. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
# BORG_RETENTION_POLICY: --keep-within=7d --keep-weekly=4 --keep-monthly=6 # Allows to adjust borgs retention policy. See https://github.com/nextcloud/all-in-one#how-to-adjust-borgs-retention-policy
# COLLABORA_SECCOMP_DISABLED: false # Setting this to true allows to disable Collabora's Seccomp feature. See https://github.com/nextcloud/all-in-one#how-to-disable-collaboras-seccomp-feature
# COLLABORA_EXTRA_HOSTS: "foo.example.org=2001:db8::1 bar.example.org=127.0.0.1" # space-separated list of extra /etc/hosts entries for Collabora container
# DOCKER_API_VERSION: 1.44 # You can adjust the internally used docker api version with this variable. ⚠️⚠️⚠️ Warning: please note that only the default api version (unset this variable) is supported and tested by the maintainers of Nextcloud AIO. So use this on your own risk and things might break without warning. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-internally-used-docker-api-version
# FULLTEXTSEARCH_JAVA_OPTIONS: "-Xms1024M -Xmx1024M" # Allows to adjust the fulltextsearch java options. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-fulltextsearch-java-options
# NEXTCLOUD_DATADIR: /mnt/ncdata # Allows to set the host directory for Nextcloud's datadir. ⚠️⚠️⚠️ Warning: do not set or adjust this value after the initial Nextcloud installation is done! See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir

View file

@ -763,6 +763,14 @@ class ConfigurationManager
return trim($this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue));
}
public function GetCollaboraExtraHosts() : string {
$envVariableName = 'COLLABORA_EXTRA_HOSTS';
$configName = 'collabora_extra_hosts';
$defaultValue = '';
$value = trim($this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue));
return preg_split('/ +/', $value, -1, PREG_SPLIT_NO_EMPTY);
}
public function GetCollaboraSeccompPolicy() : string {
$defaultString = '--o:security.seccomp=';
if (!$this->isSeccompDisabled()) {

View file

@ -425,6 +425,10 @@ readonly class DockerActionManager {
if ($this->configurationManager->GetAdditionalCollaboraOptions() !== '') {
$requestBody['Cmd'] = [$this->configurationManager->GetAdditionalCollaboraOptions()];
}
if (count($this->configurationManager->GetCollaboraExtraHosts()) > 0) {
$requestBody['HostConfig']['ExtraHosts'] = $this->configurationManager->GetCollaboraExtraHosts();
}
}
if (count($mounts) > 0) {

View file

@ -565,6 +565,10 @@ The Collabora container enables Seccomp by default, which is a security feature
### How to adjust the Fulltextsearch Java options?
The Fulltextsearch Java options are by default set to `-Xms512M -Xmx512M` which might not be enough on some systems. You can adjust this by adding e.g. `--env FULLTEXTSEARCH_JAVA_OPTIONS="-Xms1024M -Xmx1024M"` to the initial docker run command. If it was started already, you will need to stop the mastercontainer, remove it (no data will be lost) and recreate it using the docker run command that you initially used.
### How to add additional hosts to Collabora's /etc/hosts?
You can override DNS for specific hosts within the Collabora container by adding e.g. `--env COLLABORA_EXTRA_HOSTS="foo.example.org=2001:db8::1 bar.example.org=127.0.0.1"` to the initial docker run command. If it was started already, you will need to stop the mastercontainer, remove it (no data will be lost) and recreate it using the docker run command that you initially used.
## Guides
### How to run AIO on macOS?