allow to specify AIO_COMMUNITY_CONTAINERS

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-09-27 17:40:42 +02:00
parent 598faf7eef
commit 2a746863b9
6 changed files with 33 additions and 1 deletions

View file

@ -65,7 +65,7 @@ RUN set -ex; \
chmod +x /usr/local/bin/composer; \
cd /var/www/docker-aio; \
git clone https://github.com/nextcloud-releases/all-in-one.git --depth 1 .; \
find ./ -maxdepth 1 -mindepth 1 -not -path ./php -exec rm -r {} \; ; \
find ./ -maxdepth 1 -mindepth 1 -not -path ./php -not -path ./community-containers -exec rm -r {} \; ; \
chown www-data:www-data -R /var/www/docker-aio; \
cd php; \
sudo -u www-data composer install --no-dev; \

View file

@ -241,6 +241,20 @@ It is set to '$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS'."
exit 1
fi
fi
if [ -n "$AIO_COMMUNITY_CONTAINERS" ]; then
read -ra AIO_CCONTAINERS <<< "$AIO_COMMUNITY_CONTAINERS"
for container in "${AIO_CCONTAINERS[@]}"; do
if ! [ -d "/var/www/docker-aio/community-containers/$container" ]; then
echo "The community container $container was not found!"
FAIL_CCONTAINERS=1
fi
done
if [ -n "$FAIL_CCONTAINERS" ]; then
print_red "You've set AIO_COMMUNITY_CONTAINERS but at least one container was not found.
It is set to '$AIO_COMMUNITY_CONTAINERS'."
exit 1
fi
fi
# Check DNS resolution
# Prevents issues like https://github.com/nextcloud/all-in-one/discussions/565

View file

@ -1 +1,3 @@
## This is a WIP and not working yet!
You might want to add additional community containers to the default AIO stack. You can do so by adding `--env AIO_COMMUNITY_CONTAINERS="container1 container2"` to the docker run command of the mastercontainer (but before the last line `nextcloud/all-in-one:latest`! 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) and customize the value to your fitting. It must match the folder names in this directory! ⚠️⚠️⚠️ Please review the folder for documentation on each of the containers before adding them! Not reviewing the documentation for each of them first might break starting the AIO containers because e.g. fail2ban only works on Linux and not on Docker Desktop!

View file

@ -874,6 +874,17 @@ class ConfigurationManager
}
}
private function GetCommunityContainers() : string {
$envVariableName = 'AIO_COMMUNITY_CONTAINERS';
$configName = 'aio_community_containers';
$defaultValue = '';
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
}
public function GetEnabledCommunityContainers() : array {
return explode(' ', $this->GetCommunityContainers());
}
private function GetEnabledDriDevice() : string {
$envVariableName = 'NEXTCLOUD_ENABLE_DRI_DEVICE';
$configName = 'nextcloud_enable_dri_device';

View file

@ -50,4 +50,8 @@ class DataConst {
public static function GetSessionDateFile() : string {
return self::GetDataDirectory() . '/session_date_file';
}
public static function GetCommunityContainersDirectory() : string {
return realpath(__DIR__ . '/../../../community-containers/');
}
}

View file

@ -21,5 +21,6 @@ See https://github.com/nextcloud/all-in-one#how-to-trust-user-defined-certificat
- [ ] When starting the mastercontainer with `--env NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=inotify`, the resulting Nextcloud container should have the inotify extension installed and not the imagick extension.
- [ ] When starting the mastercontainer with `--env NEXTCLOUD_ENABLE_DRI_DEVICE=true`, the resulting Nextcloud container should have the /dev/dri device mounted into the container. (Only works if a `/dev/dri` device is present on the host)
- [ ] When starting the mastercontainer with `--env NEXTCLOUD_KEEP_DISABLED_APPS=true` it should keep apps in Nextcloud that are disabled in the AIO interface. For example if Collabora is disabled in the AIO interface and you install the richdocuments app in Nextcloud, a restart should not uninstall the richdocuments app in Nextcloud anymore.
- [ ] When starting the mastercontainer with `--env AIO_COMMUNITY_CONTAINERS="fail2ban"`, it should add the fail2ban container to the container stack and show it in the AIO interface as well as start it, etc.
You can now continue with [070-timezone-change.md](./070-timezone-change.md)