Repository: nextcloud/all-in-one Branch: main Commit: 35dd0a2c0084 Files: 361 Total size: 1.3 MB Directory structure: gitextract_32moa423/ ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── Bug_report.md │ │ ├── Feature_request.md │ │ └── config.yml │ ├── dependabot.yml │ ├── pull_request_template.md │ ├── release.yml │ └── workflows/ │ ├── codespell.yml │ ├── collabora.yml │ ├── community-containers.yml │ ├── dependency-updates.yml │ ├── docker-lint.yml │ ├── fail-on-prerelease.yml │ ├── helm-release.yml │ ├── imaginary-update.yml │ ├── json-validator.yml │ ├── lint-helm.yml │ ├── lint-php.yml │ ├── lint-yaml.yml │ ├── lock-threads.yml │ ├── nextcloud-update.yml │ ├── php-deprecation-detector.yml │ ├── playwright-on-push.yml │ ├── playwright-on-workflow-dispatch.yml │ ├── psalm-update-baseline.yml │ ├── psalm.yml │ ├── shellcheck.yml │ ├── talk.yml │ ├── twig-lint.yml │ ├── update-copyright.yml │ ├── update-helm.yml │ ├── update-yaml.yml │ └── watchtower-update.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Containers/ │ ├── alpine/ │ │ └── Dockerfile │ ├── apache/ │ │ ├── Caddyfile │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ ├── nextcloud.conf │ │ ├── start.sh │ │ └── supervisord.conf │ ├── borgbackup/ │ │ ├── Dockerfile │ │ ├── backupscript.sh │ │ ├── borg_excludes │ │ └── start.sh │ ├── clamav/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ ├── start.sh │ │ └── supervisord.conf │ ├── collabora/ │ │ ├── Dockerfile │ │ └── healthcheck.sh │ ├── collabora-online/ │ │ ├── Dockerfile │ │ └── healthcheck.sh │ ├── docker-socket-proxy/ │ │ ├── Dockerfile │ │ ├── haproxy.cfg │ │ ├── healthcheck.sh │ │ └── start.sh │ ├── domaincheck/ │ │ ├── Dockerfile │ │ ├── lighttpd.conf │ │ └── start.sh │ ├── fulltextsearch/ │ │ ├── Dockerfile │ │ └── healthcheck.sh │ ├── imaginary/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ └── start.sh │ ├── mastercontainer/ │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── acme.Caddyfile │ │ ├── backup-time-file-watcher.sh │ │ ├── cron.sh │ │ ├── daily-backup.sh │ │ ├── healthcheck.sh │ │ ├── internal.Caddyfile │ │ ├── session-deduplicator.sh │ │ ├── start.sh │ │ └── supervisord.conf │ ├── nextcloud/ │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── config/ │ │ │ ├── aio.config.php │ │ │ ├── apcu.config.php │ │ │ ├── apps.config.php │ │ │ ├── certificates-bundle.config.php │ │ │ ├── postgres.config.php │ │ │ ├── proxy.config.php │ │ │ ├── redis.config.php │ │ │ ├── reverse-proxy.config.php │ │ │ ├── s3.config.php │ │ │ ├── smtp.config.php │ │ │ └── swift.config.php │ │ ├── cron.sh │ │ ├── entrypoint.sh │ │ ├── healthcheck.sh │ │ ├── notify-all.sh │ │ ├── notify.sh │ │ ├── root.motd │ │ ├── run-exec-commands.sh │ │ ├── start.sh │ │ ├── supervisord.conf │ │ └── upgrade.exclude │ ├── notify-push/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ └── start.sh │ ├── onlyoffice/ │ │ ├── Dockerfile │ │ └── healthcheck.sh │ ├── postgresql/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ ├── init-user-db.sh │ │ └── start.sh │ ├── redis/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ └── start.sh │ ├── talk/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ ├── server.conf.in │ │ ├── start.sh │ │ └── supervisord.conf │ ├── talk-recording/ │ │ ├── Dockerfile │ │ ├── healthcheck.sh │ │ ├── recording.conf │ │ └── start.sh │ ├── watchtower/ │ │ ├── Dockerfile │ │ └── start.sh │ └── whiteboard/ │ ├── Dockerfile │ ├── healthcheck.sh │ └── start.sh ├── LICENSE ├── app/ │ ├── .editorconfig │ ├── appinfo/ │ │ └── info.xml │ ├── composer/ │ │ ├── autoload.php │ │ ├── composer/ │ │ │ ├── ClassLoader.php │ │ │ ├── InstalledVersions.php │ │ │ ├── LICENSE │ │ │ ├── autoload_classmap.php │ │ │ ├── autoload_namespaces.php │ │ │ ├── autoload_psr4.php │ │ │ ├── autoload_real.php │ │ │ ├── autoload_static.php │ │ │ ├── installed.json │ │ │ └── installed.php │ │ └── composer.json │ ├── lib/ │ │ └── Settings/ │ │ └── Admin.php │ ├── readme.md │ └── templates/ │ └── admin.php ├── community-containers/ │ ├── borgbackup-viewer/ │ │ ├── borgbackup-viewer.json │ │ └── readme.md │ ├── caddy/ │ │ ├── caddy.json │ │ └── readme.md │ ├── calcardbackup/ │ │ ├── calcardbackup.json │ │ └── readme.md │ ├── container-management/ │ │ ├── container-management.json │ │ └── readme.md │ ├── dlna/ │ │ ├── dlna.json │ │ └── readme.md │ ├── facerecognition/ │ │ ├── facerecognition.json │ │ └── readme.md │ ├── fail2ban/ │ │ ├── fail2ban.json │ │ └── readme.md │ ├── glances/ │ │ ├── glances.json │ │ └── readme.md │ ├── helloworld/ │ │ ├── helloworld.json │ │ └── readme.md │ ├── jellyfin/ │ │ ├── jellyfin.json │ │ └── readme.md │ ├── jellyseerr/ │ │ ├── jellyseerr.json │ │ └── readme.md │ ├── languagetool/ │ │ ├── languagetool.json │ │ └── readme.md │ ├── libretranslate/ │ │ ├── libretranslate.json │ │ └── readme.md │ ├── lldap/ │ │ ├── lldap.json │ │ └── readme.md │ ├── local-ai/ │ │ ├── local-ai.json │ │ └── readme.md │ ├── makemkv/ │ │ ├── makemkv.json │ │ └── readme.md │ ├── memories/ │ │ ├── memories.json │ │ └── readme.md │ ├── minio/ │ │ ├── minio.json │ │ └── readme.md │ ├── nextcloud-exporter/ │ │ ├── nextcloud-exporter.json │ │ └── readme.md │ ├── nocodb/ │ │ ├── nocodb.json │ │ └── readme.md │ ├── notifications/ │ │ ├── notifications.json │ │ └── readme.md │ ├── npmplus/ │ │ ├── npmplus.json │ │ └── readme.md │ ├── pi-hole/ │ │ ├── pi-hole.json │ │ └── readme.md │ ├── plex/ │ │ ├── plex.json │ │ └── readme.md │ ├── readme.md │ ├── scrutiny/ │ │ ├── readme.md │ │ └── scrutiny.json │ ├── smbserver/ │ │ ├── readme.md │ │ └── smbserver.json │ ├── stalwart/ │ │ ├── readme.md │ │ └── stalwart.json │ └── vaultwarden/ │ ├── readme.md │ └── vaultwarden.json ├── compose.yaml ├── develop.md ├── docker-ipv6-support.md ├── docker-rootless.md ├── local-instance.md ├── manual-install/ │ ├── latest.yml │ ├── readme.md │ ├── sample.conf │ └── update-yaml.sh ├── manual-upgrade.md ├── migration.md ├── multiple-instances.md ├── nextcloud-aio-helm-chart/ │ ├── Chart.yaml │ ├── readme.md │ ├── templates/ │ │ ├── nextcloud-aio-apache-deployment.yaml │ │ ├── nextcloud-aio-apache-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-apache-service.yaml │ │ ├── nextcloud-aio-clamav-deployment.yaml │ │ ├── nextcloud-aio-clamav-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-clamav-service.yaml │ │ ├── nextcloud-aio-collabora-deployment.yaml │ │ ├── nextcloud-aio-collabora-service.yaml │ │ ├── nextcloud-aio-database-deployment.yaml │ │ ├── nextcloud-aio-database-dump-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-database-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-database-service.yaml │ │ ├── nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-fulltextsearch-deployment.yaml │ │ ├── nextcloud-aio-fulltextsearch-service.yaml │ │ ├── nextcloud-aio-imaginary-deployment.yaml │ │ ├── nextcloud-aio-imaginary-service.yaml │ │ ├── nextcloud-aio-namespace-namespace.yaml │ │ ├── nextcloud-aio-networkpolicy.yaml │ │ ├── nextcloud-aio-nextcloud-data-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-nextcloud-deployment.yaml │ │ ├── nextcloud-aio-nextcloud-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-nextcloud-service.yaml │ │ ├── nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-notify-push-deployment.yaml │ │ ├── nextcloud-aio-notify-push-service.yaml │ │ ├── nextcloud-aio-onlyoffice-deployment.yaml │ │ ├── nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-onlyoffice-service.yaml │ │ ├── nextcloud-aio-redis-deployment.yaml │ │ ├── nextcloud-aio-redis-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-redis-service.yaml │ │ ├── nextcloud-aio-talk-deployment.yaml │ │ ├── nextcloud-aio-talk-recording-deployment.yaml │ │ ├── nextcloud-aio-talk-recording-persistentvolumeclaim.yaml │ │ ├── nextcloud-aio-talk-recording-service.yaml │ │ ├── nextcloud-aio-talk-service.yaml │ │ ├── nextcloud-aio-whiteboard-deployment.yaml │ │ └── nextcloud-aio-whiteboard-service.yaml │ ├── update-helm.sh │ └── values.yaml ├── php/ │ ├── README.md │ ├── composer.json │ ├── containers-schema.json │ ├── containers.json │ ├── cool-seccomp-profile.json │ ├── data/ │ │ └── .gitkeep │ ├── domain-validator.php │ ├── get-configurable-aio-variables.sh │ ├── psalm-baseline.xml │ ├── psalm.xml │ ├── public/ │ │ ├── automatic_reload.js │ │ ├── base_path.js │ │ ├── before-unload.js │ │ ├── containers-form-submit.js │ │ ├── disable-clamav.js │ │ ├── disable-collabora.js │ │ ├── disable-docker-socket-proxy.js │ │ ├── disable-fulltextsearch.js │ │ ├── disable-harp.js │ │ ├── disable-imaginary.js │ │ ├── disable-onlyoffice.js │ │ ├── disable-talk-recording.js │ │ ├── disable-talk.js │ │ ├── disable-whiteboard.js │ │ ├── forms.js │ │ ├── index.php │ │ ├── log-view.js │ │ ├── robots.txt │ │ ├── second-tab-warning.js │ │ ├── style.css │ │ ├── timezone.js │ │ └── toggle-dark-mode.js │ ├── session/ │ │ └── .gitkeep │ ├── src/ │ │ ├── Auth/ │ │ │ ├── AuthManager.php │ │ │ └── PasswordGenerator.php │ │ ├── Container/ │ │ │ ├── AioVariables.php │ │ │ ├── Container.php │ │ │ ├── ContainerEnvironmentVariables.php │ │ │ ├── ContainerPort.php │ │ │ ├── ContainerPorts.php │ │ │ ├── ContainerState.php │ │ │ ├── ContainerVolume.php │ │ │ ├── ContainerVolumes.php │ │ │ └── VersionState.php │ │ ├── ContainerDefinitionFetcher.php │ │ ├── Controller/ │ │ │ ├── ConfigurationController.php │ │ │ ├── DockerController.php │ │ │ └── LoginController.php │ │ ├── Cron/ │ │ │ ├── BackupNotification.php │ │ │ ├── CheckBackup.php │ │ │ ├── CheckFreeDiskSpace.php │ │ │ ├── CreateBackup.php │ │ │ ├── OutdatedNotification.php │ │ │ ├── PullContainerImages.php │ │ │ ├── StartAndUpdateContainers.php │ │ │ ├── StartContainers.php │ │ │ ├── StopContainers.php │ │ │ ├── UpdateMastercontainer.php │ │ │ └── UpdateNotification.php │ │ ├── Data/ │ │ │ ├── ConfigurationManager.php │ │ │ ├── DataConst.php │ │ │ ├── InvalidSettingConfigurationException.php │ │ │ └── Setup.php │ │ ├── DependencyInjection.php │ │ ├── Docker/ │ │ │ ├── DockerActionManager.php │ │ │ ├── DockerHubManager.php │ │ │ └── GitHubContainerRegistryManager.php │ │ ├── Middleware/ │ │ │ └── AuthMiddleware.php │ │ └── Twig/ │ │ ├── ClassExtension.php │ │ └── CsrfExtension.php │ ├── templates/ │ │ ├── already-installed.twig │ │ ├── components/ │ │ │ └── container-state.twig │ │ ├── containers.twig │ │ ├── includes/ │ │ │ ├── aio-config.twig │ │ │ ├── aio-version.twig │ │ │ ├── backup-dirs.twig │ │ │ ├── community-containers.twig │ │ │ └── optional-containers.twig │ │ ├── layout.twig │ │ ├── log.twig │ │ ├── login.twig │ │ └── setup.twig │ └── tests/ │ ├── .gitignore │ ├── package.json │ ├── playwright.config.js │ └── tests/ │ ├── initial-setup.spec.js │ └── restore-instance.spec.js ├── readme.md ├── reverse-proxy.md ├── tests/ │ └── QA/ │ ├── 001-initial-setup.md │ ├── 002-new-instance.md │ ├── 003-automatic-login.md │ ├── 004-initial-backup.md │ ├── 010-restore-instance.md │ ├── 020-backup-and-restore.md │ ├── 030-aio-password-change.md │ ├── 040-login-behavior.md │ ├── 050-optional-addons.md │ ├── 055-community-containers.md │ ├── 060-environmental-variables.md │ ├── 070-timezone-change.md │ ├── 080-daily-backup-script.md │ ├── assets/ │ │ └── backup-archive/ │ │ └── readme.md │ └── readme.md └── zizmor.yml ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ * text=auto ================================================ FILE: .github/ISSUE_TEMPLATE/Bug_report.md ================================================ --- name: 🐛 Bug report - no questions and no support! about: Help us improving by reporting a bug - this category is not for questions and also not for support! Please use one of the options below for questions and support labels: 0. Needs triage --- ### Steps to reproduce 1. 2. 3. ### Expected behavior ### Actual behavior ### Other information #### Host OS #### Output of `sudo docker info` #### Docker run command or docker-compose file that you used #### Output of `sudo docker logs nextcloud-aio-mastercontainer` #### Output of `sudo docker inspect nextcloud-aio-mastercontainer` #### Output of `sudo docker ps -a` #### Other valuable info ================================================ FILE: .github/ISSUE_TEMPLATE/Feature_request.md ================================================ --- name: 📖 Existing feature/documentation enhancement about: Suggest an enhancement of an existing feature/documentation - for other types, please use the feature request option below labels: 0. Needs triage --- ### Is your feature request related to a problem? Please describe. ### Describe the solution you'd like ### Describe alternatives you've considered ### Additional context ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: false contact_links: - name: 📘 Documentation on Nextcloud AIO url: https://github.com/nextcloud/all-in-one#faq about: Please read the docs first before submitting any report or request! - name: ⛑️ Questions and support url: https://help.nextcloud.com/tag/aio about: For questions, support and help - name: 💡 Suggest a new feature or discuss one url: https://github.com/nextcloud/all-in-one/discussions/categories/ideas about: For new feature requests and discussion of existing ones - name: 💼 Nextcloud Enterprise url: https://portal.nextcloud.com/ about: If you are a Nextcloud Enterprise customer, or need Professional support, so it can be resolved directly by our dedicated engineers more quickly ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: "github-actions" directory: ".github/workflows" schedule: interval: "daily" time: "12:00" open-pull-requests-limit: 10 rebase-strategy: "disabled" labels: - 3. to review - dependencies cooldown: default-days: 7 - package-ecosystem: composer directory: "/php/" schedule: interval: "daily" time: "12:00" open-pull-requests-limit: 10 rebase-strategy: "auto" labels: - 3. to review - dependencies - package-ecosystem: "docker" directories: - "/Containers/alpine" - "/Containers/apache" - "/Containers/borgbackup" - "/Containers/clamav" - "/Containers/collabora" - "/Containers/docker-socket-proxy" - "/Containers/domaincheck" - "/Containers/fulltextsearch" - "/Containers/imaginary" - "/Containers/mastercontainer" - "/Containers/nextcloud" - "/Containers/notify-push" - "/Containers/onlyoffice" - "/Containers/postgresql" - "/Containers/redis" - "/Containers/talk" - "/Containers/talk-recording" - "/Containers/watchtower" - "/Containers/whiteboard" schedule: interval: "daily" time: "04:00" open-pull-requests-limit: 10 rebase-strategy: "disabled" labels: - 3. to review - dependencies ignore: - dependency-name: "php" update-types: ["version-update:semver-major", "version-update:semver-minor"] - dependency-name: "postgres" update-types: ["version-update:semver-major"] - dependency-name: "redis" update-types: ["version-update:semver-major"] - dependency-name: "elasticsearch" update-types: ["version-update:semver-major"] ================================================ FILE: .github/pull_request_template.md ================================================ ================================================ FILE: .github/release.yml ================================================ changelog: categories: - title: 🏕 New features and other improvements labels: - enhancement - title: 🐞 Fixed bugs labels: - bug - title: 👒 Updated dependencies labels: - dependencies - title: 📄 Improved documentation labels: - documentation ================================================ FILE: .github/workflows/codespell.yml ================================================ name: 'Codespell' on: pull_request: push: branches: - main jobs: codespell: name: Check spelling runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check spelling uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2 with: check_filenames: true check_hidden: true ================================================ FILE: .github/workflows/collabora.yml ================================================ name: collabora-update on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: collabora-update: name: update collabora runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run collabora-profile-update run: | rm -f php/cool-seccomp-profile.json wget https://raw.githubusercontent.com/CollaboraOnline/online/refs/heads/main/docker/cool-seccomp-profile.json mv cool-seccomp-profile.json php/ - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: collabora-seccomp-update automated change signoff: true title: collabora seccomp update body: Automated collabora seccomp profile update labels: dependencies, 3. to review milestone: next branch: collabora-seccomp-update ================================================ FILE: .github/workflows/community-containers.yml ================================================ name: Validate community containers on: pull_request: paths: - 'community-containers/**' push: branches: - main paths: - 'community-containers/**' jobs: validator-community-containers: name: Validate community containers runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Validate structure run: | CONTAINERS="$(find ./community-containers -mindepth 1 -maxdepth 1 -type d)" mapfile -t CONTAINERS <<< "$CONTAINERS" for container in "${CONTAINERS[@]}"; do container="$(echo "$container" | sed 's|./community-containers/||')" if ! [ -f ./community-containers/"$container"/"$container.json" ]; then echo ".json file must be named like its parent folder $container" FAIL=1 fi if ! [ -f ./community-containers/"$container"/readme.md ]; then echo "There must be a readme.md file in the folder!" FAIL=1 fi if [ -n "$FAIL" ]; then exit 1 fi done ================================================ FILE: .github/workflows/dependency-updates.yml ================================================ name: dependency-updates on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: dependency_updates: name: Run dependency update script runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2 with: php-version: 8.5 extensions: apcu - name: Run dependency update script run: | set -x cd ./php composer update --with-all-dependencies # Disable dependency updates for now # set +e # ALL_LINES="$(composer outdated | grep -v "^$\|Direct dependencies\|Everything up to date\|Transitive dependencies")" # set -e # while [ -n "$ALL_LINES" ]; do # CURRENT_LINE="$(echo "$ALL_LINES" | head -1)" # composer require "$(echo "$CURRENT_LINE" | awk '{print $1}')" "^$(echo "$CURRENT_LINE" | awk '{print $4}')" --with-all-dependencies # ALL_LINES="$(echo "$ALL_LINES" | sed '1d')" # done # echo "outdated dependencies: # $(composer outdated)" - name: Update apcu run: | # APCU apcu_version="$( git ls-remote --tags https://github.com/krakjoe/apcu.git \ | cut -d/ -f3 \ | grep -viE -- 'rc|b' \ | sed -E 's/^v//' \ | sort -V \ | tail -1 )" sed -i "s|pecl install APCu.*\;|pecl install APCu-$apcu_version\;|" ./Containers/mastercontainer/Dockerfile # CADDY_REMOTE_HOST_HASH CADDY_REMOTE_HOST_HASH="$( git ls-remote https://github.com/muety/caddy-remote-host master \ | cut -f1 \ | tail -1 )" sed -i "s|^ARG CADDY_REMOTE_HOST_HASH.*$|ARG CADDY_REMOTE_HOST_HASH=$CADDY_REMOTE_HOST_HASH|" ./Containers/mastercontainer/Dockerfile - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: php dependency updates signoff: true title: PHP dependency updates body: Automated php dependency updates since dependabot does not support grouped updates labels: dependencies, 3. to review milestone: next branch: aio-dependency-update ================================================ FILE: .github/workflows/docker-lint.yml ================================================ name: Docker Lint on: pull_request: paths: - 'Containers/**' push: branches: - main paths: - 'Containers/**' permissions: contents: read concurrency: group: docker-lint-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: docker-lint: runs-on: ubuntu-latest name: docker-lint steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install hadolint run: | sudo wget https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -O /usr/bin/hadolint sudo chmod +x /usr/bin/hadolint - name: run lint run: | DOCKERFILES="$(find ./Containers -name Dockerfile)" mapfile -t DOCKERFILES <<< "$DOCKERFILES" for file in "${DOCKERFILES[@]}"; do # DL3018 warning: Pin versions in apk add. Instead of `apk add ` use `apk add =` # DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check hadolint "$file" --ignore DL3018 --ignore DL4006 | tee -a ./hadolint.log done if grep -q "DL[0-9]\+\|SC[0-9]\+" ./hadolint.log; then exit 1 fi ================================================ FILE: .github/workflows/fail-on-prerelease.yml ================================================ name: Block if prerelease is present on: pull_request: permissions: contents: read jobs: check-latest-release: runs-on: ubuntu-latest steps: - name: "Check latest published release isn't a prerelease" uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v6 with: script: | const tags = await github.rest.repos.listTags({ owner: context.repo.owner, repo: context.repo.repo, per_page: 1 }); if (!tags.data || tags.data.length === 0) { core.info('No tags found for this repository; skipping prerelease check.'); return; } const latestTag = tags.data[0].name; core.info(`Latest tag found: ${latestTag}`); try { const { data } = await github.rest.repos.getReleaseByTag({ owner: context.repo.owner, repo: context.repo.repo, tag: latestTag }); if (data.prerelease) { core.setFailed(`Release for tag ${latestTag} (${data.tag_name}) is a prerelease. Blocking merges to main as we need to wait for the prerelease to become stable.`); } else { core.info(`Release for tag ${latestTag} (${data.tag_name}) is not a prerelease.`); } } catch (err) { if (err.status === 404) { core.info(`No release found for tag ${latestTag}; skipping prerelease check.`); } else { throw err; } } ================================================ FILE: .github/workflows/helm-release.yml ================================================ name: Helm Chart Releaser on: push: branches: - main paths: - 'nextcloud-aio-helm-chart/**' jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Turnstyle uses: softprops/turnstyle@e565d2d86403c5d23533937e95980570545e5586 # v2 with: continue-after-seconds: 180 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fetch history run: git fetch --prune --unshallow - name: Configure Git run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" # See https://github.com/helm/chart-releaser-action/issues/6 - name: Set up Helm uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4 with: version: v3.6.3 - name: Run Helm Lint run: | helm lint ./nextcloud-aio-helm-chart - name: Run chart-releaser uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0 with: mark_as_latest: false charts_dir: . env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}" CR_SKIP_EXISTING: true ================================================ FILE: .github/workflows/imaginary-update.yml ================================================ name: imaginary-update on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: run_update: name: update to latest imaginary commit on master branch runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run imaginary-update run: | # Imaginary imaginary_version="$( git ls-remote https://github.com/h2non/imaginary master \ | cut -f1 \ | tail -1 )" sed -i "s|^ENV IMAGINARY_HASH.*$|ENV IMAGINARY_HASH=$imaginary_version|" ./Containers/imaginary/Dockerfile - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: imaginary-update automated change signoff: true title: Imaginary update body: Automated Imaginary container update labels: dependencies, 3. to review milestone: next branch: imaginary-container-update ================================================ FILE: .github/workflows/json-validator.yml ================================================ name: Json Validator on: pull_request: paths: - '**.json' push: branches: - main paths: - '**.json' jobs: json-validator: name: Json Validator runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Validate Json run: | sudo apt-get update sudo apt-get install python3-venv -y --no-install-recommends python3 -m venv venv . venv/bin/activate pip3 install json-spec if ! json validate --schema-file=php/containers-schema.json --document-file=php/containers.json; then exit 1 fi JSON_FILES="$(find ./community-containers -name '*.json')" mapfile -t JSON_FILES <<< "$JSON_FILES" for file in "${JSON_FILES[@]}"; do json validate --schema-file=php/containers-schema.json --document-file="$file" 2>&1 | tee -a ./json-validator.log done if grep -q "document does not validate with schema.\|invalid JSONFile" ./json-validator.log; then exit 1 fi ================================================ FILE: .github/workflows/lint-helm.yml ================================================ name: Lint Helm Charts on: workflow_dispatch: pull_request: paths: - 'nextcloud-aio-helm-chart/**' jobs: lint-helm: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 - name: Install Helm uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4 with: version: v3.11.1 - name: Lint charts run: helm lint nextcloud-aio-helm-chart ================================================ FILE: .github/workflows/lint-php.yml ================================================ # This workflow is provided via the organization template repository # # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT name: Lint php on: pull_request: paths: - 'php/**' push: branches: - main paths: - 'php/**' permissions: contents: read concurrency: group: lint-php-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: php-lint: runs-on: ubuntu-latest strategy: matrix: php-versions: [ "8.5" ] name: php-lint steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up php ${{ matrix.php-versions }} uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2.36.0 with: php-version: ${{ matrix.php-versions }} coverage: none ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Lint run: cd php && composer run lint summary: permissions: contents: none runs-on: ubuntu-latest-low needs: php-lint if: always() name: php-lint-summary steps: - name: Summary status run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi ================================================ FILE: .github/workflows/lint-yaml.yml ================================================ # This workflow is provided via the organization template repository # # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT name: Lint YAML on: pull_request: paths: - '**.yml' permissions: contents: read jobs: yaml-lint: runs-on: ubuntu-latest name: yaml steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.1 with: persist-credentials: false - name: GitHub action templates lint uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1 with: file_or_dir: .github/workflows config_data: | line-length: warning - name: Install the latest version of uv uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 - name: Check GitHub actions run: uvx zizmor --min-severity medium .github/workflows/*.yml ================================================ FILE: .github/workflows/lock-threads.yml ================================================ name: 'Lock Threads' on: schedule: - cron: '0 0 * * *' permissions: issues: write concurrency: group: lock jobs: action: runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # v5 with: issue-inactive-days: '14' process-only: 'issues' ================================================ FILE: .github/workflows/nextcloud-update.yml ================================================ # Inspired by https://github.com/nextcloud/docker/blob/master/.github/workflows/update-sh.yml name: nextcloud-update on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: run_update_sh: name: Run nextcloud-update script runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run nextcloud-update script run: | # Inspired by https://github.com/nextcloud/docker/blob/master/update.sh # APCU apcu_version="$( git ls-remote --tags https://github.com/krakjoe/apcu.git \ | cut -d/ -f3 \ | grep -viE -- 'rc|b' \ | sed -E 's/^v//' \ | sort -V \ | tail -1 )" sed -i "s|\(pecl install[^;]*APCu-\)[0-9.]*|\1$apcu_version|" ./Containers/nextcloud/Dockerfile # Memcached memcached_version="$( git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \ | cut -d/ -f3 \ | grep -viE -- 'rc|b' \ | sed -E 's/^[rv]//' \ | sort -V \ | tail -1 )" sed -i "s|\(pecl install[^;]*memcached-\)[0-9.]*|\1$memcached_version|" ./Containers/nextcloud/Dockerfile # Redis redis_version="$( git ls-remote --tags https://github.com/phpredis/phpredis.git \ | cut -d/ -f3 \ | grep -viE '[a-z]' \ | tr -d '^{}' \ | sort -V \ | tail -1 )" sed -i "s|\(pecl install[^;]*redis-\)[0-9.]*|\1$redis_version|" ./Containers/nextcloud/Dockerfile # Imagick imagick_version="$( git ls-remote --tags https://github.com/imagick/imagick.git \ | cut -d/ -f3 \ | grep -viE '[a-z]' \ | tr -d '^{}' \ | sort -V \ | tail -1 )" sed -i "s|\(pecl install[^;]*imagick-\)[0-9.]*|\1$imagick_version|" ./Containers/nextcloud/Dockerfile # Igbinary igbinary_version="$( git ls-remote --tags https://github.com/igbinary/igbinary.git \ | cut -d/ -f3 \ | grep -viE '[a-z]' \ | tr -d '^{}' \ | sort -V \ | tail -1 )" sed -i "s|\(pecl install[^;]*igbinary-\)[0-9.]*|\1$igbinary_version|" ./Containers/nextcloud/Dockerfile # Nextcloud NC_MAJOR="$(grep "ENV NEXTCLOUD_VERSION" ./Containers/nextcloud/Dockerfile | grep -oP '[23][0-9]')" NCVERSION=$(curl -s -m 900 https://download.nextcloud.com/server/releases/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' | grep "$NC_MAJOR" | sort --version-sort | tail -1) if [ -n "$NCVERSION" ]; then sed -i "s|^ENV NEXTCLOUD_VERSION.*|ENV NEXTCLOUD_VERSION=$NCVERSION|" ./Containers/nextcloud/Dockerfile fi - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: nextcloud-update automated change signoff: true title: Nextcloud dependency update body: Automated Nextcloud container update labels: dependencies, 3. to review milestone: next branch: nextcloud-container-update ================================================ FILE: .github/workflows/php-deprecation-detector.yml ================================================ name: PHP Deprecation Detector # See https://github.com/wapmorgan/PhpDeprecationDetector on: pull_request: paths: - 'php/**' push: branches: - main paths: - 'php/**' jobs: phpdd: name: PHP Deprecation Detector runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up php uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2 with: php-version: 8.5 extensions: apcu coverage: none - name: Run script run: | set -x cd php composer install composer run php-deprecation-detector | tee -i ./phpdd.log if grep "Total issues:" ./phpdd.log; then exit 1 fi ================================================ FILE: .github/workflows/playwright-on-push.yml ================================================ name: Playwright Tests on push on: pull_request: paths: - 'php/**' push: branches: - main paths: - 'php/**' concurrency: group: playwright-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: BASE_URL: https://localhost:8080 jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: node-version: lts/* - name: Install dependencies run: cd php/tests && npm ci - name: Install Playwright Browsers run: cd php/tests && npx playwright install --with-deps chromium - name: Set up php 8.5 uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2.36.0 with: extensions: apcu php-version: 8.5 coverage: none ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Adjust some things and fix permissions run: | cd php rm -r ./data rm -r ./session composer install --no-dev composer clear-cache sudo chmod 777 -R ./ - name: Start fresh development server run: | docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true docker pull ghcr.io/nextcloud-releases/all-in-one:develop docker run \ -d \ --init \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 8080:8080 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume ./php:/var/www/docker-aio/php \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ --env SKIP_DOMAIN_VALIDATION=true \ --env APACHE_PORT=11000 \ ghcr.io/nextcloud-releases/all-in-one:develop echo Waiting for 10 seconds for the development container to start ... sleep 10 - name: Run Playwright tests for initial setup run: | cd php/tests export DEBUG=pw:api if ! npx playwright test tests/initial-setup.spec.js; then docker logs nextcloud-aio-mastercontainer docker logs nextcloud-aio-borgbackup exit 1 fi - name: Start fresh development server run: | docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true docker run \ -d \ --init \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 8080:8080 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume ./php:/var/www/docker-aio/php \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ --env SKIP_DOMAIN_VALIDATION=false \ --env APACHE_PORT=11000 \ ghcr.io/nextcloud-releases/all-in-one:develop echo Waiting for 10 seconds for the development container to start ... sleep 10 - name: Run Playwright tests for backup restore run: | cd php/tests export DEBUG=pw:api if ! npx playwright test tests/restore-instance.spec.js; then docker logs nextcloud-aio-mastercontainer docker logs nextcloud-aio-borgbackup exit 1 fi - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: ${{ !cancelled() }} with: name: playwright-report path: php/tests/playwright-report/ retention-days: 14 overwrite: true ================================================ FILE: .github/workflows/playwright-on-workflow-dispatch.yml ================================================ name: Playwright Tests on: workflow_dispatch: env: BASE_URL: https://localhost:8080 jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: node-version: lts/* - name: Install dependencies run: cd php/tests && npm ci - name: Install Playwright Browsers run: cd php/tests && npx playwright install --with-deps chromium - name: Start fresh development server run: | docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true docker pull ghcr.io/nextcloud-releases/all-in-one:develop docker run \ -d \ --init \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 8080:8080 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ --env SKIP_DOMAIN_VALIDATION=true \ --env APACHE_PORT=11000 \ ghcr.io/nextcloud-releases/all-in-one:develop echo Waiting for 10 seconds for the development container to start ... sleep 10 - name: Run Playwright tests for initial setup run: | cd php/tests export DEBUG=pw:api if ! npx playwright test tests/initial-setup.spec.js; then docker logs nextcloud-aio-mastercontainer docker logs nextcloud-aio-borgbackup exit 1 fi - name: Start fresh development server run: | docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true docker run \ -d \ --init \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 8080:8080 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ --env SKIP_DOMAIN_VALIDATION=false \ --env APACHE_PORT=11000 \ ghcr.io/nextcloud-releases/all-in-one:develop echo Waiting for 10 seconds for the development container to start ... sleep 10 - name: Run Playwright tests for backup restore run: | cd php/tests export DEBUG=pw:api if ! npx playwright test tests/restore-instance.spec.js; then docker logs nextcloud-aio-mastercontainer docker logs nextcloud-aio-borgbackup exit 1 fi - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: ${{ !cancelled() }} with: name: playwright-report path: php/tests/playwright-report/ retention-days: 14 overwrite: true ================================================ FILE: .github/workflows/psalm-update-baseline.yml ================================================ name: Update Psalm baseline on: workflow_dispatch: schedule: - cron: '5 4 * * *' jobs: update-psalm-baseline: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up php uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2 with: php-version: 8.5 extensions: apcu coverage: none ini-file: development - name: Run script run: | set -x cd php composer install composer run psalm:update-baseline git clean -f lib/composer git checkout composer.json composer.lock lib/composer continue-on-error: true - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update psalm baseline committer: GitHub author: nextcloud-command signoff: true branch: automated/noid/psalm-baseline-update title: '[Automated] Update psalm-baseline.xml' milestone: next body: | Auto-generated update psalm-baseline.xml with fixed psalm warnings labels: | 3. to review, dependencies ================================================ FILE: .github/workflows/psalm.yml ================================================ # This workflow is provided via the organization template repository # # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT name: Static analysis on: pull_request: paths: - 'php/**' push: branches: - main paths: - 'php/**' concurrency: group: psalm-${{ github.head_ref || github.run_id }} cancel-in-progress: true permissions: contents: read jobs: static-analysis: runs-on: ubuntu-latest name: static-psalm-analysis steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up php uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2.36.0 with: php-version: 8.5 extensions: apcu coverage: none ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies and run psalm run: | set -x cd php composer install composer run psalm ================================================ FILE: .github/workflows/shellcheck.yml ================================================ name: Shellcheck on: pull_request: paths: - '**.sh' push: branches: - main paths: - '**.sh' jobs: shellcheck: name: Check Shell runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run Shellcheck uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0 with: check_together: 'yes' env: SHELLCHECK_OPTS: --shell bash ================================================ FILE: .github/workflows/talk.yml ================================================ name: talk-update on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: talk-update: name: update talk runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run talk-container-update run: | # Recording recording_version="$( git ls-remote https://github.com/nextcloud/nextcloud-talk-recording v* \ | cut -d/ -f3 \ | sort -V \ | grep -E "^v[0-9\.]+$" \ | tail -1 )" sed -i "s|^ENV RECORDING_VERSION.*$|ENV RECORDING_VERSION=$recording_version|" ./Containers/talk-recording/Dockerfile curl -L "https://raw.githubusercontent.com/nextcloud/nextcloud-talk-recording/$recording_version/server.conf.in" -o Containers/talk-recording/recording.conf # Signaling signaling_version="$( git ls-remote https://github.com/strukturag/nextcloud-spreed-signaling v*.*.* \ | cut -d/ -f3 \ | sort -V \ | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" \ | tail -1 )" curl -L "https://raw.githubusercontent.com/strukturag/nextcloud-spreed-signaling/$signaling_version/server.conf.in" -o Containers/talk/server.conf.in # Janus janus_version="$( git ls-remote https://github.com/meetecho/janus-gateway v1.*.* \ | cut -d/ -f3 \ | sort -V \ | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" \ | tail -1 )" sed -i "s|^ARG JANUS_VERSION=.*$|ARG JANUS_VERSION=$janus_version|" ./Containers/talk/Dockerfile - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: talk-update automated change signoff: true title: talk container update body: Automated talk container update labels: dependencies, 3. to review milestone: next branch: talk-container-update ================================================ FILE: .github/workflows/twig-lint.yml ================================================ name: Twig Lint on: pull_request: paths: - '**.twig' push: branches: - main paths: - '**.twig' permissions: contents: read concurrency: group: lint-twig-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: twig-lint: runs-on: ubuntu-latest name: twig-lint steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up php ${{ matrix.php-versions }} uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2 with: php-version: 8.5 extensions: apcu coverage: none - name: twig lint run: | cd php composer install composer run lint:twig ================================================ FILE: .github/workflows/update-copyright.yml ================================================ name: Update Copyright on: workflow_dispatch: jobs: update-copyright: name: update copyright runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 ================================================ FILE: .github/workflows/update-helm.yml ================================================ name: Update Helm Chart on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: update-helm: name: update helm chart runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: update helm chart run: | set -x GHCR_TOKEN="$(curl https://ghcr.io/token?scope=repository:nextcloud-releases/nce-php-fpm-mgmt:pull | jq '.token' | sed 's|"||g')" DOCKER_TAG="$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" -L -s 'https://ghcr.io/v2/nextcloud-releases/all-in-one/tags/list?page_size=1024' | jq '.tags' | sed 's|"||g;s|[[:space:]]||g;s|,||g' | grep '^20[0-9_]\+' | grep -v latest | sort -r | head -1)" export DOCKER_TAG set +x if [ -n "$DOCKER_TAG" ] && ! grep -q "aio-nextcloud:$DOCKER_TAG" ./nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml; then sudo bash nextcloud-aio-helm-chart/update-helm.sh "$DOCKER_TAG" fi - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: commit-message: Helm Chart updates signoff: true title: Helm Chart updates body: Automated Helm Chart updates for the yaml files. It can be merged if it looks good at any time which will automatically trigger a new release of the helm chart. labels: dependencies, 3. to review milestone: next branch: aio-helm-update token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/update-yaml.yml ================================================ name: Update Yaml files on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: update-yaml: name: update yaml files runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: update yaml files run: | sudo bash manual-install/update-yaml.sh - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: commit-message: Yaml updates signoff: true title: Yaml updates body: Automated yaml updates for the docker-compose files. Should only be merged shortly before the next latest release. labels: dependencies, 3. to review milestone: next branch: aio-yaml-update token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/watchtower-update.yml ================================================ name: watchtower-update on: workflow_dispatch: schedule: - cron: '00 12 * * *' jobs: watchtower-update: name: update watchtower runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run watchtower-container-update run: | # Watchtower watchtower_version="$( git ls-remote https://github.com/nicholas-fedor/watchtower v* \ | cut -d/ -f3 \ | sort -V \ | grep -E "^v[0-9\.]+$" \ | tail -1 )" watchtower_commit_hash="$(git ls-remote https://github.com/nicholas-fedor/watchtower $watchtower_version | sed 's/refs.*//')" sed -i "s|^ENV WATCHTOWER_COMMIT_HASH.*$|ENV WATCHTOWER_COMMIT_HASH=$watchtower_commit_hash|" ./Containers/watchtower/Dockerfile sed -i "s|\$WATCHTOWER_COMMIT_HASH.*$|\$WATCHTOWER_COMMIT_HASH # $watchtower_version|" ./Containers/watchtower/Dockerfile - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: watchtower-update automated change signoff: true title: watchtower container update body: Automated watchtower container update labels: dependencies, 3. to review milestone: next branch: watchtower-container-update ================================================ FILE: .gitignore ================================================ .DS_Store .idea/ *.iml /php/data/* /php/session/* !/php/data/.gitkeep !/php/session/.gitkeep /php/vendor /manual-install/*.conf !/manual-install/sample.conf /manual-install/docker-compose.yml /manual-install/compose.yaml /manual-install/.env ================================================ FILE: CODE_OF_CONDUCT.md ================================================ In the Nextcloud community, participants from all over the world come together to create Free Software for a free internet. This is made possible by the support, hard work and enthusiasm of thousands of people, including those who create and use Nextcloud software. Our code of conduct offers some guidance to ensure Nextcloud participants can cooperate effectively in a positive and inspiring atmosphere, and to explain how together we can strengthen and support each other. The Code of Conduct is shared by all contributors and users who engage with the Nextcloud team and its community services. It presents a summary of the shared values and “common sense” thinking in our community. You can find our full code of conduct on our website: https://nextcloud.com/code-of-conduct/ Please, keep our CoC in mind when you contribute! That way, everyone can be a part of our community in a productive, positive, creative and fun way. ================================================ FILE: Containers/alpine/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM alpine:3.23.3 RUN set -ex; \ apk upgrade --no-cache -a LABEL org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/apache/Caddyfile ================================================ { auto_https disable_redirects storage file_system { root /mnt/data/caddy } servers { # trusted_proxies placeholder } log { level ERROR } } https://{$ADDITIONAL_TRUSTED_DOMAIN}:443, http://{$APACHE_HOST}.nextcloud-aio:23973, # For Collabora callback and WOPI requests, see containers.json {$PROTOCOL}://{$NC_DOMAIN}:{$APACHE_PORT} { header -Server header -X-Powered-By # Collabora route /browser/* { reverse_proxy {$COLLABORA_HOST}:9980 } route /hosting/* { reverse_proxy {$COLLABORA_HOST}:9980 } route /cool/* { reverse_proxy {$COLLABORA_HOST}:9980 } # Notify Push route /push/* { uri strip_prefix /push reverse_proxy {$NOTIFY_PUSH_HOST}:7867 } # Onlyoffice route /onlyoffice/* { uri strip_prefix /onlyoffice reverse_proxy {$ONLYOFFICE_HOST}:80 { header_up X-Forwarded-Host {http.request.hostport}/onlyoffice header_up X-Forwarded-Proto https } } # Talk route /standalone-signaling/* { uri strip_prefix /standalone-signaling reverse_proxy {$TALK_HOST}:8081 } # Whiteboard route /whiteboard/* { uri strip_prefix /whiteboard reverse_proxy {$WHITEBOARD_HOST}:3002 } # HaRP (ExApps) route /exapps/* { reverse_proxy {$HARP_HOST}:8780 } # Nextcloud route { header Strict-Transport-Security max-age=31536000; reverse_proxy 127.0.0.1:8000 } redir /.well-known/carddav /remote.php/dav/ 301 redir /.well-known/caldav /remote.php/dav/ 301 # TLS options tls { issuer acme { disable_http_challenge } } } ================================================ FILE: Containers/apache/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM caddy:2.11.2-alpine AS caddy # From https://github.com/docker-library/httpd/blob/master/2.4/alpine/Dockerfile FROM httpd:2.4.66-alpine3.23 COPY --from=caddy /usr/bin/caddy /usr/bin/caddy COPY --chown=33:33 Caddyfile /Caddyfile COPY --chmod=664 nextcloud.conf /usr/local/apache2/conf/nextcloud.conf COPY --chmod=664 supervisord.conf /supervisord.conf COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh VOLUME /mnt/data RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache shadow; \ groupmod -g 33 www-data; \ usermod -u 33 -g 33 www-data; \ apk del --no-cache shadow; \ \ mkdir -p /mnt/data; \ chown -R www-data:www-data /mnt/data; \ chown -R 777 /tmp; \ \ apk add --no-cache \ bash \ supervisor \ tzdata \ ca-certificates \ openssl \ bind-tools \ netcat-openbsd; \ \ sed -i \ -e '/^Listen /d' \ -e 's/^#\(LoadModule .*mod_rewrite.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_headers.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_proxy.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_proxy_fcgi.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_setenvif.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_env.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_mime.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_dir.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_authz_core.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_alias.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_mpm_event.so\)/\1/' \ -e 's/^#\(LoadModule .*mod_brotli.so\)/\1/' \ -e 's/\(LoadModule .*mod_mpm_worker.so\)/#\1/' \ -e 's/\(LoadModule .*mod_mpm_prefork.so\)/#\1/' \ -e 's/\(ScriptAlias \)/#\1/' \ /usr/local/apache2/conf/httpd.conf; \ echo "Include conf/nextcloud.conf" | tee -a /usr/local/apache2/conf/httpd.conf; \ echo "ServerName localhost" | tee -a /usr/local/apache2/conf/httpd.conf; \ # Sync this with max db connections and pm.max_children # We don't actually expect so many workers but don't want to limit it artificially because people will report issues otherwise. sed -i 's|MaxRequestWorkers.*|MaxRequestWorkers 5000|' /usr/local/apache2/conf/extra/httpd-mpm.conf; \ grep -q '' /usr/local/apache2/conf/extra/httpd-mpm.conf; \ # ServerLimit needs to be set to MaxRequestWorkers divided by ThreadsPerChild which is set to 25 by default sed -i '//a\ \ \ \ ServerLimit 200' /usr/local/apache2/conf/extra/httpd-mpm.conf; \ \ rm -rf /usr/local/apache2/conf/original /var/www; \ mkdir -p /var/www; \ chown -R www-data:www-data /var/www; \ \ mkdir /var/log/supervisord; \ mkdir /var/run/supervisord; \ chown www-data:www-data /var/run/supervisord; \ chown www-data:www-data /var/log/supervisord; \ chmod 777 /var/run/supervisord; \ chmod 777 /var/log/supervisord; \ \ chown -R www-data:www-data /usr/local/apache2; \ chmod +r -R /usr/local/apache2; \ mkdir -p /usr/local/apache2/logs; \ chmod 777 -R /home/www-data; \ chmod 777 -R /usr/local/apache2/logs; \ rm -rf /usr/local/apache2/cgi-bin/; \ \ echo "root:$(openssl rand -base64 12)" | chpasswd; \ apk --no-cache del openssl USER 33 ENTRYPOINT ["/start.sh"] CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/apache/healthcheck.sh ================================================ #!/bin/bash nc -z "$NEXTCLOUD_HOST" 9000 || exit 0 nc -z 127.0.0.1 8000 || exit 1 nc -z 127.0.0.1 "$APACHE_PORT" || exit 1 ================================================ FILE: Containers/apache/nextcloud.conf ================================================ Listen 8000 ServerName localhost # Add error log CustomLog /proc/self/fd/1 proxy LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy ErrorLog /proc/self/fd/2 ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]" LogLevel warn # PHP match SetHandler "proxy:fcgi://${NEXTCLOUD_HOST}:9000" # Enable Brotli compression for js, css and svg files - other plain files are compressed by Nextcloud by default AddOutputFilterByType BROTLI_COMPRESS text/javascript application/javascript application/x-javascript text/css image/svg+xml BrotliCompressionQuality 0 # Nextcloud dir DocumentRoot /var/www/html/ Options Indexes FollowSymLinks Require all granted AllowOverride All Options FollowSymLinks MultiViews Satisfy Any Dav off # Deny access to .ht files Require all denied # See https://httpd.apache.org/docs/current/en/mod/core.html#limitrequestbody LimitRequestBody ${APACHE_MAX_SIZE} # See https://httpd.apache.org/docs/current/mod/core.html#timeout Timeout ${APACHE_MAX_TIME} # See https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxytimeout ProxyTimeout ${APACHE_MAX_TIME} # See https://httpd.apache.org/docs/trunk/mod/core.html#traceenable TraceEnable Off ================================================ FILE: Containers/apache/start.sh ================================================ #!/bin/bash if [ -z "$NC_DOMAIN" ]; then echo "NC_DOMAIN and NEXTCLOUD_HOST need to be provided. Exiting!" exit 1 fi # Need write access to /mnt/data if ! [ -w /mnt/data ]; then echo "Cannot write to /mnt/data" exit 1 fi # Only start container if nextcloud is accessible while ! nc -z "$NEXTCLOUD_HOST" 9000; do echo "Waiting for Nextcloud to start..." sleep 5 done # Get ipv4-address of Apache # shellcheck disable=SC2153 IPv4_ADDRESS="$(dig "$APACHE_HOST" A +short +search | head -1)" # Bring it in CIDR notation # shellcheck disable=SC2001 IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|0/16|')" if [ -z "$APACHE_PORT" ]; then export APACHE_PORT="443" fi # Change variables in case of reverse proxies if [ "$APACHE_PORT" != '443' ]; then export PROTOCOL="http" export NC_DOMAIN="" else export PROTOCOL="https" fi # Change the auto_https in case of reverse proxies if [ "$APACHE_PORT" != '443' ]; then CADDYFILE="$(sed 's|auto_https.*|auto_https off|' /Caddyfile)" else CADDYFILE="$(sed 's|auto_https.*|auto_https disable_redirects|' /Caddyfile)" fi echo "$CADDYFILE" > /tmp/Caddyfile # Change the trusted_proxies in case of reverse proxies if [ "$APACHE_PORT" != '443' ]; then # Here the 100.64.0.0/10 range gets added which is the CGNAT range used by Tailscale nodes # See https://github.com/nextcloud/all-in-one/pull/6703 for reference CADDYFILE="$(sed 's|# trusted_proxies placeholder|trusted_proxies static private_ranges 100.64.0.0/10|' /tmp/Caddyfile)" else CADDYFILE="$(sed "s|# trusted_proxies placeholder|trusted_proxies static $IPv4_ADDRESS|" /tmp/Caddyfile)" fi echo "$CADDYFILE" > /tmp/Caddyfile # Remove additional domain if not given if [ -z "$ADDITIONAL_TRUSTED_DOMAIN" ]; then CADDYFILE="$(sed '/ADDITIONAL_TRUSTED_DOMAIN/d' /tmp/Caddyfile)" fi echo "$CADDYFILE" > /tmp/Caddyfile # Fix the Caddyfile format caddy fmt --overwrite /tmp/Caddyfile # Add caddy path mkdir -p /mnt/data/caddy/ # Fix caddy startup if [ -d "/mnt/data/caddy/locks" ]; then rm -rf /mnt/data/caddy/locks/* fi # Fix apache startup rm -f /usr/local/apache2/logs/httpd.pid exec "$@" ================================================ FILE: Containers/apache/supervisord.conf ================================================ [supervisord] nodaemon=true nodaemon=true logfile=/var/log/supervisord/supervisord.log pidfile=/var/run/supervisord/supervisord.pid childlogdir=/var/log/supervisord/ logfile_maxbytes=50MB logfile_backups=10 loglevel=error [program:apache] # Stdout logging is disabled as otherwise the logs are spammed stdout_logfile=NONE stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=apachectl -DFOREGROUND [program:caddy] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/usr/bin/caddy run --config /tmp/Caddyfile ================================================ FILE: Containers/borgbackup/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM alpine:3.23.3 RUN set -ex; \ \ apk upgrade --no-cache -a; \ apk add --no-cache \ util-linux-misc \ bash \ borgbackup \ rsync \ fuse \ py3-llfuse \ jq \ openssh-client VOLUME /root COPY --chmod=770 *.sh / COPY borg_excludes / ENTRYPOINT ["/start.sh"] # hadolint ignore=DL3002 USER root LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ENV BORG_RETENTION_POLICY="--keep-within=7d --keep-weekly=4 --keep-monthly=6" ================================================ FILE: Containers/borgbackup/backupscript.sh ================================================ #!/bin/bash # Functions get_start_time(){ START_TIME=$(date +%s) CURRENT_DATE=$(date --date @"$START_TIME" +"%Y%m%d_%H%M%S") } get_expiration_time() { END_TIME=$(date +%s) END_DATE_READABLE=$(date --date @"$END_TIME" +"%d.%m.%Y - %H:%M:%S") DURATION=$((END_TIME-START_TIME)) DURATION_SEC=$((DURATION % 60)) DURATION_MIN=$(((DURATION / 60) % 60)) DURATION_HOUR=$((DURATION / 3600)) DURATION_READABLE=$(printf "%02d hours %02d minutes %02d seconds" $DURATION_HOUR $DURATION_MIN $DURATION_SEC) } # Test if all volumes aren't empty VOLUME_DIRS="$(find /nextcloud_aio_volumes -mindepth 1 -maxdepth 1 -type d)" mapfile -t VOLUME_DIRS <<< "$VOLUME_DIRS" for directory in "${VOLUME_DIRS[@]}"; do if ! mountpoint -q "$directory"; then echo "$directory is not a mountpoint which is not allowed." exit 1 fi done # Test if default volumes are there DEFAULT_VOLUMES=(nextcloud_aio_apache nextcloud_aio_nextcloud nextcloud_aio_database nextcloud_aio_database_dump nextcloud_aio_elasticsearch nextcloud_aio_nextcloud_data nextcloud_aio_mastercontainer) for volume in "${DEFAULT_VOLUMES[@]}"; do if ! mountpoint -q "/nextcloud_aio_volumes/$volume"; then echo "$volume is missing which is not intended." exit 1 fi done # Check if target is mountpoint if [ -z "$BORG_REMOTE_REPO" ] && ! mountpoint -q "$MOUNT_DIR"; then echo "$MOUNT_DIR is not a mountpoint which is not allowed." exit 1 fi # Check if repo is uninitialized if [ "$BORG_MODE" != backup ] && [ "$BORG_MODE" != test ] && ! borg info > /dev/null; then if [ -n "$BORG_REMOTE_REPO" ]; then echo "The repository is uninitialized or cannot connect to remote. Cannot perform check or restore." else echo "The repository is uninitialized. Cannot perform check or restore." fi exit 1 fi # Do not continue if this file exists (needed for simple external blocking) if [ -z "$BORG_REMOTE_REPO" ] && [ -f "$BORG_BACKUP_DIRECTORY/aio-lockfile" ]; then echo "Not continuing because aio-lockfile exists – it seems like a script is externally running which is locking the backup archive." echo "If this should not be the case, you can fix this by deleting the 'aio-lockfile' file from the backup archive directory." exit 1 fi # Create lockfile if [ "$BORG_MODE" = backup ] || [ "$BORG_MODE" = restore ]; then touch "/nextcloud_aio_volumes/nextcloud_aio_database_dump/backup-is-running" fi if [ -n "$BORG_REMOTE_REPO" ] && ! [ -f "$BORGBACKUP_KEY" ]; then echo "First run, creating borg ssh key" ssh-keygen -f "$BORGBACKUP_KEY" -N "" echo "You should configure the remote to accept this public key" fi if [ -n "$BORG_REMOTE_REPO" ] && [ -f "$BORGBACKUP_KEY.pub" ]; then echo "Your public ssh key for borgbackup is: $(cat "$BORGBACKUP_KEY.pub")" fi # Do the backup if [ "$BORG_MODE" = backup ]; then # Test if important files are present if ! [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json" ]; then echo "configuration.json not present. Cannot perform the backup!" exit 1 elif ! grep -q '"domain"' "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json" \ || ! grep -q '"wasStartButtonClicked"' "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json"; then echo "It seems like the configuration.json setup was not done correctly. Something is wrong! (Most likely the provided configuration.json is invalid)" exit 1 elif ! [ -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/config/config.php" ]; then echo "config.php is missing. Cannot perform backup!" exit 1 elif ! [ -f "/nextcloud_aio_volumes/nextcloud_aio_database_dump/database-dump.sql" ]; then echo "database-dump is missing. Cannot perform backup!" echo "Please check the database container logs!" exit 1 elif ! [ -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.ocdata" ] && ! [ -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.ncdata" ]; then echo "The .ncdata or .ocdata file is missing in Nextcloud datadir which means it is invalid!" echo "Is the drive where the datadir is located on still mounted?" exit 1 fi # Test that default volumes are not empty for volume in "${DEFAULT_VOLUMES[@]}"; do if [ -z "$(ls -A "/nextcloud_aio_volumes/$volume")" ] && [ "$volume" != "nextcloud_aio_elasticsearch" ]; then echo "/nextcloud_aio_volumes/$volume is empty which should not happen!" exit 1 fi done if [ -f "/nextcloud_aio_volumes/nextcloud_aio_database_dump/export.failed" ]; then echo "Cannot create a backup now." echo "Reason is that the database export failed the last time." echo "Most likely was the database container not correctly shut down via the AIO interface." echo "" echo "You might want to try the database export again manually by running the three commands:" echo "sudo docker start nextcloud-aio-database" echo "sleep 10" echo "sudo docker stop nextcloud-aio-database -t 1800" echo "" echo "Afterwards try to create a backup again and it should hopefully work." echo "If it should still fail, feel free to report this to https://github.com/nextcloud/all-in-one/issues and post the database container logs and the borgbackup container logs into the thread. Thanks!" exit 1 fi if [ -z "$BORG_REMOTE_REPO" ]; then # Create backup folder mkdir -p "$BORG_BACKUP_DIRECTORY" fi # Initialize the repository if can't get info from target if ! borg info > /dev/null; then # Don't initialize if already initialized if [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" ]; then if [ -n "$BORG_REMOTE_REPO" ]; then echo "Borg could not get info from the remote repo." echo "This might be a failure to connect to the remote server. See the above borg info output for details." else echo "Borg could not get info from the targeted directory." echo "This might happen if the targeted directory is located on an external drive and the drive not connected anymore. You should check this." fi echo "If you instead want to initialize a new backup repository, you may delete the 'borg.config' file that is stored in the mastercontainer volume manually, which will allow you to initialize a new borg repository in the chosen directory:" echo "sudo docker exec nextcloud-aio-mastercontainer rm /mnt/docker-aio-config/data/borg.config" exit 1 fi echo "Initializing repository..." NEW_REPOSITORY=1 if ! borg init --debug --encryption=repokey-blake2; then echo "Could not initialize borg repository." exit 1 fi if [ -z "$BORG_REMOTE_REPO" ]; then # borg config only works for local repos; it's up to the remote to ensure the disk isn't full borg config :: additional_free_space 2G # Fix too large Borg cache # https://borgbackup.readthedocs.io/en/stable/faq.html#the-borg-cache-eats-way-too-much-disk-space-what-can-i-do BORG_ID="$(borg config :: id)" rm -r "/root/.cache/borg/$BORG_ID/chunks.archive.d" touch "/root/.cache/borg/$BORG_ID/chunks.archive.d" fi if ! borg info > /dev/null; then echo "Borg can't get info from the repo it created. Something is wrong." exit 1 fi rm -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" if [ -n "$BORG_REMOTE_REPO" ]; then # `borg config` does not support remote repos so instead create a dummy file and rely on the remote to avoid # corruption of the config file (which contains the encryption key). We don't actually use the contents of # this file anywhere, so a touch is all we need so we remember we already initialized the repo. touch "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" else # Make a backup from the borg config file if ! cp "$BORG_BACKUP_DIRECTORY/config" "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config"; then echo "Could not copy config file to second place. Cannot perform backup." exit 1 fi fi echo "Repository successfully initialized." fi # Perform backup echo "Performing backup..." # Borg options # auto,zstd compression seems to has the best ratio based on: # https://forum.level1techs.com/t/optimal-compression-for-borg-backups/145870/6 BORG_OPTS=(-v --stats --compression "auto,zstd") if [ "$NEW_REPOSITORY" = 1 ]; then BORG_OPTS+=(--progress) fi # Exclude the nextcloud log and audit log for GDPR reasons BORG_EXCLUDE=(--exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log*" --exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log" --exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/lost+found") BORG_INCLUDE=() # Exclude datadir if .noaiobackup file was found # shellcheck disable=SC2144 if [ -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.noaiobackup" ]; then BORG_EXCLUDE+=(--exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/") BORG_INCLUDE+=(--pattern="+/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.noaiobackup") echo "⚠️⚠️⚠️ '.noaiobackup' file was found in Nextcloud's data directory. Excluding the data directory from backup!" # Exclude preview folder if .noaiobackup file was found elif [ -f /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/.noaiobackup ]; then BORG_EXCLUDE+=(--exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/") BORG_INCLUDE+=(--pattern="+/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/.noaiobackup") echo "⚠️⚠️⚠️ '.noaiobackup' file was found in the preview directory. Excluding the preview directory from backup!" fi # Make sure that there is always a borg.config file before creating a new backup if ! [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" ]; then echo "Did not find borg.config file in the mastercontainer volume." echo "Cannot create a backup as this is wrong." exit 1 fi # Create the backup echo "Starting the backup..." get_start_time if ! borg create "${BORG_OPTS[@]}" "${BORG_INCLUDE[@]}" "${BORG_EXCLUDE[@]}" "::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/" --exclude-from /borg_excludes; then echo "Deleting the failed backup archive..." borg delete --stats "::$CURRENT_DATE-nextcloud-aio" echo "Backup failed!" echo "You might want to check the backup integrity via the AIO interface." if [ "$NEW_REPOSITORY" = 1 ]; then echo "Deleting borg.config file so that you can choose a different location for the backup." rm "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" fi exit 1 fi # Remove the update skip file because the backup was successful rm -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update" # Prune options read -ra BORG_PRUNE_OPTS <<< "$BORG_RETENTION_POLICY" echo "BORG_PRUNE_OPTS are ${BORG_PRUNE_OPTS[*]}" # Prune archives echo "Pruning the archives..." if ! borg prune --stats --glob-archives '*_*-nextcloud-aio' "${BORG_PRUNE_OPTS[@]}"; then echo "Failed to prune archives!" exit 1 fi # Compact archives echo "Compacting the archives..." if ! borg compact; then echo "Failed to compact archives!" exit 1 fi # Back up additional directories of the host if [ "$ADDITIONAL_DIRECTORIES_BACKUP" = 'yes' ]; then if [ -d "/docker_volumes/" ]; then DOCKER_VOLUME_DIRS="$(find /docker_volumes -mindepth 1 -maxdepth 1 -type d)" mapfile -t DOCKER_VOLUME_DIRS <<< "$DOCKER_VOLUME_DIRS" for directory in "${DOCKER_VOLUME_DIRS[@]}"; do if [ -z "$(ls -A "$directory")" ]; then echo "$directory is empty which is not allowed." exit 1 fi done echo "Starting the backup for additional volumes..." if ! borg create "${BORG_OPTS[@]}" "::$CURRENT_DATE-additional-docker-volumes" "/docker_volumes/"; then echo "Deleting the failed backup archive..." borg delete --stats "::$CURRENT_DATE-additional-docker-volumes" echo "Backup of additional docker-volumes failed!" exit 1 fi echo "Pruning additional volumes..." if ! borg prune --stats --glob-archives '*_*-additional-docker-volumes' "${BORG_PRUNE_OPTS[@]}"; then echo "Failed to prune additional docker-volumes archives!" exit 1 fi echo "Compacting additional volumes..." if ! borg compact; then echo "Failed to compact additional docker-volume archives!" exit 1 fi fi if [ -d "/host_mounts/" ]; then EXCLUDED_DIRECTORIES=(home/*/.cache root/.cache var/cache lost+found run var/run dev tmp sys proc) # Exclude borg backup cache EXCLUDED_DIRECTORIES+=(var/lib/docker/volumes/nextcloud_aio_backup_cache/_data) # Exclude target directory if [ -n "$BORGBACKUP_HOST_LOCATION" ] && [ "$BORGBACKUP_HOST_LOCATION" != "nextcloud_aio_backupdir" ]; then EXCLUDED_DIRECTORIES+=("$BORGBACKUP_HOST_LOCATION") fi for directory in "${EXCLUDED_DIRECTORIES[@]}" do EXCLUDE_DIRS+=(--exclude "/host_mounts/$directory/") done echo "Starting the backup for additional host mounts..." if ! borg create "${BORG_OPTS[@]}" "${EXCLUDE_DIRS[@]}" "::$CURRENT_DATE-additional-host-mounts" "/host_mounts/"; then echo "Deleting the failed backup archive..." borg delete --stats "::$CURRENT_DATE-additional-host-mounts" echo "Backup of additional host-mounts failed!" exit 1 fi echo "Pruning additional host mounts..." if ! borg prune --stats --glob-archives '*_*-additional-host-mounts' "${BORG_PRUNE_OPTS[@]}"; then echo "Failed to prune additional host-mount archives!" exit 1 fi echo "Compacting additional host mounts..." if ! borg compact; then echo "Failed to compact additional host-mount archives!" exit 1 fi fi fi # Inform user get_expiration_time echo "Backup finished successfully on $END_DATE_READABLE ($DURATION_READABLE)." if [ -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/update.failed" ]; then echo "However a Nextcloud update failed. So reporting that the backup failed which will skip any update attempt the next time." echo "Please restore a backup from before the failed Nextcloud update attempt." exit 1 fi exit 0 fi # Do the restore if [ "$BORG_MODE" = restore ]; then get_start_time # Pick archive to restore if [ -n "$SELECTED_RESTORE_TIME" ]; then SELECTED_ARCHIVE="$(borg list | grep "nextcloud-aio" | grep "$SELECTED_RESTORE_TIME" | awk -F " " '{print $1}' | head -1)" else SELECTED_ARCHIVE="$(borg list | grep "nextcloud-aio" | awk -F " " '{print $1}' | sort -r | head -1)" fi echo "Restoring '$SELECTED_ARCHIVE'..." ADDITIONAL_RSYNC_EXCLUDES=() ADDITIONAL_BORG_EXCLUDES=() ADDITIONAL_FIND_EXCLUDES=() # Exclude datadir if .noaiobackup file was found # shellcheck disable=SC2144 if [ -f "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.noaiobackup" ]; then # Keep these 3 in sync. Beware, the pattern syntax and the paths differ ADDITIONAL_RSYNC_EXCLUDES=(--exclude "nextcloud_aio_nextcloud_data/**") ADDITIONAL_BORG_EXCLUDES=(--exclude "sh:nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/**") ADDITIONAL_FIND_EXCLUDES=(-o -regex 'nextcloud_aio_volumes/nextcloud_aio_nextcloud_data\(/.*\)?') echo "⚠️⚠️⚠️ '.noaiobackup' file was found in Nextcloud's data directory. Excluding the data directory from restore!" echo "You might run into problems due to this afterwards as potentially this makes the directory go out of sync with the database." echo "You might be able to fix this by running 'occ files:scan --all' and 'occ maintenance:repair' and 'occ files:scan-app-data' after the restore." echo "See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands" # Exclude previews from restore if selected to speed up process or exclude preview folder if .noaiobackup file was found elif [ -n "$RESTORE_EXCLUDE_PREVIEWS" ] || [ -f /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/.noaiobackup ]; then # Keep these 3 in sync. Beware, the pattern syntax and the paths differ ADDITIONAL_RSYNC_EXCLUDES=(--exclude "nextcloud_aio_nextcloud_data/appdata_*/preview/**") ADDITIONAL_BORG_EXCLUDES=(--exclude "sh:nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/**") ADDITIONAL_FIND_EXCLUDES=(-o -regex 'nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_[^/]*/preview\(/.*\)?') echo "⚠️⚠️⚠️ Excluding previews from restore!" echo "You might run into problems due to this afterwards as potentially this makes the directory go out of sync with the database." echo "You might be able to fix this by running 'occ files:scan-app-data preview' after the restore." echo "See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands" fi # Save Additional Backup dirs if [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories" ]; then ADDITIONAL_BACKUP_DIRECTORIES="$(cat /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories)" fi # Save daily backup time if [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time" ]; then DAILY_BACKUPTIME="$(cat /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time)" fi # Save current aio password AIO_PASSWORD="$(jq '.password' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" # Save current backup location vars BORG_LOCATION="$(jq '.borg_backup_host_location' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" REMOTE_REPO="$(jq '.borg_remote_repo' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" # Save current nextcloud datadir if grep -q '"nextcloud_datadir":' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json; then NEXTCLOUD_DATADIR="$(jq '.nextcloud_datadir' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" else NEXTCLOUD_DATADIR='""' fi if [ -z "$BORG_REMOTE_REPO" ]; then mkdir -p /tmp/borg if ! borg mount "::$SELECTED_ARCHIVE" /tmp/borg; then echo "Could not mount the backup!" exit 1 fi # Restore everything except the configuration file # # These exclude patterns need to be kept in sync with the borg_excludes file and the find excludes in this file, # which use a different syntax (patterns appear in 3 places in total) if ! rsync --stats --archive --human-readable -vv --delete \ --exclude "nextcloud_aio_apache/caddy/**" \ --exclude "nextcloud_aio_mastercontainer/caddy/**" \ --exclude "nextcloud_aio_nextcloud/data/nextcloud.log*" \ --exclude "nextcloud_aio_nextcloud/data/audit.log" \ --exclude "nextcloud_aio_mastercontainer/certs/**" \ --exclude "nextcloud_aio_mastercontainer/data/configuration.json" \ --exclude "nextcloud_aio_mastercontainer/data/daily_backup_running" \ --exclude "nextcloud_aio_mastercontainer/data/session_date_file" \ --exclude "nextcloud_aio_mastercontainer/session/**" \ --exclude "nextcloud_aio_nextcloud_data/lost+found" \ "${ADDITIONAL_RSYNC_EXCLUDES[@]}" \ /tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes/; then RESTORE_FAILED=1 echo "Something failed while restoring from backup." fi # Restore the configuration file if ! rsync --archive --human-readable -vv \ /tmp/borg/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json \ /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json; then RESTORE_FAILED=1 echo "Something failed while restoring the configuration.json." fi if ! umount /tmp/borg; then echo "Failed to unmount the borg archive but should still be able to restore successfully" fi else # Restore nearly everything # # borg mount is really slow for remote repos (did not check whether it's slow for local repos too), # using extract to /tmp would require temporarily storing a second copy of the data. # So instead extract directly on top of the destination with exclude patterns for the config, but # then we do still need to delete local files which are not present in the archive. # # Older backups may still contain files we've since excluded, so we have to exclude on extract as well. cd / # borg extract has no destination arg and extracts to CWD if ! borg extract "::$SELECTED_ARCHIVE" --progress --exclude-from /borg_excludes "${ADDITIONAL_BORG_EXCLUDES[@]}" --pattern '+nextcloud_aio_volumes/**' then RESTORE_FAILED=1 echo "Failed to extract backup archive." else # Delete files/dirs present locally, but not in the backup archive, excluding conf files # https://unix.stackexchange.com/a/759341 # This comm does not support -z, but I doubt any file names would have \n in them # # These find patterns need to be kept in sync with the borg_excludes file and the rsync excludes in this # file, which use a different syntax (patterns appear in 3 places in total) echo "Deleting local files which do not exist in the backup" if ! find nextcloud_aio_volumes \ -not \( \ -path nextcloud_aio_volumes/nextcloud_aio_apache/caddy \ -o -path "nextcloud_aio_volumes/nextcloud_aio_apache/caddy/*" \ -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy \ -o -path "nextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy/*" \ -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/certs \ -o -path "nextcloud_aio_volumes/nextcloud_aio_mastercontainer/certs/*" \ -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/session \ -o -path "nextcloud_aio_volumes/nextcloud_aio_mastercontainer/session/*" \ -o -path "nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log*" \ -o -path nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log \ -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_running \ -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/session_date_file \ -o -path "nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/id_borg*" \ -o -path "nextcloud_aio_nextcloud_data/lost+found" \ "${ADDITIONAL_FIND_EXCLUDES[@]}" \ \) \ | LC_ALL=C sort \ | LC_ALL=C comm -23 - \ <(borg list "::$SELECTED_ARCHIVE" --short --exclude-from /borg_excludes --pattern '+nextcloud_aio_volumes/**' | LC_ALL=C sort) \ > /tmp/local_files_not_in_backup then RESTORE_FAILED=1 echo "Failed to delete local files not in backup archive." else # More robust than e.g. xargs as I got a ~"args line too long" error while testing that, but it's slower # https://stackoverflow.com/a/21848934 while IFS= read -r file do rm -vrf -- "$file" || DELETE_FAILED=1 done < /tmp/local_files_not_in_backup if [ "$DELETE_FAILED" = 1 ]; then RESTORE_FAILED=1 echo "Failed to delete (some) local files not in backup archive." fi fi fi fi # Set backup-mode to restore since it was a restore CONTENTS="$(jq '."backup-mode" = "restore"' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" echo -E "${CONTENTS}" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json # Reset the backup location vars to the currently used one CONTENTS="$(jq ".borg_backup_host_location = $BORG_LOCATION" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" echo -E "${CONTENTS}" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json CONTENTS="$(jq ".borg_remote_repo = $REMOTE_REPO" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" echo -E "${CONTENTS}" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json # Reset the AIO password to the currently used one CONTENTS="$(jq ".password = $AIO_PASSWORD" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" echo -E "${CONTENTS}" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json # Reset the datadir to the one that was used for the restore CONTENTS="$(jq ".nextcloud_datadir = $NEXTCLOUD_DATADIR" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)" echo -E "${CONTENTS}" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json # Reset the additional backup directories if [ -n "$ADDITIONAL_BACKUP_DIRECTORIES" ]; then echo "$ADDITIONAL_BACKUP_DIRECTORIES" > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories" chown 33:0 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories" chmod 770 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories" fi # Reset the additional backup directories if [ -n "$DAILY_BACKUPTIME" ]; then echo "$DAILY_BACKUPTIME" > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time" chown 33:0 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time" chmod 770 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time" fi if [ "$RESTORE_FAILED" = 1 ]; then exit 1 elif ! grep -q '"domain"' "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json" \ || ! grep -q '"wasStartButtonClicked"' "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json"; then echo "It seems like the restore of the configuration.json was not done correctly. Something is wrong! (Most likely is the restore archive already incorrect)!" exit 1 fi # Inform user get_expiration_time echo "Restore finished successfully on $END_DATE_READABLE ($DURATION_READABLE)." # Add file to Nextcloud container so that it skips any update the next time touch "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update" chmod 777 "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update" # Add file to Nextcloud container so that it performs a fingerprint update the next time touch "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/fingerprint.update" chmod 777 "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/fingerprint.update" # Add file to Netcloud container to trigger a preview scan the next time it starts if [ -n "$RESTORE_EXCLUDE_PREVIEWS" ]; then touch "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/trigger-preview.scan" chmod 777 "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/trigger-preview.scan" fi # Delete redis cache rm -f "/mnt/redis/dump.rdb" fi # Do the Backup check if [ "$BORG_MODE" = check ]; then get_start_time echo "Checking the backup integrity..." # Perform the check if ! borg check -v --verify-data; then echo "Some errors were found while checking the backup integrity!" echo "Check the AIO interface for advice on how to proceed now!" exit 1 fi # Inform user get_expiration_time echo "Check finished successfully on $END_DATE_READABLE ($DURATION_READABLE)." exit 0 fi # Do the Backup check-repair if [ "$BORG_MODE" = "check-repair" ]; then get_start_time echo "Checking the backup integrity and repairing it..." # Perform the check-repair if ! echo YES | borg check -v --repair; then echo "Some errors were found while checking and repairing the backup integrity!" exit 1 fi # Inform user get_expiration_time echo "Check finished successfully on $END_DATE_READABLE ($DURATION_READABLE)." exit 0 fi # Do the backup test if [ "$BORG_MODE" = test ]; then if [ -n "$BORG_REMOTE_REPO" ]; then if ! borg info > /dev/null; then echo "Borg could not get info from the remote repo." echo "See the above borg info output for details." exit 1 fi else if ! [ -d "$BORG_BACKUP_DIRECTORY" ]; then echo "No 'borg' directory in the given backup directory found!" echo "Only the files/folders below have been found in the given directory." ls -a "$MOUNT_DIR" echo "Please adjust the directory so that the borg archive is positioned in a folder named 'borg' inside the given directory!" exit 1 elif ! [ -f "$BORG_BACKUP_DIRECTORY/config" ]; then echo "A 'borg' directory was found but could not find the borg archive." echo "Only the files/folders below have been found in the borg directory." ls -a "$BORG_BACKUP_DIRECTORY" echo "The archive and most importantly the config file must be positioned directly in the 'borg' subfolder." exit 1 fi fi if ! borg list >/dev/null; then echo "The entered path seems to be valid but could not open the backup archive." echo "Most likely the entered password was wrong so please adjust it accordingly!" exit 1 else if ! borg list | grep "nextcloud-aio"; then echo "The backup archive does not contain a valid Nextcloud AIO backup." echo "Most likely was the archive not created via Nextcloud AIO." exit 1 else echo "Everything looks fine so feel free to continue!" exit 0 fi fi fi if [ "$BORG_MODE" = list ]; then echo "Updating backup list..." if ! borg info > /dev/null; then echo "Could not update the backup list." exit 1 fi # The update gets done automatically in the wrapper start.sh script. fi ================================================ FILE: Containers/borgbackup/borg_excludes ================================================ # These patterns need to be kept in sync with rsync and find excludes in backupscript.sh, # which use a different syntax (patterns appear in 3 places in total) nextcloud_aio_volumes/nextcloud_aio_apache/caddy/ nextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy/ nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log* nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log nextcloud_aio_volumes/nextcloud_aio_mastercontainer/certs/ nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_running nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/session_date_file nextcloud_aio_volumes/nextcloud_aio_mastercontainer/session/ nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/id_borg* ================================================ FILE: Containers/borgbackup/start.sh ================================================ #!/bin/bash # Variables export MOUNT_DIR="/mnt/borgbackup" export BORG_BACKUP_DIRECTORY="$MOUNT_DIR/borg" # necessary even when remote to store the aio-lockfile # Validate BORG_PASSWORD if [ -z "$BORG_PASSWORD" ] && [ -z "$BACKUP_RESTORE_PASSWORD" ]; then echo "Neither BORG_PASSWORD nor BACKUP_RESTORE_PASSWORD are set." exit 1 fi # Export defaults if [ -n "$BACKUP_RESTORE_PASSWORD" ]; then export BORG_PASSPHRASE="$BACKUP_RESTORE_PASSWORD" else export BORG_PASSPHRASE="$BORG_PASSWORD" fi export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes if [ -n "$BORG_REMOTE_REPO" ]; then export BORG_REPO="$BORG_REMOTE_REPO" # Location to create the borg ssh pub/priv key export BORGBACKUP_KEY="/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/id_borg" # Accept any host key the first time connecting to the remote. Strictly speaking should be provided by user but you'd # have to be very unlucky to get MitM'ed on your first connection. export BORG_RSH="ssh -o StrictHostKeyChecking=accept-new -i $BORGBACKUP_KEY" else export BORG_REPO="$BORG_BACKUP_DIRECTORY" fi # Validate BORG_MODE if [ "$BORG_MODE" != backup ] && [ "$BORG_MODE" != restore ] && [ "$BORG_MODE" != check ] && [ "$BORG_MODE" != "check-repair" ] && [ "$BORG_MODE" != "test" ] && [ "$BORG_MODE" != "list" ]; then echo "No correct BORG_MODE mode applied. Valid are 'backup', 'check', 'restore', 'test' and 'list'." exit 1 fi export BORG_MODE # Run the backup script if ! bash /backupscript.sh; then FAILED=1 fi # Remove lockfile rm -f "/nextcloud_aio_volumes/nextcloud_aio_database_dump/backup-is-running" # Get a list of all available borg archives if borg list &>/dev/null; then borg list | grep "nextcloud-aio" | awk -F " " '{print $1","$3,$4}' > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list" else echo "" > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list" fi chmod +r "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list" if [ -n "$FAILED" ]; then if [ "$BORG_MODE" = backup ]; then # Add file to Nextcloud container so that it skips any update the next time touch "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update" chmod 777 "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update" fi exit 1 fi exec "$@" ================================================ FILE: Containers/clamav/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM alpine:3.23.3 RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache tzdata clamav clamav-milter supervisor bash; \ mkdir -p /tmp /var/lib/clamav /run/clamav /var/log/supervisord /var/run/supervisord; \ chmod 777 -R /tmp /run/clamav /var/log/clamav /var/log/supervisord /var/run/supervisord; \ chown -R 100:100 /var/lib/clamav; \ sed -i "s|#\?MaxDirectoryRecursion.*|MaxDirectoryRecursion 30|g" /etc/clamav/clamd.conf; \ sed -i "s|#\?MaxScanSize.*|MaxScanSize 2000M|g" /etc/clamav/clamd.conf; \ sed -i "s|#\?MaxFileSize.*|MaxFileSize 2000M|g" /etc/clamav/clamd.conf; \ sed -i "s|#\?PCREMaxFileSize.*|PCREMaxFileSize 2000M|g" /etc/clamav/clamd.conf; \ # StreamMaxLength must be synced with av_stream_max_length inside the Nextcloud files_antivirus plugin sed -i "s|#\?StreamMaxLength.*|StreamMaxLength 2000M|g" /etc/clamav/clamd.conf; \ sed -i "s|#\?TCPSocket|TCPSocket|g" /etc/clamav/clamd.conf; \ sed -i "s|^LocalSocket .*|LocalSocket /tmp/clamd.sock|g" /etc/clamav/clamd.conf; \ sed -i "s|Example| |g" /etc/clamav/clamav-milter.conf; \ sed -i "s|#\?MilterSocket inet:7357|MilterSocket inet:7357|g" /etc/clamav/clamav-milter.conf; \ sed -i "s|#\?ClamdSocket unix:/run/clamav/clamd.sock|ClamdSocket unix:/tmp/clamd.sock|g" /etc/clamav/clamav-milter.conf; \ sed -i "s|#\?OnInfected Quarantine|OnInfected Reject|g" /etc/clamav/clamav-milter.conf; \ sed -i "s|#\?AddHeader Replace|AddHeader Add|g" /etc/clamav/clamav-milter.conf; \ sed -i "s|#\?Foreground yes|Foreground yes|g" /etc/clamav/clamav-milter.conf COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh COPY --chmod=664 supervisord.conf /supervisord.conf USER 100 RUN set -ex; \ freshclam --foreground --stdout VOLUME /var/lib/clamav ENTRYPOINT ["/start.sh"] CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" HEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh ================================================ FILE: Containers/clamav/healthcheck.sh ================================================ #!/bin/bash if [ "$(echo "PING" | nc 127.0.0.1 3310)" != "PONG" ]; then echo "ERROR: Unable to contact server" exit 1 fi echo "Clamd is up" exit 0 ================================================ FILE: Containers/clamav/start.sh ================================================ #!/bin/bash # Print out clamav version for compliance reasons clamscan --version echo "Clamav started" exec "$@" ================================================ FILE: Containers/clamav/supervisord.conf ================================================ [supervisord] nodaemon=true nodaemon=true logfile=/var/log/supervisord/supervisord.log pidfile=/var/run/supervisord/supervisord.pid childlogdir=/var/log/supervisord/ logfile_maxbytes=50MB logfile_backups=10 loglevel=error [program:freshclam] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=freshclam --foreground --stdout --daemon --daemon-notify=/etc/clamav/clamd.conf [program:clamd] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=clamd --foreground --config-file=/etc/clamav/clamd.conf [program:milter] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=clamav-milter --config-file=/etc/clamav/clamav-milter.conf ================================================ FILE: Containers/collabora/Dockerfile ================================================ # syntax=docker/dockerfile:latest # From a file located probably somewhere here: https://github.com/CollaboraOnline/online/blob/master/docker/from-packages/Dockerfile FROM collabora/code:25.04.9.3.1 USER root ARG DEBIAN_FRONTEND=noninteractive COPY --chmod=775 healthcheck.sh /healthcheck.sh USER 1001 HEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/collabora/healthcheck.sh ================================================ #!/bin/bash # Unfortunately, no curl and no nc is installed in the container # and packages can also not be added as the package list is broken. # So always exiting 0 for now. # nc http://127.0.0.1:9980 || exit 1 exit 0 ================================================ FILE: Containers/collabora-online/Dockerfile ================================================ # syntax=docker/dockerfile:latest # From https://gitlab.collabora.com/collabora-online/docker # hadolint ignore=DL3007 FROM registry.gitlab.collabora.com/collabora-online/docker:latest USER root ARG DEBIAN_FRONTEND=noninteractive COPY --chmod=775 healthcheck.sh /healthcheck.sh USER 1001 HEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/collabora-online/healthcheck.sh ================================================ #!/bin/bash # Unfortunately, no curl and no nc is installed in the container # and packages can also not be added as the package list is broken. # So always exiting 0 for now. # nc http://127.0.0.1:9980 || exit 1 exit 0 ================================================ FILE: Containers/docker-socket-proxy/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM haproxy:3.3.6-alpine # hadolint ignore=DL3002 USER root ENV NEXTCLOUD_HOST=nextcloud-aio-nextcloud RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ ca-certificates \ tzdata \ bash \ bind-tools; \ chmod -R 777 /tmp COPY --chmod=775 *.sh / COPY --chmod=664 haproxy.cfg /haproxy.cfg ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/docker-socket-proxy/haproxy.cfg ================================================ # Inspiration: https://github.com/Tecnativa/docker-socket-proxy/blob/master/haproxy.cfg global maxconn 10 defaults timeout connect 30s timeout client 30s timeout server 1800s frontend http mode http bind :::2375 v4v6 http-request deny unless { src 127.0.0.1 } || { src ::1 } || { src NC_IPV4_PLACEHOLDER } || { src NC_IPV6_PLACEHOLDER } # docker system _ping http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/_ping$ } METH_GET # docker inspect image: GET images/%s/json http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/images/.*/json } METH_GET # container inspect: GET containers/%s/json http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/json } METH_GET # container inspect: GET containers/%s/logs http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/logs } METH_GET # container start/stop: POST containers/%s/start containers/%s/stop http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/((start)|(stop)) } METH_POST # container rm: DELETE containers/%s http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+ } METH_DELETE # container update/exec: POST containers/%s/update containers/%s/exec http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/((update)|(exec)) } METH_POST # container put: PUT containers/%s/archive http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/archive } METH_PUT # run exec instance: POST exec/%s http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/exec/[a-zA-Z0-9_.-]+/start } METH_POST # container create: POST containers/create?name=%s # ACL to restrict container name to nc_app_[a-zA-Z0-9_.-]+ acl nc_app_container_name url_param(name) -m reg -i "^nc_app_[a-zA-Z0-9_.-]+" # ACL to restrict the number of Mounts to 1 acl one_mount_volume req.body -m reg -i "\"Mounts\"\s*:\s*\[\s*(?:(?!\"Mounts\"\s*:\s*\[)[^}]*)}[^}]*\]" # ACL to deny if there are any binds acl binds_present req.body -m reg -i "\"HostConfig\"\s*:.*\"Binds\"\s*:" # ACL to restrict the type of Mounts to volume acl type_not_volume req.body -m reg -i "\"Mounts\"\s*:\s*\[[^\]]*(\"Type\"\s*:\s*\"(?!volume\b)\w+\"[^\]]*)+\]" http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/create } nc_app_container_name !one_mount_volume binds_present type_not_volume METH_POST # ACL to restrict container creation, that it has HostConfig.Privileged(by searching for "Privileged" word in all payload) acl no_privileged_flag req.body -m reg -i "\"Privileged\"" # ACL to allow mount volume with strict pattern for name: nc_app_[a-zA-Z0-9_.-]+_data acl nc_app_volume_data_only req.body -m reg -i "\"Mounts\"\s*:\s*\[\s*{[^}]*\"Source\"\s*:\s*\"nc_app_[a-zA-Z0-9_.-]+_data\"" http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/create } nc_app_container_name !no_privileged_flag nc_app_volume_data_only METH_POST # end of container create # volume create: POST volumes/create # restrict name acl nc_app_volume_data req.body -m reg -i "\"Name\"\s*:\s*\"nc_app_[a-zA-Z0-9_.-]+_data\"" # do not allow to use "device" word e.g., "--opt device=:/path/to/dir" acl volume_no_device req.body -m reg -i "\"device\"" http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes/create } nc_app_volume_data !volume_no_device METH_POST # volume rm: DELETE volumes/%s http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes/nc_app_[a-zA-Z0-9_.-]+_data } METH_DELETE # image pull: POST images/create?fromImage=%s http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/images/create } METH_POST http-request deny default_backend dockerbackend backend dockerbackend mode http server dockersocket /var/run/docker.sock ================================================ FILE: Containers/docker-socket-proxy/healthcheck.sh ================================================ #!/bin/bash nc -z "$NEXTCLOUD_HOST" 9001 || exit 0 nc -z 127.0.0.1 2375 || exit 1 ================================================ FILE: Containers/docker-socket-proxy/start.sh ================================================ #!/bin/sh # Only start container if nextcloud is accessible while ! nc -z "$NEXTCLOUD_HOST" 9001; do echo "Waiting for Nextcloud to start..." sleep 5 done set -x IPv4_ADDRESS_NC="$(dig nextcloud-aio-nextcloud IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" HAPROXYFILE="$(sed "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|" /haproxy.cfg)" echo "$HAPROXYFILE" > /tmp/haproxy.cfg IPv6_ADDRESS_NC="$(dig nextcloud-aio-nextcloud AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" if [ -n "$IPv6_ADDRESS_NC" ]; then HAPROXYFILE="$(sed "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|" /tmp/haproxy.cfg)" else HAPROXYFILE="$(sed "s# || { src NC_IPV6_PLACEHOLDER }##g" /tmp/haproxy.cfg)" fi echo "$HAPROXYFILE" > /tmp/haproxy.cfg set +x haproxy -f /tmp/haproxy.cfg -db ================================================ FILE: Containers/domaincheck/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM alpine:3.23.3 RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache bash lighttpd netcat-openbsd; \ adduser -S www-data -G www-data; \ rm -rf /etc/lighttpd/lighttpd.conf; \ chmod 777 -R /etc/lighttpd; \ mkdir -p /var/www/domaincheck; \ chown www-data:www-data -R /var/www; \ chmod 777 -R /var/www/domaincheck COPY --chown=www-data:www-data lighttpd.conf /lighttpd.conf COPY --chmod=775 start.sh /start.sh USER www-data ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD nc -z 127.0.0.1 $APACHE_PORT || exit 1 LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/domaincheck/lighttpd.conf ================================================ server.document-root = "/var/www/domaincheck/" server.port = env.APACHE_PORT server.username = "www-data" server.groupname = "www-data" mimetype.assign = ( ".html" => "text/html", ".txt" => "text/plain", ".jpg" => "image/jpeg", ".png" => "image/png" ) static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" ) index-file.names = ( "index.html" ) $SERVER["socket"] == "ipv6-placeholder" { server.document-root = "/var/www/domaincheck/" } ================================================ FILE: Containers/domaincheck/start.sh ================================================ #!/bin/bash if [ -z "$INSTANCE_ID" ]; then echo "You need to provide an instance id." exit 1 fi echo "$INSTANCE_ID" > /var/www/domaincheck/index.html if [ -z "$APACHE_PORT" ]; then export APACHE_PORT="443" fi CONF_FILE="$(sed "s|ipv6-placeholder|\[::\]:$APACHE_PORT|" /lighttpd.conf)" echo "$CONF_FILE" > /etc/lighttpd/lighttpd.conf # Check config file lighttpd -tt -f /etc/lighttpd/lighttpd.conf # Run server lighttpd -D -f /etc/lighttpd/lighttpd.conf exec "$@" ================================================ FILE: Containers/fulltextsearch/Dockerfile ================================================ # syntax=docker/dockerfile:latest # Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile FROM elasticsearch:8.19.13 USER root ARG DEBIAN_FRONTEND=noninteractive # hadolint ignore=DL3008 RUN set -ex; \ \ apt-get update; \ apt-get upgrade -y; \ apt-get install -y --no-install-recommends \ tzdata \ ; \ rm -rf /var/lib/apt/lists/*; COPY --chmod=775 healthcheck.sh /healthcheck.sh USER 1000:0 HEALTHCHECK --interval=10s --timeout=5s --start-period=1m --retries=5 CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ENV ES_JAVA_OPTS="-Xms512M -Xmx512M" ================================================ FILE: Containers/fulltextsearch/healthcheck.sh ================================================ #!/bin/bash nc -z 127.0.0.1 9200 || exit 1 ================================================ FILE: Containers/imaginary/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM golang:1.26.1-alpine3.23 AS go ENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ vips-dev \ vips-magick \ vips-heif \ vips-jxl \ vips-poppler \ build-base; \ go install github.com/h2non/imaginary@"$IMAGINARY_HASH"; FROM alpine:3.23.3 RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ tzdata \ ca-certificates \ netcat-openbsd \ vips \ vips-magick \ vips-heif \ vips-jxl \ vips-poppler \ ttf-dejavu \ bash COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh ENV PORT=9000 USER 65534 # https://github.com/h2non/imaginary#memory-issues ENV MALLOC_ARENA_MAX=2 ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/imaginary/healthcheck.sh ================================================ #!/bin/bash nc -z 127.0.0.1 "$PORT" || exit 1 ================================================ FILE: Containers/imaginary/start.sh ================================================ #!/bin/bash echo "Imaginary has started" if [ -z "$IMAGINARY_SECRET" ]; then imaginary -return-size -max-allowed-resolution 222.2 "$@" else imaginary -return-size -max-allowed-resolution 222.2 -key "$IMAGINARY_SECRET" "$@" fi ================================================ FILE: Containers/mastercontainer/Dockerfile ================================================ # syntax=docker/dockerfile:latest # Docker CLI is a requirement FROM docker:29.3.0-cli AS docker ARG CADDY_REMOTE_HOST_HASH=b21775afa730ffb52a24ddff310c8a6d1fd37276 # Caddy is a requirement FROM caddy:2.11.2-builder-alpine AS caddy RUN set -ex; \ xcaddy build --with github.com/muety/caddy-remote-host@"$CADDY_REMOTE_HOST_HASH"; \ /usr/bin/caddy list-modules # From https://github.com/docker-library/php/blob/master/8.5/alpine3.23/fpm/Dockerfile FROM php:8.5.4-fpm-alpine3.23 EXPOSE 80 EXPOSE 8080 EXPOSE 8443 # Overwrite home variable for subservices ENV HOME=/var/www COPY --from=caddy /usr/bin/caddy /usr/bin/caddy COPY --from=docker /usr/local/bin/docker /usr/local/bin/docker COPY community-containers /var/www/docker-aio/community-containers COPY php /var/www/docker-aio/php COPY --chmod=775 Containers/mastercontainer/*.sh / COPY --chmod=664 Containers/mastercontainer/*.Caddyfile / COPY --chmod=664 Containers/mastercontainer/supervisord.conf /supervisord.conf WORKDIR /var/www/docker-aio # hadolint ignore=SC2086,DL3047,DL3003,DL3004 RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache shadow; \ groupmod -g 33 www-data; \ usermod -u 33 -g 33 www-data; \ \ apk add --no-cache \ util-linux-misc \ ca-certificates \ bash \ supervisor \ sudo \ netcat-openbsd \ curl \ grep; \ \ apk add --no-cache --virtual .build-deps \ autoconf \ build-base; \ pecl install APCu-5.1.28; \ docker-php-ext-enable apcu; \ rm -r /tmp/pear; \ runDeps="$( \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ | tr ',' '\n' \ | sort -u \ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )"; \ apk add --no-cache --virtual .nextcloud-aio-rundeps $runDeps; \ apk del .build-deps; \ grep -q '^pm = dynamic' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm = dynamic/pm = ondemand/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm.max_children =.*/pm.max_children = 80/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf; \ grep -q '^listen =' /usr/local/etc/php-fpm.d/docker.conf; \ sed -i 's|listen =.*|listen = /run/php.sock|' /usr/local/etc/php-fpm.d/docker.conf; \ echo "listen.owner = www-data" | tee -a /usr/local/etc/php-fpm.d/docker.conf; \ \ apk add --no-cache git; \ curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer; \ chmod +x /usr/local/bin/composer; \ cd /var/www/docker-aio; \ rm -r ./php/tests; \ chown www-data:www-data -R /var/www/docker-aio; \ cd php; \ sudo -E -u www-data composer install --no-dev; \ sudo -E -u www-data composer clear-cache; \ cd ..; \ rm -f /usr/local/bin/composer; \ chmod -R 770 /var/www/docker-aio; \ chown -R www-data:www-data /var/www; \ rm -r php/data; \ rm -r php/session; \ \ mkdir /var/log/supervisord; \ mkdir /var/run/supervisord; # hadolint ignore=DL3048 LABEL org.label-schema.vendor="Nextcloud" \ wud.watch="false" \ com.docker.compose.project="nextcloud-aio" # hadolint ignore=DL3002 USER root ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD /healthcheck.sh ================================================ FILE: Containers/mastercontainer/README.md ================================================ # Nextcloud All-in-One `mastercontainer` This folder contains the OCI/Docker container definition, along with associated resources and configuration files, for building the `mastercontainer` as part of the Nextcloud All-in-One project. This container hosts [the Nextcloud AIO interface]( https://github.com/nextcloud/all-in-one/tree/main/php)[^app], and a dedicated PHP environment for it (which is completely independent of the Nextcloud Server). ## Overview The mastercontainer acts as the central orchestration service for the deployment and management of all other containers in the Nextcloud All-in-One stack. It hosts: - A dedicated PHP SAPI/backend (php-fpm) for AIO itself (not Nextcloud Server) - A Caddy server enabling self-signed HTTPS access to the AIO frontend on port 8080/tcp. - A Caddy server enabling trusted HTTPS access to the AIO frontend on port 8443/tcp. - Caddy will automatically issue a Let's Encrypt issued certificate if port 80 and 8443 is open/forwarded and a domain pointer is in place; then, simply open the Nextcloud AIO interface using the domain (`https://your-domain-that-points-to-this-server.tld:8443`). The Let's Encrypt certificate request will use an [ACME HTTP-01](https://letsencrypt.org/docs/challenge-types/#http-01-challenge) challenge. - Miscellaneous support services specific to AIO (backup management, health checks, etc.) ## Key Responsibilities - Orchestrates the deployment and lifecycle of all Nextcloud service containers - Handles initial setup and container configuration - Coordinates image updates - Monitors general system health It triggers the initial installation and ensures the smooth operation of the Nextcloud All-in-One stack. ## Contents - **Dockerfile**: Instructions for building the mastercontainer image. - **Entrypoint script**: The `start.sh` script is used for container initialization and runtime configuration before starting supervisord. - [**Nextcloud All-in-One Controller App**](https://github.com/nextcloud/all-in-one/tree/main/php): The core AIO orchestrator that handles configuration and settings for the containers. - **Supervisor**: The `supervisord.conf` file defines the long-running services hosted within the container (php-fpm, cron, etc.) ## Usage This container should be used as the trigger image when deploying the Nextcloud All-in-One stack in a Docker or other OCI-compliant container environment. For detailed deployment instructions, refer to the [project documentation]( https://github.com/nextcloud/all-in-one). ## Related Resources - [Main Repository](https://github.com/nextcloud/all-in-one) - [Documentation](https://github.com/nextcloud/all-in-one#readme) ## Contributing Contributions are welcome! Please follow the Nextcloud project's guidelines and submit pull requests or issues via the main repository. ## License This folder and its contents are licensed under the [GNU AGPLv3](https://www.gnu.org/licenses/agpl-3.0.html), in line with the rest of Nextcloud All-in-One. [^app]: The Nextcloud All-in-One interface allows users to install, configure, and manage their Nextcloud instance and related containers via a secure web interface and API. It automates and simplifies complex tasks such as container orchestration, backups, updates, and service management for users deploying Nextcloud in Docker environments. ================================================ FILE: Containers/mastercontainer/acme.Caddyfile ================================================ { admin off # auto_https will create redirects for https://{host}:8443 instead of https://{host} # https redirects are added manually in the http://:80 block auto_https disable_redirects storage file_system { root /mnt/docker-aio-config/caddy/ } log { level ERROR # We need to exclude the remote-host plugin from logging as it would spam the logs # See https://github.com/nextcloud/all-in-one/pull/7006#issuecomment-4003238239 exclude http.matchers.remote_host } servers { # Only h1 is allowed as we prevent `ERR_NETWORK_CHANGED` from happening protocols h1 } on_demand_tls { ask http://127.0.0.1:9876/ } skip_install_trust } http://:80 { redir https://{host}{uri} permanent } https://:8443 { @denied { path /api/auth/login /api/auth/getlogin remote_host nextcloud-aio-nextcloud } abort @denied root * /var/www/docker-aio/php/public php_fastcgi unix//run/php.sock file_server tls { on_demand issuer acme { disable_tlsalpn_challenge } } } ================================================ FILE: Containers/mastercontainer/backup-time-file-watcher.sh ================================================ #!/bin/bash restart_process() { echo "Restarting cron.sh because daily backup time was set, changed or unset." pkill cron.sh } file_present() { if [ -f "/mnt/docker-aio-config/data/daily_backup_time" ]; then if [ "$FILE_PRESENT" = 0 ]; then restart_process else if [ -n "$BACKUP_TIME" ] && [ "$(head -1 "/mnt/docker-aio-config/data/daily_backup_time")" != "$BACKUP_TIME" ]; then restart_process fi fi FILE_PRESENT=1 BACKUP_TIME="$(head -1 "/mnt/docker-aio-config/data/daily_backup_time")" else if [ "$FILE_PRESENT" = 1 ]; then restart_process fi FILE_PRESENT=0 fi } while true; do file_present sleep 2 done ================================================ FILE: Containers/mastercontainer/cron.sh ================================================ #!/bin/bash while true; do if [ -f "/mnt/docker-aio-config/data/daily_backup_time" ]; then set -x BACKUP_TIME="$(head -1 "/mnt/docker-aio-config/data/daily_backup_time")" export BACKUP_TIME export DAILY_BACKUP=1 if [ "$(sed -n '2p' "/mnt/docker-aio-config/data/daily_backup_time")" != 'automaticUpdatesAreNotEnabled' ]; then export AUTOMATIC_UPDATES=1 else export AUTOMATIC_UPDATES=0 export START_CONTAINERS=1 fi if [ "$(sed -n '3p' "/mnt/docker-aio-config/data/daily_backup_time")" != 'successNotificationsAreNotEnabled' ]; then export SEND_SUCCESS_NOTIFICATIONS=1 else export SEND_SUCCESS_NOTIFICATIONS=0 fi set +x if [ -f "/mnt/docker-aio-config/data/daily_backup_running" ]; then export LOCK_FILE_PRESENT=1 else export LOCK_FILE_PRESENT=0 fi else export BACKUP_TIME="04:00" export DAILY_BACKUP=0 export LOCK_FILE_PRESENT=0 fi # Allow to continue directly if e.g. the mastercontainer was updated. Otherwise wait for the next execution if [ "$LOCK_FILE_PRESENT" = 0 ]; then while [ "$(date +%H:%M)" != "$BACKUP_TIME" ]; do sleep 30 done fi if [ "$DAILY_BACKUP" = 1 ]; then bash /daily-backup.sh fi # Make sure to delete the lock file always rm -f "/mnt/docker-aio-config/data/daily_backup_running" # Check for updates and send notification if yes on saturdays if [ "$(date +%u)" = 6 ]; then sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/UpdateNotification.php fi # Check if AIO is outdated sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/OutdatedNotification.php # Remove sessions older than 24h find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete # Remove nextcloud-aio-domaincheck container if sudo -E -u www-data docker ps --format "{{.Names}}" --filter "status=exited" | grep -q "^nextcloud-aio-domaincheck$"; then sudo -E -u www-data docker container remove nextcloud-aio-domaincheck fi # Remove dangling images sudo -E -u www-data docker image prune --filter "label=org.label-schema.vendor=Nextcloud" --force # Check for available free space sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/CheckFreeDiskSpace.php # Remove mastercontainer from default bridge network if sudo -E -u www-data docker inspect nextcloud-aio-mastercontainer --format "{{.NetworkSettings.Networks}}" | grep -q "bridge"; then sudo -E -u www-data docker network disconnect bridge nextcloud-aio-mastercontainer fi # Wait 60s so that the whole loop will not be executed again sleep 60 done ================================================ FILE: Containers/mastercontainer/daily-backup.sh ================================================ #!/bin/bash echo "Daily backup script has started" # Check if initial configuration has been done, otherwise this script should do nothing. CONFIG_FILE=/mnt/docker-aio-config/data/configuration.json if ! [ -f "$CONFIG_FILE" ] || (! grep -q "wasStartButtonClicked.*1" "$CONFIG_FILE" && ! grep -q "wasStartButtonClicked.*true" "$CONFIG_FILE"); then echo "Initial configuration via AIO interface not done yet. Exiting..." exit 0 fi # Daily backup and backup check cannot be run at the same time if [ "$DAILY_BACKUP" = 1 ] && [ "$CHECK_BACKUP" = 1 ]; then echo "Daily backup and backup check cannot be run at the same time. Exiting..." exit 1 fi # Delete all active sessions and create a lock file # But don't kick out the user if the mastercontainer was just updated since we block the interface either way with the lock file if [ "$LOCK_FILE_PRESENT" = 0 ] || ! [ -f "/mnt/docker-aio-config/data/daily_backup_running" ]; then find "/mnt/docker-aio-config/session/" -mindepth 1 -delete fi sudo -E -u www-data touch "/mnt/docker-aio-config/data/daily_backup_running" # Check if apache is running/stopped, watchtower is stopped and backupcontainer is stopped LOCAL_APACHE_PORT="$(docker inspect nextcloud-aio-apache --format "{{.Config.Env}}" | grep -o 'APACHE_PORT=[0-9]\+' | grep -o '[0-9]\+' | head -1)" if [ -z "$LOCAL_APACHE_PORT" ]; then echo "APACHE_PORT is not set which is not expected..." else # Connect mastercontainer to nextcloud-aio network to make sure that nextcloud-aio-apache is reachable # Prevent issues like https://github.com/nextcloud/all-in-one/discussions/5222 docker network connect nextcloud-aio nextcloud-aio-mastercontainer &>/dev/null # Wait for apache to start while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-apache$" && ! nc -z nextcloud-aio-apache "$LOCAL_APACHE_PORT"; do echo "Waiting for apache to become available" sleep 30 done fi while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-watchtower$"; do echo "Waiting for watchtower to stop" sleep 30 done while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-borgbackup$"; do echo "Waiting for borgbackup to stop" sleep 30 done # Update the mastercontainer if [ "$AUTOMATIC_UPDATES" = 1 ]; then echo "Starting mastercontainer update..." echo "(The script might get exited due to that. In order to update all the other containers correctly, you need to run this script with the same settings a second time.)" sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/UpdateMastercontainer.php fi # Wait for watchtower to stop if [ "$AUTOMATIC_UPDATES" = 1 ]; then if ! docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-watchtower$"; then echo "Something seems to be wrong: Watchtower should be started at this step." fi while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-watchtower$"; do echo "Waiting for watchtower to stop" sleep 30 done fi # Update container images to reduce downtime later on if [ "$AUTOMATIC_UPDATES" = 1 ]; then echo "Updating container images..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/PullContainerImages.php fi # Stop containers if required # shellcheck disable=SC2235 if [ "$CHECK_BACKUP" != 1 ] && ([ "$DAILY_BACKUP" != 1 ] || [ "$STOP_CONTAINERS" = 1 ]); then echo "Stopping containers..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/StopContainers.php fi # Execute the backup itself and some related tasks (also stops the containers) if [ "$DAILY_BACKUP" = 1 ]; then echo "Creating daily backup..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/CreateBackup.php if ! docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-borgbackup$"; then echo "Something seems to be wrong: the borg container should be started at this step." fi while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-borgbackup$"; do echo "Waiting for backup container to stop" sleep 30 done fi # Execute backup check if [ "$CHECK_BACKUP" = 1 ]; then echo "Starting backup check..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/CheckBackup.php fi # Start and/or update containers if [ "$AUTOMATIC_UPDATES" = 1 ]; then echo "Starting and updating containers..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/StartAndUpdateContainers.php else if [ "$START_CONTAINERS" = 1 ]; then echo "Starting containers without updating them..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/StartContainers.php fi fi # Delete the lock file rm -f "/mnt/docker-aio-config/data/daily_backup_running" # Send backup notification # shellcheck disable=SC2235 if [ "$DAILY_BACKUP" = 1 ] && ([ "$AUTOMATIC_UPDATES" = 1 ] || [ "$START_CONTAINERS" = 1 ]); then # Wait for the nextcloud container to start and send if the backup was successful if ! docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-nextcloud$"; then echo "Something seems to be wrong: Nextcloud should be started at this step." else while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-nextcloud$" && ! nc -z nextcloud-aio-nextcloud 9000; do echo "Waiting for the Nextcloud container to start" sleep 30 if [ "$(docker inspect nextcloud-aio-nextcloud --format "{{.State.Restarting}}")" = "true" ]; then echo "Nextcloud container restarting. Skipping this check!" break fi done fi echo "Sending backup notification..." sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/BackupNotification.php fi echo "Daily backup script has finished" ================================================ FILE: Containers/mastercontainer/healthcheck.sh ================================================ #!/bin/bash if [ -f "/mnt/docker-aio-config/data/configuration.json" ]; then nc -z 127.0.0.1 80 || exit 1 nc -z 127.0.0.1 8080 || exit 1 nc -z 127.0.0.1 8443 || exit 1 test -S /run/php.sock || exit 1 nc -z 127.0.0.1 9876 || exit 1 fi ================================================ FILE: Containers/mastercontainer/internal.Caddyfile ================================================ { admin off storage file_system { root /mnt/docker-aio-config/caddy/ } log { level ERROR # We need to exclude the remote-host plugin from logging as it would spam the logs # See https://github.com/nextcloud/all-in-one/pull/7006#issuecomment-4003238239 exclude http.matchers.remote_host } servers { # Only h1 is allowed as we prevent `ERR_NETWORK_CHANGED` from happening protocols h1 } skip_install_trust } https://:8080 { @denied { path /api/auth/login /api/auth/getlogin remote_host nextcloud-aio-nextcloud } abort @denied root * /var/www/docker-aio/php/public php_fastcgi unix//run/php.sock file_server tls { on_demand issuer internal } } ================================================ FILE: Containers/mastercontainer/session-deduplicator.sh ================================================ #!/bin/bash deduplicate_sessions() { echo "Deleting duplicate sessions" find "/mnt/docker-aio-config/session/" -mindepth 1 -exec grep -qv "$NEW_SESSION_TIME" {} \; -delete } compare_times() { if [ -f "/mnt/docker-aio-config/data/session_date_file" ]; then unset NEW_SESSION_TIME NEW_SESSION_TIME="$(cat "/mnt/docker-aio-config/data/session_date_file")" if [ -n "$NEW_SESSION_TIME" ] && [ -n "$OLD_SESSION_TIME" ] && [ "$NEW_SESSION_TIME" != "$OLD_SESSION_TIME" ]; then deduplicate_sessions fi OLD_SESSION_TIME="$NEW_SESSION_TIME" fi } while true; do compare_times sleep 2 done ================================================ FILE: Containers/mastercontainer/start.sh ================================================ #!/bin/bash # Function to show text in green print_green() { local TEXT="$1" printf "%b%s%b\n" "\e[0;92m" "$TEXT" "\e[0m" } # Function to show text in red print_red() { local TEXT="$1" printf "%b%s%b\n" "\e[0;31m" "$TEXT" "\e[0m" } # Function to check if number was provided check_if_number() { case "${1}" in ''|*[!0-9]*) return 1 ;; *) return 0 ;; esac } # Check if running as root user if [ "$EUID" != "0" ]; then print_red "Container does not run as root user. This is not supported." exit 1 fi # Check that the CMD is not overwritten nor set if [ "$*" != "" ]; then print_red "Docker run command for AIO is incorrect as a CMD option was given which is not expected." exit 1 fi # Check if socket is available and readable if ! [ -e "/var/run/docker.sock" ]; then print_red "Docker socket is not available. Cannot continue." echo "Please make sure to mount the docker socket into /var/run/docker.sock inside the container!" echo "If you did this by purpose because you don't want the container to have access to the docker socket, see https://github.com/nextcloud/all-in-one/tree/main/manual-install." echo "And https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml" exit 1 elif ! mountpoint -q "/mnt/docker-aio-config"; then print_red "/mnt/docker-aio-config is not a mountpoint. Cannot proceed!" echo "Please make sure to mount the nextcloud_aio_mastercontainer docker volume into /mnt/docker-aio-config inside the container!" echo "If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale" exit 1 elif mountpoint -q /var/www/docker-aio/php/containers.json; then print_red "/var/www/docker-aio/php/containers.json is a mountpoint. Cannot proceed!" echo "This is a not-supported customization of the mastercontainer!" echo "Please remove this bind-mount from the mastercontainer." echo "If you need to customize things, feel free to use https://github.com/nextcloud/all-in-one/tree/main/manual-install" echo "See https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml" exit 1 elif ! sudo -E -u www-data test -r /var/run/docker.sock; then echo "Trying to fix docker.sock permissions internally..." DOCKER_GROUP=$(stat -c '%G' /var/run/docker.sock) DOCKER_GROUP_ID=$(stat -c '%g' /var/run/docker.sock) # Check if a group with the same group name of /var/run/docker.socket already exists in the container if grep -q "^$DOCKER_GROUP:" /etc/group; then # If yes, add www-data to that group echo "Adding internal www-data to group $DOCKER_GROUP" usermod -aG "$DOCKER_GROUP" www-data else # Delete the docker group for cases when the docker socket permissions changed between restarts groupdel docker &>/dev/null # If the group doesn't exist, create it echo "Creating docker group internally with id $DOCKER_GROUP_ID" groupadd -g "$DOCKER_GROUP_ID" docker usermod -aG docker www-data fi if ! sudo -E -u www-data test -r /var/run/docker.sock; then print_red "Docker socket is not readable by the www-data user. Cannot continue." exit 1 fi fi # Get default docker api version API_VERSION_FILE="$(find ./ -name DockerActionManager.php | head -1)" API_VERSION="$(grep -oP 'const string API_VERSION.*\;' "$API_VERSION_FILE" | grep -oP '[0-9]+.[0-9]+' | head -1)" if [ -z "$API_VERSION" ]; then print_red "Could not get API_VERSION. Something is wrong!" exit 1 fi # Check if DOCKER_API_VERSION is set globally if [ -n "$DOCKER_API_VERSION" ]; then if ! echo "$DOCKER_API_VERSION" | grep -q '^[0-9].[0-9]\+$'; then print_red "You've set DOCKER_API_VERSION but not to an allowed value. The string must be a version number like e.g. '1.44'. It is set to '$DOCKER_API_VERSION'." exit 1 fi print_red "DOCKER_API_VERSION was found to be set to '$DOCKER_API_VERSION'." print_red "Please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO." print_red "So you run on your own risk and things might break without warning." else # Export docker api version to use it everywhere export DOCKER_API_VERSION="$API_VERSION" fi # Set a fallback docker api version. Needed for api version check. # The check will not work otherwise on old docker versions FALLBACK_DOCKER_API_VERSION="1.41" # Check if docker info can be used if ! sudo -E -u www-data docker info &>/dev/null; then if ! sudo -E -u www-data DOCKER_API_VERSION="$FALLBACK_DOCKER_API_VERSION" docker info &>/dev/null; then print_red "Cannot connect to the docker socket. Cannot proceed." echo "Did you maybe remove group read permissions for the docker socket? AIO needs them in order to access the docker socket." echo "If SELinux is enabled on your host, see https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled" echo "If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale" echo "On macOS, see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-macos" echo "Another possibility might be that Docker api v$API_VERSION is not supported by your docker daemon." echo "In that case, you should report this to https://github.com/nextcloud/all-in-one/issues" echo "" exit 1 fi fi # Docker api version check # shellcheck disable=SC2001 API_VERSION_NUMB="$(echo "$DOCKER_API_VERSION" | sed 's/\.//')" LOCAL_API_VERSION_NUMB="$(sudo -E -u www-data docker version | grep -i "api version" | grep -oP '[0-9]+.[0-9]+' | head -1 | sed 's/\.//')" if [ -z "$LOCAL_API_VERSION_NUMB" ]; then LOCAL_API_VERSION_NUMB="$(sudo -E -u www-data DOCKER_API_VERSION="$FALLBACK_DOCKER_API_VERSION" docker version | grep -i "api version" | grep -oP '[0-9]+.[0-9]+' | head -1 | sed 's/\.//')" fi if [ -n "$LOCAL_API_VERSION_NUMB" ] && [ -n "$API_VERSION_NUMB" ]; then if ! [ "$LOCAL_API_VERSION_NUMB" -ge "$API_VERSION_NUMB" ]; then print_red "Docker API v$DOCKER_API_VERSION is not supported by your docker engine. Cannot proceed. Please upgrade your docker engine if you want to run Nextcloud AIO!" echo "Alternatively, set the DOCKER_API_VERSION environmental variable to a compatible version." echo "However please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO." echo "See https://github.com/nextcloud/all-in-one#how-to-adjust-the-internally-used-docker-api-version" exit 1 fi else echo "LOCAL_API_VERSION_NUMB or API_VERSION_NUMB are not set correctly. Cannot check if the API version is supported." sleep 10 fi # Check Storage drivers STORAGE_DRIVER="$(sudo -E -u www-data docker info | grep "Storage Driver")" # Check if vfs is used: https://github.com/nextcloud/all-in-one/discussions/1467 if echo "$STORAGE_DRIVER" | grep -q vfs; then echo "$STORAGE_DRIVER" print_red "Warning: It seems like the storage driver vfs is used. This will lead to problems with disk space and performance and is disrecommended!" elif echo "$STORAGE_DRIVER" | grep -q fuse-overlayfs; then echo "$STORAGE_DRIVER" print_red "Warning: It seems like the storage driver fuse-overlayfs is used. Please check if you can switch to overlay2 instead." fi # Check if snap install if sudo -E -u www-data docker info | grep "Docker Root Dir" | grep "/var/snap/docker/"; then print_red "Warning: It looks like your installation uses docker installed via snap." print_red "This comes with some limitations and is disrecommended by the docker maintainers." print_red "See for example https://github.com/nextcloud/all-in-one/discussions/4890#discussioncomment-10386752" fi # Check if startup command was executed correctly if ! sudo -E -u www-data docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-mastercontainer$"; then print_red "It seems like you did not give the mastercontainer the correct name? (The 'nextcloud-aio-mastercontainer' container was not found.) Using a different name is not supported since mastercontainer updates will not work in that case! If you are on docker swarm and try to run AIO, see https://github.com/nextcloud/all-in-one#can-i-run-this-with-docker-swarm" exit 1 elif sudo -E -u www-data docker inspect nextcloud-aio-mastercontainer --format "{{.Config.Image}}" | grep -q '@'; then print_red "It seems like you used a hash for the mastercontainer image tag. This is not supported!" exit 1 elif ! sudo -E -u www-data docker volume ls --format "{{.Name}}" | grep -q "^nextcloud_aio_mastercontainer$"; then print_red "It seems like you did not give the mastercontainer volume the correct name? (The 'nextcloud_aio_mastercontainer' volume was not found.) Using a different name is not supported since the built-in backup solution will not work in that case!" exit 1 elif ! sudo -E -u www-data docker inspect nextcloud-aio-mastercontainer | grep -q "nextcloud_aio_mastercontainer"; then print_red "It seems like you did not attach the 'nextcloud_aio_mastercontainer' volume to the mastercontainer? This is not supported since the built-in backup solution will not work in that case!" exit 1 fi # Check for other options if [ -n "$NEXTCLOUD_DATADIR" ]; then if [ "$NEXTCLOUD_DATADIR" = "nextcloud_aio_nextcloud_datadir" ]; then sleep 1 elif ! echo "$NEXTCLOUD_DATADIR" | grep -q "^/" || [ "$NEXTCLOUD_DATADIR" = "/" ]; then print_red "You've set NEXTCLOUD_DATADIR but not to an allowed value. The string must start with '/' and must not be equal to '/'. Also allowed is 'nextcloud_aio_nextcloud_datadir'. It is set to '$NEXTCLOUD_DATADIR'." exit 1 fi fi if [ -n "$NEXTCLOUD_MOUNT" ]; then if ! echo "$NEXTCLOUD_MOUNT" | grep -q "^/" || [ "$NEXTCLOUD_MOUNT" = "/" ]; then print_red "You've set NEXTCLOUD_MOUNT but not to an allowed value. The string must start with '/' and must not be equal to '/'. It is set to '$NEXTCLOUD_MOUNT'." exit 1 elif [ "$NEXTCLOUD_MOUNT" = "/mnt/ncdata" ] || echo "$NEXTCLOUD_MOUNT" | grep -q "^/mnt/ncdata/"; then print_red "'/mnt/ncdata' and '/mnt/ncdata/' are not allowed as values for NEXTCLOUD_MOUNT." exit 1 fi fi if [ -n "$NEXTCLOUD_DATADIR" ] && [ -n "$NEXTCLOUD_MOUNT" ]; then if [ "$NEXTCLOUD_DATADIR" = "$NEXTCLOUD_MOUNT" ]; then print_red "NEXTCLOUD_DATADIR and NEXTCLOUD_MOUNT are not allowed to be equal." exit 1 fi fi if [ -n "$NEXTCLOUD_UPLOAD_LIMIT" ]; then if ! echo "$NEXTCLOUD_UPLOAD_LIMIT" | grep -q '^[0-9]\+G$'; then print_red "You've set NEXTCLOUD_UPLOAD_LIMIT but not to an allowed value. The string must start with a number and end with 'G'. It is set to '$NEXTCLOUD_UPLOAD_LIMIT'." exit 1 fi fi if [ -n "$NEXTCLOUD_MAX_TIME" ]; then if ! echo "$NEXTCLOUD_MAX_TIME" | grep -q '^[0-9]\+$'; then print_red "You've set NEXTCLOUD_MAX_TIME but not to an allowed value. The string must be a number. E.g. '3600'. It is set to '$NEXTCLOUD_MAX_TIME'." exit 1 fi fi if [ -n "$NEXTCLOUD_MEMORY_LIMIT" ]; then if ! echo "$NEXTCLOUD_MEMORY_LIMIT" | grep -q '^[0-9]\+M$'; then print_red "You've set NEXTCLOUD_MEMORY_LIMIT but not to an allowed value. The string must start with a number and end with 'M'. It is set to '$NEXTCLOUD_MEMORY_LIMIT'." exit 1 fi fi if [ -n "$APACHE_PORT" ]; then if ! check_if_number "$APACHE_PORT"; then print_red "You provided an Apache port but did not only use numbers. It is set to '$APACHE_PORT'." exit 1 elif ! [ "$APACHE_PORT" -le 65535 ] || ! [ "$APACHE_PORT" -ge 1 ]; then print_red "The provided Apache port is invalid. It must be between 1 and 65535" exit 1 fi fi if [ -n "$APACHE_IP_BINDING" ]; then if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$\|^[0-9a-f:]\+$\|^@INTERNAL$'; then print_red "You provided an ip-address for the apache container's ip-binding but it was not a valid ip-address. It is set to '$APACHE_IP_BINDING'." exit 1 fi fi if [ -n "$APACHE_ADDITIONAL_NETWORK" ]; then if ! echo "$APACHE_ADDITIONAL_NETWORK" | grep -q "^[a-zA-Z0-9._-]\+$"; then print_red "You've set APACHE_ADDITIONAL_NETWORK but not to an allowed value. It needs to be a string with letters, numbers, hyphens and underscores. It is set to '$APACHE_ADDITIONAL_NETWORK'." exit 1 fi fi if [ -n "$TALK_PORT" ]; then if ! check_if_number "$TALK_PORT"; then print_red "You provided an Talk port but did not only use numbers. It is set to '$TALK_PORT'." exit 1 elif ! [ "$TALK_PORT" -le 65535 ] || ! [ "$TALK_PORT" -ge 1 ]; then print_red "The provided Talk port is invalid. It must be between 1 and 65535" exit 1 fi fi if [ -n "$APACHE_PORT" ] && [ -n "$TALK_PORT" ]; then if [ "$APACHE_PORT" = "$TALK_PORT" ]; then print_red "APACHE_PORT and TALK_PORT are not allowed to be equal." exit 1 fi fi if [ -n "$WATCHTOWER_DOCKER_SOCKET_PATH" ]; then if ! echo "$WATCHTOWER_DOCKER_SOCKET_PATH" | grep -q "^/" || echo "$WATCHTOWER_DOCKER_SOCKET_PATH" | grep -q "/$"; then print_red "You've set WATCHTOWER_DOCKER_SOCKET_PATH but not to an allowed value. The string must start with '/' and must not end with '/'. It is set to '$WATCHTOWER_DOCKER_SOCKET_PATH'." exit 1 fi fi if [ -n "$NEXTCLOUD_TRUSTED_CACERTS_DIR" ]; then if ! echo "$NEXTCLOUD_TRUSTED_CACERTS_DIR" | grep -q "^/" || echo "$NEXTCLOUD_TRUSTED_CACERTS_DIR" | grep -q "/$"; then print_red "You've set NEXTCLOUD_TRUSTED_CACERTS_DIR but not to an allowed value. It should be an absolute path to a directory that starts with '/' but not end with '/'. It is set to '$NEXTCLOUD_TRUSTED_CACERTS_DIR '." exit 1 fi fi if [ -n "$NEXTCLOUD_STARTUP_APPS" ]; then if ! echo "$NEXTCLOUD_STARTUP_APPS" | grep -q "^[a-z0-9 _-]\+$"; then print_red "You've set NEXTCLOUD_STARTUP_APPS but not to an allowed value. It needs to be a string. Allowed are small letters a-z, 0-9, spaces, hyphens and '_'. It is set to '$NEXTCLOUD_STARTUP_APPS'." exit 1 fi fi if [ -n "$NEXTCLOUD_ADDITIONAL_APKS" ]; then if ! echo "$NEXTCLOUD_ADDITIONAL_APKS" | grep -q "^[a-z0-9 ._-]\+$"; then print_red "You've set NEXTCLOUD_ADDITIONAL_APKS but not to an allowed value. It needs to be a string. Allowed are small letters a-z, digits 0-9, spaces, hyphens, dots and '_'. It is set to '$NEXTCLOUD_ADDITIONAL_APKS'." exit 1 fi fi if [ -n "$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS" ]; then if ! echo "$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS" | grep -q "^[a-z0-9 ._-]\+$"; then print_red "You've set NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS but not to an allowed value. It needs to be a string. Allowed are small letters a-z, digits 0-9, spaces, hyphens, dots and '_'. It is set to '$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS'." exit 1 fi fi if [ -n "$AIO_COMMUNITY_CONTAINERS" ]; then print_red "You've set AIO_COMMUNITY_CONTAINERS but the option was removed. The community containers get managed via the AIO interface now." fi # Check if ghcr.io is reachable # Solves issues like https://github.com/nextcloud/all-in-one/discussions/5268 if ! curl --no-progress-meter https://ghcr.io/v2/ >/dev/null; then print_red "Could not reach https://ghcr.io." echo "Most likely is something blocking access to it." echo "You should be able to fix this by following https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html" echo "Another solution is using https://github.com/nextcloud/all-in-one/tree/main/manual-install" echo "See https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml" exit 1 fi # Check that no changes have been made to timezone settings since AIO only supports running in Etc/UTC timezone if [ -n "$TZ" ]; then print_red "The environmental variable TZ has been set which is not supported by AIO since it only supports running in the default Etc/UTC timezone!" echo "The correct timezone can be set in the AIO interface later on!" # Disable exit since it seems to be by default set on unraid and we dont want to break these instances # exit 1 fi # Check that http proxy or no_proxy variable is not set which AIO does not support if [ -n "$HTTP_PROXY" ] || [ -n "$http_proxy" ] || [ -n "$HTTPS_PROXY" ] || [ -n "$https_proxy" ] || [ -n "$NO_PROXY" ] || [ -n "$no_proxy" ]; then print_red "The environmental variable HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy, NO_PROXY or no_proxy has been set which is not supported by AIO." echo "If you need this, then you should use https://github.com/nextcloud/all-in-one/tree/main/manual-install" echo "See https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml" exit 1 fi if mountpoint -q /etc/localtime; then print_red "/etc/localtime has been mounted into the container which is not allowed because AIO only supports running in the default Etc/UTC timezone!" echo "The correct timezone can be set in the AIO interface later on!" exit 1 fi if mountpoint -q /etc/timezone; then print_red "/etc/timezone has been mounted into the container which is not allowed because AIO only supports running in the default Etc/UTC timezone!" echo "The correct timezone can be set in the AIO interface later on!" exit 1 fi # Check if unsupported env are set (but don't exit as it would break many instances) if [ -n "$APACHE_DISABLE_REWRITE_IP" ]; then print_red "The environmental variable APACHE_DISABLE_REWRITE_IP has been set which is not supported by AIO. Please remove it!" fi if [ -n "$NEXTCLOUD_TRUSTED_DOMAINS" ]; then print_red "The environmental variable NEXTCLOUD_TRUSTED_DOMAINS has been set which is not supported by AIO. Please remove it!" fi if [ -n "$TRUSTED_PROXIES" ]; then print_red "The environmental variable TRUSTED_PROXIES has been set which is not supported by AIO. Please remove it!" fi # Add important folders mkdir -p /mnt/docker-aio-config/data/ mkdir -p /mnt/docker-aio-config/session/ mkdir -p /mnt/docker-aio-config/caddy/ # Adjust permissions for all instances chmod 770 -R /mnt/docker-aio-config chmod 777 /mnt/docker-aio-config chown www-data:www-data -R /mnt/docker-aio-config/data/ chown www-data:www-data -R /mnt/docker-aio-config/session/ chown www-data:www-data -R /mnt/docker-aio-config/caddy/ print_green "Initial startup of Nextcloud All-in-One complete! You should be able to open the Nextcloud AIO Interface now on port 8080 of this server! E.g. https://internal.ip.of.this.server:8080 ⚠️ Important: do always use an ip-address if you access this port and not a domain as HSTS might block access to it later! If your server has port 80 and 8443 open and you point a domain to your server, you can get a valid certificate automatically by opening the Nextcloud AIO Interface via: https://your-domain-that-points-to-this-server.tld:8443" # Set the timezone to Etc/UTC export TZ=Etc/UTC # Remove unused certs rm -vrf /mnt/docker-aio-config/certs # Remove the php socket as safeguard rm -vf /run/php.sock # Fix caddy startup if [ -d "/mnt/docker-aio-config/caddy/locks" ]; then rm -rf /mnt/docker-aio-config/caddy/locks/* fi # Fix the Caddyfile format caddy fmt --overwrite /acme.Caddyfile caddy fmt --overwrite /internal.Caddyfile # Fix caddy log chmod 777 /root # Start supervisord exec /usr/bin/supervisord -c /supervisord.conf ================================================ FILE: Containers/mastercontainer/supervisord.conf ================================================ [supervisord] nodaemon=true logfile=/var/log/supervisord/supervisord.log pidfile=/var/run/supervisord/supervisord.pid childlogdir=/var/log/supervisord/ logfile_maxbytes=50MB logfile_backups=10 loglevel=error user=root [program:php-fpm] # Stdout logging is disabled as otherwise the logs are spammed stdout_logfile=NONE stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=php-fpm user=root [program:caddy-internal] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/usr/bin/caddy run --config /internal.Caddyfile user=www-data [program:caddy-acme] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/usr/bin/caddy run --config /acme.Caddyfile user=www-data [program:cron] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/cron.sh user=root [program:backup-time-file-watcher] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/backup-time-file-watcher.sh user=root [program:session-deduplicator] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/session-deduplicator.sh user=root [program:domain-validator] # Logging is disabled as otherwise all attempts will be logged which spams the logs stdout_logfile=NONE stderr_logfile=NONE command=php -S 127.0.0.1:9876 /var/www/docker-aio/php/domain-validator.php user=www-data ================================================ FILE: Containers/nextcloud/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM php:8.3.30-fpm-alpine3.23 ENV PHP_MEMORY_LIMIT=512M ENV PHP_UPLOAD_LIMIT=16G ENV PHP_MAX_TIME=3600 ENV SOURCE_LOCATION=/usr/src/nextcloud ENV REDIS_DB_INDEX=0 # AIO settings start # Do not remove or change this line! ENV NEXTCLOUD_VERSION=32.0.6 ENV AIO_TOKEN=123456 ENV AIO_URL=localhost # AIO settings end # Do not remove or change this line! COPY --chmod=775 Containers/nextcloud/*.sh / COPY --chmod=774 Containers/nextcloud/upgrade.exclude /upgrade.exclude COPY Containers/nextcloud/config/*.php / COPY Containers/nextcloud/supervisord.conf /supervisord.conf # AIO cloning start # Do not remove or change this line! COPY app /usr/src/nextcloud/apps/nextcloud-aio COPY Containers/nextcloud/root.motd /root.motd # AIO cloning end # Do not remove or change this line! VOLUME /mnt/ncdata VOLUME /var/www/html # Custom: change id of www-data user as it needs to be the same like on old installations # hadolint ignore=SC2086,DL3003 RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache shadow; \ deluser www-data; \ addgroup -g 33 -S www-data; \ adduser -u 33 -D -S -G www-data www-data; \ \ # entrypoint.sh and cron.sh dependencies apk add --no-cache \ rsync \ ; \ # install the PHP extensions we need # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ autoconf \ freetype-dev \ gmp-dev \ icu-dev \ imagemagick-dev \ imagemagick-svg \ imagemagick-heic \ imagemagick-tiff \ libevent-dev \ libjpeg-turbo-dev \ libmcrypt-dev \ libmemcached-dev \ libpng-dev \ libwebp-dev \ libxml2-dev \ libzip-dev \ openldap-dev \ pcre-dev \ postgresql-dev \ ; \ \ docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ docker-php-ext-configure ftp --with-openssl-dir=/usr; \ docker-php-ext-configure ldap; \ docker-php-ext-install -j "$(nproc)" \ bcmath \ exif \ gd \ gmp \ intl \ ldap \ opcache \ pcntl \ pdo_pgsql \ sysvsem \ zip \ ; \ \ # pecl will claim success even if one install fails, so we need to perform each install separately pecl install -o igbinary-3.2.16; \ pecl install APCu-5.1.28; \ pecl install -D 'enable-memcached-igbinary="yes"' memcached-3.4.0; \ pecl install -oD 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"' redis-6.3.0; \ pecl install -o imagick-3.8.1; \ \ docker-php-ext-enable \ igbinary \ apcu \ memcached \ redis \ imagick \ ; \ rm -r /tmp/pear; \ \ runDeps="$( \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ | tr ',' '\n' \ | sort -u \ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )"; \ apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps; \ apk del .build-deps; \ \ { \ echo 'apc.serializer=igbinary'; \ echo 'session.serialize_handler=igbinary'; \ } >> /usr/local/etc/php/conf.d/docker-php-ext-igbinary.ini; \ \ # set recommended PHP.ini settings # see https://docs.nextcloud.com/server/stable/admin_manual/installation/server_tuning.html#enable-php-opcache and below { \ echo 'opcache.max_accelerated_files=10000'; \ echo 'opcache.memory_consumption=256'; \ echo 'opcache.interned_strings_buffer=64'; \ echo 'opcache.save_comments=1'; \ echo 'opcache.revalidate_freq=60'; \ echo 'opcache.jit=1255'; \ echo 'opcache.jit_buffer_size=8M'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ \ { \ echo 'apc.enable_cli=1'; \ echo 'apc.shm_size=64M'; \ } >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ \ { \ echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ echo 'max_execution_time=${PHP_MAX_TIME}'; \ echo 'max_input_time=-1'; \ echo 'default_socket_timeout=${PHP_MAX_TIME}'; \ } > /usr/local/etc/php/conf.d/nextcloud.ini; \ \ { \ echo 'session.save_handler = redis'; \ echo 'session.save_path = "tcp://${REDIS_HOST}:${REDIS_PORT}?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}"'; \ echo 'redis.session.locking_enabled = 1'; \ echo 'redis.session.lock_retries = -1'; \ echo 'redis.session.lock_wait_time = 10000'; \ echo 'session.gc_maxlifetime = 86400'; \ } > /usr/local/etc/php/conf.d/redis-session.ini; \ \ mkdir -p /var/www/data; \ chown -R www-data:root /var/www; \ chmod -R g=u /var/www; \ \ # Download Nextcloud archive start # Do not remove or change this line! apk add --no-cache --virtual .fetch-deps \ bzip2 \ gnupg \ ; \ \ curl -fsSL -o nextcloud.tar.bz2 \ "https://github.com/nextcloud-releases/server/releases/download/v${NEXTCLOUD_VERSION}/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ curl -fsSL -o nextcloud.tar.bz2.asc \ "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ export GNUPGHOME="$(mktemp -d)"; \ # gpg key from https://nextcloud.com/nextcloud.asc gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ gpgconf --kill all; \ rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ mkdir -p /usr/src/nextcloud/data; \ mkdir -p /usr/src/nextcloud/custom_apps; \ chmod +x /usr/src/nextcloud/occ; \ mkdir -p /usr/src/nextcloud/config; \ apk del .fetch-deps; \ # Download Nextcloud archive end # Do not remove or change this line! mv /*.php /usr/src/nextcloud/config/; \ \ # Template from https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/fpm-alpine/Dockerfile apk add --no-cache \ ffmpeg \ procps \ samba-client \ supervisor \ # libreoffice \ ; \ \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ imap-dev \ krb5-dev \ openssl-dev \ samba-dev \ bzip2-dev \ libpq-dev \ ; \ \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ docker-php-ext-install \ bz2 \ imap \ pgsql \ ftp \ ; \ pecl install smbclient; \ docker-php-ext-enable smbclient; \ \ runDeps="$( \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ | tr ',' '\n' \ | sort -u \ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )"; \ apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps; \ apk del .build-deps; \ \ mkdir -p \ /var/log/supervisord \ /var/run/supervisord \ ; \ chmod 777 -R /var/log/supervisord; \ chmod 777 -R /var/run/supervisord; \ \ apk add --no-cache \ bash \ netcat-openbsd \ openssl \ gnupg \ git \ postgresql-client \ tzdata \ sudo \ grep \ nodejs \ bind-tools \ imagemagick \ imagemagick-svg \ imagemagick-heic \ imagemagick-tiff \ coreutils; \ \ grep -q '^pm = dynamic' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm = dynamic/pm = ondemand/' /usr/local/etc/php-fpm.d/www.conf; \ # Sync this with max db connections and MaxRequestWorkers # We don't actually expect so many children but don't want to limit it artificially because people will report issues otherwise. # Also children will usually be terminated again after the process is done due to the ondemand setting sed -i 's/^pm.max_children =.*/pm.max_children = 5000/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf; \ \ echo "[ -n \"\$TERM\" ] && [ -f /root.motd ] && cat /root.motd" >> /root/.bashrc; \ \ chown www-data:root -R /usr/src && \ chmod 777 -R /usr/local/etc/php/conf.d && \ chmod 777 -R /usr/local/etc/php-fpm.d && \ chmod -R 777 /tmp; \ chmod -R 777 /etc/openldap; \ \ mkdir -p /nc-updater; \ chmod -R 777 /nc-updater # hadolint ignore=DL3002 USER root ENTRYPOINT ["/start.sh"] CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/nextcloud/README.md ================================================ # Nextcloud All-in-One ``nextcloud`` Container This folder contains the OCI/Docker container definition, along with associated resources and configuration files, for building the `nextcloud` container as part of the [Nextcloud All-in-One](https://github.com/nextcloud/all-in-one) project. This container hosts PHP and the Nextcloud Server application. ## Overview The Nextcloud container provides the core Nextcloud application environment, including the necessary dependencies and configuration for seamless integration into the All-in-One stack. The container hosts: - The PHP SAPI/backend (php-fpm) - Nextcloud background jobs and scheduled tasks, which are handled via cron - Miscellaneous minor support services specific to AIO's Nextcloud deployment (health and exec) ## Contents - **Dockerfile**: Instructions for building the Nextcloud container image. - **Entrypoint script**: The `start.sh` script is used for container initialization and runtime configuration before starting supervisord. - **Nextcloud configuration files**: Specific to running in a containerized setting and/or within AIO. - **Supervisor**: The `supervisord.conf` file defines the long-running services hosted within the container (php-fpm, cron, etc.). ## Usage This container is intended to be used as part of the All-in-One deployment and is not meant to be used on its own. Among other requirements, it needs a web server container (which AIO provides in a dedicated Apache container). It is designed to be orchestrated by the [All-in-One mastercontainer](https://github.com/nextcloud/all-in-one/tree/main/Containers/mastercontainer) or used within an [AIO Manual Installation](https://github.com/nextcloud/all-in-one/tree/main/manual-install) or [AIO Helm chart](https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart). ## Documentation - [Nextcloud All-in-One Documentation](https://github.com/nextcloud/all-in-one#readme) - [Nextcloud Documentation](https://docs.nextcloud.com/) ## Contributing Contributions are welcome! Please follow the Nextcloud project's guidelines and submit pull requests or issues via the main repository. ## License This folder and its contents are licensed under the [GNU AGPLv3](https://www.gnu.org/licenses/agpl-3.0.html), in line with the rest of Nextcloud All-in-One. ================================================ FILE: Containers/nextcloud/config/aio.config.php ================================================ true, 'one-click-instance.user-limit' => 100, ); ================================================ FILE: Containers/nextcloud/config/apcu.config.php ================================================ '\OC\Memcache\APCu', ); ================================================ FILE: Containers/nextcloud/config/apps.config.php ================================================ array ( 0 => array ( 'path' => '/var/www/html/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/www/html/custom_apps', 'url' => '/custom_apps', 'writable' => true, ), ), ); if (getenv('APPS_ALLOWLIST')) { $CONFIG['appsallowlist'] = explode(" ", getenv('APPS_ALLOWLIST')); } if (getenv('NEXTCLOUD_APP_STORE_URL')) { $CONFIG['appstoreurl'] = getenv('NEXTCLOUD_APP_STORE_URL'); } ================================================ FILE: Containers/nextcloud/config/certificates-bundle.config.php ================================================ array( 'mode' => 'verify-ca', 'rootcert' => '/var/www/html/data/certificates/ca-bundle.crt', ), ); } if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL')) { $CONFIG = array( 'dbdriveroptions' => array( PDO::MYSQL_ATTR_SSL_CA => '/var/www/html/data/certificates/ca-bundle.crt', ), ); } ================================================ FILE: Containers/nextcloud/config/proxy.config.php ================================================ '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', ); if (getenv('REDIS_HOST')) { $CONFIG['redis']['host'] = (string) getenv('REDIS_HOST'); } if (getenv('REDIS_HOST_PASSWORD')) { $CONFIG['redis']['password'] = (string) getenv('REDIS_HOST_PASSWORD'); } if (getenv('REDIS_PORT')) { $CONFIG['redis']['port'] = (int) getenv('REDIS_PORT'); } if (getenv('REDIS_DB_INDEX')) { $CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX'); } if (getenv('REDIS_USER_AUTH')) { $CONFIG['redis']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH')); } if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_REDIS')) { $CONFIG['redis']['ssl_context']['cafile'] = '/var/www/html/data/certificates/ca-bundle.crt'; } } else { $CONFIG = array( 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis.cluster' => array( 'timeout' => 0.0, 'read_timeout' => 0.0, 'failover_mode' => \RedisCluster::FAILOVER_ERROR, 'seeds' => array_values(array_filter(array( (getenv('REDIS_HOST') && getenv('REDIS_PORT')) ? (getenv('REDIS_HOST') . ':' . (string)getenv('REDIS_PORT')) : null, (getenv('REDIS_HOST_2') && getenv('REDIS_PORT_2')) ? (getenv('REDIS_HOST_2') . ':' . (string)getenv('REDIS_PORT_2')) : null, (getenv('REDIS_HOST_3') && getenv('REDIS_PORT_3')) ? (getenv('REDIS_HOST_3') . ':' . (string)getenv('REDIS_PORT_3')) : null, (getenv('REDIS_HOST_4') && getenv('REDIS_PORT_4')) ? (getenv('REDIS_HOST_4') . ':' . (string)getenv('REDIS_PORT_4')) : null, (getenv('REDIS_HOST_5') && getenv('REDIS_PORT_5')) ? (getenv('REDIS_HOST_5') . ':' . (string)getenv('REDIS_PORT_5')) : null, (getenv('REDIS_HOST_6') && getenv('REDIS_PORT_6')) ? (getenv('REDIS_HOST_6') . ':' . (string)getenv('REDIS_PORT_6')) : null, (getenv('REDIS_HOST_7') && getenv('REDIS_PORT_7')) ? (getenv('REDIS_HOST_7') . ':' . (string)getenv('REDIS_PORT_7')) : null, (getenv('REDIS_HOST_8') && getenv('REDIS_PORT_8')) ? (getenv('REDIS_HOST_8') . ':' . (string)getenv('REDIS_PORT_8')) : null, (getenv('REDIS_HOST_9') && getenv('REDIS_PORT_9')) ? (getenv('REDIS_HOST_9') . ':' . (string)getenv('REDIS_PORT_9')) : null, ))), ), ); if (getenv('REDIS_HOST_PASSWORD')) { $CONFIG['redis.cluster']['password'] = (string) getenv('REDIS_HOST_PASSWORD'); } if (getenv('REDIS_USER_AUTH')) { $CONFIG['redis.cluster']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH')); } if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_REDIS')) { $CONFIG['redis.cluster']['ssl_context']['cafile'] = '/var/www/html/data/certificates/ca-bundle.crt'; } } ================================================ FILE: Containers/nextcloud/config/reverse-proxy.config.php ================================================ array( 'class' => '\OC\Files\ObjectStore\S3', 'arguments' => array( 'multibucket' => $multibucket === 'true', 'num_buckets' => (int)getenv('OBJECTSTORE_S3_NUM_BUCKETS') ?: 64, 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'autocreate' => strtolower($autocreate) !== 'false', 'use_ssl' => strtolower($use_ssl) !== 'false', // required for some non Amazon S3 implementations 'use_path_style' => strtolower($use_path) === 'true', // required for older protocol versions 'legacy_auth' => strtolower($use_legacyauth) === 'true', 'use_nextcloud_bundle' => 1, ) ) ); $sse_c_key = getenv('OBJECTSTORE_S3_SSE_C_KEY'); if ($sse_c_key) { $CONFIG['objectstore']['arguments']['sse_c_key'] = $sse_c_key; } $requestChecksumValidation = getenv('OBJECTSTORE_S3_REQUEST_CHECKSUM_VALIDATION'); if ($requestChecksumValidation) { $CONFIG['objectstore']['arguments']['request_checksum_calculation'] = $requestChecksumValidation; } $responseChecksumValidation = getenv('OBJECTSTORE_S3_RESPONSE_CHECKSUM_VALIDATION'); if ($responseChecksumValidation) { $CONFIG['objectstore']['arguments']['response_checksum_validation'] = $responseChecksumValidation; } } ================================================ FILE: Containers/nextcloud/config/smtp.config.php ================================================ 'smtp', 'mail_smtphost' => getenv('SMTP_HOST'), 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 'mail_domain' => getenv('MAIL_DOMAIN'), ); if (getenv('SMTP_PASSWORD')) { $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); } else { $CONFIG['mail_smtppassword'] = ''; } } if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MAILER')) { $CONFIG = array( 'mail_smtpstreamoptions' => array( 'ssl' => array( 'verify_peer_name' => false, 'cafile' => '/var/www/html/data/certificates/ca-bundle.crt', ) ) ); } ================================================ FILE: Containers/nextcloud/config/swift.config.php ================================================ [ 'class' => 'OC\\Files\\ObjectStore\\Swift', 'arguments' => [ 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 'user' => [ 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 'domain' => [ 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', ], ], 'scope' => [ 'project' => [ 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 'domain' => [ 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', ], ], ], 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), ] ] ); } ================================================ FILE: Containers/nextcloud/cron.sh ================================================ #!/bin/bash wait_for_cron() { set -x while [ -n "$(pgrep -f /var/www/html/cron.php)" ]; do echo "Waiting for cron to stop..." sleep 5 done echo "Cronjob successfully exited." exit } trap wait_for_cron SIGINT SIGTERM while true; do php -f /var/www/html/cron.php & sleep 5m & wait $! done ================================================ FILE: Containers/nextcloud/entrypoint.sh ================================================ #!/bin/bash # version_greater A B returns whether A > B version_greater() { [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] } # return true if specified directory is empty directory_empty() { [ -z "$(ls -A "$1/")" ] } run_upgrade_if_needed_due_to_app_update() { if php /var/www/html/occ status | grep maintenance | grep -q true; then php /var/www/html/occ maintenance:mode --off fi if php /var/www/html/occ status | grep needsDbUpgrade | grep -q true; then php /var/www/html/occ upgrade php /var/www/html/occ app:enable nextcloud-aio --force fi } # Create cert bundle if env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then # Enable debug mode set -x # Default vars CERTIFICATES_ROOT_DIR="/var/www/html/data/certificates" CERTIFICATE_BUNDLE="/var/www/html/data/certificates/ca-bundle.crt" # Remove old root certs and recreate them with current ones rm -rf "$CERTIFICATES_ROOT_DIR" mkdir -p "$CERTIFICATES_ROOT_DIR" # Retrieve default root cert bundle if ! [ -f "$SOURCE_LOCATION/resources/config/ca-bundle.crt" ]; then echo "Root ca-bundle not found. Only concattening configured NEXTCLOUD_TRUSTED_CERTIFICATES files!" # Recreate cert file touch "$CERTIFICATE_BUNDLE" else # Write default bundle to the target ca file cat "$SOURCE_LOCATION/resources/config/ca-bundle.crt" > "$CERTIFICATE_BUNDLE" fi # Iterate through certs TRUSTED_CERTIFICATES="$(env | grep NEXTCLOUD_TRUSTED_CERTIFICATES_ | grep -oP '^[A-Z_a-z0-9]+')" mapfile -t TRUSTED_CERTIFICATES <<< "$TRUSTED_CERTIFICATES" for certificate in "${TRUSTED_CERTIFICATES[@]}"; do # Create new line echo "" >> "$CERTIFICATE_BUNDLE" # Check if variable is an actual cert if echo "${!certificate}" | grep -q "BEGIN CERTIFICATE" && echo "${!certificate}" | grep -q "END CERTIFICATE"; then # Write out cert to bundle echo "${!certificate}" >> "$CERTIFICATE_BUNDLE" fi # Create file in cert dir for extra logic in other places if ! [ -f "$CERTIFICATES_ROOT_DIR/$CERTIFICATE_NAME" ]; then touch "$CERTIFICATES_ROOT_DIR/$CERTIFICATE_NAME" fi done # Backwards compatibility with older instances if [ -f "/var/www/html/config/postgres.config.php" ]; then sed -i "s|/var/www/html/data/certificates/POSTGRES|/var/www/html/data/certificates/ca-bundle.crt|" /var/www/html/config/postgres.config.php sed -i "s|/var/www/html/data/certificates/MYSQL|/var/www/html/data/certificates/ca-bundle.crt|" /var/www/html/config/postgres.config.php fi # Print out bundle one last time cat "$CERTIFICATE_BUNDLE" # Disable debug mode set +x fi # Adjust DATABASE_TYPE to by Nextcloud supported value if [ "$DATABASE_TYPE" = postgres ]; then export DATABASE_TYPE=pgsql fi # Only start container if Redis is accessible # shellcheck disable=SC2153 while ! nc -z "$REDIS_HOST" "$REDIS_PORT"; do echo "Waiting for Redis to start..." sleep 5 done # Check permissions in ncdata test_file="$NEXTCLOUD_DATA_DIR/this-is-a-test-file" touch "$test_file" if ! [ -f "$test_file" ]; then echo "The www-data user does not appear to have access rights to the data directory." echo "It is possible that the files are on a filesystem that does not support standard Linux permissions," echo "or the permissions simply need to be adjusted. Please change the permissions as described below." echo "Current permissions are:" stat -c "%u:%g %a" "$NEXTCLOUD_DATA_DIR" echo "(userID:groupID permissions)" echo "They should be:" echo "33:0 750" echo "(userID:groupID permissions)" echo "Also, ensure that all parent directories on the host of your chosen data directory are publicly readable." echo "For example: sudo chmod +r /mnt (adjust this command as needed)." echo "If you want to use a FUSE mount as the data directory, add 'allow_other' as an additional mount option." echo "For SMB/CIFS mounts as the data directory, see:" echo " https://github.com/nextcloud/all-in-one#can-i-use-a-cifssmb-share-as-nextclouds-datadir" exit 1 fi rm -f "$test_file" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" else installed_version="0.0.0.0" fi if [ -f "$SOURCE_LOCATION/version.php" ]; then # shellcheck disable=SC2016 image_version="$(php -r "require '$SOURCE_LOCATION/version.php'; echo implode('.', \$OC_Version);")" else image_version="$installed_version" fi # unset admin password if [ "$installed_version" != "0.0.0.0" ]; then unset ADMIN_PASSWORD fi # Don't start the container if Nextcloud is not compatible with the PHP version if [ -f "/var/www/html/lib/versioncheck.php" ] && ! php /var/www/html/lib/versioncheck.php; then echo "Your installed Nextcloud version is not compatible with the PHP version provided by this image." echo "This typically occurs when you restore an older Nextcloud backup that does not support the" echo "PHP version included in this image." echo "Please restore a more recent backup that includes a compatible Nextcloud version." echo "If you do not have a more recent backup, refer to the manual upgrade documentation:" echo " https://github.com/nextcloud/all-in-one/blob/main/manual-upgrade.md" exit 1 fi # Do not start the container if the last update failed if [ -f "$NEXTCLOUD_DATA_DIR/update.failed" ]; then echo "The last Nextcloud update failed." echo "Please restore from a backup and try again." echo "If you do not have a backup, you can delete the update.failed file in the data directory" echo "to allow the container to start again." exit 1 fi # Do not start the container if the install failed if [ -f "$NEXTCLOUD_DATA_DIR/install.failed" ]; then echo "The initial Nextcloud installation failed." echo "For more information about what went wrong, check the logs above." echo "Please reset AIO properly and try again." echo "See:" echo " https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance" exit 1 fi # Skip any update if Nextcloud was just restored if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then if version_greater "$image_version" "$installed_version"; then # Check if it skips a major version INSTALLED_MAJOR="${installed_version%%.*}" IMAGE_MAJOR="${image_version%%.*}" if [ "$installed_version" != "0.0.0.0" ]; then # Write output to logfile. exec > >(tee -i "/var/www/html/data/update.log") exec 2>&1 fi if [ "$installed_version" != "0.0.0.0" ] && [ "$((IMAGE_MAJOR - INSTALLED_MAJOR))" -gt 1 ]; then # Do not skip major versions placeholder # Do not remove or change this line! # Do not skip major versions start # Do not remove or change this line! set -ex NEXT_MAJOR="$((INSTALLED_MAJOR + 1))" curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/latest-${NEXT_MAJOR}.tar.bz2" curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/latest-${NEXT_MAJOR}.tar.bz2.asc" GNUPGHOME="$(mktemp -d)" export GNUPGHOME if ! gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; then if ! gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 28806A878AE423A28372792ED75899B9A724937A; then curl -sSL https://nextcloud.com/nextcloud.asc | gpg --import fi fi gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2 mkdir -p /usr/src/tmp tar -xjf nextcloud.tar.bz2 -C /usr/src/tmp/ gpgconf --kill all rm nextcloud.tar.bz2.asc nextcloud.tar.bz2 mkdir -p /usr/src/tmp/nextcloud/data mkdir -p /usr/src/tmp/nextcloud/custom_apps chmod +x /usr/src/tmp/nextcloud/occ cp -r "$SOURCE_LOCATION"/config/* /usr/src/tmp/nextcloud/config/ mkdir -p /usr/src/tmp/nextcloud/apps/nextcloud-aio cp -r "$SOURCE_LOCATION"/apps/nextcloud-aio/* /usr/src/tmp/nextcloud/apps/nextcloud-aio/ mv "$SOURCE_LOCATION" /usr/src/temp-nextcloud mv /usr/src/tmp/nextcloud "$SOURCE_LOCATION" rm -r /usr/src/tmp rm -r /usr/src/temp-nextcloud # shellcheck disable=SC2016 image_version="$(php -r "require '$SOURCE_LOCATION/version.php'; echo implode('.', \$OC_Version);")" IMAGE_MAJOR="${image_version%%.*}" set +ex # Do not skip major versions end # Do not remove or change this line! fi if [ "$installed_version" != "0.0.0.0" ]; then # Check connection to appstore start # Do not remove or change this line! while true; do echo -e "Checking connection to the app store..." APPSTORE_URL="https://apps.nextcloud.com/api/v1" if grep -q appstoreurl /var/www/html/config/config.php; then set -x APPSTORE_URL="$(grep appstoreurl /var/www/html/config/config.php | grep -oP 'https://.*v[0-9]+')" set +x fi # Default appstoreurl parameter in config.php defaults to 'https://apps.nextcloud.com/api/v1' so we check for the apps.json file stored in there CURL_STATUS="$(curl -LI "$APPSTORE_URL"/apps.json -o /dev/null -w '%{http_code}\n' -s)" if [[ "$CURL_STATUS" = "200" ]] then echo "App store is reachable." break else echo "Curl did not return a 200 status. Is the app store reachable?" sleep 5 fi done # Check connection to appstore end # Do not remove or change this line! run_upgrade_if_needed_due_to_app_update php /var/www/html/occ maintenance:mode --off echo "Getting and backing up the status of apps for later; this might take a while..." NC_APPS="$(find /var/www/html/custom_apps/ -type d -maxdepth 1 -mindepth 1 | sed 's|/var/www/html/custom_apps/||g')" if [ -z "$NC_APPS" ]; then echo "No apps detected. Aborting export of app status..." APPSTORAGE="no-export-done" else mapfile -t NC_APPS_ARRAY <<< "$NC_APPS" declare -Ag APPSTORAGE echo "Disabling apps before the update to make the update procedure safer. This can take a while..." for app in "${NC_APPS_ARRAY[@]}"; do if APPSTORAGE[$app]="$(php /var/www/html/occ config:app:get "$app" enabled)"; then php /var/www/html/occ app:disable "$app" else APPSTORAGE[$app]="" echo "Not disabling $app because the occ command to get its enabled state failed." fi done fi if [ "$((IMAGE_MAJOR - INSTALLED_MAJOR))" -eq 1 ]; then php /var/www/html/occ config:system:delete app_install_overwrite fi php /var/www/html/occ app:update --all run_upgrade_if_needed_due_to_app_update fi echo "Initializing Nextcloud $image_version ..." # Copy over initial data from Nextcloud archive rsync -rlD --delete \ --exclude-from=/upgrade.exclude \ "$SOURCE_LOCATION/" \ /var/www/html/ # Copy custom_apps from Nextcloud archive if ! directory_empty "$SOURCE_LOCATION/custom_apps"; then set -x for app in "$SOURCE_LOCATION/custom_apps"/*; do app_id="$(basename "$app")" mkdir -p "/var/www/html/custom_apps/$app_id" rsync -rlD --delete \ --include "/$app_id/" \ --exclude '/*' \ "$SOURCE_LOCATION/custom_apps/" \ /var/www/html/custom_apps/ done set +x fi # Copy these from Nextcloud archive if they don't exist yet (i.e. new install) for dir in config data custom_apps themes; do if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then rsync -rlD \ --include "/$dir/" \ --exclude '/*' \ "$SOURCE_LOCATION/" \ /var/www/html/ fi done rsync -rlD --delete \ --include '/config/' \ --exclude '/*' \ --exclude '/config/CAN_INSTALL' \ --exclude '/config/config.sample.php' \ --exclude '/config/config.php' \ "$SOURCE_LOCATION/" \ /var/www/html/ rsync -rlD \ --include '/version.php' \ --exclude '/*' \ "$SOURCE_LOCATION/" \ /var/www/html/ echo "Initializing finished" ################ # Fresh Install ################ if [ "$installed_version" = "0.0.0.0" ]; then echo "New Nextcloud instance." # Write output to logfile. mkdir -p /var/www/html/data exec > >(tee -i "/var/www/html/data/install.log") exec 2>&1 INSTALL_OPTIONS=(-n --admin-user "$ADMIN_USER" --admin-pass "$ADMIN_PASSWORD") if [ -n "${NEXTCLOUD_DATA_DIR}" ]; then INSTALL_OPTIONS+=(--data-dir "$NEXTCLOUD_DATA_DIR") fi # Skip the default permission check (we do our own) cat > /var/www/html/config/datadir.permission.config.php <<'EOF' false ); EOF echo "Installing with $DATABASE_TYPE database" # Set a default value for POSTGRES_PORT if [ -z "$POSTGRES_PORT" ]; then POSTGRES_PORT=5432 fi # Add database options to INSTALL_OPTIONS # shellcheck disable=SC2153 INSTALL_OPTIONS+=( --database "$DATABASE_TYPE" --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST" --database-port "$POSTGRES_PORT" ) echo "Starting Nextcloud installation..." if ! php /var/www/html/occ maintenance:install "${INSTALL_OPTIONS[@]}"; then echo "Installation of Nextcloud failed!" touch "$NEXTCLOUD_DATA_DIR/install.failed" exit 1 fi # Try to force generation of appdata dir: php /var/www/html/occ maintenance:repair if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then max_retries=10 try=0 while [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ] && [ "$try" -lt "$max_retries" ]; do echo "Waiting for appdata to become available..." try=$((try+1)) sleep 10s done if [ "$try" -ge "$max_retries" ]; then echo "Installation of Nextcloud failed!" echo "Installation errors: $(cat /var/www/html/data/nextcloud.log)" touch "$NEXTCLOUD_DATA_DIR/install.failed" exit 1 fi fi # This autoconfig is not needed anymore and should be able to be overwritten by the user rm /var/www/html/config/datadir.permission.config.php # unset admin password unset ADMIN_PASSWORD # Enable the updatenotification app but disable its UI and server update notifications php /var/www/html/occ config:system:set updatechecker --type=bool --value=false php /var/www/html/occ config:app:set updatenotification notify_groups --value="[]" # AIO update to latest start # Do not remove or change this line! if [ "$INSTALL_LATEST_MAJOR" = yes ]; then php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater" INSTALLED_AT="$(php /var/www/html/occ config:app:get core installedat)" if [ -n "${INSTALLED_AT}" ]; then # Set the installdat to 00 which will allow to skip staging and install the next major directly # shellcheck disable=SC2001 INSTALLED_AT="$(echo "${INSTALLED_AT}" | sed "s|[0-9][0-9]$|00|")" php /var/www/html/occ config:app:set core installedat --value="${INSTALLED_AT}" fi php /var/www/html/updater/updater.phar --no-interaction --no-backup if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then echo "Installation of Nextcloud failed!" touch "$NEXTCLOUD_DATA_DIR/install.failed" exit 1 fi # shellcheck disable=SC2016 installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" INSTALLED_MAJOR="${installed_version%%.*}" IMAGE_MAJOR="${image_version%%.*}" # If a valid upgrade path, trigger the Nextcloud built-in Updater if ! [ "$INSTALLED_MAJOR" -gt "$IMAGE_MAJOR" ]; then php /var/www/html/updater/updater.phar --no-interaction --no-backup if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then echo "Installation of Nextcloud failed!" # TODO: Add a hint here about what to do / where to look / updater.log? touch "$NEXTCLOUD_DATA_DIR/install.failed" exit 1 fi # shellcheck disable=SC2016 installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" fi php /var/www/html/occ config:system:set updatechecker --type=bool --value=true php /var/www/html/occ app:enable nextcloud-aio --force php /var/www/html/occ db:add-missing-columns php /var/www/html/occ db:add-missing-primary-keys yes | php /var/www/html/occ db:convert-filecache-bigint fi # AIO update to latest end # Do not remove or change this line! # Apply log settings echo "Applying default settings..." mkdir -p /var/www/html/data php /var/www/html/occ config:system:set loglevel --value="2" --type=integer php /var/www/html/occ config:system:set log_type --value="file" php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log" php /var/www/html/occ config:system:set log_rotate_size --value="10485760" --type=integer php /var/www/html/occ app:enable admin_audit php /var/www/html/occ config:app:set admin_audit logfile --value="/var/www/html/data/audit.log" php /var/www/html/occ config:system:set log.condition apps 0 --value="admin_audit" # Apply preview settings echo "Applying preview settings..." php /var/www/html/occ config:system:set preview_max_x --value="2048" --type=integer php /var/www/html/occ config:system:set preview_max_y --value="2048" --type=integer php /var/www/html/occ config:system:set jpeg_quality --value="60" --type=integer php /var/www/html/occ config:app:set preview jpeg_quality --value="60" php /var/www/html/occ config:system:delete enabledPreviewProviders php /var/www/html/occ config:system:set enabledPreviewProviders 1 --value="OC\\Preview\\Image" php /var/www/html/occ config:system:set enabledPreviewProviders 2 --value="OC\\Preview\\MarkDown" php /var/www/html/occ config:system:set enabledPreviewProviders 3 --value="OC\\Preview\\MP3" php /var/www/html/occ config:system:set enabledPreviewProviders 4 --value="OC\\Preview\\TXT" php /var/www/html/occ config:system:set enabledPreviewProviders 5 --value="OC\\Preview\\OpenDocument" php /var/www/html/occ config:system:set enabledPreviewProviders 6 --value="OC\\Preview\\Movie" php /var/www/html/occ config:system:set enabledPreviewProviders 7 --value="OC\\Preview\\Krita" php /var/www/html/occ config:system:set enable_previews --value=true --type=boolean # Apply other settings echo "Applying other settings..." # Add missing indices after new installation because they seem to be missing on new installation php /var/www/html/occ db:add-missing-indices php /var/www/html/occ config:system:set upgrade.disable-web --type=bool --value=true php /var/www/html/occ config:system:set mail_smtpmode --value="smtp" php /var/www/html/occ config:system:set trashbin_retention_obligation --value="auto, 30" php /var/www/html/occ config:system:set versions_retention_obligation --value="auto, 30" php /var/www/html/occ config:system:set activity_expire_days --value="30" --type=integer php /var/www/html/occ config:system:set simpleSignUpLink.shown --type=bool --value=false php /var/www/html/occ config:system:set share_folder --value="/Shared" # Install some apps by default if [ -n "$STARTUP_APPS" ]; then read -ra STARTUP_APPS_ARRAY <<< "$STARTUP_APPS" for app in "${STARTUP_APPS_ARRAY[@]}"; do if ! echo "$app" | grep -q '^-'; then if [ -z "$(find /var/www/html/apps /var/www/html/custom_apps -type d -maxdepth 1 -mindepth 1 -name "$app" )" ]; then # If not shipped, install and enable the app php /var/www/html/occ app:install "$app" else # If shipped, enable the app php /var/www/html/occ app:enable "$app" fi else app="${app#-}" # Disable the app if '-' was provided in front of the appid php /var/www/html/occ app:disable "$app" fi done fi #upgrade else touch "$NEXTCLOUD_DATA_DIR/update.failed" echo "Upgrading Nextcloud from $installed_version to $image_version..." php /var/www/html/occ config:system:delete integrity.check.disabled if ! php /var/www/html/occ upgrade || ! php /var/www/html/occ -V; then echo "Upgrade failed. Please restore from backup." bash /notify.sh "Nextcloud update to $image_version failed!" "Please restore from backup." exit 1 fi # shellcheck disable=SC2016 installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" rm "$NEXTCLOUD_DATA_DIR/update.failed" bash /notify.sh "Nextcloud update to $image_version successful!" "You may inspect the Nextcloud container logs for more information." php /var/www/html/occ app:update --all run_upgrade_if_needed_due_to_app_update # Restore app status if [ "${APPSTORAGE[0]}" != "no-export-done" ]; then echo "Restoring app statuses. This may take a while..." for app in "${!APPSTORAGE[@]}"; do if [ -n "${APPSTORAGE[$app]}" ]; then if [ "${APPSTORAGE[$app]}" != "no" ]; then echo "Enabling $app..." if ! php /var/www/html/occ app:enable "$app" >/dev/null; then php /var/www/html/occ app:disable "$app" >/dev/null if ! php /var/www/html/occ -V &>/dev/null; then rm -r "/var/www/html/custom_apps/$app" php /var/www/html/occ maintenance:mode --off fi run_upgrade_if_needed_due_to_app_update echo "The $app app could not be re-enabled, probably because it is not compatible with the new Nextcloud version." if [ "$app" = apporder ]; then CUSTOM_HINT="The apporder app was deprecated. A possible replacement is the side_menu app, aka 'Custom menu'." else CUSTOM_HINT="Most likely, it is not compatible with the new Nextcloud version." fi bash /notify.sh "Could not re-enable the $app app after the Nextcloud update!" "$CUSTOM_HINT Feel free to review the Nextcloud update logs and force-enable the app again if you wish." continue fi # Only restore the group settings, if the app was enabled (and is thus compatible with the new NC version) if [ "${APPSTORAGE[$app]}" != "yes" ]; then php /var/www/html/occ config:app:set "$app" enabled --value="${APPSTORAGE[$app]}" fi fi fi done fi php /var/www/html/occ app:update --all run_upgrade_if_needed_due_to_app_update # Enable the updatenotification app but disable its UI and server update notifications php /var/www/html/occ config:system:set updatechecker --type=bool --value=false php /var/www/html/occ app:enable updatenotification php /var/www/html/occ config:app:set updatenotification notify_groups --value="[]" # Apply optimization echo "Performing some optimizations..." if [ "$NEXTCLOUD_SKIP_DATABASE_OPTIMIZATION" != yes ]; then php /var/www/html/occ maintenance:repair --include-expensive php /var/www/html/occ db:add-missing-indices php /var/www/html/occ db:add-missing-columns php /var/www/html/occ db:add-missing-primary-keys yes | php /var/www/html/occ db:convert-filecache-bigint else php /var/www/html/occ maintenance:repair fi fi fi # Performing update of all apps if daily backups are enabled, running and successful and if it is saturday if [ "$UPDATE_NEXTCLOUD_APPS" = 'yes' ] && [ "$(date +%u)" = 6 ]; then UPDATED_APPS="$(php /var/www/html/occ app:update --all)" run_upgrade_if_needed_due_to_app_update if [ -n "$UPDATED_APPS" ]; then bash /notify.sh "Your apps just got updated!" "$UPDATED_APPS" fi fi else SKIP_UPDATE=1 fi run_upgrade_if_needed_due_to_app_update if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then # Check if appdata is present # If not, something broke (e.g. changing ncdatadir after aio was first started) if [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ]; then echo "Appdata is not present. Did you change the datadir after the initial Nextcloud installation? This is not supported!" echo "See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir" echo "If you moved the datadir to an external drive, make sure that the drive is still mounted." echo "The following was found in the datadir:" ls -la "$NEXTCLOUD_DATA_DIR/" exit 1 fi # Delete formerly configured tempdirectory as the default is usually faster (if the datadir is on a HDD or network FS) if [ "$(php /var/www/html/occ config:system:get tempdirectory)" = "$NEXTCLOUD_DATA_DIR/tmp/" ]; then php /var/www/html/occ config:system:delete tempdirectory if [ -d "$NEXTCLOUD_DATA_DIR/tmp/" ]; then rm -r "$NEXTCLOUD_DATA_DIR/tmp/" fi fi fi # Perform fingerprint update if instance was restored if [ -f "$NEXTCLOUD_DATA_DIR/fingerprint.update" ]; then php /var/www/html/occ maintenance:data-fingerprint rm "$NEXTCLOUD_DATA_DIR/fingerprint.update" fi # Perform preview scan if previews were excluded from restore if [ -f "$NEXTCLOUD_DATA_DIR/trigger-preview.scan" ]; then php /var/www/html/occ files:scan-app-data preview -vvv rm "$NEXTCLOUD_DATA_DIR/trigger-preview.scan" fi # AIO one-click settings start # Do not remove or change this line! # Apply one-click-instance settings echo "Applying one-click-instance settings..." php /var/www/html/occ config:system:set one-click-instance --value=true --type=bool php /var/www/html/occ config:system:set one-click-instance.user-limit --value=100 --type=int php /var/www/html/occ config:system:set one-click-instance.link --value="https://nextcloud.com/all-in-one/" # AIO one-click settings end # Do not remove or change this line! php /var/www/html/occ app:enable support if [ -n "$SUBSCRIPTION_KEY" ] && [ -z "$(php /var/www/html/occ config:app:get support potential_subscription_key)" ]; then php /var/www/html/occ config:app:set support potential_subscription_key --value="$SUBSCRIPTION_KEY" php /var/www/html/occ config:app:delete support last_check fi if [ -n "$NEXTCLOUD_DEFAULT_QUOTA" ]; then if [ "$NEXTCLOUD_DEFAULT_QUOTA" = "unlimited" ]; then php /var/www/html/occ config:app:delete files default_quota else php /var/www/html/occ config:app:set files default_quota --value="$NEXTCLOUD_DEFAULT_QUOTA" fi fi # Adjusting log files to be stored on a volume echo "Adjusting log files..." php /var/www/html/occ config:system:set upgrade.cli-upgrade-link --value="https://github.com/nextcloud/all-in-one/discussions/2726" php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log" php /var/www/html/occ config:app:set admin_audit logfile --value="/var/www/html/data/audit.log" php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater" if [ -n "$NEXTCLOUD_SKELETON_DIRECTORY" ]; then if [ "$NEXTCLOUD_SKELETON_DIRECTORY" = "empty" ]; then php /var/www/html/occ config:system:set skeletondirectory --value="" else php /var/www/html/occ config:system:set skeletondirectory --value="$NEXTCLOUD_SKELETON_DIRECTORY" fi fi if [ -n "$SERVERINFO_TOKEN" ] && [ -z "$(php /var/www/html/occ config:app:get serverinfo token)" ]; then php /var/www/html/occ config:app:set serverinfo token --value="$SERVERINFO_TOKEN" fi # Set maintenance window so that no warning is shown in the admin overview if [ -z "$NEXTCLOUD_MAINTENANCE_WINDOW" ]; then NEXTCLOUD_MAINTENANCE_WINDOW=100 fi php /var/www/html/occ config:system:set maintenance_window_start --type=int --value="$NEXTCLOUD_MAINTENANCE_WINDOW" # Apply network settings echo "Applying network settings..." php /var/www/html/occ config:system:set allow_local_remote_servers --type=bool --value=true php /var/www/html/occ config:system:set davstorage.request_timeout --value="$PHP_MAX_TIME" --type=int php /var/www/html/occ config:system:set trusted_domains 1 --value="$NC_DOMAIN" php /var/www/html/occ config:system:set overwrite.cli.url --value="https://$NC_DOMAIN/" php /var/www/html/occ config:system:set documentation_url.server_logs --value="https://github.com/nextcloud/all-in-one/discussions/5425" php /var/www/html/occ config:system:set htaccess.RewriteBase --value="/" php /var/www/html/occ maintenance:update:htaccess # Handle db persistent settings if [ "$NEXTCLOUD_PERSIST_DATABASE_CONNECTIONS" = "yes" ]; then php /var/www/html/occ config:system:set dbpersistent --value=true --type=bool else php /var/www/html/occ config:system:set dbpersistent --value=false --type=bool fi if [ "$DISABLE_BRUTEFORCE_PROTECTION" = yes ]; then php /var/www/html/occ config:system:set auth.bruteforce.protection.enabled --type=bool --value=false php /var/www/html/occ config:system:set ratelimit.protection.enabled --type=bool --value=false else php /var/www/html/occ config:system:set auth.bruteforce.protection.enabled --type=bool --value=true php /var/www/html/occ config:system:set ratelimit.protection.enabled --type=bool --value=true fi # Disallow creating local external storages when nothing was mounted if [ -z "$NEXTCLOUD_MOUNT" ]; then php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=false else php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=true fi # AIO app start # Do not remove or change this line! # AIO app if [ "$THIS_IS_AIO" = "true" ]; then if [ "$(php /var/www/html/occ config:app:get nextcloud-aio enabled)" != "yes" ]; then php /var/www/html/occ app:enable nextcloud-aio fi else if [ "$(php /var/www/html/occ config:app:get nextcloud-aio enabled)" != "no" ]; then php /var/www/html/occ app:disable nextcloud-aio fi fi # AIO app end # Do not remove or change this line! # Notify push if ! [ -d "/var/www/html/custom_apps/notify_push" ]; then php /var/www/html/occ app:install notify_push elif [ "$(php /var/www/html/occ config:app:get notify_push enabled)" != "yes" ]; then php /var/www/html/occ app:enable notify_push elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update notify_push fi chmod 775 -R /var/www/html/custom_apps/notify_push/bin/ php /var/www/html/occ config:system:set trusted_proxies 0 --value="127.0.0.1" php /var/www/html/occ config:system:set trusted_proxies 1 --value="::1" if [ -n "$ADDITIONAL_TRUSTED_PROXY" ]; then php /var/www/html/occ config:system:set trusted_proxies 2 --value="$ADDITIONAL_TRUSTED_PROXY" fi # Get ipv4-address of Nextcloud if [ -z "$NEXTCLOUD_HOST" ]; then export NEXTCLOUD_HOST="nextcloud-aio-nextcloud" fi IPv4_ADDRESS="$(dig "$NEXTCLOUD_HOST" A +short +search | head -1)" # Bring it in CIDR notation # shellcheck disable=SC2001 IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|0/16|')" if [ -n "$IPv4_ADDRESS" ]; then php /var/www/html/occ config:system:set trusted_proxies 10 --value="$IPv4_ADDRESS" fi if [ -n "$ADDITIONAL_TRUSTED_DOMAIN" ]; then php /var/www/html/occ config:system:set trusted_domains 2 --value="$ADDITIONAL_TRUSTED_DOMAIN" fi php /var/www/html/occ config:app:set notify_push base_endpoint --value="https://$NC_DOMAIN/push" # Collabora if [ "$COLLABORA_ENABLED" = 'yes' ]; then set -x if echo "$COLLABORA_HOST" | grep -q "nextcloud-.*-collabora"; then COLLABORA_HOST="$NC_DOMAIN" fi set +x # Remove richdcoumentscode if it should be incorrectly installed if [ -d "/var/www/html/custom_apps/richdocumentscode" ]; then php /var/www/html/occ app:remove richdocumentscode fi if ! [ -d "/var/www/html/custom_apps/richdocuments" ]; then php /var/www/html/occ app:install richdocuments elif [ "$(php /var/www/html/occ config:app:get richdocuments enabled)" != "yes" ]; then php /var/www/html/occ app:enable richdocuments elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update richdocuments fi php /var/www/html/occ config:app:set richdocuments wopi_url --value="https://$COLLABORA_HOST/" # Make collabora more save COLLABORA_IPv4_ADDRESS="$(dig "$COLLABORA_HOST" A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" COLLABORA_IPv6_ADDRESS="$(dig "$COLLABORA_HOST" AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" COLLABORA_ALLOW_LIST="$(php /var/www/html/occ config:app:get richdocuments wopi_allowlist)" if [ -n "$COLLABORA_IPv4_ADDRESS" ]; then if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$COLLABORA_IPv4_ADDRESS"; then if [ -z "$COLLABORA_ALLOW_LIST" ]; then COLLABORA_ALLOW_LIST="$COLLABORA_IPv4_ADDRESS" else COLLABORA_ALLOW_LIST+=",$COLLABORA_IPv4_ADDRESS" fi fi else echo "Warning: No IPv4 address found for $COLLABORA_HOST." fi if [ -n "$COLLABORA_IPv6_ADDRESS" ]; then if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$COLLABORA_IPv6_ADDRESS"; then if [ -z "$COLLABORA_ALLOW_LIST" ]; then COLLABORA_ALLOW_LIST="$COLLABORA_IPv6_ADDRESS" else COLLABORA_ALLOW_LIST+=",$COLLABORA_IPv6_ADDRESS" fi fi else echo "No IPv6 address found for $COLLABORA_HOST." fi if [ -n "$COLLABORA_ALLOW_LIST" ]; then PRIVATE_IP_RANGES='127.0.0.0/8,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8,100.64.0.0/10,fd00::/8,::1/128' if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$PRIVATE_IP_RANGES"; then COLLABORA_ALLOW_LIST+=",$PRIVATE_IP_RANGES" fi if [ -n "$ADDITIONAL_TRUSTED_PROXY" ]; then if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$ADDITIONAL_TRUSTED_PROXY"; then COLLABORA_ALLOW_LIST+=",$ADDITIONAL_TRUSTED_PROXY" fi fi php /var/www/html/occ config:app:set richdocuments wopi_allowlist --value="$COLLABORA_ALLOW_LIST" else echo "Warning: wopi_allowlist is empty; this should not be the case!" fi else if [ "$REMOVE_DISABLED_APPS" = yes ] && [ -d "/var/www/html/custom_apps/richdocuments" ]; then php /var/www/html/occ app:remove richdocuments fi fi # OnlyOffice if [ "$ONLYOFFICE_ENABLED" = 'yes' ]; then # Determine OnlyOffice port based on host pattern if echo "$ONLYOFFICE_HOST" | grep -q "nextcloud-.*-onlyoffice"; then ONLYOFFICE_PORT=80 else ONLYOFFICE_PORT=443 fi count=0 while ! nc -z "$ONLYOFFICE_HOST" "$ONLYOFFICE_PORT" && [ "$count" -lt 90 ]; do echo "Waiting for OnlyOffice to become available..." count=$((count+5)) sleep 5 done if [ "$count" -ge 90 ]; then bash /notify.sh "Onlyoffice did not start in time!" "Skipping initialization and disabling onlyoffice app." php /var/www/html/occ app:disable onlyoffice else # Install or enable OnlyOffice app as needed if ! [ -d "/var/www/html/custom_apps/onlyoffice" ]; then php /var/www/html/occ app:install onlyoffice elif [ "$(php /var/www/html/occ config:app:get onlyoffice enabled)" != "yes" ]; then php /var/www/html/occ app:enable onlyoffice elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update onlyoffice fi # Set OnlyOffice configuration php /var/www/html/occ config:system:set onlyoffice editors_check_interval --value="0" --type=integer php /var/www/html/occ config:system:set onlyoffice jwt_secret --value="$ONLYOFFICE_SECRET" php /var/www/html/occ config:app:set onlyoffice jwt_secret --value="$ONLYOFFICE_SECRET" php /var/www/html/occ config:system:set onlyoffice jwt_header --value="AuthorizationJwt" # Adjust the OnlyOffice host if using internal pattern if echo "$ONLYOFFICE_HOST" | grep -q "nextcloud-.*-onlyoffice"; then ONLYOFFICE_HOST="$NC_DOMAIN/onlyoffice" export ONLYOFFICE_HOST fi php /var/www/html/occ config:app:set onlyoffice DocumentServerUrl --value="https://$ONLYOFFICE_HOST" fi else # Remove OnlyOffice app if disabled and removal is requested if [ "$REMOVE_DISABLED_APPS" = yes ] && \ [ -d "/var/www/html/custom_apps/onlyoffice" ] && \ [ -n "$ONLYOFFICE_SECRET" ] && \ [ "$(php /var/www/html/occ config:system:get onlyoffice jwt_secret)" = "$ONLYOFFICE_SECRET" ]; then php /var/www/html/occ app:remove onlyoffice fi fi # Talk if [ "$TALK_ENABLED" = 'yes' ]; then set -x if [ -z "$TALK_HOST" ] || echo "$TALK_HOST" | grep -q "nextcloud-.*-talk"; then TALK_HOST="$NC_DOMAIN" HPB_PATH="/standalone-signaling/" fi if [ -z "$TURN_DOMAIN" ]; then TURN_DOMAIN="$TALK_HOST" fi set +x if ! [ -d "/var/www/html/custom_apps/spreed" ]; then php /var/www/html/occ app:install spreed elif [ "$(php /var/www/html/occ config:app:get spreed enabled)" != "yes" ]; then php /var/www/html/occ app:enable spreed elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update spreed fi # Based on https://github.com/nextcloud/spreed/issues/960#issuecomment-416993435 if [ -z "$(php /var/www/html/occ talk:turn:list --output="plain")" ]; then # shellcheck disable=SC2153 php /var/www/html/occ talk:turn:add turn "$TURN_DOMAIN:$TALK_PORT" "udp,tcp" --secret="$TURN_SECRET" fi STUN_SERVER="$(php /var/www/html/occ talk:stun:list --output="plain")" if [ -z "$STUN_SERVER" ] || echo "$STUN_SERVER" | grep -oP '[a-zA-Z.:0-9]+' | grep -q "^stun.nextcloud.com:443$"; then php /var/www/html/occ talk:stun:add "$TURN_DOMAIN:$TALK_PORT" php /var/www/html/occ talk:stun:delete "stun.nextcloud.com:443" fi if ! php /var/www/html/occ talk:signaling:list --output="plain" | grep -q "https://$TALK_HOST$HPB_PATH"; then php /var/www/html/occ talk:signaling:add "https://$TALK_HOST$HPB_PATH" "$SIGNALING_SECRET" --verify fi else if [ "$REMOVE_DISABLED_APPS" = yes ] && [ -d "/var/www/html/custom_apps/spreed" ]; then php /var/www/html/occ app:remove spreed fi fi # Talk recording if [ -d "/var/www/html/custom_apps/spreed" ]; then if [ "$TALK_RECORDING_ENABLED" = 'yes' ]; then while ! nc -z "$TALK_RECORDING_HOST" 1234; do echo "Waiting for Talk Recording to become available..." sleep 5 done # TODO: migrate to occ command if that becomes available RECORDING_SERVERS_STRING="{\"servers\":[{\"server\":\"http://$TALK_RECORDING_HOST:1234/\",\"verify\":true}],\"secret\":\"$RECORDING_SECRET\"}" php /var/www/html/occ config:app:set spreed recording_servers --value="$RECORDING_SERVERS_STRING" else if [ "$REMOVE_DISABLED_APPS" = yes ]; then php /var/www/html/occ config:app:delete spreed recording_servers fi fi fi # Clamav if [ "$CLAMAV_ENABLED" = 'yes' ]; then count=0 while ! nc -z "$CLAMAV_HOST" 3310 && [ "$count" -lt 90 ]; do echo "Waiting for ClamAV to become available..." count=$((count+5)) sleep 5 done if [ "$count" -ge 90 ]; then bash /notify.sh "ClamAV did not start in time!" "Skipping initialization and disabling files_antivirus app." php /var/www/html/occ app:disable files_antivirus else if ! [ -d "/var/www/html/custom_apps/files_antivirus" ]; then php /var/www/html/occ app:install files_antivirus elif [ "$(php /var/www/html/occ config:app:get files_antivirus enabled)" != "yes" ]; then php /var/www/html/occ app:enable files_antivirus elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update files_antivirus fi php /var/www/html/occ config:app:set files_antivirus av_mode --value="daemon" php /var/www/html/occ config:app:set files_antivirus av_port --value="3310" php /var/www/html/occ config:app:set files_antivirus av_host --value="$CLAMAV_HOST" # av_stream_max_length must be synced with StreamMaxLength inside clamav php /var/www/html/occ config:app:set files_antivirus av_stream_max_length --value="2147483648" php /var/www/html/occ config:app:set files_antivirus av_max_file_size --value="-1" php /var/www/html/occ config:app:set files_antivirus av_infected_action --value="only_log" if [ -n "$CLAMAV_BLOCKLISTED_DIRECTORIES" ]; then php /var/www/html/occ config:app:set files_antivirus av_blocklisted_directories --value="$CLAMAV_BLOCKLISTED_DIRECTORIES" fi fi else if [ "$REMOVE_DISABLED_APPS" = yes ] && [ -d "/var/www/html/custom_apps/files_antivirus" ]; then php /var/www/html/occ app:remove files_antivirus fi fi # Imaginary if [ "$IMAGINARY_ENABLED" = 'yes' ]; then php /var/www/html/occ config:system:set enabledPreviewProviders 0 --value="OC\\Preview\\Imaginary" php /var/www/html/occ config:system:set enabledPreviewProviders 23 --value="OC\\Preview\\ImaginaryPDF" php /var/www/html/occ config:system:set preview_imaginary_url --value="http://$IMAGINARY_HOST:9000" php /var/www/html/occ config:system:set preview_imaginary_key --value="$IMAGINARY_SECRET" else if [ -n "$(php /var/www/html/occ config:system:get preview_imaginary_url)" ]; then php /var/www/html/occ config:system:delete enabledPreviewProviders 0 php /var/www/html/occ config:system:delete preview_imaginary_url php /var/www/html/occ config:system:delete enabledPreviewProviders 20 php /var/www/html/occ config:system:delete enabledPreviewProviders 21 php /var/www/html/occ config:system:delete enabledPreviewProviders 22 php /var/www/html/occ config:system:delete enabledPreviewProviders 23 fi fi # Fulltextsearch if [ "$FULLTEXTSEARCH_ENABLED" = 'yes' ]; then count=0 while ! nc -z "$FULLTEXTSEARCH_HOST" "$FULLTEXTSEARCH_PORT" && [ "$count" -lt 90 ]; do echo "Waiting for Fulltextsearch to become available..." count=$((count+5)) sleep 5 done if [ "$count" -ge 90 ]; then echo "Fulltextsearch did not start in time. Skipping initialization and disabling fulltextsearch apps." php /var/www/html/occ app:disable fulltextsearch php /var/www/html/occ app:disable fulltextsearch_elasticsearch php /var/www/html/occ app:disable files_fulltextsearch else if [ -z "$FULLTEXTSEARCH_PROTOCOL" ]; then FULLTEXTSEARCH_PROTOCOL="http" fi if ! [ -d "/var/www/html/custom_apps/fulltextsearch" ]; then php /var/www/html/occ app:install fulltextsearch elif [ "$(php /var/www/html/occ config:app:get fulltextsearch enabled)" != "yes" ]; then php /var/www/html/occ app:enable fulltextsearch elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update fulltextsearch fi if ! [ -d "/var/www/html/custom_apps/fulltextsearch_elasticsearch" ]; then php /var/www/html/occ app:install fulltextsearch_elasticsearch elif [ "$(php /var/www/html/occ config:app:get fulltextsearch_elasticsearch enabled)" != "yes" ]; then php /var/www/html/occ app:enable fulltextsearch_elasticsearch elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update fulltextsearch_elasticsearch fi if ! [ -d "/var/www/html/custom_apps/files_fulltextsearch" ]; then php /var/www/html/occ app:install files_fulltextsearch elif [ "$(php /var/www/html/occ config:app:get files_fulltextsearch enabled)" != "yes" ]; then php /var/www/html/occ app:enable files_fulltextsearch elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update files_fulltextsearch fi php /var/www/html/occ fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform"}' php /var/www/html/occ fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"$FULLTEXTSEARCH_PROTOCOL://$FULLTEXTSEARCH_USER:$FULLTEXTSEARCH_PASSWORD@$FULLTEXTSEARCH_HOST:$FULLTEXTSEARCH_PORT\",\"elastic_index\":\"$FULLTEXTSEARCH_INDEX\"}" php /var/www/html/occ files_fulltextsearch:configure "{\"files_pdf\":true,\"files_office\":true}" # Do the index if ! [ -f "$NEXTCLOUD_DATA_DIR/fts-index.done" ]; then echo "Waiting 10 seconds before activating fulltextsearch..." sleep 10 echo "Activating fulltextsearch..." if php /var/www/html/occ fulltextsearch:test && php /var/www/html/occ fulltextsearch:index "{\"errors\": \"reset\"}" --no-readline; then touch "$NEXTCLOUD_DATA_DIR/fts-index.done" else echo "Fulltextsearch failed. Could not index." echo "If you want to skip indexing in the future, see https://github.com/nextcloud/all-in-one/discussions/1709" fi fi fi else if [ "$REMOVE_DISABLED_APPS" = yes ]; then if [ -d "/var/www/html/custom_apps/fulltextsearch" ]; then php /var/www/html/occ app:remove fulltextsearch fi if [ -d "/var/www/html/custom_apps/fulltextsearch_elasticsearch" ]; then php /var/www/html/occ app:remove fulltextsearch_elasticsearch fi if [ -d "/var/www/html/custom_apps/files_fulltextsearch" ]; then php /var/www/html/occ app:remove files_fulltextsearch fi fi fi # Docker socket proxy / HaRP # app_api is a shipped app if [ -d "/var/www/html/custom_apps/app_api" ]; then php /var/www/html/occ app:disable app_api rm -r "/var/www/html/custom_apps/app_api" fi if [ "$DOCKER_SOCKET_PROXY_ENABLED" = 'yes' ] || [ "$HARP_ENABLED" = 'yes' ]; then if [ "$(php /var/www/html/occ config:app:get app_api enabled)" != "yes" ]; then php /var/www/html/occ app:enable app_api fi else if [ "$REMOVE_DISABLED_APPS" = yes ]; then if [ "$(php /var/www/html/occ config:app:get app_api enabled)" != "no" ]; then php /var/www/html/occ app:disable app_api fi fi fi # Whiteboard app if [ "$WHITEBOARD_ENABLED" = 'yes' ]; then if ! [ -d "/var/www/html/custom_apps/whiteboard" ]; then php /var/www/html/occ app:install whiteboard elif [ "$(php /var/www/html/occ config:app:get whiteboard enabled)" != "yes" ]; then php /var/www/html/occ app:enable whiteboard elif [ "$SKIP_UPDATE" != 1 ]; then php /var/www/html/occ app:update whiteboard fi php /var/www/html/occ config:app:set whiteboard collabBackendUrl --value="https://$NC_DOMAIN/whiteboard" php /var/www/html/occ config:app:set whiteboard jwt_secret_key --value="$WHITEBOARD_SECRET" else if [ "$REMOVE_DISABLED_APPS" = yes ] && [ -d "/var/www/html/custom_apps/whiteboard" ]; then php /var/www/html/occ app:remove whiteboard fi fi # Remove the update skip file always rm -f "$NEXTCLOUD_DATA_DIR"/skip.update ================================================ FILE: Containers/nextcloud/healthcheck.sh ================================================ #!/bin/bash # Set a default value for POSTGRES_PORT if [ -z "$POSTGRES_PORT" ]; then POSTGRES_PORT=5432 fi # POSTGRES_HOST must be set in the containers env vars and POSTGRES_PORT has a default above # shellcheck disable=SC2153 nc -z "$POSTGRES_HOST" "$POSTGRES_PORT" || exit 0 if ! nc -z 127.0.0.1 9000; then exit 1 fi ================================================ FILE: Containers/nextcloud/notify-all.sh ================================================ #!/bin/bash if [[ "$EUID" = 0 ]]; then COMMAND=(sudo -E -u www-data php /var/www/html/occ) else COMMAND=(php /var/www/html/occ) fi SUBJECT="$1" MESSAGE="$2" if [ "$("${COMMAND[@]}" config:app:get notifications enabled)" = "no" ]; then echo "Cannot send notification as notification app is not enabled." exit 1 fi echo "Posting notifications to all users..." NC_USERS=$("${COMMAND[@]}" user:list | sed 's|^ - ||g' | sed 's|:.*||') mapfile -t NC_USERS <<< "$NC_USERS" for user in "${NC_USERS[@]}" do echo "Posting '$SUBJECT' to: $user" "${COMMAND[@]}" notification:generate "$user" "$NC_DOMAIN: $SUBJECT" -l "$MESSAGE" --object-type='update' --object-id="$SUBJECT" done echo "Done!" exit 0 ================================================ FILE: Containers/nextcloud/notify.sh ================================================ #!/bin/bash if [[ "$EUID" = 0 ]]; then COMMAND=(sudo -E -u www-data php /var/www/html/occ) else COMMAND=(php /var/www/html/occ) fi SUBJECT="$1" MESSAGE="$2" if [ "$("${COMMAND[@]}" config:app:get notifications enabled)" = "no" ]; then echo "Cannot send notification as notification app is not enabled." exit 1 fi echo "Posting notifications to users that are admins..." NC_USERS=$("${COMMAND[@]}" user:list | sed 's|^ - ||g' | sed 's|:.*||') mapfile -t NC_USERS <<< "$NC_USERS" for user in "${NC_USERS[@]}" do if "${COMMAND[@]}" user:info "$user" | cut -d "-" -f2 | grep -x -q " admin" then NC_ADMIN_USER+=("$user") fi done for admin in "${NC_ADMIN_USER[@]}" do echo "Posting '$SUBJECT' to: $admin" "${COMMAND[@]}" notification:generate "$admin" "$NC_DOMAIN: $SUBJECT" -l "$MESSAGE" --object-type='update' --object-id="$SUBJECT" done echo "Done!" exit 0 ================================================ FILE: Containers/nextcloud/root.motd ================================================ Warning: You have logged in into the Nextcloud container as root user. See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands if you want to run occ commands. Apart from that, you can use 'sudo -E -u www-data php occ ' in order to run occ commands. Of course needs to be substituted with the command that you want to use. ================================================ FILE: Containers/nextcloud/run-exec-commands.sh ================================================ #!/bin/bash # Wait until the apache container is ready while ! nc -z "$APACHE_HOST" "$APACHE_PORT"; do echo "Waiting for $APACHE_HOST to become available..." sleep 15 done if [ -n "$NEXTCLOUD_EXEC_COMMANDS" ]; then echo "#!/bin/bash" > /tmp/nextcloud-exec-commands echo "$NEXTCLOUD_EXEC_COMMANDS" >> /tmp/nextcloud-exec-commands if ! grep "one-click-instance" /tmp/nextcloud-exec-commands; then bash /tmp/nextcloud-exec-commands rm /tmp/nextcloud-exec-commands fi else # Collabora must work also if using manual-install if [ "$COLLABORA_ENABLED" = yes ]; then echo "Activating Collabora config..." php /var/www/html/occ richdocuments:activate-config fi fi signal_handler() { exit 0 } trap signal_handler SIGINT SIGTERM sleep inf & wait $! ================================================ FILE: Containers/nextcloud/start.sh ================================================ #!/bin/bash # Set a default value for POSTGRES_PORT if [ -z "$POSTGRES_PORT" ]; then POSTGRES_PORT=5432 fi # Only start container if database is accessible # POSTGRES_HOST must be set in the containers env vars and POSTGRES_PORT has a default above # shellcheck disable=SC2153 while ! sudo -E -u www-data nc -z "$POSTGRES_HOST" "$POSTGRES_PORT"; do echo "Waiting for database to start..." sleep 5 done # Use the correct Postgres username POSTGRES_USER="oc_$POSTGRES_USER" export POSTGRES_USER # Check that db type is not empty if [ -z "$DATABASE_TYPE" ]; then export DATABASE_TYPE=postgres fi # Fix false database connection on old instances if [ -f "/var/www/html/config/config.php" ]; then sleep 2 while ! sudo -E -u www-data psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB" -c "select now()"; do echo "Waiting for the database to start..." sleep 5 done if [ "$POSTGRES_USER" = "oc_nextcloud" ] && [ "$POSTGRES_DB" = "nextcloud_database" ] && echo "$POSTGRES_PASSWORD" | grep -q '^[a-z0-9]\+$'; then # This was introduced with https://github.com/nextcloud/all-in-one/pull/218 sed -i "s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|" /var/www/html/config/config.php sed -i "s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|" /var/www/html/config/config.php sed -i "s|'db_name'.*=>.*$|'db_name' => '$POSTGRES_DB',|" /var/www/html/config/config.php fi fi # Trust additional Cacerts, if the user provided $TRUSTED_CACERTS_DIR if [ -n "$TRUSTED_CACERTS_DIR" ]; then echo "User required to trust additional CA certificates, running 'update-ca-certificates.'" update-ca-certificates fi # Check if /dev/dri device is present and apply correct permissions set -x if ! [ -f "/dev-dri-group-was-added" ] && [ -n "$(find /dev -maxdepth 1 -mindepth 1 -name dri)" ] && [ -n "$(find /dev/dri -maxdepth 1 -mindepth 1 -name renderD128)" ]; then # From https://memories.gallery/hw-transcoding/#docker-installations GID="$(stat -c "%g" /dev/dri/renderD128)" groupadd -g "$GID" render2 || true # sometimes this is needed GROUP="$(getent group "$GID" | cut -d: -f1)" usermod -aG "$GROUP" www-data touch "/dev-dri-group-was-added" fi set +x # Check datadir permissions sudo -E -u www-data touch "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" &>/dev/null if ! [ -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" ]; then chown -R www-data:root "$NEXTCLOUD_DATA_DIR" chmod 750 -R "$NEXTCLOUD_DATA_DIR" fi sudo -E -u www-data rm -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" # Install additional dependencies if [ -n "$ADDITIONAL_APKS" ]; then if ! [ -f "/additional-apks-are-installed" ]; then # Allow to disable imagemagick without having to download it each time if ! echo "$ADDITIONAL_APKS" | grep -q imagemagick; then apk del imagemagick imagemagick-svg imagemagick-heic imagemagick-tiff; fi read -ra ADDITIONAL_APKS_ARRAY <<< "$ADDITIONAL_APKS" for app in "${ADDITIONAL_APKS_ARRAY[@]}"; do if [ "$app" != imagemagick ]; then echo "Installing $app via apk..." if ! apk add --no-cache "$app" >/dev/null; then echo "The packet $app was not installed!" fi fi done fi touch /additional-apks-are-installed fi # Install additional php extensions if [ -n "$ADDITIONAL_PHP_EXTENSIONS" ]; then if ! [ -f "/additional-php-extensions-are-installed" ]; then # Allow to disable imagick without having to enable it each time if ! echo "$ADDITIONAL_PHP_EXTENSIONS" | grep -q imagick; then # Remove the ini file as there is no docker-php-ext-disable script available rm /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini fi read -ra ADDITIONAL_PHP_EXTENSIONS_ARRAY <<< "$ADDITIONAL_PHP_EXTENSIONS" for app in "${ADDITIONAL_PHP_EXTENSIONS_ARRAY[@]}"; do if [ "$app" = imagick ]; then # imagick is already enabled by default, so does not need to be enabled anymore. continue fi # shellcheck disable=SC2086 if [ "$PHP_DEPS_ARE_INSTALLED" != 1 ]; then echo "Installing PHP build dependencies..." if ! apk add --no-cache --virtual .build-deps \ libxml2-dev \ autoconf \ $PHPIZE_DEPS >/dev/null; then echo "Could not install build-deps!" fi PHP_DEPS_ARE_INSTALLED=1 fi if [ "$app" = inotify ]; then echo "Installing $app via PECL..." pecl install "$app" >/dev/null if ! docker-php-ext-enable "$app" >/dev/null; then echo "Could not install PHP extension $app!" fi elif [ "$app" = soap ]; then echo "Installing $app from core..." if ! docker-php-ext-install -j "$(nproc)" "$app" >/dev/null; then echo "Could not install PHP extension $app!" fi else echo "Installing PHP extension $app ..." if ! docker-php-ext-install -j "$(nproc)" "$app" >/dev/null; then echo "Could not install $app from core. Trying to install from PECL..." pecl install "$app" >/dev/null if ! docker-php-ext-enable "$app" >/dev/null; then echo "Could also not install $app from PECL. The PHP extensions was not installed!" fi fi fi done if [ "$PHP_DEPS_ARE_INSTALLED" = 1 ]; then rm -rf /tmp/pear runDeps="$( \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ | tr ',' '\n' \ | sort -u \ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ )"; # shellcheck disable=SC2086 apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps >/dev/null apk del .build-deps >/dev/null fi fi touch /additional-php-extensions-are-installed fi # Run original entrypoint if ! sudo -E -u www-data bash /entrypoint.sh; then exit 1 fi while [ "$THIS_IS_AIO" = "true" ] && [ -z "$(dig nextcloud-aio-apache A +short +search)" ]; do echo "Waiting for nextcloud-aio-apache to start..." sleep 5 done set -x # shellcheck disable=SC2235 if [ "$THIS_IS_AIO" = "true" ] && [ "$APACHE_PORT" = 443 ]; then IPv4_ADDRESS_APACHE="$(dig nextcloud-aio-apache A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" IPv6_ADDRESS_APACHE="$(dig nextcloud-aio-apache AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" IPv4_ADDRESS_MASTERCONTAINER="$(dig nextcloud-aio-mastercontainer A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" IPv6_ADDRESS_MASTERCONTAINER="$(dig nextcloud-aio-mastercontainer AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" sed -i "s|^;listen.allowed_clients|listen.allowed_clients|" /usr/local/etc/php-fpm.d/www.conf sed -i "s|listen.allowed_clients.*|listen.allowed_clients = 127.0.0.1,::1,$IPv4_ADDRESS_APACHE,$IPv6_ADDRESS_APACHE,$IPv4_ADDRESS_MASTERCONTAINER,$IPv6_ADDRESS_MASTERCONTAINER|" /usr/local/etc/php-fpm.d/www.conf sed -i "/^listen.allowed_clients/s/,,/,/g" /usr/local/etc/php-fpm.d/www.conf sed -i "/^listen.allowed_clients/s/,$//" /usr/local/etc/php-fpm.d/www.conf grep listen.allowed_clients /usr/local/etc/php-fpm.d/www.conf fi set +x exec "$@" ================================================ FILE: Containers/nextcloud/supervisord.conf ================================================ # From https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/fpm/supervisord.conf [supervisord] nodaemon=true logfile=/var/log/supervisord/supervisord.log pidfile=/var/run/supervisord/supervisord.pid childlogdir=/var/log/supervisord/ logfile_maxbytes=50MB ; maximum size of logfile before rotation logfile_backups=10 ; number of backed up logfiles loglevel=error user=root [program:php-fpm] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=php-fpm user=root [program:cron] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/cron.sh user=www-data [program:run-exec-commands] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=/run-exec-commands.sh user=www-data # This is a hack but no better solution is there [program:is-nextcloud-online] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 # Restart the netcat command once a day to ensure that it stays reachable # See https://github.com/nextcloud/all-in-one/issues/6334 command=timeout 86400 nc -lk 9001 user=www-data ================================================ FILE: Containers/nextcloud/upgrade.exclude ================================================ /config/ /data/ /custom_apps/ /themes/ /version.php /lost+found ================================================ FILE: Containers/notify-push/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM alpine:3.23.3 COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ ca-certificates \ netcat-openbsd \ tzdata \ bash \ openssl; \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ apk del --no-cache \ openssl; USER 33 ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/notify-push/healthcheck.sh ================================================ #!/bin/bash if ! nc -z "$NEXTCLOUD_HOST" 9001; then exit 0 fi nc -z 127.0.0.1 7867 || exit 1 ================================================ FILE: Containers/notify-push/start.sh ================================================ #!/bin/bash if [ -z "$NEXTCLOUD_HOST" ]; then echo "NEXTCLOUD_HOST needs to be provided. Exiting!" exit 1 fi # Only start container if nextcloud is accessible while ! nc -z "$NEXTCLOUD_HOST" 9001; do echo "Waiting for Nextcloud to start..." sleep 5 done # Correctly set CPU_ARCH for notify_push CPU_ARCH="$(uname -m)" export CPU_ARCH if [ -z "$CPU_ARCH" ]; then echo "Could not get processor architecture. Exiting." exit 1 elif [ "$CPU_ARCH" != "x86_64" ]; then export CPU_ARCH="aarch64" fi # Add warning if ! [ -f /var/www/html/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push ]; then echo "The notify_push binary was not found." echo "Most likely is DNS resolution not working correctly." echo "You can try to fix this by configuring a DNS server globally in dockers daemon.json." echo "See https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html" echo "Afterwards a restart of docker should automatically resolve this." echo "Additionally, make sure to disable VPN software that might be running on your server" echo "Also check your firewall if it blocks connections to github" echo "If it should still not work afterwards, feel free to create a new thread at https://github.com/nextcloud/all-in-one/discussions/new?category=questions and post the Nextcloud container logs there." echo "" echo "" exit 1 fi echo "notify-push was started" # Run it /var/www/html/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push \ --port 7867 \ /var/www/html/config/config.php exec "$@" ================================================ FILE: Containers/onlyoffice/Dockerfile ================================================ # syntax=docker/dockerfile:latest # From https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/Dockerfile FROM onlyoffice/documentserver:9.3.1.2 # USER root is probably used COPY --chmod=775 healthcheck.sh /healthcheck.sh HEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/onlyoffice/healthcheck.sh ================================================ #!/bin/bash nc -z 127.0.0.1 80 || exit 1 ================================================ FILE: Containers/postgresql/Dockerfile ================================================ # syntax=docker/dockerfile:latest # From https://github.com/docker-library/postgres/blob/master/17/alpine3.23/Dockerfile FROM postgres:17.9-alpine COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh COPY --chmod=775 init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ bash \ openssl \ shadow \ grep; \ \ # We need to use the same gid and uid as on old installations deluser postgres; \ groupmod -g 9999 ping; \ addgroup -g 999 -S postgres; \ adduser -u 999 -S -D -G postgres -H -h /var/lib/postgresql -s /bin/sh postgres; \ apk del --no-cache shadow; \ \ # Fix default permissions chown -R postgres:postgres /var/lib/postgresql; \ chown -R postgres:postgres /var/run/postgresql; \ chmod -R 777 /var/run/postgresql; \ chown -R postgres:postgres "$PGDATA"; \ \ mkdir /mnt/data; \ chown postgres:postgres /mnt/data; \ \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ apk --no-cache del openssl; \ \ # Get rid of unused binaries rm -f /usr/local/bin/gosu /usr/local/bin/su-exec; VOLUME /mnt/data USER 999 ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/postgresql/healthcheck.sh ================================================ #!/bin/bash test -f "/mnt/data/backup-is-running" && exit 0 psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB" -c "select now()" && exit 0 psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:5432/$POSTGRES_DB" -c "select now()" || exit 1 ================================================ FILE: Containers/postgresql/init-user-db.sh ================================================ #!/bin/bash set -ex touch "$DUMP_DIR/initialization.failed" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB; ALTER DATABASE "$POSTGRES_DB" OWNER TO "oc_$POSTGRES_USER"; GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER"; GRANT ALL PRIVILEGES ON SCHEMA public TO "oc_$POSTGRES_USER"; EOSQL rm "$DUMP_DIR/initialization.failed" set +ex ================================================ FILE: Containers/postgresql/start.sh ================================================ #!/bin/bash # Variables DATADIR="/var/lib/postgresql/data" export DUMP_DIR="/mnt/data" DUMP_FILE="$DUMP_DIR/database-dump.sql" export PGPASSWORD="$POSTGRES_PASSWORD" # Don't start database as long as backup is running while [ -f "$DUMP_DIR/backup-is-running" ]; do echo "Waiting for backup container to finish..." echo "If this is incorrect because the backup container is not running anymore (because it was forcefully killed), you might delete the lock file:" echo "sudo docker exec --user root nextcloud-aio-database rm /mnt/data/backup-is-running" sleep 10 done # Check if dump dir is writeable if ! [ -w "$DUMP_DIR" ]; then echo "DUMP dir is not writeable by postgres user." exit 1 fi # Don't start if import failed if [ -f "$DUMP_DIR/import.failed" ]; then echo "The database import failed. Please restore a backup and try again." echo "For further clues on what went wrong, look at the logs above." exit 1 fi # Don't start if initialization failed if [ -f "$DUMP_DIR/initialization.failed" ]; then echo "The database initialization failed. Most likely was a wrong timezone selected." echo "The selected timezone is '$TZ'." echo "Please check if it is in the 'TZ identifier' column of the timezone list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List" echo "For further clues on what went wrong, look at the logs above." echo "You might start again from scratch by following https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance and selecting a proper timezone." exit 1 fi # Delete the datadir once (needed for setting the correct credentials on old instances once) if ! [ -f "$DUMP_DIR/export.failed" ] && ! [ -f "$DUMP_DIR/initial-cleanup-done" ]; then set -ex rm -rf "${DATADIR:?}/"* touch "$DUMP_DIR/initial-cleanup-done" set +ex fi # Test if some things match # shellcheck disable=SC2235 if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSION")" ] ) \ || ( ! [ -f "$DATADIR/PG_VERSION" ] && ( [ -f "$DUMP_FILE" ] || [ -f "$DUMP_DIR/export.failed" ] ) ); then # The DUMP_file must be provided if ! [ -f "$DUMP_FILE" ]; then echo "Unable to restore the database because the database dump is missing." exit 1 fi # If database export was unsuccessful, skip update if [ -f "$DUMP_DIR/export.failed" ]; then echo "Database export failed the last time. Most likely was the export time not high enough." echo "Please report this to https://github.com/nextcloud/all-in-one/issues. Thanks!" exit 1 fi # Write output to logfile. exec > >(tee -i "$DUMP_DIR/database-import.log") exec 2>&1 # Inform echo "Restoring from database dump." # Add import.failed file touch "$DUMP_DIR/import.failed" # Exit if any command fails set -ex # Remove old database files rm -rf "${DATADIR:?}/"* # Change database port to a random port temporarily export PGPORT=11000 # Create new database exec docker-entrypoint.sh postgres & # Wait for creation while ! psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB" -c "select now()"; do echo "Waiting for the database to start." sleep 5 done # Check if the line we grep for later on is there GREP_STRING='Name: oc_appconfig; Type: TABLE; Schema: public; Owner:' if ! grep -qa "$GREP_STRING" "$DUMP_FILE"; then echo "The needed oc_appconfig line is not there which is unexpected." echo "Please report this to https://github.com/nextcloud/all-in-one/issues. Thanks!" exit 1 fi # Get the Owner DB_OWNER="$(grep -a "$GREP_STRING" "$DUMP_FILE" | head -1 | grep -oP 'Owner:.*$' | sed 's|Owner:||;s|[[:space:]]||g')" if [ "$DB_OWNER" = "$POSTGRES_USER" ]; then echo "Unfortunately was the found database owner of the dump file the same as the POSTGRES_USER $POSTGRES_USER" echo "It is not possible to import a database dump from this database owner." echo "However you might rename the owner in the dumpfile to something else." exit 1 elif [ "$DB_OWNER" != "oc_$POSTGRES_USER" ]; then DIFFERENT_DB_OWNER=1 psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE USER "$DB_OWNER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB; ALTER DATABASE "$POSTGRES_DB" OWNER TO "$DB_OWNER"; GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "$DB_OWNER"; GRANT ALL PRIVILEGES ON SCHEMA public TO "$DB_OWNER"; EOSQL fi # Restore database echo "Restoring the database from database dump" psql "$POSTGRES_DB" -U "$POSTGRES_USER" < "$DUMP_FILE" # Correct permissions if [ -n "$DIFFERENT_DB_OWNER" ]; then psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL ALTER DATABASE "$POSTGRES_DB" OWNER TO "oc_$POSTGRES_USER"; REASSIGN OWNED BY "$DB_OWNER" TO "oc_$POSTGRES_USER"; EOSQL fi # Shut down the database to be able to start it again # The smart mode disallows new connections, then waits for all existing clients to disconnect and any online backup to finish # Wait for 1800s to make sure that a checkpoint is completed successfully pg_ctl stop -m smart -t 1800 # Change database port back to default export PGPORT=5432 # Don't exit if command fails anymore set +ex # Remove import failed file if everything went correctly rm "$DUMP_DIR/import.failed" fi # Cover the last case if ! [ -f "$DATADIR/PG_VERSION" ] && ! [ -f "$DUMP_FILE" ]; then # Remove old database files if somehow there should be some rm -rf "${DATADIR:?}/"* fi # Modify postgresql.conf if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then echo "Setting postgres values..." # Sync this with max pm.max_children and MaxRequestWorkers # 5000 connections is apparently the highest possible value with postgres so set it to that so that we don't run into a limit here. # We don't actually expect so many connections but don't want to limit it artificially because people will report issues otherwise # Also connections should usually be closed again after the process is done # If we should actually exceed this limit, it is definitely a bug in Nextcloud server or some of its apps that does not close connections correctly and not a bug in AIO sed -i "s|^max_connections =.*|max_connections = 5000|" "/var/lib/postgresql/data/postgresql.conf" # Do not log checkpoints if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf fi # Closing idling connections automatically seems to break any logic so was reverted again to default where it is disabled if grep -q "^idle_session_timeout" /var/lib/postgresql/data/postgresql.conf; then sed -i 's|^idle_session_timeout.*|#idle_session_timeout|' /var/lib/postgresql/data/postgresql.conf fi fi do_database_dump() { set -x rm -f "$DUMP_FILE.temp" touch "$DUMP_DIR/export.failed" if pg_dump --username "$POSTGRES_USER" "$POSTGRES_DB" > "$DUMP_FILE.temp"; then rm -f "$DUMP_FILE" mv "$DUMP_FILE.temp" "$DUMP_FILE" pg_ctl stop -m fast rm "$DUMP_DIR/export.failed" echo 'Database dump successful!' set +x exit 0 else pg_ctl stop -m fast echo "Database dump unsuccessful!" set +x exit 1 fi } # Catch docker stop attempts trap do_database_dump SIGINT SIGTERM # Start the database exec docker-entrypoint.sh postgres & wait $! ================================================ FILE: Containers/redis/Dockerfile ================================================ # syntax=docker/dockerfile:latest # From https://github.com/redis/docker-library-redis/blob/release/8.2/alpine/Dockerfile FROM redis:8.6.1-alpine COPY --chmod=775 start.sh /start.sh RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache openssl bash; \ \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ apk --no-cache del openssl; \ \ # Get rid of unused binaries rm -f /usr/local/bin/gosu; COPY --chmod=775 healthcheck.sh /healthcheck.sh USER 999 ENTRYPOINT ["/start.sh"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/redis/healthcheck.sh ================================================ #!/bin/bash redis-cli -a "$REDIS_HOST_PASSWORD" PING || exit 1 ================================================ FILE: Containers/redis/start.sh ================================================ #!/bin/bash # Show wiki if vm.overcommit is disabled if [ "$(sysctl -n vm.overcommit_memory)" != "1" ]; then echo "Memory overcommit is disabled but necessary for safe operation" echo "See https://github.com/nextcloud/all-in-one/discussions/1731 how to enable overcommit" fi # Run redis with a password if provided echo "Redis has started" if [ -n "$REDIS_HOST_PASSWORD" ]; then exec redis-server --requirepass "$REDIS_HOST_PASSWORD" --loglevel warning else exec redis-server --loglevel warning fi exec "$@" ================================================ FILE: Containers/talk/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM nats:2.12.5-scratch AS nats FROM eturnal/eturnal:1.12.2-alpine AS eturnal FROM strukturag/nextcloud-spreed-signaling:2.1.1 AS signaling FROM alpine:3.23.3 AS janus ARG JANUS_VERSION=v1.4.0 WORKDIR /src RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ ca-certificates \ git \ autoconf \ automake \ build-base \ pkgconfig \ libtool \ util-linux \ glib-dev \ zlib-dev \ openssl-dev \ jansson-dev \ libnice-dev \ libconfig-dev \ libsrtp-dev \ libusrsctp-dev \ gengetopt-dev \ libwebsockets-dev; \ git clone --recursive https://github.com/meetecho/janus-gateway --depth=1 --single-branch --branch "$JANUS_VERSION" /src; \ /src/autogen.sh; \ /src/configure --disable-rabbitmq --disable-mqtt --disable-boringssl; \ make; \ make install; \ make configs; \ rename -v ".jcfg.sample" ".jcfg" /usr/local/etc/janus/*.jcfg.sample FROM alpine:3.23.3 ENV ETURNAL_ETC_DIR="/conf" ENV SKIP_CERT_VERIFY=false COPY --from=janus --chmod=777 --chown=1000:1000 /usr/local /usr/local COPY --from=eturnal --chmod=777 --chown=1000:1000 /opt/eturnal /opt/eturnal COPY --from=nats --chmod=777 --chown=1000:1000 /nats-server /usr/local/bin/nats-server COPY --from=signaling --chmod=777 --chown=1000:1000 /usr/bin/nextcloud-spreed-signaling /usr/local/bin/nextcloud-spreed-signaling COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh COPY --chmod=664 supervisord.conf /supervisord.conf RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ ca-certificates \ tzdata \ bash \ openssl \ supervisor \ bind-tools \ netcat-openbsd \ \ glib \ zlib \ libssl3 \ libcrypto3 \ jansson \ libnice \ libconfig \ libsrtp \ libusrsctp \ libwebsockets \ \ shadow \ grep \ util-linux-misc; \ useradd --system -u 1000 eturnal; \ apk del --no-cache \ shadow; \ \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ \ touch \ /etc/nats.conf \ /etc/eturnal.yml; \ echo "listen: 127.0.0.1:4222" | tee /etc/nats.conf; \ mkdir -p \ /var/tmp \ /conf \ /var/lib/turn \ /var/log/supervisord \ /var/run/supervisord \ /usr/local/lib/janus/loggers; \ chown eturnal:eturnal -R \ /etc/nats.conf \ /var/log/supervisord \ /var/run/supervisord; \ chmod 777 -R \ /tmp \ /conf \ /var/run/supervisord \ /var/log/supervisord; \ ln -s /opt/eturnal/bin/stun /usr/local/bin/stun; \ ln -s /opt/eturnal/bin/eturnalctl /usr/local/bin/eturnalctl USER 1000 ENTRYPOINT ["/start.sh"] CMD ["supervisord", "-c", "/supervisord.conf"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/talk/healthcheck.sh ================================================ #!/bin/bash nc -z 127.0.0.1 8081 || exit 1 nc -z 127.0.0.1 8188 || exit 1 nc -z 127.0.0.1 4222 || exit 1 nc -z 127.0.0.1 "$TALK_PORT" || exit 1 eturnalctl status || exit 1 ================================================ FILE: Containers/talk/server.conf.in ================================================ [http] # IP and port to listen on for HTTP requests. # Comment line to disable the listener. #listen = 127.0.0.1:8080 # HTTP socket read timeout in seconds. #readtimeout = 15 # HTTP socket write timeout in seconds. #writetimeout = 30 [https] # IP and port to listen on for HTTPS requests. # Comment line to disable the listener. #listen = 127.0.0.1:8443 # HTTPS socket read timeout in seconds. #readtimeout = 15 # HTTPS socket write timeout in seconds. #writetimeout = 30 # Certificate / private key to use for the HTTPS server. certificate = /etc/nginx/ssl/server.crt key = /etc/nginx/ssl/server.key [app] # Set to "true" to install pprof debug handlers. Access will only be possible # from IPs allowed through the "allowed_ips" option below. # # See "https://golang.org/pkg/net/http/pprof/" for further information. debug = false # Set to "true" to allow subscribing any streams. This is insecure and should # only be enabled for testing. By default only streams of users in the same # room and call can be subscribed. #allowsubscribeany = false # Comma separated list of trusted proxies (IPs or CIDR networks) that may set # the "X-Real-Ip" or "X-Forwarded-For" headers. If both are provided, the # "X-Real-Ip" header will take precedence (if valid). # Leave empty to allow loopback and local addresses. #trustedproxies = [sessions] # Secret value used to generate checksums of sessions. This should be a random # string of 32 or 64 bytes. hashkey = the-secret-for-session-checksums # Optional key for encrypting data in the sessions. Must be either 16, 24 or # 32 bytes. # If no key is specified, data will not be encrypted (not recommended). blockkey = -encryption-key- [clients] # Shared secret for connections from internal clients. This must be the same # value as configured in the respective internal services. internalsecret = the-shared-secret-for-internal-clients [federation] # If set to "true", certificate validation of federation targets will be skipped. # This should only be enabled during development, e.g. to work with self-signed # certificates. #skipverify = false # Timeout in seconds for requests to federation targets. #timeout = 10 [backend] # Type of backend configuration. # Defaults to "static". # # Possible values: # - static: A comma-separated list of backends is given in the "backends" option. # - etcd: Backends are retrieved from an etcd cluster. #backendtype = static # For backend type "static": # Comma-separated list of backend ids from which clients are allowed to connect # from. Each backend will have isolated rooms, i.e. clients connecting to room # "abc12345" on backend 1 will be in a different room than clients connected to # a room with the same name on backend 2. Also sessions connected from different # backends will not be able to communicate with each other. #backends = backend-id, another-backend # For backend type "etcd": # Key prefix of backend entries. All keys below will be watched and assumed to # contain a JSON document with the following entries: # - "urls": List of urls of the Nextcloud instance. # - "url": Url of the Nextcloud instance (deprecated). # - "secret": Shared secret for requests from and to the backend servers. # # Additional optional entries: # - "maxstreambitrate": Maximum bitrate per publishing stream (in bits per second). # - "maxscreenbitrate": Maximum bitrate per screensharing stream (in bits per second). # - "sessionlimit": Number of sessions that are allowed to connect. # # Example: # "/signaling/backend/one" -> {"urls": ["https://nextcloud.domain1.invalid"], ...} # "/signaling/backend/two" -> {"urls": ["https://domain2.invalid/nextcloud"], ...} #backendprefix = /signaling/backend # Allow any hostname as backend endpoint. This is extremely insecure and should # only be used while running the benchmark client against the server. allowall = false # Common shared secret for requests from and to the backend servers. Used if # "allowall" is enabled or as fallback for individual backends that don't have # their own secret set. # This must be the same value as configured in the Nextcloud admin ui. #secret = the-shared-secret-for-allowall # Timeout in seconds for requests to the backend. timeout = 10 # Maximum number of concurrent backend connections per host. connectionsperhost = 8 # If set to "true", certificate validation of backend endpoints will be skipped. # This should only be enabled during development, e.g. to work with self-signed # certificates. #skipverify = false # For backendtype "static": # Backend configurations as defined in the "[backend]" section above. The # section names must match the ids used in "backends" above. #[backend-id] # Comma-separated list of urls of the Nextcloud instance #urls = https://cloud.domain.invalid # Shared secret for requests from and to the backend servers. Leave empty to use # the common shared secret from above. # This must be the same value as configured in the Nextcloud admin ui. #secret = the-shared-secret # Limit the number of sessions that are allowed to connect to this backend. # Omit or set to 0 to not limit the number of sessions. #sessionlimit = 10 # The maximum bitrate per publishing stream (in bits per second). # Defaults to the maximum bitrate configured for the proxy / MCU. #maxstreambitrate = 1048576 # The maximum bitrate per screensharing stream (in bits per second). # Defaults to the maximum bitrate configured for the proxy / MCU. #maxscreenbitrate = 2097152 #[another-backend] # Comma-separated list of urls of the Nextcloud instance #urls = https://cloud.otherdomain.invalid # Shared secret for requests from and to the backend servers. Leave empty to use # the common shared secret from above. # This must be the same value as configured in the Nextcloud admin ui. #secret = the-shared-secret [nats] # Url of NATS backend to use. This can also be a list of URLs to connect to # multiple backends. For local development, this can be set to "nats://loopback" # to process NATS messages internally instead of sending them through an # external NATS backend. #url = nats://localhost:4222 [mcu] # The type of the MCU to use. Currently only "janus" and "proxy" are supported. # Leave empty to disable MCU functionality. #type = # For type "janus": the URL to the websocket endpoint of the MCU server. # For type "proxy": a space-separated list of proxy URLs to connect to. #url = # The maximum bitrate per publishing stream (in bits per second). # Defaults to 1 mbit/sec. # For type "proxy": will be capped to the maximum bitrate configured at the # proxy server that is used. #maxstreambitrate = 1048576 # The maximum bitrate per screensharing stream (in bits per second). # Default is 2 mbit/sec. # For type "proxy": will be capped to the maximum bitrate configured at the # proxy server that is used. #maxscreenbitrate = 2097152 # List of IP addresses / subnets that are allowed to be used by clients in # candidates. The allowed list has preference over the blocked list below. #allowedcandidates = 10.0.0.0/8 # List of IP addresses / subnets to filter from candidates received by clients. #blockedcandidates = 1.2.3.0/24 # For type "proxy": timeout in seconds for requests to the proxy server. #proxytimeout = 2 # For type "proxy": type of URL configuration for proxy servers. # Defaults to "static". # # Possible values: # - static: A space-separated list of proxy URLs is given in the "url" option. # - etcd: Proxy URLs are retrieved from an etcd cluster (see below). #urltype = static # If set to "true", certificate validation of proxy servers will be skipped. # This should only be enabled during development, e.g. to work with self-signed # certificates. #skipverify = false # For type "proxy": the id of the token to use when connecting to proxy servers. #token_id = server1 # For type "proxy": the private key for the configured token id to use when # connecting to proxy servers. #token_key = privkey.pem # For url type "static": Enable DNS discovery on hostname of configured URL. # If the hostname resolves to multiple IP addresses, a connection is established # to each of them. # Changes to the DNS are monitored regularly and proxy connections are created # or deleted as necessary. #dnsdiscovery = true # For url type "etcd": Key prefix of MCU proxy entries. All keys below will be # watched and assumed to contain a JSON document. The entry "address" from this # document will be used as proxy URL, other contents in the document will be # ignored. # # Example: # "/signaling/proxy/server/one" -> {"address": "https://proxy1.domain.invalid"} # "/signaling/proxy/server/two" -> {"address": "https://proxy2.domain.invalid"} #keyprefix = /signaling/proxy/server [turn] # API key that the MCU will need to send when requesting TURN credentials. #apikey = the-api-key-for-the-rest-service # The shared secret to use for generating TURN credentials. This must be the # same as on the TURN server. #secret = 6d1c17a7-c736-4e22-b02c-e2955b7ecc64 # A comma-separated list of TURN servers to use. Leave empty to disable the # TURN REST API. #servers = turn:1.2.3.4:9991?transport=udp,turn:1.2.3.4:9991?transport=tcp [geoip] # License key to use when downloading the MaxMind GeoIP database. You can # register an account at "https://www.maxmind.com/en/geolite2/signup" for # free. See "https://dev.maxmind.com/geoip/geoip2/geolite2/" for further # information. # You can also get a free GeoIP database from https://db-ip.com/ without # registration. Provide the URL below in this case. # Leave empty to disable GeoIP lookups. #license = # Optional URL to download a MaxMind GeoIP database from. Will be generated if # "license" is provided above. Can be a "file://" url if a local file should # be used. Please note that the database must provide a country field when # looking up IP addresses. #url = [geoip-overrides] # Optional overrides for GeoIP lookups. The key is an IP address / range, the # value the associated country code. #127.0.0.1 = DE #192.168.0.0/24 = DE [continent-overrides] # Optional overrides for continent mappings. The key is a continent code, the # value a comma-separated list of continent codes to map the continent to. # Use European servers for clients in Africa. #AF = EU # Use servers in North Africa for clients in South America. #SA = NA [stats] # Comma-separated list of IP addresses that are allowed to access the debug, # stats and metrics endpoints. # Leave empty (or commented) to only allow access from localhost. #allowed_ips = [etcd] # Comma-separated list of static etcd endpoints to connect to. #endpoints = 127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379 # Options to perform endpoint discovery through DNS SRV. # Only used if no endpoints are configured manually. #discoverysrv = example.com #discoveryservice = foo # Path to private key, client certificate and CA certificate if TLS # authentication should be used. #clientkey = /path/to/etcd-client.key #clientcert = /path/to/etcd-client.crt #cacert = /path/to/etcd-ca.crt [grpc] # IP and port to listen on for GRPC requests. # Comment line to disable the listener. #listen = 0.0.0.0:9090 # Certificate / private key to use for the GRPC server. # Omit to use unencrypted connections. #servercertificate = /path/to/grpc-server.crt #serverkey = /path/to/grpc-server.key # CA certificate that is allowed to issue certificates of GRPC servers. # Omit to expect unencrypted connections. #serverca = /path/to/grpc-ca.crt # Certificate / private key to use for the GRPC client. # Omit if clients don't need to authenticate on the server. #clientcertificate = /path/to/grpc-client.crt #clientkey = /path/to/grpc-client.key # CA certificate that is allowed to issue certificates of GRPC clients. # Omit to allow any clients to connect. #clientca = /path/to/grpc-ca.crt # Type of GRPC target configuration. # Defaults to "static". # # Possible values: # - static: A comma-separated list of targets is given in the "targets" option. # - etcd: Target URLs are retrieved from an etcd cluster. #targettype = static # For target type "static": Comma-separated list of GRPC targets to connect to # for clustering mode. #targets = 192.168.0.1:9090, 192.168.0.2:9090 # For target type "static": Enable DNS discovery on hostnames of GRPC target. # If a hostname resolves to multiple IP addresses, a connection is established # to each of them. # Changes to the DNS are monitored regularly and GRPC clients are created or # deleted as necessary. #dnsdiscovery = true # For target type "etcd": Key prefix of GRPC target entries. All keys below will # be watched and assumed to contain a JSON document. The entry "address" from # this document will be used as target URL, other contents in the document will # be ignored. # # Example: # "/signaling/cluster/grpc/one" -> {"address": "192.168.0.1:9090"} # "/signaling/cluster/grpc/two" -> {"address": "192.168.0.2:9090"} #targetprefix = /signaling/cluster/grpc ================================================ FILE: Containers/talk/start.sh ================================================ #!/bin/bash # Variables if [ -z "$NC_DOMAIN" ]; then echo "You need to provide the NC_DOMAIN." exit 1 elif [ -z "$TALK_PORT" ]; then echo "You need to provide the TALK_PORT." exit 1 elif [ -z "$TURN_SECRET" ]; then echo "You need to provide the TURN_SECRET." exit 1 elif [ -z "$SIGNALING_SECRET" ]; then echo "You need to provide the SIGNALING_SECRET." exit 1 elif [ -z "$INTERNAL_SECRET" ]; then echo "You need to provide the INTERNAL_SECRET." exit 1 fi # Trust additional CA certificates, if the user provided NEXTCLOUD_TRUSTED_CACERTS_DIR # The container is read-only, so we build a custom bundle in /tmp (tmpfs) and # point Go's TLS stack to it via SSL_CERT_FILE. if mountpoint -q /usr/local/share/ca-certificates; then echo "Trusting additional CA certificates..." set -x cp /etc/ssl/certs/ca-certificates.crt /tmp/ca-certificates.crt for cert in /usr/local/share/ca-certificates/*; do if [ -f "$cert" ]; then cat "$cert" >> /tmp/ca-certificates.crt fi done export SSL_CERT_FILE=/tmp/ca-certificates.crt set +x fi set -x IPv4_ADDRESS_TALK_RELAY="$(hostname -i | grep -oP '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1)" # shellcheck disable=SC2153 IPv4_ADDRESS_TALK="$(dig "$TALK_HOST" IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" # shellcheck disable=SC2153 IPv6_ADDRESS_TALK="$(dig "$TALK_HOST" AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" set +x if [ -n "$IPv4_ADDRESS_TALK" ] && [ "$IPv4_ADDRESS_TALK_RELAY" = "$IPv4_ADDRESS_TALK" ]; then IPv4_ADDRESS_TALK="" fi set -x IP_BINDING="::" if grep -q "1" /sys/module/ipv6/parameters/disable \ || grep -q "1" /proc/sys/net/ipv6/conf/all/disable_ipv6 \ || grep -q "1" /proc/sys/net/ipv6/conf/default/disable_ipv6; then IP_BINDING="0.0.0.0" fi set +x # Turn cat << TURN_CONF > "/conf/eturnal.yml" eturnal: listen: - ip: "$IP_BINDING" port: $TALK_PORT transport: udp - ip: "$IP_BINDING" port: $TALK_PORT transport: tcp log_dir: stdout log_level: warning secret: "$TURN_SECRET" relay_ipv4_addr: "$IPv4_ADDRESS_TALK_RELAY" relay_ipv6_addr: "$IPv6_ADDRESS_TALK" blacklist_peers: - recommended whitelist_peers: - 127.0.0.1 - ::1 - "$IPv4_ADDRESS_TALK_RELAY" - "$IPv4_ADDRESS_TALK" - "$IPv6_ADDRESS_TALK" TURN_CONF # Remove empty lines so that the config is not invalid sed -i '/""/d' /conf/eturnal.yml if [ -z "$TALK_MAX_STREAM_BITRATE" ]; then TALK_MAX_STREAM_BITRATE=1048576 fi if [ -z "$TALK_MAX_SCREEN_BITRATE" ]; then TALK_MAX_SCREEN_BITRATE=2097152 fi # Signling cat << SIGNALING_CONF > "/conf/signaling.conf" [http] listen = 0.0.0.0:8081 [app] debug = false [sessions] hashkey = $(openssl rand -hex 16) blockkey = $(openssl rand -hex 16) [clients] internalsecret = ${INTERNAL_SECRET} [backend] backends = backend-1 allowall = false timeout = 10 connectionsperhost = 8 skipverify = ${SKIP_CERT_VERIFY} [backend-1] urls = https://${NC_DOMAIN} secret = ${SIGNALING_SECRET} maxstreambitrate = ${TALK_MAX_STREAM_BITRATE} maxscreenbitrate = ${TALK_MAX_SCREEN_BITRATE} [nats] url = nats://127.0.0.1:4222 [mcu] type = janus url = ws://127.0.0.1:8188 maxstreambitrate = ${TALK_MAX_STREAM_BITRATE} maxscreenbitrate = ${TALK_MAX_SCREEN_BITRATE} SIGNALING_CONF exec "$@" ================================================ FILE: Containers/talk/supervisord.conf ================================================ [supervisord] nodaemon=true logfile=/var/log/supervisord/supervisord.log pidfile=/var/run/supervisord/supervisord.pid childlogdir=/var/log/supervisord/ logfile_maxbytes=50MB logfile_backups=10 loglevel=error [program:eturnal] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=eturnalctl foreground [program:nats-server] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=nats-server -c /etc/nats.conf [program:janus] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 # debug-level 3 means warning command=janus --config=/usr/local/etc/janus/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level 3 [program:signaling] stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 command=nextcloud-spreed-signaling -config /conf/signaling.conf ================================================ FILE: Containers/talk-recording/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM python:3.14.3-alpine3.23 COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh ENV RECORDING_VERSION=v0.2.1 ENV ALLOW_ALL=false ENV HPB_PROTOCOL=https ENV NC_PROTOCOL=https ENV SKIP_VERIFY=false ENV HPB_PATH=/standalone-signaling/ RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ ca-certificates \ tzdata \ bash \ xvfb \ ffmpeg \ firefox \ font-noto-all \ font-noto-cjk \ font-noto-cjk-extra \ bind-tools \ netcat-openbsd \ git \ wget \ shadow \ pulseaudio \ openssl \ build-base \ linux-headers \ geckodriver; \ useradd -d /tmp --system recording -u 122; \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ git clone --recursive https://github.com/nextcloud/nextcloud-talk-recording --depth=1 --single-branch --branch "$RECORDING_VERSION" /src; \ python3 -m pip install --no-cache-dir /src; \ rm -rf /src; \ touch /etc/recording.conf; \ chown recording:recording -R \ /tmp /etc/recording.conf; \ mkdir -p /conf; \ chmod 777 /conf; \ chmod 777 /tmp; \ apk del --no-cache \ git \ wget \ shadow \ openssl \ build-base \ linux-headers; VOLUME /tmp WORKDIR /tmp USER 122 ENTRYPOINT ["/start.sh"] CMD ["python", "-m", "nextcloud.talk.recording", "--config", "/conf/recording.conf"] HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/talk-recording/healthcheck.sh ================================================ #!/bin/bash nc -z 127.0.0.1 1234 || exit 1 ================================================ FILE: Containers/talk-recording/recording.conf ================================================ # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: AGPL-3.0-or-later [logs] # Log level based on numeric values of Python logging levels: # - Critical: 50 # - Error: 40 # - Warning: 30 # - Info: 20 # - Debug: 10 # - Not set: 0 #level = 20 [http] # IP and port to listen on for HTTP requests. #listen = 127.0.0.1:8000 [app] # Comma separated list of trusted proxies (IPs or CIDR networks) that may set # the "X-Forwarded-For" header. #trustedproxies = [backend] # Allow any hostname as backend endpoint. This is extremely insecure and should # only be used during development. #allowall = false # Common shared secret for requests from and to the backend servers if # "allowall" is enabled. This must be the same value as configured in the # Nextcloud admin ui. #secret = the-shared-secret # Comma-separated list of backend ids allowed to connect. #backends = backend-id, another-backend # If set to "true", certificate validation of backend endpoints will be skipped. # This should only be enabled during development, e.g. to work with self-signed # certificates. # Overridable by backend. #skipverify = false # Maximum allowed size in bytes for messages sent by the backend. # Overridable by backend. #maxmessagesize = 1024 # Width for recorded videos. # Overridable by backend. #videowidth = 1920 # Height for recorded videos. # Overridable by backend. #videoheight = 1080 # Temporary directory used to store recordings until uploaded. It must be # writable by the user running the recording server. # Overridable by backend. #directory = /tmp # Backend configurations as defined in the "[backend]" section above. The # section names must match the ids used in "backends" above. #[backend-id] # URL of the Nextcloud instance #url = https://cloud.domain.invalid # Shared secret for requests from and to the backend servers. This must be the # same value as configured in the Nextcloud admin ui. #secret = the-shared-secret #[another-backend] # URL of the Nextcloud instance #url = https://cloud.otherdomain.invalid # Shared secret for requests from and to the backend servers. This must be the # same value as configured in the Nextcloud admin ui. #secret = the-shared-secret [signaling] # Common shared secret for authenticating as an internal client of signaling # servers if a specific secret is not set for a signaling server. This must be # the same value as configured in the signaling server configuration file. #internalsecret = the-shared-secret-for-internal-clients # Comma-separated list of signaling servers with specific internal secrets. #signalings = signaling-id, another-signaling # Signaling server configurations as defined in the "[signaling]" section above. # The section names must match the ids used in "signalings" above. #[signaling-id] # URL of the signaling server #url = https://signaling.domain.invalid # Shared secret for authenticating as an internal client of signaling servers. # This must be the same value as configured in the signaling server # configuration file. #internalsecret = the-shared-secret-for-internal-clients #[another-signaling] # URL of the signaling server #url = https://signaling.otherdomain.invalid # Shared secret for authenticating as an internal client of signaling servers. # This must be the same value as configured in the signaling server # configuration file. #internalsecret = the-shared-secret-for-internal-clients [ffmpeg] # The ffmpeg executable (name or full path) and the global options given to # ffmpeg. The options given here fully override the default global options. #common = ffmpeg -loglevel level+warning -n # The (additional) options given to ffmpeg for the audio input. The options # given here extend the default options for the audio input, although they do # not override them. # Default options: '-f pulse -i {AUDIO_SOURCE}' #inputaudio = # The (additional) options given to ffmpeg for the video input. The options # given here extend the default options for the video input, although they do # not override them. # Default options: '-f x11grab -draw_mouse 0 -video_size {WIDTH}x{HEIGHT} -i {VIDEO_SOURCE}' #inputvideo = # The options given to ffmpeg to encode the audio output. The options given here # fully override the default options for the audio output. #outputaudio = -c:a libopus # The options given to ffmpeg to encode the video output. The options given here # fully override the default options for the video output. #outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M # The extension of the file for audio only recordings. #extensionaudio = .ogg # The extension of the file for audio and video recordings. #extensionvideo = .webm [recording] # Browser to use for recordings. Please note that the "chrome" value does not # refer to the web browser, but to the Selenium WebDriver. In practice, "chrome" # will use Google Chrome, or Chromium if Google Chrome is not installed. # Allowed values: firefox, chrome # Defaults to firefox #browser = firefox # Path to the Selenium driver to use for recordings. # If set the driver must match the browser being used (for example, # "/usr/bin/geckodriver" for "firefox"). If no driver is explicitly set Selenium # Manager will try to find the right one in $PATH, downloading it as a fallback. # Note that Selenium Manager does not work in some architectures (for example, # Linux on arm64/aarch64), so in those architectures the driver must be # explicitly set. #driverPath = # Path to the browser executable to use for recordings. # If set the executable must match the browser being used (for example, # "/usr/bin/firefox-esr" for "firefox"). If no executable is explicitly set # Selenium Manager will try to find the right one in $PATH. Depending on the # installed Selenium version if the executable is not found Selenium Manager may # also download the browser as a fallback. # Note that Selenium Manager does not work in some architectures (for example, # Linux on arm64/aarch64); in those architectures the Selenium driver will try # to find the executable, but the executable may need to be explicitly set if # not found by the driver. #browserPath = [stats] # Comma-separated list of IP addresses (or CIDR networks) that are allowed to # access the stats endpoint. # Leave commented to only allow access from "127.0.0.1". #allowed_ips = ================================================ FILE: Containers/talk-recording/start.sh ================================================ #!/bin/bash # Variables if [ -z "$NC_DOMAIN" ]; then echo "You need to provide the NC_DOMAIN." exit 1 elif [ -z "$RECORDING_SECRET" ]; then echo "You need to provide the RECORDING_SECRET." exit 1 elif [ -z "$INTERNAL_SECRET" ]; then echo "You need to provide the INTERNAL_SECRET." exit 1 fi if [ -z "$HPB_DOMAIN" ]; then export HPB_DOMAIN="$NC_DOMAIN" fi # Delete all contents on startup to start fresh rm -fr /tmp/{*,.*} cat << RECORDING_CONF > "/conf/recording.conf" [logs] # 30 means Warning level = 30 [http] listen = 0.0.0.0:1234 [backend] allowall = ${ALLOW_ALL} # The secret below is still needed if allowall is set to true, also it doesn't hurt to be here secret = ${RECORDING_SECRET} backends = backend-1 skipverify = ${SKIP_VERIFY} maxmessagesize = 1024 videowidth = 1920 videoheight = 1080 directory = /tmp [backend-1] url = ${NC_PROTOCOL}://${NC_DOMAIN} secret = ${RECORDING_SECRET} skipverify = ${SKIP_VERIFY} [signaling] signalings = signaling-1 [signaling-1] url = ${HPB_PROTOCOL}://${HPB_DOMAIN}${HPB_PATH} internalsecret = ${INTERNAL_SECRET} [ffmpeg] # common = ffmpeg -loglevel level+warning -n # outputaudio = -c:a libopus # outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M extensionaudio = .ogg extensionvideo = .webm [recording] browser = firefox driverPath = /usr/bin/geckodriver browserPath = /usr/bin/firefox RECORDING_CONF exec "$@" ================================================ FILE: Containers/watchtower/Dockerfile ================================================ # syntax=docker/dockerfile:latest FROM golang:1.26.1-alpine3.23 AS go ENV WATCHTOWER_COMMIT_HASH=5a33e3c0aa3b2770c648a114b4a9d32e0a5b55ba RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ build-base; \ go install github.com/nicholas-fedor/watchtower@$WATCHTOWER_COMMIT_HASH # v1.14.4 FROM alpine:3.23.3 RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache bash ca-certificates tzdata COPY --from=go /go/bin/watchtower /watchtower COPY --chmod=775 start.sh /start.sh # hadolint ignore=DL3002 USER root ENTRYPOINT ["/start.sh"] LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/watchtower/start.sh ================================================ #!/bin/bash # Check if socket is available and readable if ! [ -e "/var/run/docker.sock" ]; then echo "Docker socket is not available. Cannot continue." exit 1 elif ! test -r /var/run/docker.sock; then echo "Docker socket is not readable by the root user. Cannot continue." exit 1 fi if [ -f /run/.containerenv ]; then # If running under podman disable memory_swappiness setting in watchtower. # It is a necessary workaround until https://github.com/containers/podman/issues/23824 gets fixed. echo "Running under Podman. Setting WATCHTOWER_DISABLE_MEMORY_SWAPPINESS to 1." export WATCHTOWER_DISABLE_MEMORY_SWAPPINESS=1 fi if [ -n "$CONTAINER_TO_UPDATE" ]; then exec /watchtower --cleanup --debug --run-once "$CONTAINER_TO_UPDATE" else echo "'CONTAINER_TO_UPDATE' is not set. Cannot update anything." exit 1 fi exec "$@" ================================================ FILE: Containers/whiteboard/Dockerfile ================================================ # syntax=docker/dockerfile:latest # Probably from this file: https://github.com/nextcloud/whiteboard/blob/main/Dockerfile FROM ghcr.io/nextcloud-releases/whiteboard:v1.5.7 USER root RUN set -ex; \ apk add --no-cache bash jq; \ chmod 777 -R /tmp; \ if [ -f /usr/lib/chromium/chrome_crashpad_handler ] && [ ! -f /usr/lib/chromium/chrome_crashpad_handler.real ]; then \ mv /usr/lib/chromium/chrome_crashpad_handler /usr/lib/chromium/chrome_crashpad_handler.real; \ printf '%s\n' '#!/bin/sh' "exec /usr/lib/chromium/chrome_crashpad_handler.real --no-periodic-tasks --database=\"\${CRASHPAD_DATABASE:-/tmp/chrome-crashpad}\" \"\$@\"" >/usr/lib/chromium/chrome_crashpad_handler; \ chmod +x /usr/lib/chromium/chrome_crashpad_handler; \ fi USER 65534 COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh HEALTHCHECK CMD /healthcheck.sh WORKDIR /tmp ENTRYPOINT ["/start.sh"] LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ org.label-schema.vendor="Nextcloud" ================================================ FILE: Containers/whiteboard/healthcheck.sh ================================================ #!/bin/bash nc -z "$REDIS_HOST" "$REDIS_PORT" || exit 0 nc -z 127.0.0.1 3002 || exit 1 ================================================ FILE: Containers/whiteboard/start.sh ================================================ #!/bin/bash # Only start container if nextcloud is accessible while ! nc -z "$REDIS_HOST" "$REDIS_PORT"; do echo "Waiting for redis to start..." sleep 5 done # Set a default for redis db index if [ -z "$REDIS_DB_INDEX" ]; then REDIS_DB_INDEX=0 fi # URL-encode password REDIS_HOST_PASSWORD="$(jq -rn --arg v "$REDIS_HOST_PASSWORD" '$v|@uri')" export REDIS_URL="redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST:$REDIS_PORT/$REDIS_DB_INDEX" # Run it exec npm --prefix /app run server:start ================================================ FILE: LICENSE ================================================ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . ================================================ FILE: app/.editorconfig ================================================ # https://editorconfig.org root = true [*] charset = utf-8 end_of_line = lf indent_size = 4 indent_style = tab insert_final_newline = true trim_trailing_whitespace = true [*.feature] indent_size = 2 indent_style = space [*.yml] indent_size = 2 indent_style = space ================================================ FILE: app/appinfo/info.xml ================================================ nextcloud-aio Nextcloud All-in-One Provides a login link for admins. Add a link to the admin settings that gives access to the Nextcloud All-in-One admin interface 0.8.0 agpl Azul AllInOne monitoring https://github.com/nextcloud/all-in-one/issues OCA\AllInOne\Settings\Admin ================================================ FILE: app/composer/autoload.php ================================================ * Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier * @author Jordi Boggiano * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { private $vendorDir; // PSR-4 private $prefixLengthsPsr4 = array(); private $prefixDirsPsr4 = array(); private $fallbackDirsPsr4 = array(); // PSR-0 private $prefixesPsr0 = array(); private $fallbackDirsPsr0 = array(); private $useIncludePath = false; private $classMap = array(); private $classMapAuthoritative = false; private $missingClasses = array(); private $apcuPrefix; private static $registeredLoaders = array(); public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } public function getFallbackDirs() { return $this->fallbackDirsPsr0; } public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } public function getClassMap() { return $this->classMap; } /** * @param array $classMap Class to filename map */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param array|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param array|string $paths The PSR-0 base directories */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders indexed by their corresponding vendor directories. * * @return self[] */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } } /** * Scope isolated include. * * Prevents access to $this/self from included files. */ function includeFile($file) { include $file; } ================================================ FILE: app/composer/composer/InstalledVersions.php ================================================ * Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require it's presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions { private static $installed; private static $canGetVendors; private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints($constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = require __DIR__ . '/installed.php'; } else { self::$installed = array(); } } $installed[] = self::$installed; return $installed; } } ================================================ FILE: app/composer/composer/LICENSE ================================================ Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: app/composer/composer/autoload_classmap.php ================================================ $vendorDir . '/composer/InstalledVersions.php', 'OCA\\AllInOne\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', ); ================================================ FILE: app/composer/composer/autoload_namespaces.php ================================================ array($baseDir . '/../lib'), ); ================================================ FILE: app/composer/composer/autoload_real.php ================================================ = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInitAllInOne::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { $loader->addClassMap($classMap); } } $loader->setClassMapAuthoritative(true); $loader->register(true); return $loader; } } ================================================ FILE: app/composer/composer/autoload_static.php ================================================ array ( 'OCA\\AllInOne\\' => 13, ), ); public static $prefixDirsPsr4 = array ( 'OCA\\AllInOne\\' => array ( 0 => __DIR__ . '/..' . '/../lib', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'OCA\\AllInOne\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitAllInOne::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitAllInOne::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitAllInOne::$classMap; }, null, ClassLoader::class); } } ================================================ FILE: app/composer/composer/installed.json ================================================ { "packages": [], "dev": true, "dev-package-names": [] } ================================================ FILE: app/composer/composer/installed.php ================================================ array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), 'reference' => '1b16a136ebd8f63e09df061d383f34170e2cef35', 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), 'reference' => '1b16a136ebd8f63e09df061d383f34170e2cef35', 'dev_requirement' => false, ), ), ); ================================================ FILE: app/composer/composer.json ================================================ { "config" : { "vendor-dir": ".", "optimize-autoloader": true, "classmap-authoritative": true, "autoloader-suffix": "AllInOne" }, "autoload" : { "psr-4": { "OCA\\AllInOne\\": "../lib/" } } } ================================================ FILE: app/lib/Settings/Admin.php ================================================ * * @author Azul * * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * */ namespace OCA\AllInOne\Settings; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\IDateTimeFormatter; use OCP\L10N\IFactory; use OCP\Settings\ISettings; class Admin implements ISettings { /** @var IConfig */ private $config; /** @var IDateTimeFormatter */ private $dateTimeFormatter; /** @var IFactory */ private $l10nFactory; public function __construct( IConfig $config, IDateTimeFormatter $dateTimeFormatter, IFactory $l10nFactory ) { $this->config = $config; $this->dateTimeFormatter = $dateTimeFormatter; $this->l10nFactory = $l10nFactory; } /** * @return TemplateResponse */ public function getForm(): TemplateResponse { $lastUpdateCheckTimestamp = $this->config->getAppValue('core', 'lastupdatedat'); $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp); $token = urlencode(getenv('AIO_TOKEN')); $params = [ 'AIOLoginUrl' => 'https://' . getenv('AIO_URL') . '/api/auth/getlogin' . '?token=' . $token, ]; return new TemplateResponse('nextcloud-aio', 'admin', $params, ''); } /** * @return string the section ID, e.g. 'sharing' */ public function getSection(): string { return 'overview'; } /** * @return int whether the form should be rather on the top or bottom of * the admin section. The forms are arranged in ascending order of the * priority values. It is required to return a value between 0 and 100. * * E.g.: 70 */ public function getPriority(): int { return 0; } } ================================================ FILE: app/readme.md ================================================ ## How to develop the app? Please note that in order to check if an app is already downloaded Nextcloud will look for a folder with the same name as the app. Therefore you need to add the app to one of the app directories naming the directory `nextcloud-aio`. ================================================ FILE: app/templates/admin.php ================================================ * * @author Azul * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. */ /** @var array $_ */ ?> ================================================ FILE: community-containers/borgbackup-viewer/borgbackup-viewer.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-borgbackup-viewer", "image_tag": "v1", "display_name": "Borg Backup Viewer", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer", "image": "ghcr.io/szaimen/aio-borgbackup-viewer", "internal_port": "5801", "ports": [ { "ip_binding": "", "port_number": "5801", "protocol": "tcp" } ], "environment": [ "BORG_HOST_ID=nextcloud-aio-borgbackup-viewer", "WEB_AUTHENTICATION_USERNAME=nextcloud", "WEB_AUTHENTICATION_PASSWORD=%BORGBACKUP_VIEWER_PASSWORD%", "WEB_LISTENING_PORT=5801", "BORG_PASSPHRASE=%BORGBACKUP_PASSWORD%", "BORG_REPO=/mnt/borgbackup/borg" ], "secrets": [ "BORGBACKUP_VIEWER_PASSWORD", "BORGBACKUP_PASSWORD" ], "ui_secret": "BORGBACKUP_VIEWER_PASSWORD", "volumes": [ { "source": "nextcloud_aio_backup_cache", "destination": "/root", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data", "writeable": true }, { "source": "nextcloud_aio_mastercontainer", "destination": "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer", "writeable": true }, { "source": "%BORGBACKUP_HOST_LOCATION%", "destination": "/mnt/borgbackup", "writeable": true }, { "source": "nextcloud_aio_elasticsearch", "destination": "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch", "writeable": true }, { "source": "nextcloud_aio_redis", "destination": "/mnt/redis", "writeable": true } ], "devices": [ "/dev/fuse" ], "cap_add": [ "SYS_ADMIN" ], "apparmor_unconfined": true } ] } ================================================ FILE: community-containers/borgbackup-viewer/readme.md ================================================ ## Borgbackup Viewer This container allows to view the local borg repository in a web session. It also allows you to restore files and folders from the backup by using desktop programs in a web browser. ### Notes - After adding and starting the container, you need to visit `https://ip.address.of.this.server:5801` in order to log in with the user `nextcloud` and the password that you can see next to the container in the AIO interface. (The web page uses a self-signed certificate, so you need to accept the warning). - Then, you should see a terminal. There type in `borg mount /mnt/borgbackup/borg /tmp/borg` to mount the backup archive at `/tmp/borg` inside the container. Afterwards type in `nautilus /tmp/borg` which will show a file explorer and allows you to see all the files. You can then copy files and folders back to their initial mountpoints inside `/nextcloud_aio_volumes/`, `/host_mounts/` and `/docker_volumes/`. ⚠️ Be very carefully while doing that as can break your instance! - After you are done with the operation, click on the terminal in the background and press `[CTRL]+[c]` multiple times to close any open application. Then run `umount /tmp/borg` to unmount the mountpoint correctly. - You can also delete specific archives by running `borg list`, delete a specific archive e.g. via `borg delete --stats --progress "::20220223_174237-nextcloud-aio"` and compact the archives via `borg compact`. After doing so, make sure to update the backup archives list in the AIO interface! You can do so by clicking on the `Update backup list` button in the `Update backup list` section inside the `Backup and restore` section. - ⚠️ After you are done doing your operations, remove the container for better security again from the stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers#how-to-remove-containers-from-aios-stack - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-borgbackup-viewer ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/caddy/caddy.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-caddy", "display_name": "Caddy with geoblocking", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy", "image": "ghcr.io/szaimen/aio-caddy", "image_tag": "v4", "internal_port": "443", "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "443", "protocol": "tcp" } ], "environment": [ "TZ=%TIMEZONE%", "NC_DOMAIN=%NC_DOMAIN%", "APACHE_PORT=%APACHE_PORT%", "APACHE_IP_BINDING=%APACHE_IP_BINDING%", "NEXTCLOUD_EXPORTER_CADDY_PASSWORD=%NEXTCLOUD_EXPORTER_CADDY_PASSWORD%" ], "volumes": [ { "source": "nextcloud_aio_caddy", "destination": "/data", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/nextcloud", "writeable": false } ], "secrets": [ "NEXTCLOUD_EXPORTER_CADDY_PASSWORD" ], "aio_variables": [ "apache_ip_binding=@INTERNAL", "apache_port=11000", "turn_domain=%NC_DOMAIN%", "talk_port=443" ], "nextcloud_exec_commands": [ "mkdir '/mnt/ncdata/admin/files/nextcloud-aio-caddy'", "touch '/mnt/ncdata/admin/files/nextcloud-aio-caddy/allowed-countries.txt'", "echo 'Scanning nextcloud-aio-caddy folder for admin user...'", "php /var/www/html/occ files:scan --path='/admin/files/nextcloud-aio-caddy'" ] } ] } ================================================ FILE: community-containers/caddy/readme.md ================================================ ## Caddy with geoblocking This container bundles caddy and auto-configures it for you. It also covers [vaultwarden](https://github.com/nextcloud/all-in-one/tree/main/community-containers/vaultwarden) by listening on `bw.$NC_DOMAIN`, if installed. It also covers [stalwart](https://github.com/nextcloud/all-in-one/tree/main/community-containers/stalwart) by listening on `mail.$NC_DOMAIN`, if installed. It also covers [jellyfin](https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyfin) by listening on `media.$NC_DOMAIN`, if installed. It also covers [lldap](https://github.com/nextcloud/all-in-one/tree/main/community-containers/lldap) by listening on `ldap.$NC_DOMAIN`, if installed. It also covers [nocodb](https://github.com/nextcloud/all-in-one/tree/main/community-containers/nocodb) by listening on `tables.$NC_DOMAIN`, if installed. It also covers [seerr](https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyseerr) by listening on `requests.$NC_DOMAIN`, if installed. It also covers [nextcloud-exporter](https://github.com/nextcloud/all-in-one/tree/main/community-containers/nextcloud-exporter) by listening on `metrics.$NC_DOMAIN`, if installed. It also covers [LocalAI](https://github.com/nextcloud/all-in-one/tree/main/community-containers/local-ai) by listening on `ai.$NC_DOMAIN`, if installed. ### Notes - This container is incompatible with the [npmplus](https://github.com/nextcloud/all-in-one/tree/main/community-containers/npmplus) community container. So make sure that you do not enable both at the same time! - Make sure that no other service is using port 443/tcp on your host as otherwise the containers will fail to start. You can check this with `sudo netstat -tulpn | grep 443` before installing AIO. - Starting with AIO v12, the Talk port that was usually exposed on port 3478 is now set to port 443 udp and tcp and reachable via `your-nc-domain.com`. For the changes to become activated, you need to go to `https://your-nc-domain.com/settings/admin/talk` and delete all turn and stun servers. Then restart the containers and the new config should become active. - Starting with AIO v12, you can also limit vaultwarden, stalwart and lldap to certain ip-addresses. You can do so by creating a `allowed-IPs-vaultwarden.txt`, `allowed-IPs-stalwart.txt`, or `allowed-IPs-lldap.txt` file in the `nextcloud-aio-caddy` directory of your admin user and adding the ip-addresses in these files. - The container also supports the proxy protocol inside caddy. That means that you can run a supported web server in front of port 443/tcp and use the proxy protocol. You can enable this by configuring the `APACHE_IP_BINDING` environmental variable for the mastercontainer and set it to an ip-address from which the protocol shall be accepted. ⚠️ Note that the initial domain validation will not work correctly if you want to use the proxy protocol. So make sure to skip the domain validation in that case. See the [documentation](https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation). - If you want to use this with [vaultwarden](https://github.com/nextcloud/all-in-one/tree/main/community-containers/vaultwarden), make sure that you point `bw.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for vaultwarden. - If you want to use this with [stalwart](https://github.com/nextcloud/all-in-one/tree/main/community-containers/stalwart), make sure that you point `mail.your-nc-domain.com` to your server using an A, AAAA or CNAME record so that caddy can get a certificate automatically for stalwart. - If you want to use this with [jellyfin](https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyfin), make sure that you point `media.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for jellyfin. - If you want to use this with [lldap](https://github.com/nextcloud/all-in-one/tree/main/community-containers/lldap), make sure that you point `ldap.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for lldap. - If you want to use this with [nocodb](https://github.com/nextcloud/all-in-one/tree/main/community-containers/nocodb), make sure that you point `tables.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for nocodb. - If you want to use this with [seerr](https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyseerr), make sure that you point `requests.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for seerr. - If you want to use this with [nextcloud-exporter](https://github.com/nextcloud/all-in-one/tree/main/community-containers/nextcloud-exporter), make sure that you point `metrics.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for nextcloud-exporter. - If you want to use this with [local AI](https://github.com/nextcloud/all-in-one/tree/main/community-containers/local-ai), make sure that you point `ai.your-nc-domain.com` to your server using a cname record so that caddy can get a certificate automatically for local AI. - After the container was started the first time, you should see a new `nextcloud-aio-caddy` folder and inside there an `allowed-countries.txt` file when you open the files app with the default `admin` user. In there you can adjust the allowed country codes for caddy by adding them to the first line, e.g. `IT FR` would allow access from italy and france. Private ip-ranges are always allowed. Additionally, in order to activate this config, you need to get an account at https://dev.maxmind.com/geoip/geolite2-free-geolocation-data and download the `GeoLite2-Country.mmdb` and upload it with this exact name into the `nextcloud-aio-caddy` folder. Afterwards restart all containers from the AIO interface and your new config should be active! - You can add your own Caddy configurations in `/data/caddy-imports/` inside the Caddy container (`sudo docker exec -it nextcloud-aio-caddy bash`). These will be imported on container startup. **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack - If you want to remove the container again and revert back to the default, you need to disable the container via the AIO-interface and follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#8-removing-the-reverse-proxy ### Repository https://github.com/szaimen/aio-caddy ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/calcardbackup/calcardbackup.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-calcardbackup", "display_name": "Calendar and contacts backup", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/calcardbackup", "image": "waja/calcardbackup", "image_tag": "latest", "restart": "unless-stopped", "environment": [ "CRON_TIME=0 0 * * *", "INIT_BACKUP=yes", "BACKUP_DIR=/backup", "NC_DIR=/nextcloud", "NC_HOST=%NC_DOMAIN%", "DB_HOST=nextcloud-aio-database", "DB_PORT=5432", "CALCARD_OPTS=-ltm 5" ], "volumes": [ { "source": "nextcloud_aio_calcardbackup", "destination": "/backup", "writeable": true }, { "source": "nextcloud_aio_nextcloud", "destination": "/nextcloud", "writeable": false } ], "backup_volumes": [ "nextcloud_aio_calcardbackup" ] } ] } ================================================ FILE: community-containers/calcardbackup/readme.md ================================================ ## calcardbackup This container packages calcardbackup which is a tool that exports calendars and addressbooks from Nextcloud to .ics and .vcf files and saves them to a compressed file. ### Notes - Backups will be created at 00:00 UTC every day. Make sure that this does not conflict with the configured daily backups inside AIO. - All the exports will be included in AIOs backup solution - You can find the exports in the nextcloud_aio_calcardbackup volume - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/waja/docker-calcardbackup ### Maintainer https://github.com/pailloM ================================================ FILE: community-containers/container-management/container-management.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-container-management", "display_name": "Container Management", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management", "image": "ghcr.io/szaimen/aio-container-management", "image_tag": "v1", "internal_port": "5804", "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "5804", "protocol": "tcp" } ], "volumes": [ { "source": "%WATCHTOWER_DOCKER_SOCKET_PATH%", "destination": "/var/run/docker.sock", "writeable": false } ], "environment": [ "TZ=%TIMEZONE%", "SECURE_CONNECTION=1", "WEB_AUTHENTICATION=1", "USER_ID=0", "GROUP_ID=0", "WEB_AUTHENTICATION_USERNAME=container-management", "WEB_AUTHENTICATION_PASSWORD=%CONTAINER_MANAGEMENT_PASSWORD%", "WEB_LISTENING_PORT=5804" ], "secrets": [ "CONTAINER_MANAGEMENT_PASSWORD" ], "ui_secret": "CONTAINER_MANAGEMENT_PASSWORD" } ] } ================================================ FILE: community-containers/container-management/readme.md ================================================ ## Container-Management This container allows to manage insides of other containers via a GUI inside a Web session by allowing to run docker commands from inside this container. ### Notes - After adding and starting the container, you need to visit `https://ip.address.of.this.server:5804` in order to log in with the user `container-management` and the password that you can see next to the container in the AIO interface. (The web page uses a self-signed certificate, so you need to accept the warning). - Then, you should see a terminal. There you can use any docker command. ⚠️ Be very carefully while doing that as can break your instance! - There are also some pre-made scripts that make configuring some of the community containers easier. For example scripts for [LLDAP](https://github.com/nextcloud/all-in-one/tree/main/community-containers/lldap) and [Facerecognition](https://github.com/nextcloud/all-in-one/tree/main/community-containers/facerecognition). - ⚠️ After you are done doing your operations, remove the container for better security again from the stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers#how-to-remove-containers-from-aios-stack - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-container-management ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/dlna/dlna.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-dlna", "display_name": "DLNA", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/dlna", "image": "thanek/nextcloud-dlna", "image_tag": "latest", "internal_port": "host", "restart": "unless-stopped", "depends_on": [ "nextcloud-aio-database" ], "environment": [ "NC_DOMAIN=%NC_DOMAIN%", "NC_PORT=443", "NEXTCLOUD_DLNA_SERVER_PORT=9999", "NEXTCLOUD_DLNA_FRIENDLY_NAME=nextcloud-aio", "NEXTCLOUD_DATA_DIR=/data", "NEXTCLOUD_DB_TYPE=postgres", "NEXTCLOUD_DB_HOST=%AIO_DATABASE_HOST%", "NEXTCLOUD_DB_PORT=5432", "NEXTCLOUD_DB_NAME=nextcloud_database", "NEXTCLOUD_DB_USER=oc_nextcloud", "NEXTCLOUD_DB_PASS=%DATABASE_PASSWORD%" ], "secrets": [ "DATABASE_PASSWORD" ], "volumes": [ { "source": "%NEXTCLOUD_DATADIR%", "destination": "/data", "writeable": false } ] } ] } ================================================ FILE: community-containers/dlna/readme.md ================================================ ## DLNA server This container bundles DLNA server for your Nextcloud files to be accessible by the clients in your local network. Simply run the container and look for a new media server `nextcloud-aio` in your local network. ### Notes - This container will work only if the Nextcloud installation is in your home network, it is not suitable for installations on remote servers. - If you have a firewall like ufw configured, you might need to open at least port 9999 TCP and 1900 UDP first in order to make it work. - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/thanek/nextcloud-dlna ### Maintainer https://github.com/thanek ================================================ FILE: community-containers/facerecognition/facerecognition.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-facerecognition", "display_name": "Computing container for facerecognition", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/facerecognition", "image": "matiasdelellis/facerecognition-external-model", "image_tag": "v1", "internal_port": "5000", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%", "API_KEY=%FACERECOGNITION_API_KEY%", "FACE_MODEL=3" ], "aio_variables": [ "nextcloud_memory_limit=2048M" ], "secrets": [ "FACERECOGNITION_API_KEY" ], "enable_nvidia_gpu": false, "nextcloud_exec_commands": [ "php /var/www/html/occ app:install facerecognition", "php /var/www/html/occ app:enable facerecognition", "php /var/www/html/occ config:system:set facerecognition.external_model_url --value nextcloud-aio-facerecognition:5000", "php /var/www/html/occ config:system:set facerecognition.external_model_api_key --value %FACERECOGNITION_API_KEY%", "php /var/www/html/occ face:setup -m 5", "php /var/www/html/occ face:setup -M 1G", "php /var/www/html/occ config:app:set facerecognition analysis_image_area --value 4320000", "php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 0 --value image/jpeg", "php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 1 --value image/png", "php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 2 --value image/heic", "php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 3 --value image/tiff", "php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 4 --value image/webp", "php /var/www/html/occ face:background_job --defer-clustering &" ] } ] } ================================================ FILE: community-containers/facerecognition/readme.md ================================================ ## Facerecognition This container bundles the external model of facerecognition and auto-configures it for you. ### Notes - This container needs imaginary in order to analyze modern file format images. Make sure to enable imaginary in the AIO interface before adding this container. - The image analysis is currently set to fixed value of `1G`. See [this](https://github.com/search?q=repo%3Anextcloud%2Fall-in-one+1G+path%3A%2F%5Ecommunity-containers%5C%2Ffacerecognition%5C%2F%2F&type=code) - Facerecognition is by default disabled for all users. If you want to enable facerecognition for all users, you can run the following commands before adding this container:
**Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management. This script below can be run from inside the container-management container via `bash /facerecognition.sh`. ```bash # Go into the container sudo docker exec --user www-data -it nextcloud-aio-nextcloud bash ``` Now inside the container: ```bash NC_USERS_NEW=$(php occ user:list | sed 's|^ - ||g' | sed 's|:.*||') mapfile -t NC_USERS_NEW <<< "$NC_USERS_NEW" for user in "${NC_USERS_NEW[@]}" do php occ user:setting "$user" facerecognition full_image_scan_done false php occ user:setting "$user" facerecognition enabled true done # Exit the container shell exit ``` - If facerecognition shall analyze shared files & folders (`sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set facerecognition handle_shared_files --value true`), groupfolders (`sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set facerecognition handle_group_files --value true`) and/or external storages (`sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:app:set facerecognition handle_external_files --value true`) in Nextcloud, you need to enable support for it manually first by running the mentioned commands before adding this container. See https://github.com/matiasdelellis/facerecognition/wiki/Settings#hidden-settings for further notes on each of these settings.
**Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/matiasdelellis/facerecognition-external-model ### Maintainer https://github.com/matiasdelellis ================================================ FILE: community-containers/fail2ban/fail2ban.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-fail2ban", "display_name": "Fail2ban", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban", "image": "ghcr.io/szaimen/aio-fail2ban", "image_tag": "v1", "internal_port": "host", "restart": "unless-stopped", "cap_add": [ "NET_ADMIN", "NET_RAW" ], "environment": [ "TZ=%TIMEZONE%" ], "volumes": [ { "source": "nextcloud_aio_nextcloud", "destination": "/nextcloud", "writeable": false }, { "source": "nextcloud_aio_vaultwarden_logs", "destination": "/vaultwarden", "writeable": false }, { "source": "nextcloud_aio_jellyfin", "destination": "/jellyfin", "writeable": false }, { "source": "nextcloud_aio_jellyseerr", "destination": "/jellyseerr", "writeable": false } ] } ] } ================================================ FILE: community-containers/fail2ban/readme.md ================================================ ## Fail2ban This container bundles fail2ban and auto-configures it for you in order to block ip-addresses automatically. It also covers https://github.com/nextcloud/all-in-one/tree/main/community-containers/vaultwarden, https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyfin, and https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyseerr, if installed. ### Notes - If you get an error like `"ip6tables v1.8.9 (legacy): can't initialize ip6tables table filter': Table does not exist (do you need to insmod?)"`, you need to enable ip6tables on your host via `sudo modprobe ip6table_filter`. - If you get an error like `stderr: 'iptables: No chain/target/match by that name.'` and `stderr: 'ip6tables: No chain/target/match by that name.'`, you need to follow https://github.com/szaimen/aio-fail2ban/issues/9#issuecomment-2026898790 in order to resolve this. - You can unban ip addresses like so for example: `docker exec -it nextcloud-aio-fail2ban fail2ban-client set nextcloud unbanip 203.113.167.162`. **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-fail2ban ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/glances/glances.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-glances", "display_name": "Glances", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/glances", "image": "nicolargo/glances", "image_tag": "latest-full", "internal_port": "61208", "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "61208", "protocol": "tcp" } ], "volumes": [ { "source": "nextcloud_aio_glances", "destination": "/etc/glances", "writeable": true }, { "source": "%WATCHTOWER_DOCKER_SOCKET_PATH%", "destination": "/var/run/docker.sock", "writeable": false } ], "environment": [ "GLANCES_OPT=-w" ], "backup_volumes": [ "nextcloud_aio_glances" ] } ] } ================================================ FILE: community-containers/glances/readme.md ================================================ ## Glances This container starts Glances, a web-based info-board, and auto-configures it for you. > [!CAUTION] > This container mounts the docker-socket from the host-system. ### Notes - After adding and starting the container, you can directly visit http://ip.address.of.server:61208/ and access your new Glances instance! - It is recommended to start this container only in home networks, because there is no built-in authentication. But you can do a http-auth with your proxy. - In order to access your Glances outside the local network, you have to set up your own reverse proxy. You can set up a reverse proxy following [these instructions](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md). - The data of Glances will be automatically included in AIO's backup solution! - See [here](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) how to add it to the AIO stack. ### Repository https://github.com/nicolargo/glances ### Maintainer https://github.com/pi-farm ================================================ FILE: community-containers/helloworld/helloworld.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-helloworld", "display_name": "Hello world", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/helloworld", "image": "ghcr.io/docjyj/aio-helloworld", "image_tag": "%AIO_CHANNEL%", "restart": "unless-stopped" } ] } ================================================ FILE: community-containers/helloworld/readme.md ================================================ ## Hello World This container is a template for creating a community container. ### Repository https://github.com/docjyj/aio-helloworld ### Maintainer https://github.com/docjyj ================================================ FILE: community-containers/jellyfin/jellyfin.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-jellyfin", "display_name": "Jellyfin", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyfin", "image": "jellyfin/jellyfin", "image_tag": "latest", "internal_port": "host", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%" ], "volumes": [ { "source": "nextcloud_aio_jellyfin", "destination": "/config", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/media", "writeable": false }, { "source": "%NEXTCLOUD_MOUNT%", "destination": "%NEXTCLOUD_MOUNT%", "writeable": true } ], "devices": [ "/dev/dri" ], "enable_nvidia_gpu": true, "backup_volumes": [ "nextcloud_aio_jellyfin" ] } ] } ================================================ FILE: community-containers/jellyfin/readme.md ================================================ ## Jellyfin This container bundles Jellyfin and auto-configures it for you. ### Notes - This container is incompatible with the [Plex](https://github.com/nextcloud/all-in-one/tree/main/community-containers/plex) community container. So make sure that you do not enable both at the same time! - After adding and starting the container, you can directly visit http://ip.address.of.server:8096/ and access your new Jellyfin instance! - This container should usually only be run in home networks as it exposes unencrypted services like DLNA by default which can be disabld via the web interface though. - In order to access your Jellyfin outside the local network, you have to set up your own reverse proxy. You can set up a reverse proxy following [these instructions](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md) and [Jellyfin's networking documentation](https://jellyfin.org/docs/general/networking/#running-jellyfin-behind-a-reverse-proxy), OR use the [Caddy](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy) community container that will automatically configure `media.$NC_DOMAIN` to redirect to your Jellyfin. - ⚠️ After the initial start, Jellyfin shows a configuration page to set up the root password, etc. **Be careful to initialize your Jellyfin before adding the DNS record.** - If you have a firewall like ufw configured, you might need to open all Jellyfin ports in there first in order to make it work. Especially port 8096 is important! - If you want to secure the installation with fail2ban, you might want to check out https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban - The data of Jellyfin will be automatically included in AIO's backup solution! - See [here](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) how to add it to the AIO stack. ### Repository https://github.com/jellyfin/jellyfin ### Maintainer https://github.com/airopi ================================================ FILE: community-containers/jellyseerr/jellyseerr.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-jellyseerr", "display_name": "Seerr", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyseerr", "image": "ghcr.io/seerr-team/seerr", "image_tag": "latest", "internal_port": "5055", "restart": "unless-stopped", "init": true, "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "5055", "protocol": "tcp" } ], "environment": [ "PORT=5055", "TZ=%TIMEZONE%" ], "volumes": [ { "source": "nextcloud_aio_jellyseerr", "destination": "/app/config", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_jellyseerr" ] } ] } ================================================ FILE: community-containers/jellyseerr/readme.md ================================================ ## Seerr This container bundles Seerr and auto-configures it for you. ### Notes - **Migration from Jellyseerr**: Jellyseer previously ran as the root user. With the migration to Seerr, the container now runs rootless with userid 1000, meaning that if you previously used Jellyseerr, Seerr will not be able to access the config files generated by the old Jellyseerr container. To migrate, execute the following steps: 1. stop all containers using the AIO-interface, 2. run `sudo docker run --rm -v nextcloud_aio_jellyseerr:/data alpine chown -R 1000:1000 /data` - This container is only intended to be used inside home networks as it uses http for its management page by default. - After adding and starting the container, you can directly visit `http://ip.address.of.server:5055` and access your new Seerr instance, which can be used to manage Plex, Jellyfin, and Emby. - In order to access your Seerr outside the local network, you have to set up your own reverse proxy. You can set up a reverse proxy following [these instructions](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md) and [Seerr's reverse proxy documentation.](https://docs.seerr.dev/extending-Seerr/reverse-proxy), OR use the Caddy community container that will automatically configure requests.$NC_DOMAIN to redirect to your Seerr. Note that it is recommended to [enable CSRF protection in Seerr](https://docs.seerr.dev/using-Seerr/settings/general#enable-csrf-protection) for added security if you plan to use Seerr outside the local network, but make sure to read up on it and understand the caveats first. - If you want to secure the installation with fail2ban, you might want to check out https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban. Note that [enabling the proxy support option in Seerr](https://docs.seerr.dev/using-Seerr/settings/general#enable-proxy-support) is required for this to work properly. - The config of Seerr will be automatically included in AIO's backup solution! - See [here](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) how to add it to the AIO stack. ### Repository https://github.com/seerr-team/seerr ### Maintainer https://github.com/Anvil5465 ================================================ FILE: community-containers/languagetool/languagetool.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-languagetool", "display_name": "LanguageTool for Collabora", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/languagetool", "image": "erikvl87/languagetool", "image_tag": "latest", "internal_port": "8010", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%" ] } ] } ================================================ FILE: community-containers/languagetool/readme.md ================================================ ## LanguageTool for Nextcloud Office This container bundles a LanguageTool for Nextcloud Office which adds spell checking functionality to Nextcloud Office. ### Notes - Make sure to have Nextcloud Office enabled via the AIO interface - After adding this container via the AIO Interface, while all containers are still stopped, you need to scroll down to the `Additional Nextcloud Office options` section and enter `--o:languagetool.enabled=true --o:languagetool.base_url=http://nextcloud-aio-languagetool:8010/v2`. - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/Erikvl87/docker-languagetool ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/libretranslate/libretranslate.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-libretranslate", "display_name": "LibreTranslate (deprecated)", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/libretranslate", "image": "ghcr.io/szaimen/aio-libretranslate", "image_tag": "v1", "internal_port": "5000", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%" ], "volumes": [ { "source": "nextcloud_aio_libretranslate_db", "destination": "/app/db", "writeable": true }, { "source": "nextcloud_aio_libretranslate_models", "destination": "/home/libretranslate/.local", "writeable": true } ], "nextcloud_exec_commands": [ "php /var/www/html/occ app:install integration_libretranslate", "php /var/www/html/occ app:enable integration_libretranslate", "php /var/www/html/occ config:app:set integration_libretranslate host --value='http://nextcloud-aio-libretranslate'", "php /var/www/html/occ config:app:set integration_libretranslate port --value='5000'" ] } ] } ================================================ FILE: community-containers/libretranslate/readme.md ================================================ ## LibreTranslate This container bundles LibreTranslate and auto-configures it for you. > [!WARNING] > The LibreTranslate container and app is deprecated! > Please use the [translate2 app](https://apps.nextcloud.com/apps/translate2) instead. > You can activate it by first enabling the Docker-Socket-Proxy in the AIO-interface and then heading over to `https://your-nc-domain.com/settings/apps/tools` and installing and enabling the `Local Machine Translation` app. ### Notes - After the initial startup is done, you might want to change the default language to translate from and to via: ```bash # Adjust the values `en` and `de` in commands below accordingly sudo docker exec --user www-data nextcloud-aio-nextcloud php occ config:app:set integration_libretranslate from_lang --value="en" sudo docker exec --user www-data nextcloud-aio-nextcloud php occ config:app:set integration_libretranslate to_lang --value="de" ``` - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-libretranslate ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/lldap/lldap.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-lldap", "display_name": "Light LDAP implementation", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/lldap", "image": "lldap/lldap", "image_tag": "v0-alpine", "internal_port": "17170", "restart": "unless-stopped", "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "17170", "protocol": "tcp" } ], "environment": [ "TZ=%TIMEZONE%", "UID=65534", "GID=65534", "LLDAP_JWT_SECRET=%LLDAP_JWT_SECRET%", "LLDAP_LDAP_USER_PASS=%LLDAP_LDAP_USER_PASS%", "LLDAP_LDAP_BASE_DN=%NC_BASE_DN%" ], "secrets": [ "LLDAP_JWT_SECRET", "LLDAP_LDAP_USER_PASS" ], "ui_secret": "LLDAP_LDAP_USER_PASS", "volumes": [ { "source": "nextcloud_aio_lldap", "destination": "/data", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_lldap" ], "nextcloud_exec_commands": [ "php /var/www/html/occ app:install user_ldap", "php /var/www/html/occ app:enable user_ldap" ] } ] } ================================================ FILE: community-containers/lldap/readme.md ================================================ ## Light LDAP server This container bundles LLDAP server and auto-configures your Nextcloud instance for you. ### Notes - In order to access your LLDAP web interface outside the local network, you have to set up your own reverse proxy. You can set up a reverse proxy following [these instructions](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md) OR use the [Caddy](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy) community container that will automatically configure `ldap.$NC_DOMAIN` to redirect to your Lldap. You need to point the reverse proxy at port 17170 of this server. - After adding and starting the container, you can log in to the lldap web interface by using the username `admin` and the secret that you can see next to the container in the AIO interface. - To configure Nextcloud, you can use the generic configuration proposed below. - For advanced configurations, see how to configure a client with lldap https://github.com/lldap/lldap#client-configuration - Also, see how Nextcloud's LDAP application works https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/user_auth_ldap.html - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Generic Nextcloud LDAP config Functionality with this configuration: - User and group management. - Login via username (or email) and password. - Profile picture sync. - Synchronization of administrator accounts (via the lldap_admin group). > For simplicity, this configuration is done via the command line (don't worry, it's very simple). First, you need to retrieve the LLDAP admin password that you can see next to the container in the AIO interface. There you can configure smtp first and then invite users via mail. Now go into the Nextcloud container:
**Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management. This script below can be run from inside the container-management container via `bash /lldap.sh`. ```bash sudo docker exec --user www-data -it nextcloud-aio-nextcloud bash ``` Now inside the container: ```bash # Get Base BASE_DN="dc=${NC_DOMAIN//./,dc=}" # Create a new empty ldap config CONF_NAME=$(php /var/www/html/occ ldap:create-empty-config -p) # Check that the base DN matches your domain and retrieve your configuration name echo "Base DN: '$BASE_DN', Config name: '$CONF_NAME'" # Set the ldap password php /var/www/html/occ ldap:set-config $CONF_NAME ldapAgentPassword "" # Set the ldap config: Host and connection php /var/www/html/occ ldap:set-config $CONF_NAME ldapAdminGroup lldap_admin php /var/www/html/occ ldap:set-config $CONF_NAME ldapAgentName "cn=admin,ou=people,$BASE_DN" php /var/www/html/occ ldap:set-config $CONF_NAME ldapBase "$BASE_DN" php /var/www/html/occ ldap:set-config $CONF_NAME ldapHost "ldap://nextcloud-aio-lldap" php /var/www/html/occ ldap:set-config $CONF_NAME ldapPort 3890 php /var/www/html/occ ldap:set-config $CONF_NAME ldapTLS 0 php /var/www/html/occ ldap:set-config $CONF_NAME turnOnPasswordChange 0 # Set the ldap config: Users php /var/www/html/occ ldap:set-config $CONF_NAME ldapBaseUsers "ou=people,$BASE_DN" php /var/www/html/occ ldap:set-config $CONF_NAME ldapEmailAttribute mail php /var/www/html/occ ldap:set-config $CONF_NAME ldapGidNumber gidNumber php /var/www/html/occ ldap:set-config $CONF_NAME ldapLoginFilter "(&(|(objectclass=person))(|(uid=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))))" php /var/www/html/occ ldap:set-config $CONF_NAME ldapLoginFilterEmail 1 php /var/www/html/occ ldap:set-config $CONF_NAME ldapLoginFilterUsername 1 php /var/www/html/occ ldap:set-config $CONF_NAME ldapUserAvatarRule default php /var/www/html/occ ldap:set-config $CONF_NAME ldapUserDisplayName cn php /var/www/html/occ ldap:set-config $CONF_NAME ldapUserFilter "(|(objectclass=person))" php /var/www/html/occ ldap:set-config $CONF_NAME ldapUserFilterMode 0 php /var/www/html/occ ldap:set-config $CONF_NAME ldapUserFilterObjectclass person # Set the ldap config: Groups php /var/www/html/occ ldap:set-config $CONF_NAME ldapBaseGroups "ou=groups,$BASE_DN" php /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupDisplayName cn php /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupFilter "(&(|(objectclass=groupOfUniqueNames)))" php /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupFilterMode 0 php /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupFilterObjectclass groupOfUniqueNames php /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupMemberAssocAttr uniqueMember php /var/www/html/occ ldap:set-config $CONF_NAME useMemberOfToDetectMembership 1 # Optional : Check the configuration #php /var/www/html/occ ldap:show-config $CONF_NAME # Test the ldap config php /var/www/html/occ ldap:test-config $CONF_NAME # Enable ldap config php /var/www/html/occ ldap:set-config $CONF_NAME ldapConfigurationActive 1 # Exit the container shell exit ``` It's done ! All you have to do is go to the Nextcloud administration interface to see the magic of LDAP. ### Repository https://github.com/lldap/lldap ### Maintainer https://github.com/docjyj ================================================ FILE: community-containers/local-ai/local-ai.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-local-ai", "display_name": "Local AI", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/local-ai", "image": "ghcr.io/docjyj/aio-local-ai-vulkan", "image_tag": "v1", "internal_port": "10078", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%", "LOCALAI_API_KEY=%LOCALAI_API_KEY%", "LOCALAI_ADDRESS=:10078", "LOCALAI_CONFIG_DIR=/configuration", "LOCALAI_MODEL_PATH=/models", "LOCALAI_BACKEND_PATH=/backends" ], "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "10078", "protocol": "tcp" } ], "volumes": [ { "source": "nextcloud_aio_localai_configuration", "destination": "/configuration", "writeable": true }, { "source": "nextcloud_aio_localai_models", "destination": "/models", "writeable": true }, { "source": "nextcloud_aio_localai_backends", "destination": "/backends", "writeable": true } ], "secrets": [ "LOCALAI_API_KEY" ], "ui_secret": "LOCALAI_API_KEY", "devices": [ "/dev/dri" ], "nextcloud_exec_commands": [ "php /var/www/html/occ app:install integration_openai", "php /var/www/html/occ app:enable integration_openai", "php /var/www/html/occ config:app:set integration_openai url --value http://nextcloud-aio-local-ai:10078", "php /var/www/html/occ config:app:set integration_openai api_key --value %LOCALAI_API_KEY%", "php /var/www/html/occ app:install assistant", "php /var/www/html/occ app:enable assistant" ], "backup_volumes": [ "nextcloud_aio_localai_configuration" ] } ] } ================================================ FILE: community-containers/local-ai/readme.md ================================================ ## Local AI This container bundles Local AI and auto-configures it for you. It support hardware acceleration with Vulkan. ### Notes Documentation is available on the container repository. This documentation is regularly updated and is intended to be as simple and detailed as possible. Thanks for all your feedback! - See https://github.com/docjyJ/aio-local-ai-vulkan#getting-started for getting start with this container. - See [this guide](https://github.com/nextcloud/all-in-one/discussions/5430) for how to improve AI task pickup speed - Note that Nextcloud supports only one server for AI queries, so this container cannot be used at the same time as other AI containers. - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/docjyJ/aio-local-ai-vulkan ### Maintainer https://github.com/docjyJ ================================================ FILE: community-containers/makemkv/makemkv.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-makekv", "display_name": "MakeMKV", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/makemkv", "image": "jlesage/makemkv", "image_tag": "latest", "internal_port": "5802", "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "5802", "protocol": "tcp" } ], "volumes": [ { "source": "nextcloud_aio_makemkv", "destination": "/config", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/storage", "writeable": false }, { "source": "%NEXTCLOUD_MOUNT%", "destination": "/output", "writeable": true }, { "source": "/dev", "destination": "/dev", "writeable": false } ], "environment": [ "TZ=%TIMEZONE%", "SECURE_CONNECTION=1", "WEB_AUTHENTICATION=1", "USER_ID=33", "GROUP_ID=33", "WEB_AUTHENTICATION_USERNAME=makemkv", "WEB_AUTHENTICATION_PASSWORD=%MAKEMKV_PASSWORD%", "WEB_LISTENING_PORT=5802" ], "secrets": [ "MAKEMKV_PASSWORD" ], "ui_secret": "MAKEMKV_PASSWORD", "backup_volumes": [ "nextcloud_aio_makemkv" ] } ] } ================================================ FILE: community-containers/makemkv/readme.md ================================================ ## MakeMKV This container bundles MakeMKV and auto-configures it for you. ### Notes - This container should only be run in home networks - ⚠️ This container mounts all devices from the host inside the container in order to be able to access the external DVD/Blu-ray drives which is a security issue. However no better solution was found for the time being. - This container only works on Linux and not on Docker-Desktop. - This container requires the [`NEXTCLOUD_MOUNT` variable in AIO to be set](https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host). Otherwise the output will not be saved correctly.. - After adding and starting the container, you need to visit `https://internal.ip.of.server:5802` in order to log in with the `makemkv` user and the password that you can see next to the container in the AIO interface. (The web page uses a self-signed certificate, so you need to accept the warning). - After the first login, you can adjust the `/output` directory in the MakeMKV settings to a subdirectory of the root of your chosen `NEXTCLOUD_MOUNT`. (by default `NEXTCLOUD_MOUNT` is mounted to `/output` inside the container. Thus all data is written to the root of it) - The configured `NEXTCLOUD_DATADIR` is getting mounted to `/storage` inside the container. - The config data of MakeMKV will be automatically included in AIOs backup solution! - ⚠️ After you are done doing your operations, remove the container for better security again from the stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers#how-to-remove-containers-from-aios-stack - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/jlesage/docker-makemkv ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/memories/memories.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-memories", "display_name": "Memories Transcoder", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/memories", "image": "radialapps/go-vod", "image_tag": "latest", "internal_port": "47788", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%", "NEXTCLOUD_HOST=https://%NC_DOMAIN%" ], "volumes": [ { "source": "%NEXTCLOUD_DATADIR%", "destination": "/mnt/ncdata", "writeable": false }, { "source": "%NEXTCLOUD_MOUNT%", "destination": "%NEXTCLOUD_MOUNT%", "writeable": false } ], "devices": [ "/dev/dri" ], "enable_nvidia_gpu": true, "nextcloud_exec_commands": [ "php /var/www/html/occ app:install memories", "php /var/www/html/occ app:enable memories", "php /var/www/html/occ config:system:set memories.vod.external --value true --type bool", "php /var/www/html/occ config:system:set memories.vod.connect --value nextcloud-aio-memories:47788" ] } ] } ================================================ FILE: community-containers/memories/readme.md ================================================ ## Memories This container bundles the hardware-transcoding container of memories and auto-configures it for you. ### Notes - In order to actually enable the hardware transcoding, you need to add the following flag to AIO apart from adding this container: https://github.com/nextcloud/all-in-one#how-to-enable-hardware-acceleration-for-nextcloud - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/pulsejet/memories ### Maintainer https://github.com/pulsejet ================================================ FILE: community-containers/minio/minio.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-minio", "image_tag": "v2", "display_name": "Minio S3 Storage", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/minio", "image": "ghcr.io/szaimen/aio-minio", "internal_port": "9000", "environment": [ "MINIO_ROOT_USER=nextcloud", "MINIO_ROOT_PASSWORD=%MINIO_ROOT_PASSWORD%" ], "secrets": [ "MINIO_ROOT_PASSWORD" ], "volumes": [ { "source": "nextcloud_aio_minio", "destination": "/data", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_minio" ], "nextcloud_exec_commands": [ "php /var/www/html/occ config:system:set objectstore class --value 'OC\\Files\\ObjectStore\\S3'", "php /var/www/html/occ config:system:set objectstore arguments autocreate --value true --type bool", "php /var/www/html/occ config:system:set objectstore arguments use_path_style --value true --type bool", "php /var/www/html/occ config:system:set objectstore arguments use_ssl --value false --type bool", "php /var/www/html/occ config:system:set objectstore arguments region --value ''", "php /var/www/html/occ config:system:set objectstore arguments bucket --value nextcloud", "php /var/www/html/occ config:system:set objectstore arguments key --value nextcloud", "php /var/www/html/occ config:system:set objectstore arguments secret --value %MINIO_ROOT_PASSWORD%", "php /var/www/html/occ config:system:set objectstore arguments port --value 9000", "php /var/www/html/occ config:system:set objectstore arguments hostname --value nextcloud-aio-minio" ] } ] } ================================================ FILE: community-containers/minio/readme.md ================================================ ## Minio This container bundles minio s3 storage and auto-configures it for you. >[!WARNING] > Enabling this container will remove access to all the files formerly written to the data directory. > So only enable this on a clean instance directly after installing AIO. > All additional users that are added via Nextcloud afterwards are going to work correctly. > Also, after enabling and using it, make sure to not disable the container as you cannot migrate from s3 to local storage anymore and s3 is a critical part of your infrastructure from then on. ### Notes - The data of Minio will be automatically included in AIOs backup solution! - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-minio ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/nextcloud-exporter/nextcloud-exporter.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-nextcloud-exporter", "display_name": "Prometheus Nextcloud Exporter", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/nextcloud-exporter", "image": "ghcr.io/xperimental/nextcloud-exporter", "image_tag": "0.9.0", "internal_port": "9205", "restart": "unless-stopped", "ports": [ { "ip_binding": "127.0.0.1", "port_number": "9205", "protocol": "tcp" } ], "environment": [ "TZ=%TIMEZONE%", "NEXTCLOUD_SERVER=https://%NC_DOMAIN%", "NEXTCLOUD_AUTH_TOKEN=%NEXTCLOUD_EXPORTER_TOKEN%", "NEXTCLOUD_LISTEN_ADDRESS=0.0.0.0:9205", "NEXTCLOUD_TIMEOUT=5s" ], "ui_secret": "NEXTCLOUD_EXPORTER_CADDY_PASSWORD", "secrets": [ "NEXTCLOUD_EXPORTER_TOKEN", "NEXTCLOUD_EXPORTER_CADDY_PASSWORD" ], "nextcloud_exec_commands": [ "php /var/www/html/occ config:app:set serverinfo token --value %NEXTCLOUD_EXPORTER_TOKEN%" ] } ] } ================================================ FILE: community-containers/nextcloud-exporter/readme.md ================================================ ## Prometheus Nextcloud Exporter A Prometheus exporter that collects metrics from your Nextcloud instance for monitoring and alerting. ### How to install See the [Community Containers documentation](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) for instructions on how to install this in your Nextcloud All-in-One setup. ### Security & Access **Important:** This container is configured to bind only to `127.0.0.1` (localhost) for security reasons. Prometheus exporters typically don't include authentication, so direct network exposure is not recommended. #### Access Options 1. **With Caddy Container (Recommended)**: If you also install the [Caddy community container](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy), it will automatically configure secure HTTPS access to your metrics with authentication at `metrics.your-domain.com` **Getting Authentication Credentials**: - **Username**: Always `metrics` - **Password**: After deploying the nextcloud-exporter container, the automatically generated password will be displayed in the AIO interface. Look for it in the container section below the container name "Prometheus Nextcloud Exporter". 2. **Custom Reverse Proxy**: Set up your own reverse proxy (nginx, Apache, etc.) to provide HTTPS and authentication. See configuration guides: - [NGINX Authentication](https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html) + [Reverse Proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) - [Apache Authentication](https://httpd.apache.org/docs/2.4/howto/auth.html) + [Reverse Proxy](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html) - [Traefik BasicAuth](https://doc.traefik.io/traefik/middlewares/http/basicauth/) - [Prometheus Security Best Practices](https://prometheus.io/docs/operating/security/) 3. **Direct Local Access**: Access metrics directly from the server at `http://127.0.0.1:9205/metrics` (no authentication) ### What it monitors - User activity (active users hourly, daily) - File counts and storage usage - System health and database size - App statistics and update availability - Nextcloud performance metrics ### Prometheus Configuration For **local server access** (if Prometheus runs on the same server): ```yaml scrape_configs: - job_name: 'nextcloud' scrape_interval: 90s static_configs: - targets: ['127.0.0.1:9205'] metrics_path: /metrics scheme: http ``` For **Caddy integration** (secure external access): ```yaml scrape_configs: - job_name: 'nextcloud' scrape_interval: 90s static_configs: - targets: ['metrics.your-domain.com'] metrics_path: / scheme: https basic_auth: username: 'metrics' password: 'your-generated-password' ``` ### Visualization Compatible with Grafana for creating monitoring dashboards: - Pre-built dashboard available: [Grafana Dashboard #20716](https://grafana.com/grafana/dashboards/20716-nextcloud/) ### Repository https://github.com/xperimental/nextcloud-exporter ### Maintainer https://github.com/grotax ================================================ FILE: community-containers/nocodb/nocodb.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-nocodb", "display_name": "NocoDB (deprecated)", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/nocodb", "image": "nocodb/nocodb", "image_tag": "latest", "internal_port": "10028", "restart": "unless-stopped", "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "10028", "protocol": "tcp" } ], "environment": [ "NC_AUTH_JWT_SECRET=%NOCODB_JWT_SECRET%", "NC_PUBLIC_URL=https://tables.%NC_DOMAIN%/", "NC_DASHBOARD_URL=/", "NC_ADMIN_EMAIL=admin@noco.db", "NC_ADMIN_PASS=%NOCODB_USER_PASS%", "PORT=10028", "NC_DISABLE_TELE=true" ], "secrets": [ "NOCODB_JWT_SECRET", "NOCODB_USER_PASS" ], "ui_secret": "NOCODB_USER_PASS", "volumes": [ { "source": "nextcloud_aio_nocodb", "destination": "/usr/app/data", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_nocodb" ] } ] } ================================================ FILE: community-containers/nocodb/readme.md ================================================ > [!CAUTION] > NocoDB is licensed under a non-free license. > > And is no longer maintained. > [!NOTE] > This container is there to compensate for the lack of functionality in Nextcloud Tables. > > When Nextcloud Tables V2 is released, I will stop checking for updates, and will no longer fix any potential issues. > > Some missing functionality in Nextcloud Tables: > - Multiple view layout (Gantt, Kanban, Calendar...) > - Field (Person, Tag, File...) > - See more here https://github.com/nextcloud/tables/issues/103 ## NocoDb server This container bundles NocoDb without synchronization with Nextcloud. This is an alternative of **Airtable**. ### Notes - You need to configure a reverse proxy in order to run this container since nocodb needs a dedicated (sub)domain! For that, you might have a look at https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy. - Currently, only `tables.$NC_DOMAIN` is supported as subdomain! So if Nextcloud is using `your-domain.com`, nocodb will use `tables.your-domain.com`. - The data of NocoDb will be automatically included in AIOs backup solution! - After adding and starting the container, you can log in to the web interface at `https://tables.$NC_DOMAIN/#/signin` with the username `admin@noco.db` and the password that you can see in the AIO interface next to the container. - See https://docs.nocodb.com/ for usage of NocoDb - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/nocodb/nocodb ### Maintainer https://github.com/docjyJ ================================================ FILE: community-containers/notifications/notifications.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-notifications", "display_name": "Notifications", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/notifications", "image": "ghcr.io/szaimen/aio-notifications", "image_tag": "v1", "internal_port": "10000", "restart": "unless-stopped", "volumes": [ { "source": "%WATCHTOWER_DOCKER_SOCKET_PATH%", "destination": "/var/run/docker.sock", "writeable": false } ], "environment": [ "TZ=%TIMEZONE%" ] } ] } ================================================ FILE: community-containers/notifications/readme.md ================================================ ## Notifications This container allows other AIO community containers to send admin notifications to Nextcloud users. ### Notes - It needs to be enabled for the [scrutiny container](https://github.com/nextcloud/all-in-one/tree/main/community-containers/scrutiny) for example to make use of admin notifications that are sent if a smartctl failure was found. - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-notifications ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/npmplus/npmplus.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-npmplus", "display_name": "NPMplus", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/npmplus", "image": "ghcr.io/zoeyvid/npmplus", "image_tag": "latest", "internal_port": "host", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%", "NC_AIO=true", "NC_DOMAIN=%NC_DOMAIN%" ], "volumes": [ { "source": "nextcloud_aio_npmplus", "destination": "/data", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_npmplus" ], "aio_variables": [ "apache_ip_binding=127.0.0.1", "apache_port=11000" ] } ] } ================================================ FILE: community-containers/npmplus/readme.md ================================================ ## NPMplus This container contains a fork of the Nginx Proxy Manager, which is a WebUI for nginx. It will also automatically create a config and cert for AIO. ### Notes - This container is incompatible with the [caddy](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy) community container. So make sure that you do not enable both at the same time! - Make sure that no other service is using port `443 (tcp/upd)` or `81 (tcp)` on your host as otherwise the containers will fail to start. You can check this with `sudo netstat -tulpn | grep "443\|81"` before installing AIO. - Please change the default login data first, after you can read inside the logs that the default config for AIO is created and there are no errors. - After the container was started the first time, please check the logs for errors. Then you can open NPMplus on `https://:81` and change the password. - The default password is `iArhP1j7p1P6TA92FA2FMbbUGYqwcYzxC4AVEe12Wbi94FY9gNN62aKyF1shrvG4NycjjX9KfmDQiwkLZH1ZDR9xMjiG2QmoHXi` and the default email is `admin@example.org` - If you want to use NPMplus behind a domain and outside localhost just create a new proxy host inside the NPMplus which proxies to `https`, `127.0.0.1` and port `81` - all other settings should be the same as for the AIO host. - If you want to set env options from this [compose.yaml](https://github.com/ZoeyVid/NPMplus/blob/develop/compose.yaml), please set them inside the `.env` file which you can find in the `nextcloud_aio_npmplus` volume **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management - The data (certs, configs, etc.) of NPMplus will be automatically included in AIOs backup solution! - **Important:** you always need to enable https for your hosts, since `DISABLE_HTTP` is set to true by default - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository and Documentation https://github.com/ZoeyVid/NPMplus ### Maintainer https://github.com/Zoey2936 ================================================ FILE: community-containers/pi-hole/pi-hole.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-pihole", "display_name": "Pi-hole", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/pi-hole", "image": "pihole/pihole", "image_tag": "latest", "internal_port": "8573", "restart": "unless-stopped", "init": false, "ports": [ { "ip_binding": "", "port_number": "53", "protocol": "tcp" }, { "ip_binding": "", "port_number": "53", "protocol": "udp" }, { "ip_binding": "", "port_number": "8573", "protocol": "tcp" } ], "environment": [ "TZ=%TIMEZONE%", "FTLCONF_webserver_api_password=%PIHOLE_WEBPASSWORD%", "FTLCONF_dns_listeningMode=all", "FTLCONF_webserver_port=8573" ], "volumes": [ { "source": "nextcloud_aio_pihole", "destination": "/etc/pihole", "writeable": true }, { "source": "nextcloud_aio_pihole_dnsmasq", "destination": "/etc/dnsmasq.d", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_pihole", "nextcloud_aio_pihole_dnsmasq" ], "ui_secret": "PIHOLE_WEBPASSWORD", "secrets": [ "PIHOLE_WEBPASSWORD" ] } ] } ================================================ FILE: community-containers/pi-hole/readme.md ================================================ ## Pi-hole This container bundles pi-hole and auto-configures it for you. ### Notes - You should not run this container on a public VPS! It is only intended to run in home networks! - Make sure that no dns server is already running by checking with `sudo netstat -tulpn | grep 53`. Otherwise the container will not be able to start! - The DHCP functionality of Pi-hole has been disabled! - The data of pi-hole will be automatically included in AIOs backup solution! - After adding and starting the container, you can visit `http://ip.address.of.this.server:8573/admin` in order to log in with the admin key that you can see next to the container in the AIO interface. There you can configure the pi-hole setup. Also you can add local dns records. - You can configure your home network now to use pi-hole as its dns server by configuring your router. - Additionally, you can configure the docker daemon to use that by editing `/etc/docker/daemon.json` and adding ` { "dns" : [ "ip.address.of.this.server" , "8.8.8.8" ] } `. - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/pi-hole/docker-pi-hole ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/plex/plex.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-plex", "display_name": "Plex", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/plex", "image": "plexinc/pms-docker", "image_tag": "latest", "internal_port": "host", "restart": "unless-stopped", "environment": [ "TZ=%TIMEZONE%", "PLEX_UID=33", "PLEX_GID=33" ], "volumes": [ { "source": "nextcloud_aio_plex", "destination": "/config", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/data", "writeable": false }, { "source": "%NEXTCLOUD_MOUNT%", "destination": "%NEXTCLOUD_MOUNT%", "writeable": false } ], "devices": [ "/dev/dri" ], "enable_nvidia_gpu": true, "backup_volumes": [ "nextcloud_aio_plex" ] } ] } ================================================ FILE: community-containers/plex/readme.md ================================================ ## Plex This container bundles Plex and auto-configures it for you. ### Notes - This container is incompatible with the [Jellyfin](https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyfin) community container. So make sure that you do not enable both at the same time! - This is not working on arm64 since Plex does only provide x64 docker images. - This container should usually only be run in home networks as it exposes unencrypted services like DLNA by default which can be disabld via the web interface though. - If you have a firewall like ufw configured, you might need to open all Plex ports in there first in order to make it work. Especially port 32400 is important! - After adding and starting the container, you need to visit http://ip.address.of.server:32400/manage in order to claim your server with a plex account - The data of Plex will be automatically included in AIOs backup solution! - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/plexinc/pms-docker ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/readme.md ================================================ # Community containers This directory features containers that are built for AIO which allows to add additional functionality very easily. ## Disclaimers All containers that are in this directory are community maintained so the responsibility is on the community to keep them updated and secure. There is no guarantee that this will be the case in the future. ## How to use this? Starting with v11 of AIO, the management of Community Containers is done via the AIO interface (it is the last section in the AIO interface, so only visible if you scroll down). ⚠️⚠️⚠️ 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! **Hint:** If the containers where running already, in order to actually start the added container, you need to click on `Stop containers` and the `Update and start containers` in order to actually start it. ## How to add containers? Simply submit a PR by creating a new folder in this directory: https://github.com/nextcloud/all-in-one/tree/main/community-containers with the name of your container. It must include a json file with the same name and with correct syntax and a readme.md with additional information. You might get inspired by caddy, fail2ban, local-ai, libretranslate, plex, pi-hole or vaultwarden (subfolders in this directory). For a full-blown example of the json file, see https://github.com/nextcloud/all-in-one/blob/main/php/containers.json. The json-schema that it validates against can be found here: https://github.com/nextcloud/all-in-one/blob/main/php/containers-schema.json. ### Is there a list of ideas for new community containers? Yes, see [this list](https://github.com/nextcloud/all-in-one/issues/5251) for already existing ideas for new community containers. Feel free to pick one up and add it to this folder by following the instructions above. ## How to remove containers from AIOs stack? You can remove containers now via the web interface. After removing the containers, there might be some data left on your server that you might want to remove. You can get rid of the data by first running `sudo docker rm nextcloud-aio-container1`, (adjust `container1` accordingly) per community-container that you removed. Then run `sudo docker image prune -a` in order to remove all images that are not used anymore. As last step you can get rid of persistent data of these containers that is stored in volumes. You can check if there is some by running `sudo docker volume ls` and look for any volume that matches the ones that you removed. If so, you can remove them with `sudo docker volume rm nextcloud_aio_volume-id` (of course you need to adjust the `volume-id`). **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ================================================ FILE: community-containers/scrutiny/readme.md ================================================ ## Scrutiny This container bundles Scrutiny which is a frontend for SMART stats and auto-configures it for you. ### Notes - This container should only be run in home networks - ⚠️ This container mounts all devices from the host inside the container in order to be able to access the drives and smartctl stats which is a security issue. However no better solution was found for the time being. - This container only works on Linux and not on Docker-Desktop. - After adding and starting the container, you need to visit `http://internal.ip.of.server:8000` which will show the dashboard for your drives. - It supports sending notifications in case of a smartctl failure if you enable the notifications community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/notifications - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-scrutiny ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/scrutiny/scrutiny.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-scrutiny", "display_name": "Scrutiny", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/scrutiny", "image": "ghcr.io/szaimen/aio-scrutiny", "image_tag": "v2", "internal_port": "8000", "init": false, "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "8000", "protocol": "tcp" } ], "cap_add": [ "SYS_RAWIO", "SYS_ADMIN" ], "environment": [ "TZ=%TIMEZONE%", "SCRUTINY_WEB_LISTEN_PORT=8000", "COLLECTOR_API_ENDPOINT=http://127.0.0.1:8000" ], "volumes": [ { "source": "nextcloud_aio_scrutiny", "destination": "/opt/scrutiny/config", "writeable": true }, { "source": "nextcloud_aio_scrutiny_db", "destination": "/opt/scrutiny/influxdb", "writeable": true }, { "source": "/run/udev", "destination": "/run/udev", "writeable": false }, { "source": "/dev", "destination": "/dev", "writeable": false } ], "backup_volumes": [ "nextcloud_aio_scrutiny", "nextcloud_aio_scrutiny_db" ] } ] } ================================================ FILE: community-containers/smbserver/readme.md ================================================ ## SMB-server This container bundles an SMB-server and allows to configure it via a graphical shell script. ### Notes - This container should only be run in home networks - After adding and starting the container, you need to visit `https://internal.ip.of.server:5803` in order to log in with the `smbserver` user and the password that you can see next to the container in the AIO interface. (The web page uses a self-signed certificate, so you need to accept the warning). Then type in `bash /smbserver.sh` and you will see a graphical UI for configuring the smb-server interactively. - The config data of SMB-server will be automatically included in AIOs backup solution! - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/szaimen/aio-smbserver/ ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/smbserver/smbserver.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-smbserver", "display_name": "SMB-server", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/smbserver", "image": "ghcr.io/szaimen/aio-smbserver", "image_tag": "v1", "internal_port": "5803", "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "5803", "protocol": "tcp" }, { "ip_binding": "", "port_number": "445", "protocol": "tcp" }, { "ip_binding": "", "port_number": "139", "protocol": "tcp" } ], "volumes": [ { "source": "nextcloud_aio_smbserver", "destination": "/smbserver", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/mnt/ncdata", "writeable": true }, { "source": "%NEXTCLOUD_MOUNT%", "destination": "/mnt", "writeable": true } ], "environment": [ "TZ=%TIMEZONE%", "WEB_AUTHENTICATION_USERNAME=smbserver", "WEB_AUTHENTICATION_PASSWORD=%SMBSERVER_PASSWORD%", "WEB_LISTENING_PORT=5803" ], "secrets": [ "SMBSERVER_PASSWORD" ], "ui_secret": "SMBSERVER_PASSWORD", "backup_volumes": [ "nextcloud_aio_smbserver" ] } ] } ================================================ FILE: community-containers/stalwart/readme.md ================================================ > [!CAUTION] > Be aware that the mail server is the most difficult service to deploy. > > Do not use this feature as a main mail server or without a redundancy system and without knowledge. ## Stalwart mail server This container bundles stalwart mail server and auto-configures it for you. ### Notes Documentation is available on the container repository. This documentation is regularly updated and is intended to be as simple and detailed as possible. Thanks for all your feedback! - See https://github.com/docjyJ/aio-stalwart#getting-started for getting start with this container. - See https://stalw.art/docs/faq for further faq and docs on the project - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/docjyj/aio-stalwart ### Maintainer https://github.com/docjyj ================================================ FILE: community-containers/stalwart/stalwart.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-stalwart", "display_name": "Stalwart", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/stalwart", "image": "ghcr.io/docjyj/aio-stalwart", "image_tag": "v3", "internal_port": "10003", "restart": "unless-stopped", "ports": [ { "ip_binding": "", "port_number": "25", "protocol": "tcp" }, { "ip_binding": "", "port_number": "143", "protocol": "tcp" }, { "ip_binding": "", "port_number": "465", "protocol": "tcp" }, { "ip_binding": "", "port_number": "587", "protocol": "tcp" }, { "ip_binding": "", "port_number": "993", "protocol": "tcp" }, { "ip_binding": "", "port_number": "4190", "protocol": "tcp" }, { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "10003", "protocol": "tcp" } ], "environment": [ "TZ=%TIMEZONE%", "NC_DOMAIN=%NC_DOMAIN%", "STALWART_USER_PASS=%STALWART_USER_PASS%", "CLAMAV_ENABLED=%CLAMAV_ENABLED%" ], "secrets": [ "STALWART_USER_PASS" ], "ui_secret": "STALWART_USER_PASS", "volumes": [ { "source": "nextcloud_aio_stalwart", "destination": "/opt/stalwart-mail", "writeable": true }, { "source": "nextcloud_aio_caddy", "destination": "/caddy", "writeable": false } ], "backup_volumes": [ "nextcloud_aio_stalwart" ] } ] } ================================================ FILE: community-containers/vaultwarden/readme.md ================================================ ## Vaultwarden This container bundles vaultwarden and auto-configures it for you. ### Notes - You need to configure a reverse proxy in order to run this container since vaultwarden needs a dedicated (sub)domain! For that, you might have a look at https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy or follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md and https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples. You need to point the reverse proxy at port 8812 of this server. - Currently, only `bw.$NC_DOMAIN` is supported as subdomain! So if Nextcloud is using `your-domain.com`, vaultwarden will use `bw.your-domain.com`. The reverse proxy and domain must be configured accordingly! - If you want to secure the installation with fail2ban, you might want to check out https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban - The data of Vaultwarden will be automatically included in AIOs backup solution! - After adding and starting the container, you need to visit `https://bw.your-domain.com/admin` in order to log in with the admin key that you can see next to the container in the AIO interface. There you can configure smtp first and then invite users via mail. After this is done, you might disable the admin panel via the reverse proxy by blocking connections to the subdirectory. - If using the caddy community container, the vaultwarden admin interface can be disabled by creating a `block-vaultwarden-admin` file in the `nextcloud-aio-caddy` folder when you open the Nextcloud files app with the default `admin` user. Afterwards restart all containers from the AIO interface and the admin interface should be disabled! You can unlock the admin interface by removing the file again and afterwards restarting the containers via the AIO interface. - See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack ### Repository https://github.com/dani-garcia/vaultwarden ### Maintainer https://github.com/szaimen ================================================ FILE: community-containers/vaultwarden/vaultwarden.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-vaultwarden", "display_name": "Vaultwarden", "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/vaultwarden", "image": "ghcr.io/dani-garcia/vaultwarden", "image_tag": "alpine", "internal_port": "8812", "restart": "unless-stopped", "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "8812", "protocol": "tcp" } ], "environment": [ "TZ=%TIMEZONE%", "ROCKET_PORT=8812", "ADMIN_TOKEN=%VAULTWARDEN_ADMIN_TOKEN%", "DOMAIN=https://bw.%NC_DOMAIN%", "LOG_FILE=/logs/vaultwarden.log", "LOG_LEVEL=warn", "SIGNUPS_VERIFY=true", "SIGNUPS_ALLOWED=false" ], "volumes": [ { "source": "nextcloud_aio_vaultwarden", "destination": "/data", "writeable": true }, { "source": "nextcloud_aio_vaultwarden_logs", "destination": "/logs", "writeable": true } ], "backup_volumes": [ "nextcloud_aio_vaultwarden" ], "ui_secret": "VAULTWARDEN_ADMIN_TOKEN", "secrets": [ "VAULTWARDEN_ADMIN_TOKEN" ] } ] } ================================================ FILE: compose.yaml ================================================ name: nextcloud-aio # Add the container to the same compose project like all the sibling containers are added to automatically. services: nextcloud-aio-mastercontainer: image: ghcr.io/nextcloud-releases/all-in-one:latest # This is the container image used. You can switch to ghcr.io/nextcloud-releases/all-in-one:beta if you want to help testing new releases. See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel init: true # This setting makes sure that signals from main process inside the container are correctly forwarded to children. See https://docs.docker.com/reference/compose-file/services/#init restart: always # This makes sure that the container starts always together with the host OS. See https://docs.docker.com/reference/compose-file/services/#restart container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly volumes: - nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed as otherwise the built-in backup solution will not work - /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'WATCHTOWER_DOCKER_SOCKET_PATH'! network_mode: bridge # This adds the container to the same network as docker run would do. Comment this line and uncomment the line below and the networks section at the end of the file if you want to define a custom MTU size for the docker network # networks: ["nextcloud-aio"] ports: - "80:80" # Can be removed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md - "8080:8080" # This is the AIO interface, served via https and self-signed certificate. See https://github.com/nextcloud/all-in-one#explanation-of-used-ports - "8443:8443" # Can be removed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md # security_opt: ["label:disable"] # Is needed when using SELinux. See https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled # environment: # Is needed when using any of the options below # AIO_DISABLE_BACKUP_SECTION: false # Setting this to true allows to hide the backup section in the AIO interface. See https://github.com/nextcloud/all-in-one#how-to-disable-the-backup-section # APACHE_PORT: 11000 # Is needed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md # APACHE_IP_BINDING: 127.0.0.1 # Should be set when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) that is running on the same host. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md # 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 # 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 # NEXTCLOUD_MOUNT: /mnt/ # Allows the Nextcloud container to access the chosen directory on the host. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host # NEXTCLOUD_UPLOAD_LIMIT: 16G # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud # NEXTCLOUD_MAX_TIME: 3600 # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud # NEXTCLOUD_MEMORY_LIMIT: 512M # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud # NEXTCLOUD_TRUSTED_CACERTS_DIR: /path/to/my/cacerts # CA certificates in this directory will be trusted by the OS of the nextcloud container (Useful e.g. for LDAPS) See https://github.com/nextcloud/all-in-one#how-to-trust-user-defined-certification-authorities-ca # NEXTCLOUD_STARTUP_APPS: deck twofactor_totp tasks calendar contacts notes # Allows to modify the Nextcloud apps that are installed on starting AIO the first time. See https://github.com/nextcloud/all-in-one#how-to-change-the-nextcloud-apps-that-are-installed-on-the-first-startup # NEXTCLOUD_ADDITIONAL_APKS: imagemagick # This allows to add additional packages to the Nextcloud container permanently. Default is imagemagick but can be overwritten by modifying this value. See https://github.com/nextcloud/all-in-one#how-to-add-os-packages-permanently-to-the-nextcloud-container # NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS: imagick # This allows to add additional php extensions to the Nextcloud container permanently. Default is imagick but can be overwritten by modifying this value. See https://github.com/nextcloud/all-in-one#how-to-add-php-extensions-permanently-to-the-nextcloud-container # NEXTCLOUD_ENABLE_DRI_DEVICE: true # This allows to enable the /dev/dri device for containers that profit from it. ⚠️⚠️⚠️ Warning: this only works if the '/dev/dri' device is present on the host! If it should not exist on your host, don't set this to true as otherwise the Nextcloud container will fail to start! See https://github.com/nextcloud/all-in-one#how-to-enable-hardware-acceleration-for-nextcloud # NEXTCLOUD_ENABLE_NVIDIA_GPU: true # This allows to enable the NVIDIA runtime and GPU access for containers that profit from it. ⚠️⚠️⚠️ Warning: this only works if an NVIDIA gpu is installed on the server. See https://github.com/nextcloud/all-in-one#how-to-enable-hardware-acceleration-for-nextcloud. # NEXTCLOUD_KEEP_DISABLED_APPS: false # Setting this to true will keep Nextcloud apps that are disabled in the AIO interface and not uninstall them if they should be installed. See https://github.com/nextcloud/all-in-one#how-to-keep-disabled-apps # SKIP_DOMAIN_VALIDATION: false # This should only be set to true if things are correctly configured. See https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation # TALK_PORT: 3478 # This allows to adjust the port that the talk container is using which is exposed on the host. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-talk-port # WATCHTOWER_DOCKER_SOCKET_PATH: /var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail. For macos it needs to be '/var/run/docker.sock' # # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/discussions/575 # # Alternatively, use Tailscale if you don't have a domain yet. See https://github.com/nextcloud/all-in-one/discussions/6817 # # Hint: You need to uncomment APACHE_PORT: 11000 above, adjust cloud.example.com to your domain and uncomment the necessary docker volumes at the bottom of this file in order to make it work # # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588 # caddy: # image: caddy:alpine # restart: always # container_name: caddy # volumes: # - caddy_certs:/certs # - caddy_config:/config # - caddy_data:/data # - caddy_sites:/srv # network_mode: "host" # configs: # - source: Caddyfile # target: /etc/caddy/Caddyfile # configs: # Caddyfile: # content: | # # Adjust cloud.example.com to your domain below # https://cloud.example.com:443 { # reverse_proxy localhost:11000 # } volumes: # If you want to store the data on a different drive, see https://github.com/nextcloud/all-in-one#how-to-store-the-filesinstallation-on-a-separate-drive nextcloud_aio_mastercontainer: name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work # caddy_certs: # caddy_config: # caddy_data: # caddy_sites: # # Adjust the MTU size of the docker network. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-mtu-size-of-the-docker-network # networks: # nextcloud-aio: # name: nextcloud-aio # driver_opts: # com.docker.network.driver.mtu: 1440 ================================================ FILE: develop.md ================================================ ## Developer channel If you want to switch to the develop channel, you simply stop and delete the mastercontainer and create a new one with a changed tag to develop: ```shell sudo docker run \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 80:80 \ --publish 8080:8080 \ --publish 8443:8443 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ ghcr.io/nextcloud-releases/all-in-one:develop ``` And you are done :) It will now also select the developer channel for all other containers automatically. ## How to publish new releases? Simply use https://github.com/nextcloud/all-in-one/issues/180 as template. ## How to update existing instances to a new major Nextcloud version? Simply use https://github.com/nextcloud/all-in-one/issues/6198 as template. ## How to build new containers Go to https://github.com/nextcloud-releases/all-in-one/actions/workflows/repo-sync.yml and run the workflow that will first sync the repo and then build new container that automatically get published to `develop` and `develop-arm64`. ## How to test things correctly? Before testing, make sure that at least the amd64 containers are built successfully by checking the last workflow here: https://github.com/nextcloud-releases/all-in-one/actions/workflows/build_images.yml. There is a testing-VM available for the maintainer of AIO that allows for some final testing before releasing new version. See [this](https://cloud.nextcloud.com/apps/collectives/Nextcloud%20Handbook/Technical/AIO%20testing%20VM?fileId=6350152) for details. Additionally, there are now E2E tests available that can be run via https://github.com/nextcloud/all-in-one/actions/workflows/playwright.yml ## How to promote builds from develop to beta 1. Verify that GitHub Services are running correctly: https://www.githubstatus.com/ 1. Verify that no job is running here: https://github.com/nextcloud-releases/all-in-one/actions/workflows/build_images.yml 2. Go to https://github.com/nextcloud-releases/all-in-one/actions/workflows/promote-to-beta.yml, click on `Run workflow`. ## Where to find the VPS and other builds? This is documented here: https://github.com/nextcloud-releases/all-in-one/tree/main/.build ## How to promote builds from beta to latest 1. Verify that GitHub Services are running correctly: https://www.githubstatus.com/ 1. Verify that no job is running here: https://github.com/nextcloud-releases/all-in-one/actions/workflows/promote-to-beta.yml 1. Go to https://github.com/nextcloud-releases/all-in-one/actions/workflows/promote-to-latest.yml, click on `Run workflow`. ## How to connect to the database? Simply run `sudo docker exec -it nextcloud-aio-database psql -U oc_nextcloud nextcloud_database` and you should be in. ## How to locally build and test changes to mastercontainer 1. Ensure you are on the developer channel per the instructions above. 1. Use the commands below from the project root to build the mastercontainer image: ``` docker buildx build --file Containers/mastercontainer/Dockerfile --tag ghcr.io/nextcloud-releases/all-in-one:develop --load . ``` 1. Start a container with above built image. 1. Since the hash of a locally built image doesn't match the latest release mastercontainer, it prompts for a mandatory update. To temporarily bypass the update suffix `?bypass_mastercontainer_update` to the URL. Eg: `https://localhost:8080/containers?bypass_mastercontainer_update` ## How to locally build and test changes to other containers using the bypass_container_update param 1. Ensure you are on the developer channel per the instructions above. 1. Use the commands below from the project root to build the container image: ``` # For the "nextcloud" container docker buildx build --file Containers/nextcloud/Dockerfile --tag ghcr.io/nextcloud-releases/aio-nextcloud:develop --load . # For all other containers docker buildx build --file Containers/{container}/Dockerfile --tag ghcr.io/nextcloud-releases/aio-{container}:develop --load Containers/{container} ``` 1. Stop the containers using the AIO interface. 1. Reload the AIO interface with the param `bypass_container_update` to avoid overwriting your local changes, e.g. `https://localhost:8080/containers?bypass_container_update`. 1. Click "Start and update containers" and test your changes. Containers will not be updated, despite the button text. ================================================ FILE: docker-ipv6-support.md ================================================ # IPv6-Support for Docker ## Docker on Linux and Docker-rootless First of all upgrade your docker installation to v27.0.1 or higher. 1. Then edit `/etc/docker/daemon.json` (or `~/.config/docker/daemon.json` in case of docker-rootless), add the below json: > [!WARNING] > This will enable ipv6 for all new docker networks by default! You can alternatively create the `nextcloud-aio` network with ipv6 support by hand manually via docker network create or via compose.yaml. ```json { "default-network-opts": {"bridge":{"com.docker.network.enable_ipv6":"true"}} } ``` And save the file. 2. Reload the Docker configuration file. ```console sudo systemctl restart docker ``` 3. Make sure that ipv6 is enabled for the internal `nextcloud-aio` network by running `sudo docker network inspect nextcloud-aio | grep EnableIPv6`. On a new instance, this command should return that it did not find a network with this name. Then you can run `sudo docker network create nextcloud-aio` in order to create the network with ipv6-support. However if it finds the network and its value `EnableIPv6` is set to false, make sure to follow https://github.com/nextcloud/all-in-one/discussions/4989 in order to recreate the network and enable ipv6 for it. ## Docker Desktop (Windows and macOS) First of all upgrade your docker desktop installation to v4.32.0 or higher. Then, on Windows and macOS which use Docker Desktop, you need to go into the settings, and select `Docker Engine`. There you should see the currently used daemon.json file. 1. You need to now adjust this json file: > [!WARNING] > This will enable ipv6 for all new docker networks by default! You can alternatively create the `nextcloud-aio` network with ipv6 support by hand manually via docker network create or via compose.yaml. ```json "default-network-opts": {"bridge":{"com.docker.network.enable_ipv6":"true"}} ``` 2. Add these values to the json and make sure to keep the other currently values and that you don't see `Unexpected token in JSON at position ...` before attempting to restart by clicking on `Apply & restart`. 3. Make sure that ipv6 is enabled for the internal `nextcloud-aio` network by running `sudo docker network inspect nextcloud-aio | grep EnableIPv6`. On a new instance, this command should return that it did not find a network with this name. Then you can run `sudo docker network create nextcloud-aio` in order to create the network with ipv6-support. However if it finds the network and its value `EnableIPv6` is set to false, make sure to follow https://github.com/nextcloud/all-in-one/discussions/4989 in order to recreate the network and enable ipv6 for it. --- **Note**: This is a copy of the original docker docs at https://docs.docker.com/config/daemon/ipv6/ which apparently are not correct. ================================================ FILE: docker-rootless.md ================================================ # Docker rootless **Please note:** Due to a bug in Collabora is the Collabora container currently in rootless mode not working. See https://github.com/CollaboraOnline/online/issues/2800. In that case, you need to run a separate Collabora instance on your own if you want to use this feature. The following flag will be useful https://github.com/nextcloud/all-in-one#how-to-keep-disabled-apps. You can run AIO with docker rootless by following the steps below. 0. If docker is already installed, you should consider disabling it first: (`sudo systemctl disable --now docker.service docker.socket`) 1. Install docker rootless by following the official documentation: https://docs.docker.com/engine/security/rootless/#install. The easiest way is installing it **Without packages** (`curl -fsSL https://get.docker.com/rootless | sh`). Further limitations, distribution specific hints, etc. are discussed on the same site. Also do not forget to enable the systemd service, which may not be enabled always by default. See https://docs.docker.com/engine/security/rootless/#usage. (`systemctl --user enable docker`) 1. If you need ipv6 support, you should enable it by following https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md. 1. Do not forget to set the mentioned environmental variables `PATH` and `DOCKER_HOST` and in best case add them to your `~/.bashrc` file as shown! 1. Also do not forget to run `loginctl enable-linger USERNAME` (and substitute USERNAME with the correct one) in order to make sure that user services are automatically started after every reboot. 1. Expose the privileged ports by following https://docs.docker.com/engine/security/rootless/#exposing-privileged-ports. (`sudo setcap cap_net_bind_service=ep $(which rootlesskit); systemctl --user restart docker`). If you require the correct source IP you must expose them via `/etc/sysctl.conf`, [see note below](#note-regarding-docker-network-driver). 1. Use the official AIO startup command but use `--volume $XDG_RUNTIME_DIR/docker.sock:/var/run/docker.sock:ro` instead of `--volume /var/run/docker.sock:/var/run/docker.sock:ro` and also add `--env WATCHTOWER_DOCKER_SOCKET_PATH=$XDG_RUNTIME_DIR/docker.sock` to the initial container startup (which is needed for mastercontainer updates to work correctly). When you are using Portainer to deploy AIO, the variable `$XDG_RUNTIME_DIR` is not available. In this case, it is necessary to manually add the path (e.g. `/run/user/1000/docker.sock`) to the Docker compose file to replace the `$XDG_RUNTIME_DIR` variable. If you are not sure how to get the path, you can run on the host: `echo $XDG_RUNTIME_DIR`. 1. Now everything should work like without docker rootless. You can consider using docker-compose for this or running it behind a reverse proxy. Basically the only thing that needs to be adjusted always in the startup command or compose.yaml file (after installing docker rootles) are things that are mentioned in point 3. 1. ⚠️ **Important:** Please read through all notes below! ### Note regarding sudo in the documentation Almost all commands in this project's documentation use `sudo docker ...`. Since `sudo` is not needed in case of docker rootless, you simply remove `sudo` from the commands and they should work. ### Note regarding permissions All files outside the containers get created, written to and accessed as the user that is running the docker daemon or a subuid of it. So for the built-in backup to work you need to allow this user to write to the target directory. E.g. with `sudo chown -R USERNAME:GROUPNAME /mnt/backup`. The same applies when changing Nextcloud's datadir via NEXTCLOUD_DATADIR. E.g. `sudo chown -R USERNAME:GROUPNAME /mnt/ncdata`. When you want to use the NEXTCLOUD_MOUNT option for local external storage, you need to adjust the permissions of the chosen folders to be accessible/writeable by the userid `100032:100032` (if running `grep ^$(whoami): /etc/subuid` as the user that is running the docker daemon returns 100000 as first value). ### Note regarding docker network driver By default rootless docker uses the `slirp4netns` IP driver and the `builtin` port driver. As mentioned in [the documentation](https://docs.docker.com/engine/security/rootless/#networking-errors), this combination doesn't provide "Source IP propagation". This means that Apache and Nextcloud will see all connections as coming from the docker gateway (e.g 172.19.0.1), which can lead to the Nextcloud brute force protection blocking all connection attempts. To expose the correct source IP, you will need to configure docker to also use `slirp4netns` as the port driver (see also [this guide](https://rootlesscontaine.rs/getting-started/docker/#changing-the-port-forwarder)). As stated in the documentation, this change will likely lead to decreased network throughput. You should test this by trying to transfer a large file after completing your setup and revert back to the `builtin` port driver if the throughput is too slow. * Add `net.ipv4.ip_unprivileged_port_start=80` to `/etc/sysctl.conf`. Editing this file requires root privileges. (using capabilities doesn't work here; see [this issue](https://github.com/rootless-containers/slirp4netns/issues/251#issuecomment-761415404)). * Run `sudo sysctl --system` to propagate the change. * Create `~/.config/systemd/user/docker.service.d/override.conf` with the following content: ``` [Service] Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns" Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns" ``` * Restart the docker daemon ``` systemctl --user restart docker ``` ================================================ FILE: local-instance.md ================================================ # Local instance It is possible due to several reasons that you do not want or cannot open Nextcloud to the public internet. Perhaps you were hoping to access AIO directly from an `ip.add.r.ess` (unsupported) or without a valid domain. However, AIO requires a valid certificate to work correctly. Below is discussed how you can achieve both: Having a valid certificate for Nextcloud and only using it locally. ### Content - [1. Tailscale](#1-tailscale) - [2. The normal way](#2-the-normal-way) - [3. Use the ACME DNS-challenge](#3-use-the-acme-dns-challenge) - [4. Use Cloudflare](#4-use-cloudflare) - [5. Buy a certificate and use that](#5-buy-a-certificate-and-use-that) ## 1. Tailscale This is the recommended way. For a reverse proxy example guide for Tailscale, see this guide by [@Perseus333](https://github.com/Perseus333): https://github.com/nextcloud/all-in-one/discussions/6817 ## 2. The normal way The normal way is the following: 1. Set up your domain correctly to point to your home network 1. Set up a reverse proxy by following the [reverse proxy documentation](./reverse-proxy.md) but only open port 80 (which is needed for the ACME challenge to work - however no real traffic will use this port). 1. Set up a local DNS-server like a pi-hole and configure it to be your local DNS-server for the whole network. Then in the Pi-hole interface, add a custom DNS-record for your domain and overwrite the A-record (and possibly the AAAA-record, too) to point to the private ip-address of your reverse proxy (see https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally) 1. Enter the ip-address of your local dns-server in the daemon.json file for docker so that you are sure that all docker containers use the correct local dns-server. 1. Now, entering the domain in the AIO-interface should work as expected and should allow you to continue with the setup **Hint:** You may have a look at [this video](https://youtu.be/zk-y2wVkY4c) for a more complete but possibly outdated example. ## 3. Use the ACME DNS-challenge You can alternatively use the ACME DNS-challenge to get a valid certificate for Nextcloud. Here is described how to set it up using an external caddy reverse proxy: https://github.com/nextcloud/all-in-one#how-to-get-nextcloud-running-using-the-acme-dns-challenge ## 4. Use Cloudflare If you do not have any control over the network, you may think about using Cloudflare Tunnel to get a valid certificate for your Nextcloud. However it will be opened to the public internet then. See https://github.com/nextcloud/all-in-one#how-to-run-nextcloud-behind-a-cloudflare-tunnel how to set this up. ## 5. Buy a certificate and use that If none of the above ways work for you, you may simply buy a certificate from an issuer for your domain. You then download the certificate onto your server, configure AIO in [reverse proxy mode](./reverse-proxy.md) and use the certificate for your domain in your reverse proxy config. ================================================ FILE: manual-install/latest.yml ================================================ services: nextcloud-aio-apache: depends_on: nextcloud-aio-onlyoffice: condition: service_started required: false nextcloud-aio-collabora: condition: service_started required: false nextcloud-aio-talk: condition: service_started required: false nextcloud-aio-notify-push: condition: service_started required: false nextcloud-aio-whiteboard: condition: service_started required: false nextcloud-aio-nextcloud: condition: service_started required: false image: ghcr.io/nextcloud-releases/aio-apache:latest user: "33" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 ports: - ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/tcp - ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/udp environment: - NC_DOMAIN - NEXTCLOUD_HOST=nextcloud-aio-nextcloud - APACHE_HOST=nextcloud-aio-apache - COLLABORA_HOST=nextcloud-aio-collabora - TALK_HOST=nextcloud-aio-talk - APACHE_PORT - ONLYOFFICE_HOST=nextcloud-aio-onlyoffice - TZ=${TIMEZONE} - APACHE_MAX_SIZE - APACHE_MAX_TIME=${NEXTCLOUD_MAX_TIME} - NOTIFY_PUSH_HOST=nextcloud-aio-notify-push - WHITEBOARD_HOST=nextcloud-aio-whiteboard - HARP_HOST=nextcloud-aio-harp volumes: - nextcloud_aio_nextcloud:/var/www/html:ro - nextcloud_aio_apache:/mnt/data:rw restart: unless-stopped read_only: true tmpfs: - /var/log/supervisord - /var/run/supervisord - /usr/local/apache2/logs - /tmp - /home/www-data cap_drop: - NET_RAW nextcloud-aio-database: image: ghcr.io/nextcloud-releases/aio-postgresql:latest user: "999" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "5432" volumes: - nextcloud_aio_database:/var/lib/postgresql/data:rw - nextcloud_aio_database_dump:/mnt/data:rw environment: - POSTGRES_PASSWORD=${DATABASE_PASSWORD} - POSTGRES_DB=nextcloud_database - POSTGRES_USER=nextcloud - TZ=${TIMEZONE} - PGTZ=${TIMEZONE} stop_grace_period: 1800s restart: unless-stopped shm_size: 268435456 read_only: true tmpfs: - /var/run/postgresql cap_drop: - NET_RAW nextcloud-aio-nextcloud: depends_on: nextcloud-aio-database: condition: service_started required: false nextcloud-aio-redis: condition: service_started required: false nextcloud-aio-clamav: condition: service_started required: false nextcloud-aio-fulltextsearch: condition: service_started required: false nextcloud-aio-talk-recording: condition: service_started required: false nextcloud-aio-imaginary: condition: service_started required: false image: ghcr.io/nextcloud-releases/aio-nextcloud:latest init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "9000" - "9001" volumes: - nextcloud_aio_nextcloud:/var/www/html:rw - ${NEXTCLOUD_DATADIR}:/mnt/ncdata:rw - ${NEXTCLOUD_MOUNT}:${NEXTCLOUD_MOUNT}:rw - ${NEXTCLOUD_TRUSTED_CACERTS_DIR}:/usr/local/share/ca-certificates:ro environment: - NEXTCLOUD_HOST=nextcloud-aio-nextcloud - POSTGRES_HOST=nextcloud-aio-database - POSTGRES_PORT=5432 - POSTGRES_PASSWORD=${DATABASE_PASSWORD} - POSTGRES_DB=nextcloud_database - POSTGRES_USER=nextcloud - REDIS_HOST=nextcloud-aio-redis - REDIS_PORT=6379 - REDIS_HOST_PASSWORD=${REDIS_PASSWORD} - APACHE_HOST=nextcloud-aio-apache - APACHE_PORT - NC_DOMAIN - ADMIN_USER=admin - ADMIN_PASSWORD=${NEXTCLOUD_PASSWORD} - NEXTCLOUD_DATA_DIR=/mnt/ncdata - OVERWRITEHOST=${NC_DOMAIN} - OVERWRITEPROTOCOL=https - TURN_SECRET - SIGNALING_SECRET - ONLYOFFICE_SECRET - NEXTCLOUD_MOUNT - CLAMAV_ENABLED - CLAMAV_HOST=nextcloud-aio-clamav - ONLYOFFICE_ENABLED - COLLABORA_ENABLED - COLLABORA_HOST=nextcloud-aio-collabora - TALK_ENABLED - ONLYOFFICE_HOST=nextcloud-aio-onlyoffice - UPDATE_NEXTCLOUD_APPS - TZ=${TIMEZONE} - TALK_PORT - IMAGINARY_ENABLED - IMAGINARY_HOST=nextcloud-aio-imaginary - PHP_UPLOAD_LIMIT=${NEXTCLOUD_UPLOAD_LIMIT} - PHP_MEMORY_LIMIT=${NEXTCLOUD_MEMORY_LIMIT} - FULLTEXTSEARCH_ENABLED - FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch - FULLTEXTSEARCH_PROTOCOL=http - FULLTEXTSEARCH_PORT=9200 - FULLTEXTSEARCH_USER=elastic - FULLTEXTSEARCH_INDEX=nextcloud-aio - PHP_MAX_TIME=${NEXTCLOUD_MAX_TIME} - TRUSTED_CACERTS_DIR=${NEXTCLOUD_TRUSTED_CACERTS_DIR} - STARTUP_APPS=${NEXTCLOUD_STARTUP_APPS} - ADDITIONAL_APKS=${NEXTCLOUD_ADDITIONAL_APKS} - ADDITIONAL_PHP_EXTENSIONS=${NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS} - INSTALL_LATEST_MAJOR - TALK_RECORDING_ENABLED - RECORDING_SECRET - TALK_RECORDING_HOST=nextcloud-aio-talk-recording - FULLTEXTSEARCH_PASSWORD - REMOVE_DISABLED_APPS - IMAGINARY_SECRET - WHITEBOARD_SECRET - WHITEBOARD_ENABLED stop_grace_period: 600s restart: unless-stopped cap_drop: - NET_RAW nextcloud-aio-notify-push: image: ghcr.io/nextcloud-releases/aio-notify-push:latest user: "33" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "7867" volumes: - nextcloud_aio_nextcloud:/var/www/html:ro environment: - NEXTCLOUD_HOST=nextcloud-aio-nextcloud - TZ=${TIMEZONE} restart: unless-stopped read_only: true cap_drop: - NET_RAW nextcloud-aio-redis: image: ghcr.io/nextcloud-releases/aio-redis:latest user: "999" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "6379" environment: - REDIS_HOST_PASSWORD=${REDIS_PASSWORD} - TZ=${TIMEZONE} volumes: - nextcloud_aio_redis:/data:rw restart: unless-stopped read_only: true cap_drop: - NET_RAW nextcloud-aio-collabora: command: ${ADDITIONAL_COLLABORA_OPTIONS} image: ghcr.io/nextcloud-releases/aio-collabora:latest init: true healthcheck: start_period: 60s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 9 expose: - "9980" environment: - aliasgroup1=https://${NC_DOMAIN}:443,http://nextcloud-aio-apache:23973 - extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.disable_server_audit=true --o:logging.level=warning --o:logging.level_startup=warning --o:welcome.enable=false --o:remote_font_config.url=https://${NC_DOMAIN}/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+ - dictionaries=${COLLABORA_DICTIONARIES} - TZ=${TIMEZONE} - server_name=${NC_DOMAIN} - DONT_GEN_SSL_CERT=1 restart: unless-stopped profiles: - collabora cap_add: - MKNOD - SYS_ADMIN - SYS_CHROOT - FOWNER - CHOWN cap_drop: - NET_RAW nextcloud-aio-talk: image: ghcr.io/nextcloud-releases/aio-talk:latest user: "1000" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 ports: - ${TALK_PORT}:${TALK_PORT}/tcp - ${TALK_PORT}:${TALK_PORT}/udp expose: - "8081" environment: - NC_DOMAIN - TALK_HOST=nextcloud-aio-talk - TURN_SECRET - SIGNALING_SECRET - TZ=${TIMEZONE} - TALK_PORT - INTERNAL_SECRET=${TALK_INTERNAL_SECRET} restart: unless-stopped profiles: - talk - talk-recording read_only: true tmpfs: - /var/log/supervisord - /var/run/supervisord - /opt/eturnal/run - /conf - /tmp cap_drop: - NET_RAW nextcloud-aio-talk-recording: image: ghcr.io/nextcloud-releases/aio-talk-recording:latest user: "122" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "1234" environment: - NC_DOMAIN - TZ=${TIMEZONE} - RECORDING_SECRET - INTERNAL_SECRET=${TALK_INTERNAL_SECRET} volumes: - nextcloud_aio_talk_recording:/tmp:rw shm_size: 2147483648 restart: unless-stopped profiles: - talk-recording read_only: true tmpfs: - /conf cap_drop: - NET_RAW nextcloud-aio-clamav: image: ghcr.io/nextcloud-releases/aio-clamav:latest user: "100" init: false healthcheck: start_period: 60s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 9 expose: - "3310" environment: - TZ=${TIMEZONE} - MAX_SIZE=${NEXTCLOUD_UPLOAD_LIMIT} volumes: - nextcloud_aio_clamav:/var/lib/clamav:rw restart: unless-stopped profiles: - clamav read_only: true tmpfs: - /tmp - /var/log/clamav - /run/clamav - /var/log/supervisord - /var/run/supervisord cap_drop: - NET_RAW nextcloud-aio-onlyoffice: image: ghcr.io/nextcloud-releases/aio-onlyoffice:latest init: true healthcheck: start_period: 60s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 9 expose: - "80" environment: - TZ=${TIMEZONE} - JWT_ENABLED=true - JWT_HEADER=AuthorizationJwt - JWT_SECRET=${ONLYOFFICE_SECRET} volumes: - nextcloud_aio_onlyoffice:/var/lib/onlyoffice:rw restart: unless-stopped profiles: - onlyoffice cap_drop: - NET_RAW nextcloud-aio-imaginary: image: ghcr.io/nextcloud-releases/aio-imaginary:latest user: "65534" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "9000" environment: - TZ=${TIMEZONE} - IMAGINARY_SECRET restart: unless-stopped cap_add: - SYS_NICE cap_drop: - NET_RAW profiles: - imaginary read_only: true tmpfs: - /tmp nextcloud-aio-fulltextsearch: image: ghcr.io/nextcloud-releases/aio-fulltextsearch:latest init: false healthcheck: start_period: 60s test: /healthcheck.sh interval: 10s timeout: 5s start_interval: 5s retries: 5 expose: - "9200" environment: - TZ=${TIMEZONE} - ES_JAVA_OPTS=${FULLTEXTSEARCH_JAVA_OPTIONS} - bootstrap.memory_lock=false - cluster.name=nextcloud-aio - discovery.type=single-node - logger.level=WARN - http.port=9200 - xpack.license.self_generated.type=basic - xpack.security.enabled=false - FULLTEXTSEARCH_PASSWORD volumes: - nextcloud_aio_elasticsearch:/usr/share/elasticsearch/data:rw restart: unless-stopped profiles: - fulltextsearch cap_drop: - NET_RAW nextcloud-aio-whiteboard: image: ghcr.io/nextcloud-releases/aio-whiteboard:latest user: "65534" init: true healthcheck: start_period: 0s test: /healthcheck.sh interval: 30s timeout: 30s start_interval: 5s retries: 3 expose: - "3002" tmpfs: - /tmp environment: - TZ=${TIMEZONE} - NEXTCLOUD_URL=https://${NC_DOMAIN} - JWT_SECRET_KEY=${WHITEBOARD_SECRET} - STORAGE_STRATEGY=redis - REDIS_HOST=nextcloud-aio-redis - REDIS_PORT=6379 - REDIS_HOST_PASSWORD=${REDIS_PASSWORD} - BACKUP_DIR=/tmp restart: unless-stopped profiles: - whiteboard read_only: true cap_drop: - NET_RAW volumes: nextcloud_aio_apache: name: nextcloud_aio_apache nextcloud_aio_clamav: name: nextcloud_aio_clamav nextcloud_aio_database: name: nextcloud_aio_database nextcloud_aio_database_dump: name: nextcloud_aio_database_dump nextcloud_aio_elasticsearch: name: nextcloud_aio_elasticsearch nextcloud_aio_nextcloud: name: nextcloud_aio_nextcloud nextcloud_aio_onlyoffice: name: nextcloud_aio_onlyoffice nextcloud_aio_redis: name: nextcloud_aio_redis nextcloud_aio_talk_recording: name: nextcloud_aio_talk_recording nextcloud_aio_nextcloud_data: name: nextcloud_aio_nextcloud_data networks: default: driver: bridge ================================================ FILE: manual-install/readme.md ================================================ # Manual installation You can run the containers that are build for AIO with docker-compose. This comes with a few downsides, that are discussed below. ### Advantages - You can run it without a container having access to the docker socket - You can modify all values on your own - You can run the containers with docker swarm - You can run this in environments where access to ghcr.io is not possible. See [this issue](https://github.com/nextcloud/all-in-one/discussions/5268). ### Disadvantages - You lose the AIO interface - You lose update notifications and automatic updates - You lose all AIO backup and restore features - You lose the built-in [Docker Socket Proxy container](https://github.com/nextcloud/docker-socket-proxy#readme) and [HaRP container](https://github.com/nextcloud/HaRP) (needed for [Nextcloud App API](https://github.com/nextcloud/app_api#nextcloud-appapi)) - You lose all community containers: https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers - **You need to know what you are doing, especially when modifying the compose.yaml file** - For updating, you need to strictly follow the at the bottom described update routine - Probably more ## How to use this? First, install docker and docker-compose (v2) if not already done. Then simply run the following: ```bash git clone https://github.com/nextcloud/all-in-one.git cd all-in-one/manual-install ``` Then copy the sample.conf to default environment file, e.g. `cp sample.conf .env`, open the new conf file, e.g. with `nano .env`, edit all values that are marked with `# TODO!`, close and save the file.
⚠️ **Warning**: Do not use the symbols `@` and `:` in your passwords. These symbols are used to build database connection strings. You will experience issues when using these symbols! Also please note that values inside the latest.yaml that are not exposed as variables are not officially supported to be changed. See for example [this report](https://github.com/nextcloud/all-in-one/issues/5612). Now copy the provided yaml file to a compose.yaml file by running `cp latest.yml compose.yaml`. Now you should be ready to go with `sudo docker compose up`. ## Docker profiles The default profile of `latest.yml` only provide the minimum necessary services: nextcloud, database, redis and apache. To get optional services collabora, talk, whiteboard, talk-recording, clamav, imaginary or fulltextsearch use additional arguments for each of them, for example `--profile collabora`. For a complete all-in-one with collabora use `sudo docker compose --profile collabora --profile talk --profile talk-recording --profile clamav --profile imaginary --profile fulltextsearch --profile whiteboard up`. ## How to update? Since the AIO containers may change in the future, it is highly recommended to strictly follow the following procedure whenever you want to upgrade your containers. 1. If your previous copy of `sample.conf` is named `my.conf`, run `mv -vn my.conf .env` in order to rename the file to `.env`. 1. Run `sudo docker compose down` to stop all running containers 1. Back up all important files and folders 1. If your compose file is still named `docker-compose.yml` rename it to `compose.yaml` by running `mv -vn docker-compose.yml compose.yaml` 1. Run `git pull` in order to get the updated yaml files from the repository. Now bring your `compose.yaml` file up-to-date with the updated one from the repository. You can use `diff compose.yaml latest.yml` for comparing. ⚠️ **Please note**: Starting with AIO v5.1.0, ipv6 networking will be enabled by default, so make sure to either enable it first by following steps 1 and 2 of https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md and then proceed with the steps below or disable ipv6 networking by editing the compose.yaml file and removing ipv6 from the network. 1. Also have a look at the `sample.conf` if any variable was added or renamed and add that to your conf file as well. Here may help the diff command as well. 1. After the file update was successful, simply run `sudo docker compose pull` to pull the new images. 1. At the end run `sudo docker compose up` in order to start and update the containers with the new configuration. ## FAQ ### Backup and restore? If you leave `NEXTCLOUD_DATADIR` in your conf file at the default value of `nextcloud_aio_nextcloud_data` and don't modify the yaml file, all data will be stored inside docker volumes which are on Linux by default located here: `/var/lib/docker/volumes`. Simply backing up this location should be a valid backup solution. Then you can also easily restore in case something bad happens. However if you change `NEXTCLOUD_DATADIR` to a path like `/mnt/ncdata`, you obviously need to back up this location, too because the Nextcloud data will be stored there. The same applies to any change to the yaml file. Obviously you also need to back up the conf file and the yaml file if you modified it. ================================================ FILE: manual-install/sample.conf ================================================ DATABASE_PASSWORD= # TODO! This needs to be a unique and good password! FULLTEXTSEARCH_PASSWORD= # TODO! This needs to be a unique and good password! IMAGINARY_SECRET= # TODO! This needs to be a unique and good password! NC_DOMAIN=yourdomain.com # TODO! Needs to be changed to the domain that you want to use for Nextcloud. NEXTCLOUD_PASSWORD= # TODO! This is the password of the initially created Nextcloud admin with username "admin". ONLYOFFICE_SECRET= # TODO! This needs to be a unique and good password! RECORDING_SECRET= # TODO! This needs to be a unique and good password! REDIS_PASSWORD= # TODO! This needs to be a unique and good password! SIGNALING_SECRET= # TODO! This needs to be a unique and good password! TALK_INTERNAL_SECRET= # TODO! This needs to be a unique and good password! TIMEZONE=Europe/Berlin # TODO! This is the timezone that your containers will use. TURN_SECRET= # TODO! This needs to be a unique and good password! WHITEBOARD_SECRET= # TODO! This needs to be a unique and good password! CLAMAV_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. COLLABORA_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. FULLTEXTSEARCH_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. IMAGINARY_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. ONLYOFFICE_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. TALK_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. TALK_RECORDING_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. WHITEBOARD_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. APACHE_IP_BINDING=0.0.0.0 # This can be changed to e.g. 127.0.0.1 if you want to run AIO behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) and if that is running on the same host and using localhost to connect APACHE_MAX_SIZE=17179869184 # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). ADDITIONAL_COLLABORA_OPTIONS=['--o:security.seccomp=true'] # You can add additional collabora options here by using the array syntax. COLLABORA_DICTIONARIES="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru" # You can change this in order to enable other dictionaries for collabora FULLTEXTSEARCH_JAVA_OPTIONS="-Xms512M -Xmx512M" # Allows to adjust the fulltextsearch java options. INSTALL_LATEST_MAJOR=no # Setting this to yes will install the latest Major Nextcloud version upon the first installation NEXTCLOUD_ADDITIONAL_APKS=imagemagick # This allows to add additional packages to the Nextcloud container permanently. Default is imagemagick but can be overwritten by modifying this value. NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick # This allows to add additional php extensions to the Nextcloud container permanently. Default is imagick but can be overwritten by modifying this value. NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_data # You can change this to e.g. "/mnt/ncdata" to map it to a location on your host. It needs to be adjusted before the first startup and never afterwards! NEXTCLOUD_MAX_TIME=3600 # This allows to change the upload time limit of the Nextcloud container NEXTCLOUD_MEMORY_LIMIT=512M # This allows to change the PHP memory limit of the Nextcloud container NEXTCLOUD_MOUNT=/mnt/ # This allows the Nextcloud container to access directories on the host. It must never be equal to the value of NEXTCLOUD_DATADIR! NEXTCLOUD_STARTUP_APPS="deck twofactor_totp tasks calendar contacts notes" # Allows to modify the Nextcloud apps that are installed on starting AIO the first time NEXTCLOUD_TRUSTED_CACERTS_DIR=/usr/local/share/ca-certificates/my-custom-ca # Nextcloud container will trust all the Certification Authorities, whose certificates are included in the given directory. NEXTCLOUD_UPLOAD_LIMIT=16G # This allows to change the upload limit of the Nextcloud container REMOVE_DISABLED_APPS=yes # Setting this to no keep Nextcloud apps that are disabled via their switch and not uninstall them if they should be installed in Nextcloud. TALK_PORT=3478 # This allows to adjust the port that the talk container is using. It should be set to something higher than 1024! Otherwise it might not work! UPDATE_NEXTCLOUD_APPS="no" # When setting to "yes" (with quotes), it will automatically update all installed Nextcloud apps upon container startup on saturdays. ================================================ FILE: manual-install/update-yaml.sh ================================================ #!/bin/bash -ex type {jq,sudo} || { echo "Commands not found. Please install them"; exit 127; } jq -c . ./php/containers.json > /tmp/containers.json sed -i 's|aio_services_v1|services|g' /tmp/containers.json sed -i 's|","destination":"|:|g' /tmp/containers.json sed -i 's|","writeable":false|:ro"|g' /tmp/containers.json sed -i 's|","writeable":true|:rw"|g' /tmp/containers.json sed -i 's|","port_number":"|:|g' /tmp/containers.json sed -i 's|","protocol":"|/|g' /tmp/containers.json sed -i 's|"ip_binding":":|"ip_binding":"|g' /tmp/containers.json cat /tmp/containers.json OUTPUT="$(cat /tmp/containers.json)" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].internal_port)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].secrets)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].ui_secrets)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].devices)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].enable_nvidia_gpu)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].backup_volumes)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].nextcloud_exec_commands)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].image_tag)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].networks)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].documentation)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-watchtower"))')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-domaincheck"))')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-borgbackup"))')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-docker-socket-proxy"))')" OUTPUT="$(echo "$OUTPUT" | jq '.services[] |= if has("depends_on") then .depends_on |= if contains(["nextcloud-aio-docker-socket-proxy"]) then del(.[index("nextcloud-aio-docker-socket-proxy")]) else . end else . end')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-harp"))')" OUTPUT="$(echo "$OUTPUT" | jq '.services[] |= if has("depends_on") then .depends_on |= if contains(["nextcloud-aio-harp"]) then del(.[index("nextcloud-aio-harp")]) else . end else . end')" OUTPUT="$(echo "$OUTPUT" | jq '.services[] |= if has("depends_on") then .depends_on |= map({ (.): { "condition": "service_started", "required": false } }) else . end' | jq '.services[] |= if has("depends_on") then .depends_on |= reduce .[] as $item ({}; . + $item) else . end')" sudo snap install yq mkdir -p ./manual-install echo "$OUTPUT" | yq -P > ./manual-install/containers.yml cd manual-install || exit sed -i "s|'||g" containers.yml sed -i '/display_name:/d' containers.yml sed -i '/THIS_IS_AIO/d' containers.yml sed -i "s|%COLLABORA_SECCOMP_POLICY% ||g" containers.yml sed -i '/stop_grace_period:/s/$/s/' containers.yml sed -i '/: \[\]/d' containers.yml sed -i 's|- source: |- |' containers.yml sed -i 's|- ip_binding: |- |' containers.yml sed -i '/AIO_TOKEN/d' containers.yml sed -i '/AIO_URL/d' containers.yml sed -i '/DOCKER_SOCKET_PROXY_ENABLED/d' containers.yml sed -i '/HARP_ENABLED/d' containers.yml sed -i '/HP_SHARED_KEY/d' containers.yml sed -i '/ADDITIONAL_TRUSTED_PROXY/d' containers.yml sed -i '/TURN_DOMAIN/d' containers.yml sed -i '/NC_AIO_VERSION/d' containers.yml TCP="$(grep -oP '[%A-Z0-9_]+/tcp' containers.yml | sort -u)" mapfile -t TCP <<< "$TCP" for port in "${TCP[@]}" do solve_port="${port%%/tcp}" sed -i "s|$solve_port/tcp|$solve_port:$solve_port/tcp|" containers.yml done UDP="$(grep -oP '[%A-Z0-9_]+/udp' containers.yml | sort -u)" mapfile -t UDP <<< "$UDP" for port in "${UDP[@]}" do solve_port="${port%%/udp}" sed -i "s|$solve_port/udp|$solve_port:$solve_port/udp|" containers.yml done rm -f sample.conf VARIABLES="$(grep -oP '%[A-Z_a-z0-6]+%' containers.yml | sort -u)" mapfile -t VARIABLES <<< "$VARIABLES" for variable in "${VARIABLES[@]}" do # shellcheck disable=SC2001 sole_variable="$(echo "$variable" | sed 's|%||g')" echo "$sole_variable=" >> sample.conf sed -i "s|$variable|\${$sole_variable}|g" containers.yml done sed -i 's|_ENABLED=|_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically.|' sample.conf sed -i 's|CLAMAV_ENABLED=no.*|CLAMAV_ENABLED="no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically.|' sample.conf sed -i 's|TALK_ENABLED=no|TALK_ENABLED="yes"|' sample.conf sed -i 's|COLLABORA_ENABLED=no|COLLABORA_ENABLED="yes"|' sample.conf sed -i 's|COLLABORA_DICTIONARIES=|COLLABORA_DICTIONARIES="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru" # You can change this in order to enable other dictionaries for collabora|' sample.conf sed -i 's|NEXTCLOUD_DATADIR=|NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_data # You can change this to e.g. "/mnt/ncdata" to map it to a location on your host. It needs to be adjusted before the first startup and never afterwards!|' sample.conf sed -i 's|NEXTCLOUD_MOUNT=|NEXTCLOUD_MOUNT=/mnt/ # This allows the Nextcloud container to access directories on the host. It must never be equal to the value of NEXTCLOUD_DATADIR!|' sample.conf sed -i 's|NEXTCLOUD_UPLOAD_LIMIT=|NEXTCLOUD_UPLOAD_LIMIT=16G # This allows to change the upload limit of the Nextcloud container|' sample.conf sed -i 's|NEXTCLOUD_MEMORY_LIMIT=|NEXTCLOUD_MEMORY_LIMIT=512M # This allows to change the PHP memory limit of the Nextcloud container|' sample.conf sed -i 's|APACHE_MAX_SIZE=|APACHE_MAX_SIZE=17179869184 # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT|' sample.conf sed -i 's|NEXTCLOUD_MAX_TIME=|NEXTCLOUD_MAX_TIME=3600 # This allows to change the upload time limit of the Nextcloud container|' sample.conf sed -i 's|NEXTCLOUD_TRUSTED_CACERTS_DIR=|NEXTCLOUD_TRUSTED_CACERTS_DIR=/usr/local/share/ca-certificates/my-custom-ca # Nextcloud container will trust all the Certification Authorities, whose certificates are included in the given directory.|' sample.conf sed -i 's|UPDATE_NEXTCLOUD_APPS=|UPDATE_NEXTCLOUD_APPS="no" # When setting to "yes" (with quotes), it will automatically update all installed Nextcloud apps upon container startup on saturdays.|' sample.conf sed -i 's|APACHE_PORT=|APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else).|' sample.conf sed -i 's|APACHE_IP_BINDING=|APACHE_IP_BINDING=0.0.0.0 # This can be changed to e.g. 127.0.0.1 if you want to run AIO behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) and if that is running on the same host and using localhost to connect|' sample.conf sed -i 's|TALK_PORT=|TALK_PORT=3478 # This allows to adjust the port that the talk container is using. It should be set to something higher than 1024! Otherwise it might not work!|' sample.conf sed -i 's|NC_DOMAIN=|NC_DOMAIN=yourdomain.com # TODO! Needs to be changed to the domain that you want to use for Nextcloud.|' sample.conf sed -i 's|NEXTCLOUD_PASSWORD=|NEXTCLOUD_PASSWORD= # TODO! This is the password of the initially created Nextcloud admin with username "admin".|' sample.conf sed -i 's|TIMEZONE=|TIMEZONE=Europe/Berlin # TODO! This is the timezone that your containers will use.|' sample.conf sed -i 's|COLLABORA_SECCOMP_POLICY=|COLLABORA_SECCOMP_POLICY=--o:security.seccomp=true # Changing the value to false allows to disable the seccomp feature of the Collabora container.|' sample.conf sed -i 's|FULLTEXTSEARCH_JAVA_OPTIONS=|FULLTEXTSEARCH_JAVA_OPTIONS="-Xms512M -Xmx512M" # Allows to adjust the fulltextsearch java options.|' sample.conf sed -i 's|NEXTCLOUD_STARTUP_APPS=|NEXTCLOUD_STARTUP_APPS="deck twofactor_totp tasks calendar contacts notes" # Allows to modify the Nextcloud apps that are installed on starting AIO the first time|' sample.conf sed -i 's|NEXTCLOUD_ADDITIONAL_APKS=|NEXTCLOUD_ADDITIONAL_APKS=imagemagick # This allows to add additional packages to the Nextcloud container permanently. Default is imagemagick but can be overwritten by modifying this value.|' sample.conf sed -i 's|NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=|NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick # This allows to add additional php extensions to the Nextcloud container permanently. Default is imagick but can be overwritten by modifying this value.|' sample.conf sed -i 's|INSTALL_LATEST_MAJOR=|INSTALL_LATEST_MAJOR=no # Setting this to yes will install the latest Major Nextcloud version upon the first installation|' sample.conf sed -i 's|REMOVE_DISABLED_APPS=|REMOVE_DISABLED_APPS=yes # Setting this to no keep Nextcloud apps that are disabled via their switch and not uninstall them if they should be installed in Nextcloud.|' sample.conf sed -i 's|=$|= # TODO! This needs to be a unique and good password!|' sample.conf grep '# TODO!' sample.conf > todo.conf grep -v '# TODO!\|_ENABLED' sample.conf > temp.conf grep '_ENABLED' sample.conf > enabled.conf cat todo.conf > sample.conf # shellcheck disable=SC2129 echo '' >> sample.conf cat enabled.conf >> sample.conf echo '' >> sample.conf cat temp.conf >> sample.conf rm todo.conf temp.conf enabled.conf cat sample.conf OUTPUT="$(cat containers.yml)" NAMES="$(grep -oP "container_name:.*" containers.yml | grep -oP 'nextcloud-aio.*')" mapfile -t NAMES <<< "$NAMES" for name in "${NAMES[@]}" do OUTPUT="$(echo "$OUTPUT" | sed "/container_name.*$name$/i\ \ $name:")" if [ "$name" != "nextcloud-aio-apache" ]; then OUTPUT="$(echo "$OUTPUT" | sed "/^ $name:/i\ ")" fi done echo "$OUTPUT" > containers.yml sed -i '/container_name/d' containers.yml sed -i 's|^ $||' containers.yml # Additional config for collabora cat << EOL > /tmp/additional-collabora.config command: \${ADDITIONAL_COLLABORA_OPTIONS} EOL sed -i "/^ nextcloud-aio-collabora:/r /tmp/additional-collabora.config" containers.yml sed -i "/^COLLABORA_DICTIONARIES.*/i ADDITIONAL_COLLABORA_OPTIONS=['--o:security.seccomp=true'] # You can add additional collabora options here by using the array syntax." sample.conf VOLUMES="$(grep -oP 'nextcloud_aio_[a-z_]+' containers.yml | sort -u)" mapfile -t VOLUMES <<< "$VOLUMES" echo "" >> containers.yml echo "volumes:" >> containers.yml for volume in "${VOLUMES[@]}" "nextcloud_aio_nextcloud_data" do cat << VOLUMES >> containers.yml $volume: name: $volume VOLUMES done cat << NETWORK >> containers.yml networks: default: driver: bridge NETWORK mv containers.yml latest.yml sed -i "/image:/s/$/:latest/" latest.yml sed -i 's/\( *- \(\w*\)\)=\${\2\}/\1/' latest.yml set +ex ================================================ FILE: manual-upgrade.md ================================================ # Manual upgrade If you do not update Nextcloud AIO for a long time (6+ months), when you eventually update in the AIO interface you will find Nextcloud no longer works. This is due to incompatible PHP versions within the nextcloud container. There is unfortunately no way to fix this from a maintainer POV if you refrain from upgrading for so long. The only way to fix this on your side is upgrading regularly (e.g. by enabling daily backups which will also automatically upgrade all containers) and following the steps below to get back to a normal state: --- ## Method 1 using `assaflavie/runlike` > [!Warning] > Please note that this method is apparently currently broken. See https://help.nextcloud.com/t/manual-upgrade-keeps-failing/217164/10 > So please refer to method 2 using Portainer. 1. Start all containers from the AIO interface - Now, it will report that Nextcloud is restarting because it is not able to start due to the above mentioned problem - #### Do **not** click on `Stop containers` because you will need them running going forward, see below 2. Find out with which PHP version your installed Nextcloud is compatible by running `sudo docker exec nextcloud-aio-nextcloud cat lib/versioncheck.php`. - There you will find information about the max. supported PHP version - **Make a mental note of this** 3. Stop the Nextcloud container and the Apache container by running ```bash sudo docker stop nextcloud-aio-nextcloud && sudo docker stop nextcloud-aio-apache ``` 4. Run the following commands in order to reverse engineer the Nextcloud container: ```bash sudo docker pull assaflavie/runlike echo '#!/bin/bash' > /tmp/nextcloud-aio-nextcloud sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike -p nextcloud-aio-nextcloud >> /tmp/nextcloud-aio-nextcloud sudo chown root:root /tmp/nextcloud-aio-nextcloud ``` 5. Now open `/tmp/nextcloud-aio-nextcloud` with a text editor, and edit the container tag: | To change | Replace with | |----------------------------------------|-----------------------------------------------------| | `ghcr.io/nextcloud-releases/aio-nextcloud:latest` | `ghcr.io/nextcloud-releases/aio-nextcloud:php{version}-latest` | | `ghcr.io/nextcloud-releases/aio-nextcloud:latest-arm64` | `ghcr.io/nextcloud-releases/aio-nextcloud:php{version}-latest-arm64` | - e.g. `ghcr.io/nextcloud-releases/aio-nextcloud:php8.0-latest` or `ghcr.io/nextcloud-releases/aio-nextcloud:php8.0-latest-arm64` - However, if you are unsure check the ghcr.io (https://github.com/nextcloud-releases/all-in-one/pkgs/container/aio-nextcloud/versions?filters%5Bversion_type%5D=tagged) and docker hub: https://hub.docker.com/r/nextcloud/aio-nextcloud/tags?name=php - Using nano and the arrow keys to navigate: - `sudo nano /tmp/nextcloud-aio-nextcloud` making changes as above, then `[Ctrl]+[o]` -> `[Enter]` and `[Ctrl]+[x]` to save and exit. 6. Next, stop and remove the current container: ```bash sudo docker stop nextcloud-aio-nextcloud sudo docker rm nextcloud-aio-nextcloud ``` 7. Now start the Nextcloud container with the new tag by simply running `sudo bash /tmp/nextcloud-aio-nextcloud` which at startup should automatically upgrade Nextcloud to a more recent version. If not, make sure that there is no `skip.update` file in the Nextcloud datadir. If there is such a file, simply delete the file and restart the container again.
**Info**: You can open the Nextcloud container logs with `sudo docker logs -f nextcloud-aio-nextcloud`. 8. After the Nextcloud container is started (you can tell by looking at the logs), simply restart the container again with `sudo docker restart nextcloud-aio-nextcloud` until it does not install a new Nextcloud update anymore upon the container startup. 9. Now, you should be able to use the AIO interface again by simply stopping the AIO containers and starting them again which should finally bring up your instance again. 10. If not and if you get the same error again, you may repeat the process starting from the beginning again until your Nextcloud version is finally up-to-date. 11. Now, if everything is finally running as usual again, it is recommended to create a backup in order to save the current state. Consider enabling daily backups if doing regular upgrades is a hassle for you. --- ## Method 2 using Portainer #### *Approach using portainer if method 1 does not work for you* Prerequisite: have all containers from AIO interface running. ##### 1. Install portainer if not installed: ```bash docker volume create portainer_data docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest ``` - If you have a reverse proxy - you can setup and navigate using a domain name. - For the **standard** AIO install - Open port 9443 on your firewall - navigate to `https://:9443` - Accept the insecure self-signed certificate and set an admin password - If prompted to add an environment - add local ##### 2. Within the local portainer environment navigate to the **containers** tab - Here you should see all the various containers running ##### 3. Now we need to stop the `nextcloud-aio-nextcloud` and `nextcloud-aio-apache` containers - This can be done by selecting the checkbox's next to the containers' name and clicking the **Stop** button at the top - or you can click into individual containers and stop them there ##### 4. Find the version of PHP compatible with the running nextcloud container - navigate to ```nextcloud-aio-nextcloud``` and click on ```logs```, you should see something along the lines of: ```logs This version of nextcloud is not compatible with >=php 8.2, you are currently running php 8.2.18 ``` Make **note** of the version which is compatible, rounding down to 1 digit after the dot. - In this example we would want php 8.1 since anything with 8.2 or above is incompatible ##### 5. Find the correct container version In general it should be ```ghcr.io/nextcloud-releases/aio-nextcloud:php8.x-latest-arm64``` or `ghcr.io/nextcloud-releases/aio-nextcloud:php8.x-latest` replacing `x` with the version you require. However, if you are unsure check the ghcr.io (https://github.com/nextcloud-releases/all-in-one/pkgs/container/aio-nextcloud/versions?filters%5Bversion_type%5D=tagged) and docker hub: https://hub.docker.com/r/nextcloud/aio-nextcloud/tags?name=php ##### 6. Replace the container - Navigate to the ```nextcloud-aio-nextcloud``` container within portainer - Click ```Duplicate/Edit``` - Within image, change this to the correct version from Step 5 - Click ```Deploy the container``` - if you are prompted to force repull the image click the slider and press pull image *Navigate to the nextcloud-aio-nextcloud logs and you will see the container updating* Once you see no more activities in the logs or a message like ```NOTICE: ready to handle connections```, we've done it! #### Now you can handle everything through the AIO interface and stop and restart the containers normally. --- ##### 7. Last Step is removing portainer if you don't want to keep it ```bash docker stop portainer docker rm portainer docker volume rm portainer_data ``` - Make sure you close port 9443 on your firewall and delete any necessary reverse proxy hosts. ================================================ FILE: migration.md ================================================ # How to migrate from an already existing Nextcloud installation to Nextcloud AIO? There are basically three ways how to migrate from an already existing Nextcloud installation to Nextcloud AIO (if you ran AIO on the former installation already, you can follow [these steps](https://github.com/nextcloud/all-in-one#how-to-migrate-from-aio-to-aio)): 1. Migrate only the files which is the easiest way (this excludes all calendar data for example) 1. Migrate the files and the database which is much more complicated (and doesn't work on former snap installations) 1. Use the user_migration app that allows to migrate some of the user's data from a former instance to a new instance but needs to be done manually for each user ## Migrate only the files **Please note**: If you used groupfolders or encrypted your files before, you will need to restore the database, as well! (This will also exclude all calendar data for example). The procedure for migrating only the files works like this: 1. Take a backup of your former instance (especially from your datadirectory, see `'datadirectory'` in your `config.php`) 1. Install Nextcloud AIO on a new server/linux installation, enter your domain and wait until all containers are running 1. Recreate all users that were present on your former installation 1. Take a backup using Nextcloud AIO's built-in backup solution (so that you can easily restore to this state again) (Note: this will stop all containers and is expected: don't start the container again at this point!) 1. Restore the datadirectory of your former instance: for `/path/to/old/nextcloud/data/` run `sudo docker cp --follow-link /path/to/old/nextcloud/data/. nextcloud-aio-nextcloud:/mnt/ncdata/` Note: the `/.` and `/` at the end are necessary. 1. Next, run `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chown -R 33:0 /mnt/ncdata/` and `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chmod -R 750 /mnt/ncdata/` to apply the correct permissions. (Or if `NEXTCLOUD_DATADIR` was provided, apply `chown -R 33:0` and `chmod -R 750` to the chosen path.) 1. Start the containers again and wait until all containers are running 1. Run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data && sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all` in order to scan all files in the datadirectory. 1. If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below. ## Migrate the files and the database **Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! Also, this will not work on former snap installations as the snap is read-only and thus you cannot install the necessary `pdo_pgsql` PHP extension. So if migrating from snap, you will need to use one of the other methods. However you could try to ask if the snaps maintainer could add this one small PHP extension to the snap here: https://github.com/nextcloud-snap/nextcloud-snap/issues which would allow for an easy migration. The procedure for migrating the files and the database works like this: 1. Make sure that your old instance is on exactly the same version like the version used in Nextcloud AIO. (e.g. 23.0.0) You can find the used version here: [click here](https://github.com/nextcloud/all-in-one/search?l=Dockerfile&q=NEXTCLOUD_VERSION&type=). If not, simply upgrade your former installation to that version or wait until the version used in Nextcloud AIO got updated to the same version of your former installation or the other way around. 1. First, on the old instance, update all Nextcloud apps to its latest version via the app management site (important for the restore later on). Then take a backup of your former instance (especially from your datadirectory and database). 1. If your former installation didn't use Postgresql already, you will now need to convert your old installation to use Postgresql as database temporarily (in order to be able to perform a pg_dump afterwards): 1. Install Postgresql on your former installation: on a Debian based OS should the following command work: ``` sudo apt update && sudo apt install postgresql -y ``` 1. Create a new database by running: ``` export PG_USER="ncadmin" # This is a temporary user that gets created for the dump but is then overwritten by the correct one later on export PG_PASSWORD="my-temporary-password" export PG_DATABASE="nextcloud_db" sudo -u postgres psql < **Troubleshooting:** If you get an error that it could not find a driver for the conversion, you most likely need to install the PHP extension `pdo_pgsql`. 1. Hopefully does the conversion finish successfully. If not, simply restore your old Nextcloud installation from backup. If yes, you should now log in to your Nextcloud and test if everything works and if all data has been converted successfully. 1. If everything works as expected, feel free to continue with the steps below. 1. Now, run a pg_dump to get an export of your current database. Something like the following command should work: ``` sudo -Hiu postgres pg_dump "$PG_DATABASE" > ./database-dump.sql ``` **Please note:** The exact name of the database export file is important! (`database-dump.sql`)
And of course you need to to use the correct name that the Postgresql database has for the export (if `$PG_DATABASE` doesn't work directly). 1. At this point, you can finally install Nextcloud AIO on a new server/linux installation, enter your domain in the AIO interface (use the same domain that you used on your former installation) and wait until all containers are running. Then you should check the included Nextcloud version by running `sudo docker inspect nextcloud-aio-nextcloud | grep NEXTCLOUD_VERSION`. On the AIO interface, use the passphrase to connect to your newly created Nextcloud instance's admin account. There, install all the Nextcloud apps that were installed on the old Nextcloud installation. If you don't, the migration will show them as installed, but they won't work. 1. Next, take a backup using Nextcloud AIO's built-in backup solution (so that you can easily restore to this state again). Once finished, all containers are automatically stopped and is expected: **don't start the container again at this point!** 1. Now, with the containers still stopped, we are slowly starting to import your files and database. First, you need to modify the datadirectory that is stored inside the database export: 1. Find out what the directory of your old Nextcloud installation is by e.g. opening the config.php file and looking at the value `datadirectory`. 1. Now, create a copy of the database file so that you can simply restore it if you should make a mistake while editing: `cp database-dump.sql database-dump.sql.backup` 1. Next, open the database export with e.g. nano: `nano database-dump.sql` 1. Press `[CTRL] + [w]` in order to open the search 1. Type in `local::/your/old/datadir/` which should bring up the exact line where you need to modify the path to use the one used in Nextcloud AIO, instead. 1. Change it to look like this: `local::/mnt/ncdata/`. 1. Now save the file by pressing `[CTRL] + [o]` then `[ENTER]` and close nano by pressing `[CTRL] + [x]` 1. In order to make sure that everything is good, you can now run `grep "/your/old/datadir" database-dump.sql` which should not bring up further results.
1. **Please note:** Unfortunately it is not possible to import a database dump from a former database owner with the name `nextcloud`. You can check if that is the case with this command: `grep "Name: oc_appconfig; Type: TABLE; Schema: public; Owner:" database-dump.sql | grep -oP 'Owner:.*$' | sed 's|Owner:||;s| ||g'`. If it returns `nextcloud`, you need to rename the owner in the dump file manually. A command like the following should work, however please note that it is possible that it will overwrite wrong lines. You can thus first check which lines it will change with `grep "Owner: nextcloud$" database-dump.sql`. If only correct looking lines get returned, feel free to change them with `sed -i 's|Owner: nextcloud$|Owner: ncadmin|' database-dump.sql`. The same applies for the second statement, check with `grep " OWNER TO nextcloud;$" database-dump.sql` and replace with `sed -i 's| OWNER TO nextcloud;$| OWNER TO ncadmin;|' database-dump.sql`. 1. Next, copy the database dump into the correct place and prepare the database container which will import from the database dump automatically the next container start: ``` sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine rm /mnt/data/database-dump.sql sudo docker cp database-dump.sql nextcloud-aio-database:/mnt/data/ sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine chmod 777 /mnt/data/database-dump.sql sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine rm /mnt/data/initial-cleanup-done ``` 1. If the commands above were executed successfully, restore the datadirectory of your former instance into your datadirectory: `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine sh -c "rm -rf /mnt/ncdata/*"` and `sudo docker cp --follow-link /path/to/nextcloud/data/. nextcloud-aio-nextcloud:/mnt/ncdata/` Note: the `/.` and `/` at the end are necessary. (Or if `NEXTCLOUD_DATADIR` was provided, first delete the files in there and then copy the files to the chosen path.) 1. Next, run `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chown -R 33:0 /mnt/ncdata/` and `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chmod -R 750 /mnt/ncdata/` to apply the correct permissions on the datadirectory. (Or if `NEXTCLOUD_DATADIR` was provided, apply `chown -R 33:0` and `chmod -R 750` to the chosen path.) 1. Edit the Nextcloud AIO config.php file using `sudo docker run -it --rm --volume nextcloud_aio_nextcloud:/var/www/html:rw alpine sh -c "apk add --no-cache nano && nano /var/www/html/config/config.php"` and modify only `passwordsalt`, `secret`, `instanceid` and set it to the old values that you used on your old installation. If you are brave, feel free to modify further values e.g. add your old LDAP config or S3 storage config. (Some things like Mail server config can be added back using Nextcloud's webinterface later on). 1. When you are done and saved your changes to the file, finally start the containers again and wait until all containers are running. Now the whole Nextcloud instance should work again.
If not, feel free to restore the AIO instance from backup and start at step 8 again. If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below. ## Use the user_migration app A new way since the Nextcloud update to 24 is to use the new [user_migration app](https://apps.nextcloud.com/apps/user_migration#app-gallery). It allows to export the most important data on one instance and import it on a different Nextcloud instance. For that, you need to install and enable the user_migration app on your old instance, trigger the export for the user, create the user on the new instance, log in with that user and import the archive that was created during the export. This then needs to be done for each user that you want to migrate. If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below. # Synchronising with clients after migration #### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery By default the Nextcloud server is considered the authoritative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server. If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:data-fingerprint` command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked. >[!Note] >The usage of maintenance:data-fingerprint can cause conflict dialogues and difficulties deleting files on the client. Therefore it’s only recommended to prevent dataloss if the backup was outdated. If you are running multiple application servers you will need to make sure the config files are synced between them so that the updated data-fingerprint is applied on all instances. ================================================ FILE: multiple-instances.md ================================================ # Multiple AIO instances It is possible to run multiple instances of AIO on one server. There are two ways to achieve this: The normal way is creating multiple VMs, installing AIO in [reverse proxy mode](./reverse-proxy.md) in each of them and having one reverse proxy in front of them that points to each VM (you also need to [use a different `TALK_PORT`](https://github.com/nextcloud/all-in-one#how-to-adjust-the-talk-port) for each of them). The second and more advanced way is creating multiple users on the server and using docker rootless for each of them in order to install multiple instances on the same server. ## Run multiple AIO instances on the same server with docker rootless 1. Create as many linux users as you need first. The easiest way is to use `sudo adduser` and follow the setup for that. Make sure to create a strong unique password for each of them and write it down! 1. Log in as each of the users by opening a new SSH connection as the user and install docker rootless for each of them by following step 0-1 and 3-4 of the [docker rootless documentation](./docker-rootless.md) (you can skip step 2 in this case). 1. Then install AIO in reverse proxy mode by using the command that is described in step 2 and 3 of the [reverse proxy documentation](./reverse-proxy.md) but use a different `APACHE_PORT` and [`TALK_PORT`](https://github.com/nextcloud/all-in-one#how-to-adjust-the-talk-port) for each instance as otherwise it will bug out. Also make sure to adjust the docker socket and `WATCHTOWER_DOCKER_SOCKET_PATH` correctly for each of them by following step 6 of the [docker rootless documentation](./docker-rootless.md). Additionally, modify `--publish 8080:8080` to a different port for each container, e.g. `8081:8080` as otherwise it will not work.
**⚠️ Please note:** If you want to adjust the `NEXTCLOUD_DATADIR`, make sure to apply the correct permissions to the chosen path as documented at the bottom of the [docker rootless documentation](./docker-rootless.md). Also for the built-in backup to work, the target path needs to have the correct permissions as documented there, too. 1. Now install your webserver of choice on the host system. It is recommended to use caddy for this as it is by far the easiest solution. You can do so by following https://caddyserver.com/docs/install#debian-ubuntu-raspbian or below. (It needs to be installed directly on the host or on a different server in the same network). 1. Next create your Caddyfile with multiple entries and domains for the different instances like described in step 1 of the [reverse proxy documentation](./reverse-proxy.md). Obviously each domain needs to point correctly to the chosen `APACHE_PORT` that you've configured before. Then start Caddy which should automatically get the needed certificates for you if your domains are configured correctly and ports 80 and 443 are forwarded to your server. 1. Now open each of the AIO interfaces by opening `https://ip.address.of.this.server:8080` or e.g. `https://ip.address.of.this.server:8081` or as chosen during step 3 of this documentation. 1. Finally type in the domain that you've configured for each of the instances during step 5 of this documentation and you are done. 1. Please also do not forget to open/forward each chosen `TALK_PORT` UDP and TCP in your firewall/router as otherwise Talk will not work correctly! Now everything should be set up correctly and you should have created multiple working instances of AIO on the same server! ## Run multiple AIO instances on the same server inside their own virtual machines This guide will walk you through creating and configuring two (or more) Debian-based VMs (with "reverse proxy mode" Nextcloud AIO installed in each VM), behind one Caddy reverse proxy, all running on one host physical machine (like a laptop or desktop PC). It's highly recommend to follow the steps in order. Steps 1 through 4 will need to be repeated. Steps 5 through 8 only need to be completed once. All commands are expected to be run as root.
PLEASE READ: A few expectations about your network This guide assumes that you have forwarded ports 443 and 8443 to your host physical machine via your router's configuration page, and either set up Dynamic DNS or obtained a static outbound IP address from your ISP. If this is not the case, or if you are brand-new to networking, you probably should not proceed with this guide, unless you are just using it for educational purposes. Proper network setup and security is critical when it comes to keeping your data safe. You may consider hosting using a VPS instead, or choosing one of Nextcloud's trusted providers.
A note for VPS users If you want to do this on a VPS, and your VPS is KVM-based and provides a static IP address, you can likely benefit from this guide too! Simply replace the words "host physical machine" with "VPS" and follow along.
**Before starting:** Make sure your host physical machine has enough resources. A host machine with 8GB RAM and 100GB storage is sufficient for running two fairly minimal VMs, with 2GB RAM and 32GB storage allocated to each VM. This guide assumes you have these resources at the minimum. This is fine for just testing the setup, but you will probably want to allocate more resources to your VMs if you plan to use this for day-to-day use. If your host machine has more than 8GB memory available, and you plan to enable any of the optional containers (Nextcloud Office, Talk, Imaginary, etc.) in any of your instances, then you should definitely allocate more memory to the VM hosting that instance. In other words, before turning on any extra features inside a particular AIO interface, make sure you've first allocated enough resources to the VM that the instance is running inside. If in doubt, the AIO interface itself gives great recommendations for extra CPU and RAM allocation. **Additional prerequisites:** Your host physical machine needs to have virtualization enabled in it's UEFI/BIOS. It also needs a few tools installed in order to create VMs. Assuming your host machine is a bare-bones Ubuntu or Debian Linux server without a desktop environment installed, the easiest way to create VMs is to install *QEMU*, *virsh*, *virt-install*, and a few extra packages to support UEFI booting and network config ([more info](https://wiki.debian.org/KVM)). You only need to do this once. To do this, run this command (**on the host physical machine**): ```shell # For host machines running Ubuntu Server or Debian: apt install --no-install-recommends qemu-system qemu-utils libvirt-clients libvirt-daemon-system virtinst ovmf bridge-utils dnsmasq-base ``` **Let's begin!** This guide assumes that you have two domains where you would like to host two individual AIO instances (one instance per domain). Let's call these domains `example1.com` and `example2.com`. Therefore, we'll create two VMs named `example1-com` and `example2-com` (These are the VM names we'll use below in step 1). **Once you're ready, follow steps 1-4 below to set up your VMs. You will configure them one at a time.** 1. Choose a name for your VM. A good choice is to name each VM the same as the domain name that will be used to access it. 2. Choose the distribution you'd like to install within the VM:
Ubuntu Server 22.04.4 LTS

Downloading the .ISO image

You must first download an .ISO image to your host machine, and then provide virt-install with the path to that image.
# Skip this part if you've already downloaded this image
   curl -o /tmp/ubuntu-22.04.4-live-server-amd64.iso https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso
   
Note: You may choose a different place to store the .ISO file, but it needs to be somewhere accessible by QEMU. "/tmp" and "/home" work well, but choosing a location like "/root" will cause the next command to fail.

Creating the VM

Now create the Ubuntu Server VM (Don't forget to replace [VM_NAME]):
virt-install \
   --name [VM_NAME] \
   --virt-type kvm \
   --location /tmp/ubuntu-22.04.4-live-server-amd64.iso,kernel=casper/vmlinuz,initrd=casper/initrd \
   --os-variant ubuntujammy \
   --disk size=32 \
   --memory 2048 \
   --graphics none \
   --console pty,target_type=serial \
   --extra-args "console=ttyS0" \
   --autostart \
   --boot uefi
   

Using a different version of Ubuntu Server

To use a different Ubuntu Server release, visit this page and find the version you want. You will need to adjust the filename and URL for the curl command, and the location and os-variant for the virt-install command, accordingly.
Debian 11

Creating the VM

Create the Debian VM (Don't forget to replace [VM_NAME]):
virt-install \
   --name [VM_NAME] \
   --virt-type kvm \
   --location http://deb.debian.org/debian/dists/bullseye/main/installer-amd64/ \
   --os-variant debian11 \
   --disk size=32 \
   --memory 2048 \
   --graphics none \
   --console pty,target_type=serial \
   --extra-args "console=ttyS0" \
   --autostart \
   --boot uefi
   
Debian 12

Creating the VM

Create the Debian VM (Don't forget to replace [VM_NAME]):
# If the os-variant "debian12" is unknown, try "debiantesting" instead
   virt-install \
   --name [VM_NAME] \
   --virt-type kvm \
   --location http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/ \
   --os-variant debian12 \
   --disk size=32 \
   --memory 2048 \
   --graphics none \
   --console pty,target_type=serial \
   --extra-args "console=ttyS0" \
   --autostart \
   --boot uefi
   
3. Navigate through the text-based installer. Most options can remain as default, but here are some tips:
For the Ubuntu Server installer When asked about the "type of installation", you can leave the default "Ubuntu Server" without third-party drivers. You can leave the HTTP proxy information blank. In the "Profile Configuration" section, you can set "Your servers name" (hostname) to the same value as the name you gave to your VM (for example, "example1-com"). The installer will only let you create a non-root user. Note down the password you use here! You may skip enabling Ubuntu Pro. You can allow the partitioner to use the entire disk, this only uses the virtual disk that you defined above in step 2. You'll eventually be given the option to install additional software. Although "Nextcloud" is listed here, you almost certainly do not want to select this option, since you are setting up Nextcloud AIO. You'll be asked about installing "SSH server", this is entirely optional (This lets you easily SSH into the VM in the future in case you have to perform any maintenance, but even if you do not install an SSH server, you can still log in using the "virsh console" command). Finally, disregard the "[FAILED] Failed unmounting /cdrom." message, and press return.
For the Debian installer When asked, you can set the hostname to the same value as the name you gave to your VM (for example, "example1-com"). You can leave the domain name and HTTP proxy information blank. Allow the installer to create both a root and a non-root user. Note down the password(s) you use here! You can allow the partitioner to use the entire disk, this only uses the virtual disk that you defined above in step 2. When tasksel (Software selection) runs and asks if you want to install additional software, use spacebar and your arrow keys to un-check the "Debian desktop environment" and "GNOME" options. The "SSH server" option is entirely optional (This lets you easily SSH into the VM in the future in case you have to perform any maintenance, but even if you do not install an SSH server, you can still log in using the "virsh console" command). Make sure "standard system utilities" is also checked. Hit tab to select "Continue". Finally, disregard the warning about GRUB, allow it to install to your "primary drive" (again, it's only virtual, and this only applies to the VM- this will not affect the boot configuration of your host physical machine) and select "/dev/vda" for the bootable device.
4. Configure your new VM: After it has finished installing, the VM will have rebooted and presented you with a login prompt. For Debian, just use `root` as the username, and enter the password you chose during the installation process. Ubuntu restricts root account access, so you'll need to first login with your non-root user, and then run `sudo su -` to elevate your privileges. We will now run a few commands to install docker and AIO in reverse proxy mode! As with any other commands, carefully read and try your best to understand them before running them. **Each time you reach this step and run the `docker run` command below, you'll need to increment the `TALK_PORT` value. For example: 3478, 3479, etc... You may use other values as long as they don't conflict, and make sure they are [greater than 1024](https://github.com/nextcloud/all-in-one/discussions/2517). Be sure to note down the Talk port number you've assigned to this VM/AIO instance. You will need it later if you decide to enable Nextcloud Talk.** Run these commands (**on the VM**): ```shell apt install -y curl curl -fsSL https://get.docker.com | sh # Make sure you increment the TALK_PORT value every time you run this! docker run \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 8080:8080 \ --env APACHE_PORT=11000 \ --env APACHE_IP_BINDING=0.0.0.0 \ --env TALK_PORT=3478 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ ghcr.io/nextcloud-releases/all-in-one:latest ``` The last command may take a few minutes. When it's finished, you should see a success message, saying "Initial startup of Nextcloud All-in-One complete!". Now exit the console session with `Ctrl + [c]`. This concludes the setup for this particular VM. --- 6. Go ahead and run through steps 1-4 again in order to set up your second VM. When you're finished, proceed down to step 6. *(Note: If you downloaded the Ubuntu .ISO image and no longer need it, you may delete it now.)* 7. Almost done! All that's left is configuring your reverse proxy. To do this, you first need to [install it](https://caddyserver.com/docs/install#debian-ubuntu-raspbian). Run (**on the host physical machine**): ```shell apt update -y apt install -y debian-keyring debian-archive-keyring apt-transport-https curl curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list apt update -y apt install -y caddy ``` These commands will ensure that your system is up-to-date and install the latest stable version of Caddy via it's official binary source. 8. To configure Caddy, you need to know the IP address assigned to each VM. Run (**on the host physical machine**): ```shell virsh net-dhcp-leases default ``` This will show you the VMs you set up, and the IP address corresponding to each of them. Note down each IP and corresponding hostname. Finally, you will configure Caddy using this information. Open the default Caddyfile with a text editor: ```shell nano /etc/caddy/Caddyfile ``` Replace everything in this file with the following configuration. Don't forget to edit this sample configuration and substitute in your own domain names and IP addresses. `[DOMAIN_NAME_*]` should be a domain name like `example1.com`, and `[IP_ADDRESS_*]` should be a local IPv4 address like `192.168.122.225`. ```shell # Virtual machine #1 - "example1-com" https://[DOMAIN_NAME_1]:8443 { reverse_proxy https://[IP_ADDRESS_1]:8080 { header_up Host {host} transport http { tls_insecure_skip_verify } } } https://[DOMAIN_NAME_1]:443 { reverse_proxy [IP_ADDRESS_1]:11000 } # Virtual machine #2 - "example2-com" https://[DOMAIN_NAME_2]:8443 { reverse_proxy https://[IP_ADDRESS_2]:8080 { header_up Host {host} transport http { tls_insecure_skip_verify } } } https://[DOMAIN_NAME_2]:443 { reverse_proxy [IP_ADDRESS_2]:11000 } # (Add more configurations here if you set up more than two VMs!) ``` After making this change, you'll need to restart Caddy: ```shell systemctl restart caddy ``` 9. That's it! Now, all that's left is to set up your instances through the AIO interface as usual by visiting `https://example1.com:8443` and `https://example2.com:8443` in a browser. Once you're finished going through each setup, you can access your new instances simply through their domain names. You can host as many instances with as many domain names as you want this way, as long as you have enough system resources. Enjoy!
A few extra tips for managing this setup
  • You can easily connect to a VM to perform maintenance using this command (on the host physical machine):
    virsh console --domain [VM_NAME]
  • If you chose to install an SSH Server, you can SSH in using this command (on the host physical machine):
    ssh [NONROOT_USER]@[IP_ADDRESS] # By default, OpenSSH does not allow logging in as root
  • If you mess up the configuration of a VM, you may wish to completely delete it and start fresh with a new one. THIS WILL DELETE ALL DATA ASSOCIATED WITH THE VM INCLUDING ANYTHING IN YOUR AIO DATADIR! If you are sure you would like to do this, run (on the host physical machine):
    virsh destroy --domain [VM_NAME] ; virsh undefine --nvram --domain [VM_NAME] && rm -rfi /var/lib/libvirt/images/[VM_NAME].qcow2
  • Using Nextcloud Talk will require some extra configuration. Back when you set up your VMs, they were (by default) configured with NAT, meaning they are in their own subnet. The VMs must each instead be bridged, so that your router may directly "see" them (as if they were real, physical devices on your network), and each AIO instance inside each VM must be configured with a different Talk port (like 3478, 3479, etc.). You should have already set these port numbers (back when you first configured the VM in step 4 above), but if you still need to set (or want to change) these values, you can remove the mastercontainer and re-run the initial "docker run" command with a modified Talk port like so. Then, the Talk port for EACH instance needs to be forwarded in your router's settings DIRECTLY to the VM hosting the instance (completely bypassing your host physical machine/reverse proxy). And finally, inside an admin-privileged account (such as the default "admin" account) in each instance, you must visit https://[DOMAIN_NAME]/settings/admin/talk then find the STUN/TURN Settings, and from there set the proper values. If this is too complicated, it may be easier to use public STUN/TURN servers, but I have not tested any of this, rather I'm just sharing what I have found so far (more info available here). If you have figured this out or if any of this information is incorrect, please edit this section!
  • Configuring daily automatic backups is a bit more involved with this setup. But for the occasional manual borg backup, you can connect a physical SSD/HDD via a cheap USB SATA adapter/dock to a free USB port on your host physical machine, and then use these commands to pass the disk through to a VM of your choosing (on the host physical machine and on the VM):
    virsh attach-device --live --domain [VM_NAME] --file [USB_DEVICE_DEFINITION.xml]
       virsh console --domain [VM_NAME]
       # (Login to the VM with root privileges)
       mkdir -p /mnt/[MOUNT_NAME]
       mount /dev/disk/by-label/[DISK_NAME] /mnt/[MOUNT_NAME]
  • To create the XML device definition file, see this short guide. An SSD/HDD is recommended, but nothing is stopping you from using something as simple as a flash drive for testing if you really want. Finally, to actually perform a manual backup, make sure your disk is properly mounted and then simply use the AIO interface to perform the backup.
  • If you want to shave off around 8-10 seconds of total boot time when you reboot your host physical machine, a simple trick is to lower the GRUB_TIMEOUT from the default five seconds to one second, on both the host physical machine and each of the VMs. You can also remove the delay, but it's generally safer to leave at least one second. (Always be extremely careful when editing GRUB config, especially on the host physical machine, as an incorrect configuration can prevent your device from booting!)
================================================ FILE: nextcloud-aio-helm-chart/Chart.yaml ================================================ name: nextcloud-aio-helm-chart description: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose version: 12.8.0 apiVersion: v2 keywords: - latest - nextcloud - helm-chart - open-source - cloud sources: - https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart home: https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart ================================================ FILE: nextcloud-aio-helm-chart/readme.md ================================================ # Nextcloud AIO Helm-chart > [!NOTE] > For an enterprise-ready and scalable deployment method based on Helm Charts (also available for Podman and OpenShift), please [contact Nextcloud GmbH](https://nextcloud.com/enterprise/). > [!IMPORTANT] > This Helm-Chart is not intended to be used with Ingress as it handles TLS itself via the built-in apache container and exposes a Loadbalancer port itself on the Cluster. See the [apache service](https://github.com/nextcloud/all-in-one/blob/main/nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-service.yaml). However if the Cluster is used behind NAT, you can adjust `APACHE_PORT` to a different one than 443 and do the TLS offloading on an external Reverse Proxy that forwards the traffic to the configured port via http. If you really need the Ingress feature, please [contact Nextcloud GmbH](https://nextcloud.com/enterprise/) as we offer an enterprise-ready and scalable deployment method based on Helm Charts that also allows Ingress to be used. You can run the containers that are build for AIO with Kubernetes using this Helm chart. This comes with a few downsides, that are discussed below. ### Advantages - You can run it without a container having access to the docker socket - You can run the containers with Kubernetes ### Disadvantages - You lose the AIO interface - You lose update notifications and automatic updates - You lose all AIO backup and restore features - You lose all community containers: https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers - **You need to know what you are doing** - For updating, you need to strictly follow the at the bottom described update routine - You need to monitor yourself if the volumes have enough free space and increase them if they don't by adjusting their size in values.yaml - Probably more ## How to use this? First download this file: https://raw.githubusercontent.com/nextcloud/all-in-one/main/nextcloud-aio-helm-chart/values.yaml and adjust at least all values marked with `# TODO!`
⚠️ **Warning**: Do not use the symbols `@` and `:` in your passwords. These symbols are used to build database connection strings. You will experience issues when using these symbols! Then run: ``` helm repo add nextcloud-aio https://nextcloud.github.io/all-in-one/ helm install nextcloud-aio nextcloud-aio/nextcloud-aio-helm-chart -f values.yaml ``` And after a while, everything should be set up. ## How to update? Since the values of this helm chart may change in the future, it is highly recommended to strictly follow the following procedure whenever you want to upgrade it. 1. Stop all running pods 1. Back up all volumes that got created by the Helm chart and the values.yaml file 1. Run `helm repo update nextcloud-aio` in order to get the updated yaml files from the repository 1. Now download the updated values.yaml file from https://raw.githubusercontent.com/nextcloud/all-in-one/main/nextcloud-aio-helm-chart/values.yaml and compare that with the one that you currently have locally. Look for variables that changed or got added. You can use the diff command to compare them. 1. After the file update was successful, simply run `helm install my-release nextcloud-aio/nextcloud-aio-helm-chart -f values.yaml` to update to the new version. ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-deployment.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-apache name: nextcloud-aio-apache namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-apache strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-apache spec: securityContext: # The items below only work in pod context fsGroup: 33 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 33 runAsGroup: 33 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: ADDITIONAL_TRUSTED_DOMAIN value: "{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}" - name: APACHE_HOST value: nextcloud-aio-apache - name: APACHE_MAX_SIZE value: "{{ .Values.APACHE_MAX_SIZE }}" - name: APACHE_MAX_TIME value: "{{ .Values.NEXTCLOUD_MAX_TIME }}" - name: APACHE_PORT value: "{{ .Values.APACHE_PORT }}" - name: COLLABORA_HOST value: nextcloud-aio-collabora - name: HARP_HOST value: nextcloud-aio-harp - name: NC_DOMAIN value: "{{ .Values.NC_DOMAIN }}" - name: NEXTCLOUD_HOST value: nextcloud-aio-nextcloud - name: NOTIFY_PUSH_HOST value: nextcloud-aio-notify-push - name: ONLYOFFICE_HOST value: nextcloud-aio-onlyoffice - name: TALK_HOST value: nextcloud-aio-talk - name: TZ value: "{{ .Values.TIMEZONE }}" - name: WHITEBOARD_HOST value: nextcloud-aio-whiteboard image: ghcr.io/nextcloud-releases/aio-apache:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-apache ports: - containerPort: {{ .Values.APACHE_PORT }} protocol: TCP - containerPort: {{ .Values.APACHE_PORT }} protocol: UDP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} add: ["NET_BIND_SERVICE"] volumeMounts: - mountPath: /var/www/html name: nextcloud-aio-nextcloud readOnly: true - mountPath: /mnt/data name: nextcloud-aio-apache volumes: - name: nextcloud-aio-nextcloud persistentVolumeClaim: claimName: nextcloud-aio-nextcloud - name: nextcloud-aio-apache persistentVolumeClaim: claimName: nextcloud-aio-apache ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-apache name: nextcloud-aio-apache namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.APACHE_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-service.yaml ================================================ apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-apache name: nextcloud-aio-apache namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack type: LoadBalancer externalTrafficPolicy: Local ports: - name: "{{ .Values.APACHE_PORT }}" port: {{ .Values.APACHE_PORT }} targetPort: {{ .Values.APACHE_PORT }} - name: {{ .Values.APACHE_PORT }}-udp port: {{ .Values.APACHE_PORT }} protocol: UDP targetPort: {{ .Values.APACHE_PORT }} selector: io.kompose.service: nextcloud-aio-apache ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-deployment.yaml ================================================ {{- if eq .Values.CLAMAV_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-clamav name: nextcloud-aio-clamav namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-clamav strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-clamav spec: securityContext: # The items below only work in pod context fsGroup: 100 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 100 runAsGroup: 100 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} initContainers: - name: init-subpath image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319 command: - mkdir - "-p" - /nextcloud-aio-clamav/data volumeMounts: - name: nextcloud-aio-clamav mountPath: /nextcloud-aio-clamav securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} containers: - env: - name: MAX_SIZE value: "{{ .Values.NEXTCLOUD_UPLOAD_LIMIT }}" - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-clamav:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 9 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 9 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-clamav ports: - containerPort: 3310 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} volumeMounts: - mountPath: /var/lib/clamav subPath: data name: nextcloud-aio-clamav volumes: - name: nextcloud-aio-clamav persistentVolumeClaim: claimName: nextcloud-aio-clamav {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-persistentvolumeclaim.yaml ================================================ {{- if eq .Values.CLAMAV_ENABLED "yes" }} apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-clamav name: nextcloud-aio-clamav namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.CLAMAV_STORAGE_SIZE }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-service.yaml ================================================ {{- if eq .Values.CLAMAV_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-clamav name: nextcloud-aio-clamav namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "3310" port: 3310 targetPort: 3310 selector: io.kompose.service: nextcloud-aio-clamav {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml ================================================ {{- if eq .Values.COLLABORA_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-collabora name: nextcloud-aio-collabora namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-collabora template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-collabora spec: containers: - args: {{ .Values.ADDITIONAL_COLLABORA_OPTIONS | default list | toJson }} env: - name: DONT_GEN_SSL_CERT value: "1" - name: TZ value: "{{ .Values.TIMEZONE }}" - name: aliasgroup1 value: https://{{ .Values.NC_DOMAIN }}:443,http://nextcloud-aio-apache:23973 - name: dictionaries value: "{{ .Values.COLLABORA_DICTIONARIES }}" - name: extra_params value: --o:ssl.enable=false --o:ssl.termination=true --o:logging.disable_server_audit=true --o:logging.level=warning --o:logging.level_startup=warning --o:welcome.enable=false --o:remote_font_config.url=https://{{ .Values.NC_DOMAIN }}/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+ - name: server_name value: "{{ .Values.NC_DOMAIN }}" {{- if contains "--o:support_key=" (join " " (.Values.ADDITIONAL_COLLABORA_OPTIONS | default list)) }} image: ghcr.io/nextcloud-releases/aio-collabora-online:20260306_081319 {{- else }} image: ghcr.io/nextcloud-releases/aio-collabora:20260306_081319 {{- end }} readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 9 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 9 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-collabora ports: - containerPort: 9980 protocol: TCP securityContext: capabilities: add: - MKNOD - CAP_SYS_ADMIN - SYS_CHROOT - FOWNER - CHOWN {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-service.yaml ================================================ {{- if eq .Values.COLLABORA_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-collabora name: nextcloud-aio-collabora namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "9980" port: 9980 targetPort: 9980 selector: io.kompose.service: nextcloud-aio-collabora {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-database-deployment.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-database name: nextcloud-aio-database namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-database strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-database spec: securityContext: # The items below only work in pod context fsGroup: 999 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 999 runAsGroup: 999 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} initContainers: - name: init-subpath image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319 command: - mkdir - "-p" - /nextcloud-aio-database/data volumeMounts: - name: nextcloud-aio-database mountPath: /nextcloud-aio-database securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} containers: - env: - name: PGTZ value: "{{ .Values.TIMEZONE }}" - name: POSTGRES_DB value: nextcloud_database - name: POSTGRES_PASSWORD value: "{{ .Values.DATABASE_PASSWORD }}" - name: POSTGRES_USER value: nextcloud - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-postgresql:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-database ports: - containerPort: 5432 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} volumeMounts: - mountPath: /var/lib/postgresql/data subPath: data name: nextcloud-aio-database - mountPath: /mnt/data name: nextcloud-aio-database-dump terminationGracePeriodSeconds: 1800 volumes: - name: nextcloud-aio-database persistentVolumeClaim: claimName: nextcloud-aio-database - name: nextcloud-aio-database-dump persistentVolumeClaim: claimName: nextcloud-aio-database-dump ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-database-dump-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-database-dump name: nextcloud-aio-database-dump namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.DATABASE_DUMP_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-database-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-database name: nextcloud-aio-database namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.DATABASE_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-database-service.yaml ================================================ apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-database name: nextcloud-aio-database namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "5432" port: 5432 targetPort: 5432 selector: io.kompose.service: nextcloud-aio-database ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml ================================================ {{- if eq .Values.FULLTEXTSEARCH_ENABLED "yes" }} apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-elasticsearch name: nextcloud-aio-elasticsearch namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.ELASTICSEARCH_STORAGE_SIZE }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-fulltextsearch-deployment.yaml ================================================ {{- if eq .Values.FULLTEXTSEARCH_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-fulltextsearch name: nextcloud-aio-fulltextsearch namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-fulltextsearch strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-fulltextsearch spec: initContainers: - name: init-volumes image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319 command: - chmod - "777" - /nextcloud-aio-elasticsearch volumeMounts: - name: nextcloud-aio-elasticsearch mountPath: /nextcloud-aio-elasticsearch containers: - env: - name: ES_JAVA_OPTS value: "{{ .Values.FULLTEXTSEARCH_JAVA_OPTIONS | default "-Xms512M -Xmx512M" }}" - name: FULLTEXTSEARCH_PASSWORD value: "{{ .Values.FULLTEXTSEARCH_PASSWORD }}" - name: TZ value: "{{ .Values.TIMEZONE }}" - name: bootstrap.memory_lock value: "false" - name: cluster.name value: nextcloud-aio - name: discovery.type value: single-node - name: http.port value: "9200" - name: logger.level value: WARN - name: xpack.license.self_generated.type value: basic - name: xpack.security.enabled value: "false" image: ghcr.io/nextcloud-releases/aio-fulltextsearch:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 5 initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 5 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 5 initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 5 name: nextcloud-aio-fulltextsearch ports: - containerPort: 9200 protocol: TCP volumeMounts: - mountPath: /usr/share/elasticsearch/data name: nextcloud-aio-elasticsearch volumes: - name: nextcloud-aio-elasticsearch persistentVolumeClaim: claimName: nextcloud-aio-elasticsearch {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-fulltextsearch-service.yaml ================================================ {{- if eq .Values.FULLTEXTSEARCH_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-fulltextsearch name: nextcloud-aio-fulltextsearch namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "9200" port: 9200 targetPort: 9200 selector: io.kompose.service: nextcloud-aio-fulltextsearch {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-imaginary-deployment.yaml ================================================ {{- if eq .Values.IMAGINARY_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-imaginary name: nextcloud-aio-imaginary namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-imaginary template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-imaginary spec: securityContext: # The items below only work in pod context fsGroup: 65534 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 65534 runAsGroup: 65534 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: IMAGINARY_SECRET value: "{{ .Values.IMAGINARY_SECRET }}" - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-imaginary:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-imaginary ports: - containerPort: 9000 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-imaginary-service.yaml ================================================ {{- if eq .Values.IMAGINARY_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-imaginary name: nextcloud-aio-imaginary namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "9000" port: 9000 targetPort: 9000 selector: io.kompose.service: nextcloud-aio-imaginary {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-namespace-namespace.yaml ================================================ {{- if and (ne .Values.NAMESPACE "default") (ne .Values.NAMESPACE_DISABLED "yes") }} apiVersion: v1 kind: Namespace metadata: name: "{{ .Values.NAMESPACE }}" namespace: "{{ .Values.NAMESPACE }}" {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} labels: pod-security.kubernetes.io/enforce: restricted {{- end }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-networkpolicy.yaml ================================================ {{- if eq .Values.NETWORK_POLICY_ENABLED "yes" }} # https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/04-deny-traffic-from-other-namespaces.md kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: namespace: "{{ .Values.NAMESPACE }}" name: nextcloud-aio-deny-from-other-namespaces spec: podSelector: matchLabels: policyTypes: - Ingress - Egress ingress: - from: - podSelector: {} egress: - {} # Allows all egress traffic --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: namespace: "{{ .Values.NAMESPACE }}" name: nextcloud-aio-webserver-allow spec: podSelector: matchExpressions: - key: io.kompose.service operator: In values: - nextcloud-aio-apache policyTypes: - Ingress ingress: - {} # Allows all ingress traffic {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-data-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-nextcloud-data name: nextcloud-aio-nextcloud-data namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS_DATA }} storageClassName: {{ .Values.STORAGE_CLASS_DATA }} {{- else if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.NEXTCLOUD_DATA_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-nextcloud name: nextcloud-aio-nextcloud namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-nextcloud strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-nextcloud spec: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} # AIO-config - do not change this comment! securityContext: # The items below only work in pod context fsGroup: 33 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 33 runAsGroup: 33 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} {{- end }} # AIO-config - do not change this comment! # AIO settings start # Do not remove or change this line! initContainers: - name: init-volumes image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319 command: - chmod - "777" - /nextcloud-aio-nextcloud - /nextcloud-aio-nextcloud-trusted-cacerts volumeMounts: - name: nextcloud-aio-nextcloud-trusted-cacerts mountPath: /nextcloud-aio-nextcloud-trusted-cacerts - name: nextcloud-aio-nextcloud mountPath: /nextcloud-aio-nextcloud # AIO settings end # Do not remove or change this line! containers: - env: - name: SMTP_HOST value: "{{ .Values.SMTP_HOST }}" - name: SMTP_SECURE value: "{{ .Values.SMTP_SECURE }}" - name: SMTP_PORT value: "{{ .Values.SMTP_PORT }}" - name: SMTP_AUTHTYPE value: "{{ .Values.SMTP_AUTHTYPE }}" - name: SMTP_NAME value: "{{ .Values.SMTP_NAME }}" - name: SMTP_PASSWORD value: "{{ .Values.SMTP_PASSWORD }}" - name: MAIL_FROM_ADDRESS value: "{{ .Values.MAIL_FROM_ADDRESS }}" - name: MAIL_DOMAIN value: "{{ .Values.MAIL_DOMAIN }}" - name: SUBSCRIPTION_KEY value: "{{ .Values.SUBSCRIPTION_KEY }}" - name: APPS_ALLOWLIST value: "{{ .Values.APPS_ALLOWLIST }}" - name: ADDITIONAL_TRUSTED_PROXY value: "{{ .Values.ADDITIONAL_TRUSTED_PROXY }}" - name: ADDITIONAL_TRUSTED_DOMAIN value: "{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}" - name: SERVERINFO_TOKEN value: "{{ .Values.SERVERINFO_TOKEN }}" - name: NEXTCLOUD_DEFAULT_QUOTA value: "{{ .Values.NEXTCLOUD_DEFAULT_QUOTA }}" - name: NEXTCLOUD_SKELETON_DIRECTORY value: "{{ .Values.NEXTCLOUD_SKELETON_DIRECTORY }}" - name: NEXTCLOUD_MAINTENANCE_WINDOW value: "{{ .Values.NEXTCLOUD_MAINTENANCE_WINDOW }}" - name: ADDITIONAL_APKS value: "{{ .Values.NEXTCLOUD_ADDITIONAL_APKS }}" - name: ADDITIONAL_PHP_EXTENSIONS value: "{{ .Values.NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS }}" - name: ADMIN_PASSWORD value: "{{ .Values.NEXTCLOUD_PASSWORD }}" - name: ADMIN_USER value: admin - name: APACHE_HOST value: nextcloud-aio-apache - name: APACHE_PORT value: "{{ .Values.APACHE_PORT }}" - name: CLAMAV_ENABLED value: "{{ .Values.CLAMAV_ENABLED }}" - name: CLAMAV_HOST value: nextcloud-aio-clamav - name: COLLABORA_ENABLED value: "{{ .Values.COLLABORA_ENABLED }}" - name: COLLABORA_HOST value: nextcloud-aio-collabora - name: FULLTEXTSEARCH_ENABLED value: "{{ .Values.FULLTEXTSEARCH_ENABLED }}" - name: FULLTEXTSEARCH_HOST value: nextcloud-aio-fulltextsearch - name: FULLTEXTSEARCH_INDEX value: nextcloud-aio - name: FULLTEXTSEARCH_PASSWORD value: "{{ .Values.FULLTEXTSEARCH_PASSWORD }}" - name: FULLTEXTSEARCH_PORT value: "9200" - name: FULLTEXTSEARCH_PROTOCOL value: http - name: FULLTEXTSEARCH_USER value: elastic - name: IMAGINARY_ENABLED value: "{{ .Values.IMAGINARY_ENABLED }}" - name: IMAGINARY_HOST value: nextcloud-aio-imaginary - name: IMAGINARY_SECRET value: "{{ .Values.IMAGINARY_SECRET }}" - name: INSTALL_LATEST_MAJOR value: "{{ .Values.INSTALL_LATEST_MAJOR }}" - name: NC_DOMAIN value: "{{ .Values.NC_DOMAIN }}" - name: NEXTCLOUD_DATA_DIR value: /mnt/ncdata - name: NEXTCLOUD_HOST value: nextcloud-aio-nextcloud - name: ONLYOFFICE_ENABLED value: "{{ .Values.ONLYOFFICE_ENABLED }}" - name: ONLYOFFICE_HOST value: nextcloud-aio-onlyoffice - name: ONLYOFFICE_SECRET value: "{{ .Values.ONLYOFFICE_SECRET }}" - name: OVERWRITEPROTOCOL value: https - name: PHP_MAX_TIME value: "{{ .Values.NEXTCLOUD_MAX_TIME }}" - name: PHP_MEMORY_LIMIT value: "{{ .Values.NEXTCLOUD_MEMORY_LIMIT }}" - name: PHP_UPLOAD_LIMIT value: "{{ .Values.NEXTCLOUD_UPLOAD_LIMIT }}" - name: POSTGRES_DB value: nextcloud_database - name: POSTGRES_HOST value: nextcloud-aio-database - name: POSTGRES_PASSWORD value: "{{ .Values.DATABASE_PASSWORD }}" - name: POSTGRES_PORT value: "5432" - name: POSTGRES_USER value: nextcloud - name: RECORDING_SECRET value: "{{ .Values.RECORDING_SECRET }}" - name: REDIS_HOST value: nextcloud-aio-redis - name: REDIS_HOST_PASSWORD value: "{{ .Values.REDIS_PASSWORD }}" - name: REDIS_PORT value: "6379" - name: REMOVE_DISABLED_APPS value: "{{ .Values.REMOVE_DISABLED_APPS }}" - name: SIGNALING_SECRET value: "{{ .Values.SIGNALING_SECRET }}" - name: STARTUP_APPS value: "{{ .Values.NEXTCLOUD_STARTUP_APPS }}" - name: TALK_ENABLED value: "{{ .Values.TALK_ENABLED }}" - name: TALK_PORT value: "{{ .Values.TALK_PORT }}" - name: TALK_RECORDING_ENABLED value: "{{ .Values.TALK_RECORDING_ENABLED }}" - name: TALK_RECORDING_HOST value: nextcloud-aio-talk-recording - name: TRUSTED_CACERTS_DIR value: "{{ .Values.NEXTCLOUD_TRUSTED_CACERTS_DIR }}" - name: TURN_SECRET value: "{{ .Values.TURN_SECRET }}" - name: TZ value: "{{ .Values.TIMEZONE }}" - name: UPDATE_NEXTCLOUD_APPS value: "{{ .Values.UPDATE_NEXTCLOUD_APPS }}" - name: WHITEBOARD_ENABLED value: "{{ .Values.WHITEBOARD_ENABLED }}" - name: WHITEBOARD_SECRET value: "{{ .Values.WHITEBOARD_SECRET }}" image: ghcr.io/nextcloud-releases/aio-nextcloud:20260306_081319 {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} # AIO-config - do not change this comment! securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} {{- end }} # AIO-config - do not change this comment! readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-nextcloud ports: - containerPort: 9000 protocol: TCP - containerPort: 9001 protocol: TCP volumeMounts: - mountPath: /var/www/html name: nextcloud-aio-nextcloud - mountPath: /mnt/ncdata name: nextcloud-aio-nextcloud-data - mountPath: /usr/local/share/ca-certificates name: nextcloud-aio-nextcloud-trusted-cacerts readOnly: true terminationGracePeriodSeconds: 600 volumes: - name: nextcloud-aio-nextcloud persistentVolumeClaim: claimName: nextcloud-aio-nextcloud - name: nextcloud-aio-nextcloud-data persistentVolumeClaim: claimName: nextcloud-aio-nextcloud-data - name: nextcloud-aio-nextcloud-trusted-cacerts persistentVolumeClaim: claimName: nextcloud-aio-nextcloud-trusted-cacerts ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-nextcloud name: nextcloud-aio-nextcloud namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteMany resources: requests: storage: {{ .Values.NEXTCLOUD_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-service.yaml ================================================ apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-nextcloud name: nextcloud-aio-nextcloud namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "9000" port: 9000 targetPort: 9000 - name: "9001" port: 9001 targetPort: 9001 selector: io.kompose.service: nextcloud-aio-nextcloud ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-nextcloud-trusted-cacerts name: nextcloud-aio-nextcloud-trusted-cacerts namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.NEXTCLOUD_TRUSTED_CACERTS_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-notify-push-deployment.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-notify-push name: nextcloud-aio-notify-push namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-notify-push strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-notify-push spec: securityContext: # The items below only work in pod context fsGroup: 33 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 33 runAsGroup: 33 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: NEXTCLOUD_HOST value: nextcloud-aio-nextcloud - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-notify-push:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-notify-push ports: - containerPort: 7867 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} volumeMounts: - mountPath: /var/www/html name: nextcloud-aio-nextcloud readOnly: true volumes: - name: nextcloud-aio-nextcloud persistentVolumeClaim: claimName: nextcloud-aio-nextcloud ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-notify-push-service.yaml ================================================ apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-notify-push name: nextcloud-aio-notify-push namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "7867" port: 7867 targetPort: 7867 selector: io.kompose.service: nextcloud-aio-notify-push ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-onlyoffice-deployment.yaml ================================================ {{- if eq .Values.ONLYOFFICE_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-onlyoffice name: nextcloud-aio-onlyoffice namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-onlyoffice strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-onlyoffice spec: initContainers: - name: init-volumes image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319 command: - chmod - "777" - /nextcloud-aio-onlyoffice volumeMounts: - name: nextcloud-aio-onlyoffice mountPath: /nextcloud-aio-onlyoffice containers: - env: - name: JWT_ENABLED value: "true" - name: JWT_HEADER value: AuthorizationJwt - name: JWT_SECRET value: "{{ .Values.ONLYOFFICE_SECRET }}" - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-onlyoffice:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 9 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 9 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-onlyoffice ports: - containerPort: 80 protocol: TCP volumeMounts: - mountPath: /var/lib/onlyoffice name: nextcloud-aio-onlyoffice volumes: - name: nextcloud-aio-onlyoffice persistentVolumeClaim: claimName: nextcloud-aio-onlyoffice {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml ================================================ {{- if eq .Values.ONLYOFFICE_ENABLED "yes" }} apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-onlyoffice name: nextcloud-aio-onlyoffice namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.ONLYOFFICE_STORAGE_SIZE }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-onlyoffice-service.yaml ================================================ {{- if eq .Values.ONLYOFFICE_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-onlyoffice name: nextcloud-aio-onlyoffice namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "80" port: 80 targetPort: 80 selector: io.kompose.service: nextcloud-aio-onlyoffice {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-deployment.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-redis name: nextcloud-aio-redis namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-redis strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-redis spec: securityContext: # The items below only work in pod context fsGroup: 999 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 999 runAsGroup: 999 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: REDIS_HOST_PASSWORD value: "{{ .Values.REDIS_PASSWORD }}" - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-redis:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-redis ports: - containerPort: 6379 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} volumeMounts: - mountPath: /data name: nextcloud-aio-redis volumes: - name: nextcloud-aio-redis persistentVolumeClaim: claimName: nextcloud-aio-redis ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-persistentvolumeclaim.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-redis name: nextcloud-aio-redis namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.REDIS_STORAGE_SIZE }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-service.yaml ================================================ apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-redis name: nextcloud-aio-redis namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "6379" port: 6379 targetPort: 6379 selector: io.kompose.service: nextcloud-aio-redis ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-deployment.yaml ================================================ {{- if eq .Values.TALK_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk name: nextcloud-aio-talk namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-talk template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk spec: securityContext: # The items below only work in pod context fsGroup: 1000 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 1000 runAsGroup: 1000 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: TALK_MAX_STREAM_BITRATE value: "{{ .Values.TALK_MAX_STREAM_BITRATE }}" - name: TALK_MAX_SCREEN_BITRATE value: "{{ .Values.TALK_MAX_SCREEN_BITRATE }}" - name: INTERNAL_SECRET value: "{{ .Values.TALK_INTERNAL_SECRET }}" - name: NC_DOMAIN value: "{{ .Values.NC_DOMAIN }}" - name: SIGNALING_SECRET value: "{{ .Values.SIGNALING_SECRET }}" - name: TALK_HOST value: nextcloud-aio-talk - name: TALK_PORT value: "{{ .Values.TALK_PORT }}" - name: TURN_SECRET value: "{{ .Values.TURN_SECRET }}" - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-talk:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-talk ports: - containerPort: {{ .Values.TALK_PORT }} protocol: TCP - containerPort: {{ .Values.TALK_PORT }} protocol: UDP - containerPort: 8081 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-deployment.yaml ================================================ {{- if eq .Values.TALK_RECORDING_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk-recording name: nextcloud-aio-talk-recording namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-talk-recording strategy: type: Recreate template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk-recording spec: securityContext: # The items below only work in pod context fsGroup: 122 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 122 runAsGroup: 122 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: INTERNAL_SECRET value: "{{ .Values.TALK_INTERNAL_SECRET }}" - name: NC_DOMAIN value: "{{ .Values.NC_DOMAIN }}" - name: RECORDING_SECRET value: "{{ .Values.RECORDING_SECRET }}" - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-talk-recording:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-talk-recording ports: - containerPort: 1234 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} volumeMounts: - mountPath: /tmp name: nextcloud-aio-talk-recording volumes: - name: nextcloud-aio-talk-recording persistentVolumeClaim: claimName: nextcloud-aio-talk-recording {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-persistentvolumeclaim.yaml ================================================ {{- if eq .Values.TALK_RECORDING_ENABLED "yes" }} apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: io.kompose.service: nextcloud-aio-talk-recording name: nextcloud-aio-talk-recording namespace: "{{ .Values.NAMESPACE }}" spec: {{- if .Values.STORAGE_CLASS }} storageClassName: {{ .Values.STORAGE_CLASS }} {{- end }} accessModes: - ReadWriteOnce resources: requests: storage: {{ .Values.TALK_RECORDING_STORAGE_SIZE }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-service.yaml ================================================ {{- if eq .Values.TALK_RECORDING_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk-recording name: nextcloud-aio-talk-recording namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "1234" port: 1234 targetPort: 1234 selector: io.kompose.service: nextcloud-aio-talk-recording {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-service.yaml ================================================ {{- if eq .Values.TALK_ENABLED "yes" }} --- apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk name: nextcloud-aio-talk-public namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack type: LoadBalancer ports: - name: "{{ .Values.TALK_PORT }}" port: {{ .Values.TALK_PORT }} targetPort: {{ .Values.TALK_PORT }} - name: {{ .Values.TALK_PORT }}-udp port: {{ .Values.TALK_PORT }} protocol: UDP targetPort: {{ .Values.TALK_PORT }} selector: io.kompose.service: nextcloud-aio-talk --- apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-talk name: nextcloud-aio-talk namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "8081" port: 8081 targetPort: 8081 selector: io.kompose.service: nextcloud-aio-talk {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-whiteboard-deployment.yaml ================================================ {{- if eq .Values.WHITEBOARD_ENABLED "yes" }} apiVersion: apps/v1 kind: Deployment metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-whiteboard name: nextcloud-aio-whiteboard namespace: "{{ .Values.NAMESPACE }}" spec: replicas: 1 selector: matchLabels: io.kompose.service: nextcloud-aio-whiteboard template: metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-whiteboard spec: securityContext: # The items below only work in pod context fsGroup: 65534 fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: 65534 runAsGroup: 65534 runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} containers: - env: - name: BACKUP_DIR value: /tmp - name: JWT_SECRET_KEY value: "{{ .Values.WHITEBOARD_SECRET }}" - name: NEXTCLOUD_URL value: https://{{ .Values.NC_DOMAIN }} - name: REDIS_HOST value: nextcloud-aio-redis - name: REDIS_HOST_PASSWORD value: "{{ .Values.REDIS_PASSWORD }}" - name: REDIS_PORT value: "6379" - name: STORAGE_STRATEGY value: redis - name: TZ value: "{{ .Values.TIMEZONE }}" image: ghcr.io/nextcloud-releases/aio-whiteboard:20260306_081319 readinessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 livenessProbe: exec: command: - /healthcheck.sh failureThreshold: 3 periodSeconds: 30 timeoutSeconds: 30 name: nextcloud-aio-whiteboard ports: - containerPort: 3002 protocol: TCP securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/templates/nextcloud-aio-whiteboard-service.yaml ================================================ {{- if eq .Values.WHITEBOARD_ENABLED "yes" }} apiVersion: v1 kind: Service metadata: annotations: kompose.version: 1.38.0 (a8f5d1cbd) labels: io.kompose.service: nextcloud-aio-whiteboard name: nextcloud-aio-whiteboard namespace: "{{ .Values.NAMESPACE }}" spec: ipFamilyPolicy: PreferDualStack ports: - name: "3002" port: 3002 targetPort: 3002 selector: io.kompose.service: nextcloud-aio-whiteboard {{- end }} ================================================ FILE: nextcloud-aio-helm-chart/update-helm.sh ================================================ #!/bin/bash [ -z "$1" ] && { echo "Error: Docker tag is not specified. Usage: ./nextcloud-aio-helm-chart/update-helm.sh "; exit 2; } DOCKER_TAG="$1" # The logic needs the files in ./helm-chart cp -r ./nextcloud-aio-helm-chart ./helm-chart # Clean rm -f ./helm-chart/values.yaml rm -rf ./helm-chart/templates # Install kompose curl -L https://github.com/kubernetes/kompose/releases/latest/download/kompose-linux-amd64 -o kompose chmod +x kompose sudo mv ./kompose /usr/local/bin/kompose # Install yq sudo snap install yq set -ex # Conversion of docker-compose cd manual-install cp latest.yml latest.yml.backup # Additional config # shellcheck disable=SC1083 sed -i -E '/^( *- )(NET_RAW|SYS_NICE|MKNOD|SYS_ADMIN|CHOWN|SYS_CHROOT|FOWNER|MAC_OVERRIDE|BLOCK_SUSPEND|AUDIT_READ)$/!s/( *- )([A-Z_]+)$/\1\2=${\2}/' latest.yml cp sample.conf /tmp/ sed -i 's|^|export |' /tmp/sample.conf # shellcheck disable=SC1091 source /tmp/sample.conf rm /tmp/sample.conf sed -i '/OVERWRITEHOST/d' latest.yml sed -i "s|:latest$|:$DOCKER_TAG|" latest.yml sed -i "s|\${APACHE_IP_BINDING}:||" latest.yml sed -i '/APACHE_IP_BINDING/d' latest.yml sed -i "s|\${APACHE_PORT}:\${APACHE_PORT}/|$APACHE_PORT:$APACHE_PORT/|" latest.yml sed -i "s|\${TALK_PORT}:\${TALK_PORT}/|$TALK_PORT:$TALK_PORT/|g" latest.yml sed -i "s|- \${APACHE_PORT}|- $APACHE_PORT|" latest.yml sed -i "s|- \${TALK_PORT}|- $TALK_PORT|" latest.yml sed -i "s|\${NEXTCLOUD_DATADIR}|$NEXTCLOUD_DATADIR|" latest.yml sed -i "s|\${ADDITIONAL_COLLABORA_OPTIONS}|ADDITIONAL_COLLABORA_OPTIONS_PLACEHOLDER|" latest.yml sed -i "/name: nextcloud-aio/,$ d" latest.yml sed -i "/NEXTCLOUD_DATADIR/d" latest.yml sed -i "/\${NEXTCLOUD_MOUNT}/d" latest.yml sed -i "/^volumes:/a\ \ nextcloud_aio_nextcloud_trusted_cacerts:\n \ \ \ \ name: nextcloud_aio_nextcloud_trusted_cacerts" latest.yml sed -i "s|\${NEXTCLOUD_TRUSTED_CACERTS_DIR}:|nextcloud_aio_nextcloud_trusted_cacerts:|g#" latest.yml sed -i 's/\${/{{ .Values./g; s/}/ }}/g' latest.yml yq -i 'del(.services.[].profiles)' latest.yml # Delete read_only and tmpfs setting while https://github.com/kubernetes/kubernetes/issues/48912 is not fixed yq -i 'del(.services.[].read_only)' latest.yml yq -i 'del(.services.[].tmpfs)' latest.yml # Remove cap_drop in order to add it later again easier yq -i 'del(.services.[].cap_drop)' latest.yml # Remove SYS_NICE for imaginary as it is not supported with RPSS yq -i 'del(.services."nextcloud-aio-imaginary".cap_add)' latest.yml # cap SYS_ADMIN is called CAP_SYS_ADMIN in k8s sed -i "s|- SYS_ADMIN$|- CAP_SYS_ADMIN|" latest.yml cat latest.yml kompose convert -c -f latest.yml --namespace nextcloud-aio-namespace cd latest if [ -f ./templates/manual-install-nextcloud-aio-networkpolicy.yaml ]; then mv ./templates/manual-install-nextcloud-aio-networkpolicy.yaml ./templates/nextcloud-aio-networkpolicy.yaml fi # shellcheck disable=SC1083 find ./ -name '*networkpolicy.yaml' -exec sed -i "s|manual-install-nextcloud-aio|nextcloud-aio|" \{} \; cat << EOL > /tmp/initcontainers initContainers: - name: init-volumes image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG command: - chmod - "777" volumeMountsInitContainer: EOL cat << EOL > /tmp/initcontainers.database initContainers: - name: init-subpath image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG command: - mkdir - "-p" - /nextcloud-aio-database/data volumeMounts: - name: nextcloud-aio-database mountPath: /nextcloud-aio-database securityContext: EOL cat << EOL > /tmp/initcontainers.clamav initContainers: - name: init-subpath image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG command: - mkdir - "-p" - /nextcloud-aio-clamav/data volumeMounts: - name: nextcloud-aio-clamav mountPath: /nextcloud-aio-clamav securityContext: EOL cat << EOL > /tmp/initcontainers.nextcloud # AIO settings start # Do not remove or change this line! initContainers: - name: init-volumes image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG command: - chmod - "777" volumeMountsInitContainer: # AIO settings end # Do not remove or change this line! EOL # shellcheck disable=SC1083 DEPLOYMENTS="$(find ./ -name '*deployment.yaml')" mapfile -t DEPLOYMENTS <<< "$DEPLOYMENTS" for variable in "${DEPLOYMENTS[@]}"; do if grep -q livenessProbe "$variable"; then sed -n "/.*livenessProbe/,/timeoutSeconds.*/p" "$variable" > /tmp/liveness.probe cat /tmp/liveness.probe sed -i "s|livenessProbe|readinessProbe|" /tmp/liveness.probe sed -i "/^ image:/r /tmp/liveness.probe" "$variable" fi if grep -q volumeMounts "$variable"; then if echo "$variable" | grep -q database; then sed -i "/^ spec:/r /tmp/initcontainers.database" "$variable" elif echo "$variable" | grep -q clamav; then sed -i "/^ spec:/r /tmp/initcontainers.clamav" "$variable" elif echo "$variable" | grep -q "nextcloud-deployment.yaml"; then sed -i "/^ spec:/r /tmp/initcontainers.nextcloud" "$variable" elif echo "$variable" | grep -q "fulltextsearch" || echo "$variable" | grep -q "onlyoffice" || echo "$variable" | grep -q "collabora"; then sed -i "/^ spec:/r /tmp/initcontainers" "$variable" fi volumeNames="$(grep -A1 mountPath "$variable" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')" mapfile -t volumeNames <<< "$volumeNames" for volumeName in "${volumeNames[@]}"; do # The Nextcloud container runs as root user and sets the correct permissions automatically for the data-dir if the www-data user cannot write to it if [ "$volumeName" != "nextcloud-aio-nextcloud-data" ]; then sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable" sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable" # Workaround for the database volume if [ "$volumeName" = nextcloud-aio-database ]; then sed -i "/mountPath: \/var\/lib\/postgresql\/data/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable" elif [ "$volumeName" = nextcloud-aio-clamav ]; then sed -i "/mountPath: \/var\/lib\/clamav/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable" fi fi done sed -i "s|volumeMountsInitContainer:|volumeMounts:|" "$variable" if grep -q claimName "$variable"; then claimNames="$(grep claimName "$variable")" mapfile -t claimNames <<< "$claimNames" for claimName in "${claimNames[@]}"; do if grep -A1 "^$claimName$" "$variable" | grep -q "readOnly: true"; then sed -i "/^$claimName$/{n;d}" "$variable" fi done fi fi if grep -q runAsUser "$variable" || echo "$variable" | grep -q "nextcloud-deployment.yaml"; then if echo "$variable" | grep -q "nextcloud-deployment.yaml"; then USER=33 GROUP=33 echo ' {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} # AIO-config - do not change this comment!' > /tmp/pod.securityContext else USER="$(grep runAsUser "$variable" | grep -oP '[0-9]+')" GROUP="$USER" rm -f /tmp/pod.securityContext fi sed -i "/runAsUser:/d" "$variable" sed -i "/capabilities:/d" "$variable" if [ -n "$USER" ]; then cat << EOL >> /tmp/pod.securityContext securityContext: # The items below only work in pod context fsGroup: $USER fsGroupChangePolicy: "OnRootMismatch" # The items below work in both contexts runAsUser: $USER runAsGroup: $GROUP runAsNonRoot: true {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} seccompProfile: type: RuntimeDefault {{- end }} EOL if echo "$variable" | grep -q "nextcloud-deployment.yaml"; then echo " {{- end }} # AIO-config - do not change this comment!" >> /tmp/pod.securityContext fi sed -i "/^ spec:$/r /tmp/pod.securityContext" "$variable" fi fi done # shellcheck disable=SC1083 find ./ -name '*.yaml' -exec sed -i 's|nextcloud-aio-namespace|"\{\{ .Values.NAMESPACE \}\}"|' \{} \; # shellcheck disable=SC1083 find ./ -name '*service.yaml' -exec sed -i "/^status:/,$ d" \{} \; # shellcheck disable=SC1083 find ./ -name '*deployment.yaml' -exec sed -i "s|manual-install-nextcloud-aio|nextcloud-aio|" \{} \; # shellcheck disable=SC1083 find ./ -name '*deployment.yaml' -exec sed -i "/medium: Memory/d" \{} \; # shellcheck disable=SC1083 find ./ -name '*.yaml' -exec sed -i "/kompose.cmd/d" \{} \; # shellcheck disable=SC1083 find ./ -name '*deployment.yaml' -exec sed -i "s|emptyDir:|emptyDir: \{\}|" \{} \; # shellcheck disable=SC1083 find ./ -name '*deployment.yaml' -exec sed -i "/hostPort:/d" \{} \; # shellcheck disable=SC1083 find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "s|ReadOnlyMany|ReadWriteOnce|" \{} \; # shellcheck disable=SC1083 find ./ -name 'nextcloud-aio-nextcloud-persistentvolumeclaim.yaml' -exec sed -i "s|ReadWriteOnce|ReadWriteMany|" \{} \; # shellcheck disable=SC1083 find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "/accessModes:/i\ \ {{- if .Values.STORAGE_CLASS }}" \{} \; # shellcheck disable=SC1083 find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "/accessModes:/i\ \ storageClassName: {{ .Values.STORAGE_CLASS }}" \{} \; # shellcheck disable=SC1083 find ./ -name '*persistentvolumeclaim.yaml' -exec sed -i "/accessModes:/i\ \ {{- end }}" \{} \; # shellcheck disable=SC1083 find ./ -name 'nextcloud-aio-nextcloud-data-persistentvolumeclaim.yaml' -exec sed -i "/{{- if .Values.STORAGE_CLASS }}/i\ {{- if .Values.STORAGE_CLASS_DATA }}\n storageClassName: {{ .Values.STORAGE_CLASS_DATA }}" \{} \; # shellcheck disable=SC1083 find ./ -name 'nextcloud-aio-nextcloud-data-persistentvolumeclaim.yaml' -exec sed -i "s/{{- if .Values.STORAGE_CLASS }}/{{- else if .Values.STORAGE_CLASS }}/" \{} \; # shellcheck disable=SC1083 find ./ -name '*deployment.yaml' -exec sed -i "/restartPolicy:/d" \{} \; # shellcheck disable=SC1083 find ./ -name '*apache*' -exec sed -i "s|$APACHE_PORT|{{ .Values.APACHE_PORT }}|" \{} \; # shellcheck disable=SC1083 find ./ -name '*talk*' -exec sed -i "s|$TALK_PORT|{{ .Values.TALK_PORT }}|" \{} \; # shellcheck disable=SC1083 find ./ -name '*apache-service.yaml' -exec sed -i "/^spec:/a\ \ type: LoadBalancer" \{} \; # shellcheck disable=SC1083 find ./ -name '*talk-service.yaml' -exec sed -i "/^spec:/a\ \ type: LoadBalancer" \{} \; echo '---' > /tmp/talk-service.copy # shellcheck disable=SC1083 find ./ -name '*talk-service.yaml' -exec cat \{} \; >> /tmp/talk-service.copy sed -i 's|name: nextcloud-aio-talk|name: nextcloud-aio-talk-public|' /tmp/talk-service.copy # shellcheck disable=SC1083 INTERNAL_TALK_PORTS="$(find ./ -name '*talk-deployment.yaml' -exec grep -oP 'containerPort: [0-9]+' \{} \;)" mapfile -t INTERNAL_TALK_PORTS <<< "$INTERNAL_TALK_PORTS" for port in "${INTERNAL_TALK_PORTS[@]}"; do port="$(echo "$port" | grep -oP '[0-9]+')" sed -i "/$port/d" /tmp/talk-service.copy done echo '---' >> /tmp/talk-service.copy # shellcheck disable=SC1083 find ./ -name '*talk-service.yaml' -exec grep -v '{{ .Values.TALK.*}}\|protocol: UDP\|type: LoadBalancer' \{} \; >> /tmp/talk-service.copy # shellcheck disable=SC1083 find ./ -name '*talk-service.yaml' -exec mv /tmp/talk-service.copy \{} \; # shellcheck disable=SC1083 find ./ -name '*apache-service.yaml' -exec sed -i "/type: LoadBalancer/a\ \ externalTrafficPolicy: Local" \{} \; # shellcheck disable=SC1083 find ./ -name '*service.yaml' -exec sed -i "/^spec:/a\ \ ipFamilyPolicy: PreferDualStack" \{} \; # shellcheck disable=SC1083 find ./ -name '*.yaml' -exec sed -i "s|'{{|\"{{|g;s|}}'|}}\"|g" \{} \; # shellcheck disable=SC1083 find ./ \( -not -name '*service.yaml' -name '*.yaml' \) -exec sed -i "/^status:/d" \{} \; # shellcheck disable=SC1083 find ./ \( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \) -exec sed -i "/resources:/d" \{} \; # shellcheck disable=SC1083 find ./ -name "*namespace.yaml" -exec sed -i "1i\\{{- if and \(ne .Values.NAMESPACE \"default\"\) \(ne .Values.NAMESPACE_DISABLED \"yes\"\) }}" \{} \; # Additional config cat << EOL > /tmp/additional-namespace.config {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} labels: pod-security.kubernetes.io/enforce: restricted {{- end }} EOL # shellcheck disable=SC1083 find ./ -name "*namespace.yaml" -exec sed -i "/namespace.*/r /tmp/additional-namespace.config" \{} \; # shellcheck disable=SC1083 find ./ -name "*namespace.yaml" -exec sed -i "$ a {{- end }}" \{} \; # shellcheck disable=SC1083 find ./ -name '*.yaml' -exec sed -i "/creationTimestamp: null/d" \{} \; VOLUMES="$(find ./ -name '*persistentvolumeclaim.yaml' | sed 's|-persistentvolumeclaim.yaml||g;s|.*nextcloud-aio-||g' | sort)" mapfile -t VOLUMES <<< "$VOLUMES" for variable in "${VOLUMES[@]}"; do name="$(echo "$variable" | sed 's|-|_|g' | tr '[:lower:]' '[:upper:]')_STORAGE_SIZE" VOLUME_VARIABLE+=("$name") # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$variable-persistentvolumeclaim.yaml" -exec sed -i "s|storage: 100Mi|storage: {{ .Values.$name }}|" \{} \; done # Additional config cat << EOL > /tmp/additional.config - name: SMTP_HOST value: "{{ .Values.SMTP_HOST }}" - name: SMTP_SECURE value: "{{ .Values.SMTP_SECURE }}" - name: SMTP_PORT value: "{{ .Values.SMTP_PORT }}" - name: SMTP_AUTHTYPE value: "{{ .Values.SMTP_AUTHTYPE }}" - name: SMTP_NAME value: "{{ .Values.SMTP_NAME }}" - name: SMTP_PASSWORD value: "{{ .Values.SMTP_PASSWORD }}" - name: MAIL_FROM_ADDRESS value: "{{ .Values.MAIL_FROM_ADDRESS }}" - name: MAIL_DOMAIN value: "{{ .Values.MAIL_DOMAIN }}" - name: SUBSCRIPTION_KEY value: "{{ .Values.SUBSCRIPTION_KEY }}" - name: APPS_ALLOWLIST value: "{{ .Values.APPS_ALLOWLIST }}" - name: ADDITIONAL_TRUSTED_PROXY value: "{{ .Values.ADDITIONAL_TRUSTED_PROXY }}" - name: ADDITIONAL_TRUSTED_DOMAIN value: "{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}" - name: SERVERINFO_TOKEN value: "{{ .Values.SERVERINFO_TOKEN }}" - name: NEXTCLOUD_DEFAULT_QUOTA value: "{{ .Values.NEXTCLOUD_DEFAULT_QUOTA }}" - name: NEXTCLOUD_SKELETON_DIRECTORY value: "{{ .Values.NEXTCLOUD_SKELETON_DIRECTORY }}" - name: NEXTCLOUD_MAINTENANCE_WINDOW value: "{{ .Values.NEXTCLOUD_MAINTENANCE_WINDOW }}" EOL # shellcheck disable=SC1083 find ./ -name '*nextcloud-deployment.yaml' -exec sed -i "/^.*\- env:/r /tmp/additional.config" \{} \; # shellcheck disable=SC1083 find ./ -name '*fulltextsearch-deployment.yaml' -exec sed -i 's/{{ .Values.FULLTEXTSEARCH_JAVA_OPTIONS }}/{{ .Values.FULLTEXTSEARCH_JAVA_OPTIONS | default "-Xms512M -Xmx512M" }}/' \{} \; # Additional config cat << EOL > /tmp/additional-apache.config - name: ADDITIONAL_TRUSTED_DOMAIN value: "{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}" EOL # shellcheck disable=SC1083 find ./ -name '*apache-deployment.yaml' -exec sed -i "/^.*\- env:/r /tmp/additional-apache.config" \{} \; # Additional config cat << EOL > /tmp/additional-talk.config - name: TALK_MAX_STREAM_BITRATE value: "{{ .Values.TALK_MAX_STREAM_BITRATE }}" - name: TALK_MAX_SCREEN_BITRATE value: "{{ .Values.TALK_MAX_SCREEN_BITRATE }}" EOL # shellcheck disable=SC1083 find ./ -name '*talk-deployment.yaml' -exec sed -i "/^.*\- env:/r /tmp/additional-talk.config" \{} \; # Additional collabora config # shellcheck disable=SC1083 find ./ -name '*collabora-deployment.yaml' -exec sed -i "s/image: ghcr.io.*/IMAGE_PLACEHOLDER/" \{} \; cat << EOL > /tmp/additional-collabora.config {{- if contains "--o:support_key=" (join " " (.Values.ADDITIONAL_COLLABORA_OPTIONS | default list)) }} image: ghcr.io/nextcloud-releases/aio-collabora-online:$DOCKER_TAG {{- else }} image: ghcr.io/nextcloud-releases/aio-collabora:$DOCKER_TAG {{- end }} EOL # shellcheck disable=SC1083 find ./ -name '*collabora-deployment.yaml' -exec sed -i "/IMAGE_PLACEHOLDER/r /tmp/additional-collabora.config" \{} \; # shellcheck disable=SC1083 find ./ -name '*collabora-deployment.yaml' -exec sed -i "/IMAGE_PLACEHOLDER/d" \{} \; cat << EOL > templates/nextcloud-aio-networkpolicy.yaml {{- if eq .Values.NETWORK_POLICY_ENABLED "yes" }} # https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/04-deny-traffic-from-other-namespaces.md kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: namespace: "{{ .Values.NAMESPACE }}" name: nextcloud-aio-deny-from-other-namespaces spec: podSelector: matchLabels: policyTypes: - Ingress - Egress ingress: - from: - podSelector: {} egress: - {} # Allows all egress traffic --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: namespace: "{{ .Values.NAMESPACE }}" name: nextcloud-aio-webserver-allow spec: podSelector: matchExpressions: - key: io.kompose.service operator: In values: - nextcloud-aio-apache policyTypes: - Ingress ingress: - {} # Allows all ingress traffic {{- end }} EOL cd ../ mkdir -p ../helm-chart/ rm latest/Chart.yaml rm latest/README.md mv latest/* ../helm-chart/ rm -r latest rm latest.yml mv latest.yml.backup latest.yml # Get version of AIO AIO_VERSION="$(grep -oP '[0-9]+.[0-9]+.[0-9]+' ../php/templates/includes/aio-version.twig)" sed -i "s|^version:.*|version: $AIO_VERSION|" ../helm-chart/Chart.yaml # Conversion of sample.conf cp sample.conf /tmp/ sed -i 's|"||g' /tmp/sample.conf sed -i 's|=|: |' /tmp/sample.conf sed -i 's|= |: |' /tmp/sample.conf sed -i '/^NEXTCLOUD_DATADIR/d' /tmp/sample.conf sed -i '/^APACHE_IP_BINDING/d' /tmp/sample.conf sed -i '/^NEXTCLOUD_MOUNT/d' /tmp/sample.conf sed -i 's/ yes / "yes" /' /tmp/sample.conf sed -i 's/ no / "no" /' /tmp/sample.conf sed -i 's/"no" authentication/no authentication/' /tmp/sample.conf sed -i 's|^NEXTCLOUD_TRUSTED_CACERTS_DIR: .*|NEXTCLOUD_TRUSTED_CACERTS_DIR: # Setting this to any value allows to automatically import root certificates into the Nextcloud container|' /tmp/sample.conf sed -i 's|17179869184|"17179869184"|' /tmp/sample.conf # shellcheck disable=SC2129 echo "" >> /tmp/sample.conf # shellcheck disable=SC2129 echo 'STORAGE_CLASS: # By setting this, you can adjust the storage class for your volumes. This should be a fast storage like SSD backed storage! This storage class must provide RWX and RWO volumes (ReadWriteMany and ReadWriteOnce).' >> /tmp/sample.conf echo 'STORAGE_CLASS_DATA: # Allows to set a dedicated storage class for the Nextcloud data volume. This can be a bit slower storage than the one above. This storage class must provide RWX volumes (ReadWriteMany). ⚠️ Warning: only set this for new installations, not existing ones!' >> /tmp/sample.conf for variable in "${VOLUME_VARIABLE[@]}"; do echo "$variable: 1Gi # You can change the size of the $(echo "$variable" | sed 's|_STORAGE_SIZE||;s|_|-|g' | tr '[:upper:]' '[:lower:]') volume that default to 1Gi with this value" >> /tmp/sample.conf done sed -i "s|NEXTCLOUD_STORAGE_SIZE: 1Gi|NEXTCLOUD_STORAGE_SIZE: 5Gi|" /tmp/sample.conf sed -i "s|NEXTCLOUD_DATA_STORAGE_SIZE: 1Gi|NEXTCLOUD_DATA_STORAGE_SIZE: 5Gi|" /tmp/sample.conf # Additional config cat << ADDITIONAL_CONFIG >> /tmp/sample.conf NAMESPACE: default # By changing this, you can adjust the namespace of the installation which allows to install multiple instances on one kubernetes cluster NAMESPACE_DISABLED: "no" # By setting this to "yes", you can disabled the creation of the namespace so that you can use a pre-created one NETWORK_POLICY_ENABLED: "no" # By setting this to "yes", you can enable a network policy that limits network access to the same namespace. Except the Web server service which is reachable from all endpoints. SUBSCRIPTION_KEY: # This allows to set the Nextcloud Enterprise key via ENV SERVERINFO_TOKEN: # This allows to set the serverinfo app token for monitoring your Nextcloud via the serverinfo app APPS_ALLOWLIST: # This allows to configure allowed apps that will be shown in Nextcloud's Appstore. You need to enter the app-IDs of the apps here and separate them with spaces. E.g. 'files richdocuments' ADDITIONAL_TRUSTED_PROXY: # Allows to add one additional ip-address to Nextcloud's trusted proxies and to the Office WOPI-allowlist automatically. Set it e.g. like this: 'your.public.ip-address'. You can also use an ip-range here. ADDITIONAL_TRUSTED_DOMAIN: # Allows to add one domain to Nextcloud's trusted domains and also generates a certificate automatically for it NEXTCLOUD_DEFAULT_QUOTA: "10 GB" # Allows to adjust the default quota that will be taken into account in Nextcloud for new users. Setting it to "unlimited" will set it to unlimited NEXTCLOUD_SKELETON_DIRECTORY: # Allows to adjust the sekeleton dir for Nextcloud. Setting it to "empty" will set the value to an empty string "" which will turn off the setting for new users in Nextcloud. NEXTCLOUD_MAINTENANCE_WINDOW: # Allows to define the maintenance window for Nextcloud. See https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/background_jobs_configuration.html#parameters for possible values SMTP_HOST: # (empty by default): The hostname of the SMTP server. SMTP_SECURE: # (empty by default): Set to 'ssl' to use SSL, or 'tls' to use STARTTLS. SMTP_PORT: # (default: '465' for SSL and '25' for non-secure connections): Optional port for the SMTP connection. Use '587' for an alternative port for STARTTLS. SMTP_AUTHTYPE: # (default: 'LOGIN'): The method used for authentication. Use 'PLAIN' if no authentication or STARTLS is required. SMTP_NAME: # (empty by default): The username for the authentication. SMTP_PASSWORD: # (empty by default): The password for the authentication. MAIL_FROM_ADDRESS: # (not set by default): Set the local-part for the 'from' field in the emails sent by Nextcloud. MAIL_DOMAIN: # (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed. TALK_MAX_STREAM_BITRATE: "1048576" # This allows to adjust the max stream bitrate of the talk hpb TALK_MAX_SCREEN_BITRATE: "2097152" # This allows to adjust the max stream bitrate of the talk hpb ADDITIONAL_CONFIG mv /tmp/sample.conf ../helm-chart/values.yaml ENABLED_VARIABLES="$(grep -oP '^[A-Z_]+_ENABLED' ../helm-chart/values.yaml)" mapfile -t ENABLED_VARIABLES <<< "$ENABLED_VARIABLES" cd ../helm-chart/ for variable in "${ENABLED_VARIABLES[@]}"; do name="$(echo "$variable" | sed 's|_ENABLED||g;s|_|-|g' | tr '[:upper:]' '[:lower:]')" # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$name-deployment.yaml" -exec sed -i "1i\\{{- if eq .Values.$variable \"yes\" }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$name-deployment.yaml" -exec sed -i "$ a {{- end }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$name-service.yaml" -exec sed -i "1i\\{{- if eq .Values.$variable \"yes\" }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$name-service.yaml" -exec sed -i "$ a {{- end }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$name-persistentvolumeclaim.yaml" -exec sed -i "1i\\{{- if eq .Values.$variable \"yes\" }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-$name-persistentvolumeclaim.yaml" -exec sed -i "$ a {{- end }}" \{} \; done # Additional case for FTS volume # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml" -exec sed -i "1i\\{{- if eq .Values.FULLTEXTSEARCH_ENABLED \"yes\" }}" \{} \; # shellcheck disable=SC1083 find ./ -name "*nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml" -exec sed -i "$ a {{- end }}" \{} \; cat << EOL > /tmp/security.conf # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} EOL # shellcheck disable=SC1083 find ./ \( -not -name '*collabora-deployment.yaml*' -not -name '*apache-deployment.yaml*' -not -name '*onlyoffice-deployment.yaml*' -name "*deployment.yaml" \) -exec sed -i "/^ securityContext:$/r /tmp/security.conf" \{} \; # shellcheck disable=SC1083 find ./ -name '*collabora-deployment.yaml*' -exec sed -i "/ADDITIONAL_COLLABORA_OPTIONS_PLACEHOLDER/d" \{} \; # shellcheck disable=SC1083 find ./ -name '*collabora-deployment.yaml*' -exec sed -i "s/- args:/- args: \{\{ .Values.ADDITIONAL_COLLABORA_OPTIONS | default list | toJson \}\}/" \{} \; cat << EOL > /tmp/security.conf # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} add: ["NET_BIND_SERVICE"] EOL # shellcheck disable=SC1083 find ./ -name '*apache-deployment.yaml*' -exec sed -i "/^ securityContext:$/r /tmp/security.conf" \{} \; cat << EOL > /tmp/security.conf {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} # AIO-config - do not change this comment! securityContext: # The items below only work in container context allowPrivilegeEscalation: false capabilities: {{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} drop: ["ALL"] {{- else }} drop: ["NET_RAW"] {{- end }} {{- end }} # AIO-config - do not change this comment! EOL # shellcheck disable=SC1083 find ./ -name '*nextcloud-deployment.yaml*' -exec sed -i "/image: .*nextcloud.*aio-nextcloud:.*/r /tmp/security.conf" \{} \; chmod 777 -R ./ # Seems like the dir needs to match the name of the chart cd ../ rm -rf ./nextcloud-aio-helm-chart mv ./helm-chart ./nextcloud-aio-helm-chart set +ex ================================================ FILE: nextcloud-aio-helm-chart/values.yaml ================================================ DATABASE_PASSWORD: # TODO! This needs to be a unique and good password! FULLTEXTSEARCH_PASSWORD: # TODO! This needs to be a unique and good password! IMAGINARY_SECRET: # TODO! This needs to be a unique and good password! NC_DOMAIN: yourdomain.com # TODO! Needs to be changed to the domain that you want to use for Nextcloud. NEXTCLOUD_PASSWORD: # TODO! This is the password of the initially created Nextcloud admin with username admin. ONLYOFFICE_SECRET: # TODO! This needs to be a unique and good password! RECORDING_SECRET: # TODO! This needs to be a unique and good password! REDIS_PASSWORD: # TODO! This needs to be a unique and good password! SIGNALING_SECRET: # TODO! This needs to be a unique and good password! TALK_INTERNAL_SECRET: # TODO! This needs to be a unique and good password! TIMEZONE: Europe/Berlin # TODO! This is the timezone that your containers will use. TURN_SECRET: # TODO! This needs to be a unique and good password! WHITEBOARD_SECRET: # TODO! This needs to be a unique and good password! CLAMAV_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. COLLABORA_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. FULLTEXTSEARCH_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. IMAGINARY_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. ONLYOFFICE_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. TALK_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. TALK_RECORDING_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. WHITEBOARD_ENABLED: "no" # Setting this to "yes" (with quotes) enables the option in Nextcloud automatically. APACHE_MAX_SIZE: "17179869184" # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT APACHE_PORT: 443 # Changing this to a different value than 443 will allow you to run it behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). ADDITIONAL_COLLABORA_OPTIONS: ['--o:security.seccomp=true'] # You can add additional collabora options here by using the array syntax. COLLABORA_DICTIONARIES: de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru # You can change this in order to enable other dictionaries for collabora FULLTEXTSEARCH_JAVA_OPTIONS: -Xms512M -Xmx512M # Allows to adjust the fulltextsearch java options. INSTALL_LATEST_MAJOR: "no" # Setting this to "yes" will install the latest Major Nextcloud version upon the first installation NEXTCLOUD_ADDITIONAL_APKS: imagemagick # This allows to add additional packages to the Nextcloud container permanently. Default is imagemagick but can be overwritten by modifying this value. NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS: imagick # This allows to add additional php extensions to the Nextcloud container permanently. Default is imagick but can be overwritten by modifying this value. NEXTCLOUD_MAX_TIME: 3600 # This allows to change the upload time limit of the Nextcloud container NEXTCLOUD_MEMORY_LIMIT: 512M # This allows to change the PHP memory limit of the Nextcloud container NEXTCLOUD_STARTUP_APPS: deck twofactor_totp tasks calendar contacts notes # Allows to modify the Nextcloud apps that are installed on starting AIO the first time NEXTCLOUD_TRUSTED_CACERTS_DIR: # Setting this to any value allows to automatically import root certificates into the Nextcloud container NEXTCLOUD_UPLOAD_LIMIT: 16G # This allows to change the upload limit of the Nextcloud container REMOVE_DISABLED_APPS: "yes" # Setting this to "no" keep Nextcloud apps that are disabled via their switch and not uninstall them if they should be installed in Nextcloud. TALK_PORT: 3478 # This allows to adjust the port that the talk container is using. It should be set to something higher than 1024! Otherwise it might not work! UPDATE_NEXTCLOUD_APPS: "no" # When setting to "yes" (with quotes), it will automatically update all installed Nextcloud apps upon container startup on saturdays. STORAGE_CLASS: # By setting this, you can adjust the storage class for your volumes. This should be a fast storage like SSD backed storage! This storage class must provide RWX and RWO volumes (ReadWriteMany and ReadWriteOnce). STORAGE_CLASS_DATA: # Allows to set a dedicated storage class for the Nextcloud data volume. This can be a bit slower storage than the one above. This storage class must provide RWX volumes (ReadWriteMany). ⚠️ Warning: only set this for new installations, not existing ones! APACHE_STORAGE_SIZE: 1Gi # You can change the size of the apache volume that default to 1Gi with this value CLAMAV_STORAGE_SIZE: 1Gi # You can change the size of the clamav volume that default to 1Gi with this value DATABASE_STORAGE_SIZE: 1Gi # You can change the size of the database volume that default to 1Gi with this value DATABASE_DUMP_STORAGE_SIZE: 1Gi # You can change the size of the database-dump volume that default to 1Gi with this value ELASTICSEARCH_STORAGE_SIZE: 1Gi # You can change the size of the elasticsearch volume that default to 1Gi with this value NEXTCLOUD_STORAGE_SIZE: 5Gi # You can change the size of the nextcloud volume that default to 1Gi with this value NEXTCLOUD_DATA_STORAGE_SIZE: 5Gi # You can change the size of the nextcloud-data volume that default to 1Gi with this value NEXTCLOUD_TRUSTED_CACERTS_STORAGE_SIZE: 1Gi # You can change the size of the nextcloud-trusted-cacerts volume that default to 1Gi with this value ONLYOFFICE_STORAGE_SIZE: 1Gi # You can change the size of the onlyoffice volume that default to 1Gi with this value REDIS_STORAGE_SIZE: 1Gi # You can change the size of the redis volume that default to 1Gi with this value TALK_RECORDING_STORAGE_SIZE: 1Gi # You can change the size of the talk-recording volume that default to 1Gi with this value NAMESPACE: default # By changing this, you can adjust the namespace of the installation which allows to install multiple instances on one kubernetes cluster NAMESPACE_DISABLED: "no" # By setting this to "yes", you can disabled the creation of the namespace so that you can use a pre-created one NETWORK_POLICY_ENABLED: "no" # By setting this to "yes", you can enable a network policy that limits network access to the same namespace. Except the Web server service which is reachable from all endpoints. SUBSCRIPTION_KEY: # This allows to set the Nextcloud Enterprise key via ENV SERVERINFO_TOKEN: # This allows to set the serverinfo app token for monitoring your Nextcloud via the serverinfo app APPS_ALLOWLIST: # This allows to configure allowed apps that will be shown in Nextcloud's Appstore. You need to enter the app-IDs of the apps here and separate them with spaces. E.g. 'files richdocuments' ADDITIONAL_TRUSTED_PROXY: # Allows to add one additional ip-address to Nextcloud's trusted proxies and to the Office WOPI-allowlist automatically. Set it e.g. like this: 'your.public.ip-address'. You can also use an ip-range here. ADDITIONAL_TRUSTED_DOMAIN: # Allows to add one domain to Nextcloud's trusted domains and also generates a certificate automatically for it NEXTCLOUD_DEFAULT_QUOTA: "10 GB" # Allows to adjust the default quota that will be taken into account in Nextcloud for new users. Setting it to "unlimited" will set it to unlimited NEXTCLOUD_SKELETON_DIRECTORY: # Allows to adjust the sekeleton dir for Nextcloud. Setting it to "empty" will set the value to an empty string "" which will turn off the setting for new users in Nextcloud. NEXTCLOUD_MAINTENANCE_WINDOW: # Allows to define the maintenance window for Nextcloud. See https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/background_jobs_configuration.html#parameters for possible values SMTP_HOST: # (empty by default): The hostname of the SMTP server. SMTP_SECURE: # (empty by default): Set to 'ssl' to use SSL, or 'tls' to use STARTTLS. SMTP_PORT: # (default: '465' for SSL and '25' for non-secure connections): Optional port for the SMTP connection. Use '587' for an alternative port for STARTTLS. SMTP_AUTHTYPE: # (default: 'LOGIN'): The method used for authentication. Use 'PLAIN' if no authentication or STARTLS is required. SMTP_NAME: # (empty by default): The username for the authentication. SMTP_PASSWORD: # (empty by default): The password for the authentication. MAIL_FROM_ADDRESS: # (not set by default): Set the local-part for the 'from' field in the emails sent by Nextcloud. MAIL_DOMAIN: # (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed. TALK_MAX_STREAM_BITRATE: "1048576" # This allows to adjust the max stream bitrate of the talk hpb TALK_MAX_SCREEN_BITRATE: "2097152" # This allows to adjust the max stream bitrate of the talk hpb ================================================ FILE: php/README.md ================================================ # PHP Docker Controller This is the code for the PHP Docker controller. ## How to run Running this locally requires : ### 1. Install the development environment This project uses Composer as dependency management software. It is very similar to NPM. The command to install all dependencies is: ```bash composer install ``` ### 2. Access to docker socket The `root` user has all privileges including access to the Docker socket. But **it is not recommended to launch the local instance with full privileges**, consider the docker group for docker access without being `root`. See https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user ### 3. Run a `nextcloud-aio-mastercontainer` container This application manages containers, including its own container. So you need to run a `nextcloud-aio-mastercontainer` container for the application to work properly. Here is a command to quickly launch a container : ```bash docker run \ --rm \ --name nextcloud-aio-mastercontainer \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock \ ghcr.io/nextcloud-releases/all-in-one:latest ``` ### 4. Start your server With this command you will launch the server: ```bash # Make sure to launch this command with a user having access to the docker socket. SKIP_DOMAIN_VALIDATION=true composer run dev ``` You can then access the web interface at http://localhost:8080. Note: You can restart the server by preceding the command with other environment variables. ## Composer routine | Command | Description | |-----------------------------------------|----------------------------------------| | `composer run dev` | Starts the development server | | `composer run psalm` | Run Psalm static analysis | | `composer run psalm:strict` | Run Psalm static analysis strict | | `composer run psalm:update-baseline` | Run Psalm with `--update-baseline` arg | | `composer run lint` | Run PHP Syntax check | | `composer run lint:twig` | Run Twig Syntax check | | `composer run php-deprecation-detector` | Run PHP Deprecation Detector | ================================================ FILE: php/composer.json ================================================ { "autoload": { "psr-4": { "AIO\\": ["src/"] } }, "require": { "php": "8.5.*", "ext-json": "*", "ext-sodium": "*", "ext-curl": "*", "slim/slim": "^4.11", "php-di/slim-bridge": "^3.3", "guzzlehttp/guzzle": "^7.5", "guzzlehttp/psr7": "^2.4", "http-interop/http-factory-guzzle": "^1.2", "slim/twig-view": "^3.3", "slim/csrf": "^1.3", "ext-apcu": "*", "slim/psr7": "^1.8" }, "require-dev": { "sserbin/twig-linter": "@dev", "vimeo/psalm": "^6.0", "wapmorgan/php-deprecation-detector": "dev-master" }, "scripts": { "dev": [ "Composer\\Config::disableProcessTimeout", "php -S localhost:8080 -t public" ], "psalm": "psalm --threads=1", "psalm:update-baseline": "psalm --threads=1 --monochrome --no-progress --output-format=text --update-baseline", "psalm:strict": "psalm --threads=1 --show-info=true", "lint": "php -l src/*.php src/**/*.php public/index.php", "lint:twig": "twig-linter lint ./templates", "php-deprecation-detector": "phpdd scan -n -t 8.5 src/*.php src/**/*.php public/index.php" } } ================================================ FILE: php/containers-schema.json ================================================ { "type": "object", "description": "AIO containers definition schema", "minProperties": 1, "required": ["aio_services_v1"], "properties": { "aio_services_v1": { "type": "array", "items": { "type": "object", "additionalProperties": false, "minProperties": 2, "required": ["image", "container_name", "image_tag"], "properties": { "image": { "type": "string", "minLength": 1, "pattern": "^(ghcr.io/)?[a-z0-9/-]+$" }, "expose": { "type": "array", "items": { "type": "string", "pattern": "^([0-9]{1,5})$" } }, "cap_add": { "type": "array", "items": { "type": "string", "pattern": "^[A-Z_]+$" } }, "cap_drop": { "type": "array", "items": { "type": "string", "pattern": "^[A-Z_]+$" } }, "depends_on": { "type": "array", "items": { "type": "string", "pattern": "^nextcloud-aio-[a-z-]+$" } }, "display_name": { "type": "string", "pattern": "^[()A-Za-z &0-9-]+$" }, "hide_from_list": { "type": "boolean" }, "environment": { "type": "array", "items": { "type": "string", "pattern": "^.*=.*$", "minlength": 1 } }, "container_name": { "type": "string", "pattern": "^nextcloud-aio-[a-z0-9-]+$" }, "internal_port": { "type": "string", "pattern": "^(([0-9]{1,5})|host|(%[A-Z_]+%))$" }, "stop_grace_period": { "type": "integer" }, "user": { "type": "string", "pattern": "^[0-9]{1,6}$" }, "ports": { "type": "array", "items": { "type": "object", "additionalProperties": false, "minProperties": 3, "properties": { "ip_binding": { "type": "string", "pattern": "^((%[A-Z_]+%)|127\\.0\\.0\\.1)?$" }, "port_number": { "type": "string", "pattern": "^(%[A-Z_]+%|[0-9]{1,5})$" }, "protocol": { "type": "string", "pattern": "^(tcp|udp)$" } } } }, "healthcheck": { "type": "object", "additionalProperties": false, "minProperties": 6, "properties": { "interval": { "type": "string", "pattern": "^[0-9]+s$" }, "timeout": { "type": "string", "pattern": "^[0-9]+s$" }, "retries": { "type": "integer" }, "start_period": { "type": "string", "pattern": "^[0-9]+s$" }, "start_interval": { "type": "string", "pattern": "^[0-9]+s$" }, "test": { "type": "string", "pattern": "^.*$" } } }, "aio_variables": { "type": "array", "items": { "type": "string", "pattern": "^[A-Z_a-z-]+=.*$" } }, "restart": { "type": "string", "pattern": "^unless-stopped$" }, "shm_size": { "type": "integer" }, "secrets": { "type": "array", "items": { "type": "string", "pattern": "^[A-Z_]+$" } }, "ui_secret": { "type": "string", "pattern": "^[A-Z_]+$" }, "image_tag": { "type": "string", "pattern": "^([a-z0-9.-]+|%AIO_CHANNEL%)$" }, "documentation": { "type": "string", "pattern": "^https://.*$" }, "devices": { "type": "array", "items": { "type": "string", "pattern": "^/dev/[a-z]+$" } }, "enable_nvidia_gpu": { "type": "boolean" }, "apparmor_unconfined": { "type": "boolean" }, "backup_volumes": { "type": "array", "items": { "type": "string", "pattern": "^nextcloud_aio_[a-z_]+$" } }, "nextcloud_exec_commands": { "type": "array", "items": { "type": "string", "pattern": "^(php /var/www/html/occ .*|echo .*|touch .*|mkdir .*)$" } }, "profiles": { "type": "array", "items": { "type": "string", "pattern": "^[a-z-]+$" } }, "read_only": { "type": "boolean" }, "init": { "type": "boolean" }, "tmpfs": { "type": "array", "items": { "type": "string", "pattern": "^/[a-z/_0-9-:]+$" } }, "volumes": { "type": "array", "items": { "type": "object", "additionalProperties": false, "minProperties": 3, "properties": { "destination": { "type": "string", "pattern": "^((/[a-z_/.-]+)|(%[A-Z_]+%))$" }, "source": { "type": "string", "pattern": "^((nextcloud_aio_[a-z_]+)|(%[A-Z_]+%)|(/dev)|(/run/udev))$" }, "writeable": { "type": "boolean" } } } } } } } } } ================================================ FILE: php/containers.json ================================================ { "aio_services_v1": [ { "container_name": "nextcloud-aio-apache", "image_tag": "%AIO_CHANNEL%", "documentation": "https://github.com/nextcloud/all-in-one/discussions/2105", "depends_on": [ "nextcloud-aio-onlyoffice", "nextcloud-aio-collabora", "nextcloud-aio-talk", "nextcloud-aio-notify-push", "nextcloud-aio-whiteboard", "nextcloud-aio-harp", "nextcloud-aio-nextcloud" ], "display_name": "Apache & Caddy", "image": "ghcr.io/nextcloud-releases/aio-apache", "user": "33", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "%APACHE_PORT%", "protocol": "tcp" }, { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "%APACHE_PORT%", "protocol": "udp" } ], "internal_port": "%APACHE_PORT%", "environment": [ "NC_DOMAIN=%NC_DOMAIN%", "NEXTCLOUD_HOST=nextcloud-aio-nextcloud", "APACHE_HOST=nextcloud-aio-apache", "COLLABORA_HOST=nextcloud-aio-collabora", "TALK_HOST=nextcloud-aio-talk", "APACHE_PORT=%APACHE_PORT%", "ONLYOFFICE_HOST=nextcloud-aio-onlyoffice", "TZ=%TIMEZONE%", "APACHE_MAX_SIZE=%APACHE_MAX_SIZE%", "APACHE_MAX_TIME=%NEXTCLOUD_MAX_TIME%", "NOTIFY_PUSH_HOST=nextcloud-aio-notify-push", "WHITEBOARD_HOST=nextcloud-aio-whiteboard", "HARP_HOST=nextcloud-aio-harp" ], "volumes": [ { "source": "nextcloud_aio_nextcloud", "destination": "/var/www/html", "writeable": false }, { "source": "nextcloud_aio_apache", "destination": "/mnt/data", "writeable": true } ], "restart": "unless-stopped", "backup_volumes": [ "nextcloud_aio_nextcloud", "nextcloud_aio_apache" ], "read_only": true, "tmpfs": [ "/var/log/supervisord", "/var/run/supervisord", "/usr/local/apache2/logs", "/tmp", "/home/www-data" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-database", "image_tag": "%AIO_CHANNEL%", "display_name": "PostgreSQL", "image": "ghcr.io/nextcloud-releases/aio-postgresql", "user": "999", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "5432" ], "internal_port": "5432", "secrets": [ "DATABASE_PASSWORD" ], "volumes": [ { "source": "nextcloud_aio_database", "destination": "/var/lib/postgresql/data", "writeable": true }, { "source": "nextcloud_aio_database_dump", "destination": "/mnt/data", "writeable": true } ], "environment": [ "POSTGRES_PASSWORD=%DATABASE_PASSWORD%", "POSTGRES_DB=nextcloud_database", "POSTGRES_USER=nextcloud", "TZ=%TIMEZONE%", "PGTZ=%TIMEZONE%" ], "stop_grace_period": 1800, "restart": "unless-stopped", "shm_size": 268435456, "backup_volumes": [ "nextcloud_aio_database", "nextcloud_aio_database_dump" ], "read_only": true, "tmpfs": [ "/var/run/postgresql" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-nextcloud", "image_tag": "%AIO_CHANNEL%", "depends_on": [ "nextcloud-aio-database", "nextcloud-aio-redis", "nextcloud-aio-clamav", "nextcloud-aio-fulltextsearch", "nextcloud-aio-talk-recording", "nextcloud-aio-imaginary", "nextcloud-aio-docker-socket-proxy" ], "display_name": "Nextcloud", "image": "ghcr.io/nextcloud-releases/aio-nextcloud", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "9000", "9001" ], "internal_port": "9000", "secrets": [ "DATABASE_PASSWORD", "REDIS_PASSWORD", "NEXTCLOUD_PASSWORD", "TURN_SECRET", "SIGNALING_SECRET", "FULLTEXTSEARCH_PASSWORD", "IMAGINARY_SECRET", "WHITEBOARD_SECRET", "HP_SHARED_KEY" ], "volumes": [ { "source": "nextcloud_aio_nextcloud", "destination": "/var/www/html", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/mnt/ncdata", "writeable": true }, { "source": "%NEXTCLOUD_MOUNT%", "destination": "%NEXTCLOUD_MOUNT%", "writeable": true }, { "source": "%NEXTCLOUD_TRUSTED_CACERTS_DIR%", "destination": "/usr/local/share/ca-certificates", "writeable": false } ], "environment": [ "NEXTCLOUD_HOST=nextcloud-aio-nextcloud", "POSTGRES_HOST=nextcloud-aio-database", "POSTGRES_PORT=5432", "POSTGRES_PASSWORD=%DATABASE_PASSWORD%", "POSTGRES_DB=nextcloud_database", "POSTGRES_USER=nextcloud", "REDIS_HOST=nextcloud-aio-redis", "REDIS_PORT=6379", "REDIS_HOST_PASSWORD=%REDIS_PASSWORD%", "APACHE_HOST=nextcloud-aio-apache", "APACHE_PORT=%APACHE_PORT%", "AIO_TOKEN=%AIO_TOKEN%", "NC_DOMAIN=%NC_DOMAIN%", "ADMIN_USER=admin", "ADMIN_PASSWORD=%NEXTCLOUD_PASSWORD%", "NEXTCLOUD_DATA_DIR=/mnt/ncdata", "OVERWRITEHOST=%NC_DOMAIN%", "OVERWRITEPROTOCOL=https", "TURN_SECRET=%TURN_SECRET%", "SIGNALING_SECRET=%SIGNALING_SECRET%", "ONLYOFFICE_SECRET=%ONLYOFFICE_SECRET%", "AIO_URL=%AIO_URL%", "NC_AIO_VERSION=v%AIO_VERSION%", "NEXTCLOUD_MOUNT=%NEXTCLOUD_MOUNT%", "CLAMAV_ENABLED=%CLAMAV_ENABLED%", "CLAMAV_HOST=nextcloud-aio-clamav", "ONLYOFFICE_ENABLED=%ONLYOFFICE_ENABLED%", "COLLABORA_ENABLED=%COLLABORA_ENABLED%", "COLLABORA_HOST=nextcloud-aio-collabora", "TALK_ENABLED=%TALK_ENABLED%", "ONLYOFFICE_HOST=nextcloud-aio-onlyoffice", "UPDATE_NEXTCLOUD_APPS=%UPDATE_NEXTCLOUD_APPS%", "TZ=%TIMEZONE%", "TALK_PORT=%TALK_PORT%", "TURN_DOMAIN=%TURN_DOMAIN%", "IMAGINARY_ENABLED=%IMAGINARY_ENABLED%", "IMAGINARY_HOST=nextcloud-aio-imaginary", "PHP_UPLOAD_LIMIT=%NEXTCLOUD_UPLOAD_LIMIT%", "PHP_MEMORY_LIMIT=%NEXTCLOUD_MEMORY_LIMIT%", "FULLTEXTSEARCH_ENABLED=%FULLTEXTSEARCH_ENABLED%", "FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch", "FULLTEXTSEARCH_PROTOCOL=http", "FULLTEXTSEARCH_PORT=9200", "FULLTEXTSEARCH_USER=elastic", "FULLTEXTSEARCH_INDEX=nextcloud-aio", "PHP_MAX_TIME=%NEXTCLOUD_MAX_TIME%", "TRUSTED_CACERTS_DIR=%NEXTCLOUD_TRUSTED_CACERTS_DIR%", "STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%", "ADDITIONAL_APKS=%NEXTCLOUD_ADDITIONAL_APKS%", "ADDITIONAL_PHP_EXTENSIONS=%NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS%", "INSTALL_LATEST_MAJOR=%INSTALL_LATEST_MAJOR%", "TALK_RECORDING_ENABLED=%TALK_RECORDING_ENABLED%", "RECORDING_SECRET=%RECORDING_SECRET%", "TALK_RECORDING_HOST=nextcloud-aio-talk-recording", "FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%", "DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%", "REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%", "ADDITIONAL_TRUSTED_PROXY=%CADDY_IP_ADDRESS%", "THIS_IS_AIO=true", "IMAGINARY_SECRET=%IMAGINARY_SECRET%", "WHITEBOARD_SECRET=%WHITEBOARD_SECRET%", "WHITEBOARD_ENABLED=%WHITEBOARD_ENABLED%", "HARP_ENABLED=%HARP_ENABLED%", "HP_SHARED_KEY=%HP_SHARED_KEY%" ], "stop_grace_period": 600, "restart": "unless-stopped", "devices": [ "/dev/dri" ], "enable_nvidia_gpu": true, "backup_volumes": [ "nextcloud_aio_nextcloud" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-notify-push", "image_tag": "%AIO_CHANNEL%", "display_name": "Client Push", "image": "ghcr.io/nextcloud-releases/aio-notify-push", "user": "33", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "7867" ], "internal_port": "7867", "secrets": [ "REDIS_PASSWORD", "DATABASE_PASSWORD" ], "volumes": [ { "source": "nextcloud_aio_nextcloud", "destination": "/var/www/html", "writeable": false } ], "environment": [ "NEXTCLOUD_HOST=nextcloud-aio-nextcloud", "TZ=%TIMEZONE%" ], "restart": "unless-stopped", "read_only": true, "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-redis", "image_tag": "%AIO_CHANNEL%", "display_name": "Redis", "image": "ghcr.io/nextcloud-releases/aio-redis", "user": "999", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "6379" ], "internal_port": "6379", "environment": [ "REDIS_HOST_PASSWORD=%REDIS_PASSWORD%", "TZ=%TIMEZONE%" ], "volumes": [ { "source": "nextcloud_aio_redis", "destination": "/data", "writeable": true } ], "secrets": [ "REDIS_PASSWORD", "ONLYOFFICE_SECRET", "RECORDING_SECRET" ], "restart": "unless-stopped", "read_only": true, "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-collabora", "image_tag": "%AIO_CHANNEL%", "documentation": "https://github.com/nextcloud/all-in-one/discussions/1358", "display_name": "Nextcloud Office", "image": "ghcr.io/nextcloud-releases/aio-collabora", "init": true, "healthcheck": { "start_period": "60s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 9 }, "expose": [ "9980" ], "internal_port": "9980", "environment": [ "aliasgroup1=https://%NC_DOMAIN%:443,http://nextcloud-aio-apache.nextcloud-aio:23973", "extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.disable_server_audit=true --o:logging.level=warning --o:logging.level_startup=warning --o:welcome.enable=false --o:fetch_update_check=0 --o:allow_update_popup=false %COLLABORA_SECCOMP_POLICY% --o:remote_font_config.url=https://%NC_DOMAIN%/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+", "dictionaries=%COLLABORA_DICTIONARIES%", "TZ=%TIMEZONE%", "server_name=%NC_DOMAIN%", "DONT_GEN_SSL_CERT=1" ], "restart": "unless-stopped", "nextcloud_exec_commands": [ "echo 'Activating Collabora config...'", "php /var/www/html/occ richdocuments:activate-config --wopi-url='http://nextcloud-aio-apache.nextcloud-aio:23973' --callback-url='http://nextcloud-aio-apache.nextcloud-aio:23973'" ], "profiles": [ "collabora" ], "cap_add": [ "SYS_ADMIN", "SYS_CHROOT", "FOWNER", "CHOWN" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-talk", "image_tag": "%AIO_CHANNEL%", "documentation": "https://github.com/nextcloud/all-in-one/discussions/1358", "display_name": "Nextcloud Talk", "image": "ghcr.io/nextcloud-releases/aio-talk", "user": "1000", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "ports": [ { "ip_binding": "", "port_number": "%TALK_PORT%", "protocol": "tcp" }, { "ip_binding": "", "port_number": "%TALK_PORT%", "protocol": "udp" } ], "expose": [ "8081" ], "internal_port": "%TALK_PORT%", "volumes": [ { "source": "%NEXTCLOUD_TRUSTED_CACERTS_DIR%", "destination": "/usr/local/share/ca-certificates", "writeable": false } ], "environment": [ "NC_DOMAIN=%NC_DOMAIN%", "TALK_HOST=nextcloud-aio-talk", "TURN_SECRET=%TURN_SECRET%", "SIGNALING_SECRET=%SIGNALING_SECRET%", "TZ=%TIMEZONE%", "TALK_PORT=%TALK_PORT%", "INTERNAL_SECRET=%TALK_INTERNAL_SECRET%" ], "secrets": [ "TURN_SECRET", "SIGNALING_SECRET", "TALK_INTERNAL_SECRET" ], "restart": "unless-stopped", "profiles": [ "talk", "talk-recording" ], "read_only": true, "tmpfs": [ "/var/log/supervisord", "/var/run/supervisord", "/opt/eturnal/run", "/conf", "/tmp" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-talk-recording", "image_tag": "%AIO_CHANNEL%", "display_name": "Nextcloud Talk Recording", "image": "ghcr.io/nextcloud-releases/aio-talk-recording", "user": "122", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "1234" ], "internal_port": "1234", "environment": [ "NC_DOMAIN=%NC_DOMAIN%", "TZ=%TIMEZONE%", "RECORDING_SECRET=%RECORDING_SECRET%", "INTERNAL_SECRET=%TALK_INTERNAL_SECRET%" ], "volumes": [ { "source": "nextcloud_aio_talk_recording", "destination": "/tmp", "writeable": true } ], "shm_size": 2147483648, "secrets": [ "RECORDING_SECRET", "TALK_INTERNAL_SECRET" ], "restart": "unless-stopped", "profiles": [ "talk-recording" ], "devices": [ "/dev/dri" ], "enable_nvidia_gpu": true, "read_only": true, "tmpfs": [ "/conf" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-borgbackup", "display_name": "Borgbackup", "hide_from_list": true, "image_tag": "%AIO_CHANNEL%", "image": "ghcr.io/nextcloud-releases/aio-borgbackup", "init": true, "environment": [ "BORG_REMOTE_REPO=%BORGBACKUP_REMOTE_REPO%", "BORG_PASSWORD=%BORGBACKUP_PASSWORD%", "BORG_MODE=%BORGBACKUP_MODE%", "SELECTED_RESTORE_TIME=%SELECTED_RESTORE_TIME%", "RESTORE_EXCLUDE_PREVIEWS=%RESTORE_EXCLUDE_PREVIEWS%", "BACKUP_RESTORE_PASSWORD=%BACKUP_RESTORE_PASSWORD%", "ADDITIONAL_DIRECTORIES_BACKUP=%ADDITIONAL_DIRECTORIES_BACKUP%", "BORGBACKUP_HOST_LOCATION=%BORGBACKUP_HOST_LOCATION%", "BORG_HOST_ID=nextcloud-aio-borgbackup", "BORG_RETENTION_POLICY=%BORG_RETENTION_POLICY%" ], "volumes": [ { "source": "nextcloud_aio_backup_cache", "destination": "/root", "writeable": true }, { "source": "%NEXTCLOUD_DATADIR%", "destination": "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data", "writeable": true }, { "source": "nextcloud_aio_mastercontainer", "destination": "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer", "writeable": true }, { "source": "%BORGBACKUP_HOST_LOCATION%", "destination": "/mnt/borgbackup", "writeable": true }, { "source": "nextcloud_aio_elasticsearch", "destination": "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch", "writeable": true }, { "source": "nextcloud_aio_redis", "destination": "/mnt/redis", "writeable": true } ], "secrets": [ "BORGBACKUP_PASSWORD" ], "devices": [ "/dev/fuse" ], "cap_add": [ "SYS_ADMIN" ], "cap_drop": [ "NET_RAW" ], "apparmor_unconfined": true, "read_only": true, "tmpfs": [ "/tmp", "/nextcloud_aio_volumes" ] }, { "container_name": "nextcloud-aio-watchtower", "display_name": "Watchtower", "hide_from_list": true, "image_tag": "%AIO_CHANNEL%", "image": "ghcr.io/nextcloud-releases/aio-watchtower", "init": true, "environment": [ "CONTAINER_TO_UPDATE=nextcloud-aio-mastercontainer" ], "volumes": [ { "source": "%WATCHTOWER_DOCKER_SOCKET_PATH%", "destination": "/var/run/docker.sock", "writeable": false } ], "read_only": true, "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-domaincheck", "display_name": "Domaincheck", "hide_from_list": true, "image_tag": "%AIO_CHANNEL%", "image": "ghcr.io/nextcloud-releases/aio-domaincheck", "init": true, "ports": [ { "ip_binding": "%APACHE_IP_BINDING%", "port_number": "%APACHE_PORT%", "protocol": "tcp" } ], "internal_port": "%APACHE_PORT%", "environment": [ "INSTANCE_ID=%INSTANCE_ID%", "APACHE_PORT=%APACHE_PORT%" ], "secrets": [ "INSTANCE_ID" ], "stop_grace_period": 1, "read_only": true, "tmpfs": [ "/etc/lighttpd", "/var/www/domaincheck" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-clamav", "image_tag": "%AIO_CHANNEL%", "display_name": "ClamAV", "image": "ghcr.io/nextcloud-releases/aio-clamav", "user": "100", "init": false, "healthcheck": { "start_period": "60s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 9 }, "expose": [ "3310" ], "internal_port": "3310", "environment": [ "TZ=%TIMEZONE%", "MAX_SIZE=%NEXTCLOUD_UPLOAD_LIMIT%" ], "volumes": [ { "source": "nextcloud_aio_clamav", "destination": "/var/lib/clamav", "writeable": true } ], "restart": "unless-stopped", "profiles": [ "clamav" ], "read_only": true, "tmpfs": [ "/tmp", "/var/log/clamav", "/run/clamav", "/var/log/supervisord", "/var/run/supervisord" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-onlyoffice", "image_tag": "%AIO_CHANNEL%", "display_name": "OnlyOffice", "image": "ghcr.io/nextcloud-releases/aio-onlyoffice", "init": true, "healthcheck": { "start_period": "60s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 9 }, "expose": [ "80" ], "internal_port": "80", "environment": [ "TZ=%TIMEZONE%", "JWT_ENABLED=true", "JWT_HEADER=AuthorizationJwt", "JWT_SECRET=%ONLYOFFICE_SECRET%" ], "volumes": [ { "source": "nextcloud_aio_onlyoffice", "destination": "/var/lib/onlyoffice", "writeable": true } ], "secrets": [ "ONLYOFFICE_SECRET" ], "restart": "unless-stopped", "profiles": [ "onlyoffice" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-imaginary", "image_tag": "%AIO_CHANNEL%", "display_name": "Imaginary", "image": "ghcr.io/nextcloud-releases/aio-imaginary", "user": "65534", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "9000" ], "internal_port": "9000", "environment": [ "TZ=%TIMEZONE%", "IMAGINARY_SECRET=%IMAGINARY_SECRET%" ], "restart": "unless-stopped", "cap_add": [ "SYS_NICE" ], "cap_drop": [ "NET_RAW" ], "profiles": [ "imaginary" ], "read_only": true, "tmpfs": [ "/tmp" ], "secrets": [ "IMAGINARY_SECRET" ] }, { "container_name": "nextcloud-aio-fulltextsearch", "image_tag": "%AIO_CHANNEL%", "documentation": "https://github.com/nextcloud/all-in-one/discussions/1709", "display_name": "Fulltextsearch", "image": "ghcr.io/nextcloud-releases/aio-fulltextsearch", "init": false, "healthcheck": { "start_period": "60s", "test": "/healthcheck.sh", "interval": "10s", "timeout": "5s", "start_interval": "5s", "retries": 5 }, "expose": [ "9200" ], "internal_port": "9200", "environment": [ "TZ=%TIMEZONE%", "ES_JAVA_OPTS=%FULLTEXTSEARCH_JAVA_OPTIONS%", "bootstrap.memory_lock=false", "cluster.name=nextcloud-aio", "discovery.type=single-node", "logger.level=WARN", "http.port=9200", "xpack.license.self_generated.type=basic", "xpack.security.enabled=false", "FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%" ], "volumes": [ { "source": "nextcloud_aio_elasticsearch", "destination": "/usr/share/elasticsearch/data", "writeable": true } ], "restart": "unless-stopped", "profiles": [ "fulltextsearch" ], "secrets": [ "FULLTEXTSEARCH_PASSWORD" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-docker-socket-proxy", "image_tag": "%AIO_CHANNEL%", "display_name": "Docker Socket Proxy (deprecated)", "image": "ghcr.io/nextcloud-releases/aio-docker-socket-proxy", "init": true, "internal_port": "2375", "environment": [ "TZ=%TIMEZONE%" ], "volumes": [ { "source": "%WATCHTOWER_DOCKER_SOCKET_PATH%", "destination": "/var/run/docker.sock", "writeable": false } ], "restart": "unless-stopped", "read_only": true, "tmpfs": [ "/tmp" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-harp", "image_tag": "release", "display_name": "HaRP", "image": "ghcr.io/nextcloud/nextcloud-appapi-harp", "init": true, "internal_port": "8780", "expose": [ "8780" ], "environment": [ "HP_SHARED_KEY=%HP_SHARED_KEY%", "NC_INSTANCE_URL=https://%NC_DOMAIN%", "HP_LOG_LEVEL=warning", "HP_FRP_DISABLE_TLS=true", "TZ=%TIMEZONE%" ], "secrets": [ "HP_SHARED_KEY" ], "volumes": [ { "source": "%WATCHTOWER_DOCKER_SOCKET_PATH%", "destination": "/var/run/docker.sock", "writeable": false }, { "source": "nextcloud_aio_harp", "destination": "/certs", "writeable": true } ], "restart": "unless-stopped", "read_only": true, "tmpfs": [ "/tmp", "/run/harp" ], "cap_drop": [ "NET_RAW" ] }, { "container_name": "nextcloud-aio-whiteboard", "image_tag": "%AIO_CHANNEL%", "display_name": "Nextcloud Whiteboard", "image": "ghcr.io/nextcloud-releases/aio-whiteboard", "user": "65534", "init": true, "healthcheck": { "start_period": "0s", "test": "/healthcheck.sh", "interval": "30s", "timeout": "30s", "start_interval": "5s", "retries": 3 }, "expose": [ "3002" ], "tmpfs": [ "/tmp" ], "internal_port": "3002", "environment": [ "TZ=%TIMEZONE%", "NEXTCLOUD_URL=https://%NC_DOMAIN%", "JWT_SECRET_KEY=%WHITEBOARD_SECRET%", "STORAGE_STRATEGY=redis", "REDIS_HOST=nextcloud-aio-redis", "REDIS_PORT=6379", "REDIS_HOST_PASSWORD=%REDIS_PASSWORD%", "BACKUP_DIR=/tmp" ], "secrets": [ "WHITEBOARD_SECRET", "REDIS_PASSWORD" ], "restart": "unless-stopped", "profiles": [ "whiteboard" ], "read_only": true, "cap_drop": [ "NET_RAW" ] } ] } ================================================ FILE: php/cool-seccomp-profile.json ================================================ { "defaultAction": "SCMP_ACT_ERRNO", "defaultErrnoRet": 1, "archMap": [ { "architecture": "SCMP_ARCH_X86_64", "subArchitectures": [ "SCMP_ARCH_X86", "SCMP_ARCH_X32" ] }, { "architecture": "SCMP_ARCH_AARCH64", "subArchitectures": [ "SCMP_ARCH_ARM" ] }, { "architecture": "SCMP_ARCH_MIPS64", "subArchitectures": [ "SCMP_ARCH_MIPS", "SCMP_ARCH_MIPS64N32" ] }, { "architecture": "SCMP_ARCH_MIPS64N32", "subArchitectures": [ "SCMP_ARCH_MIPS", "SCMP_ARCH_MIPS64" ] }, { "architecture": "SCMP_ARCH_MIPSEL64", "subArchitectures": [ "SCMP_ARCH_MIPSEL", "SCMP_ARCH_MIPSEL64N32" ] }, { "architecture": "SCMP_ARCH_MIPSEL64N32", "subArchitectures": [ "SCMP_ARCH_MIPSEL", "SCMP_ARCH_MIPSEL64" ] }, { "architecture": "SCMP_ARCH_S390X", "subArchitectures": [ "SCMP_ARCH_S390" ] }, { "architecture": "SCMP_ARCH_RISCV64", "subArchitectures": null } ], "syscalls": [ { "names": [ "unshare", "mount", "setns", "clone", "chroot", "umount2" ], "action": "SCMP_ACT_ALLOW" }, { "names": [ "accept", "accept4", "access", "adjtimex", "alarm", "bind", "brk", "cachestat", "capget", "capset", "chdir", "chmod", "chown", "chown32", "clock_adjtime", "clock_adjtime64", "clock_getres", "clock_getres_time64", "clock_gettime", "clock_gettime64", "clock_nanosleep", "clock_nanosleep_time64", "close", "close_range", "connect", "copy_file_range", "creat", "dup", "dup2", "dup3", "epoll_create", "epoll_create1", "epoll_ctl", "epoll_ctl_old", "epoll_pwait", "epoll_pwait2", "epoll_wait", "epoll_wait_old", "eventfd", "eventfd2", "execve", "execveat", "exit", "exit_group", "faccessat", "faccessat2", "fadvise64", "fadvise64_64", "fallocate", "fanotify_mark", "fchdir", "fchmod", "fchmodat", "fchmodat2", "fchown", "fchown32", "fchownat", "fcntl", "fcntl64", "fdatasync", "fgetxattr", "flistxattr", "flock", "fork", "fremovexattr", "fsetxattr", "fstat", "fstat64", "fstatat64", "fstatfs", "fstatfs64", "fsync", "ftruncate", "ftruncate64", "futex", "futex_requeue", "futex_time64", "futex_wait", "futex_waitv", "futex_wake", "futimesat", "getcpu", "getcwd", "getdents", "getdents64", "getegid", "getegid32", "geteuid", "geteuid32", "getgid", "getgid32", "getgroups", "getgroups32", "getitimer", "getpeername", "getpgid", "getpgrp", "getpid", "getppid", "getpriority", "getrandom", "getresgid", "getresgid32", "getresuid", "getresuid32", "getrlimit", "get_robust_list", "getrusage", "getsid", "getsockname", "getsockopt", "get_thread_area", "gettid", "gettimeofday", "getuid", "getuid32", "getxattr", "inotify_add_watch", "inotify_init", "inotify_init1", "inotify_rm_watch", "io_cancel", "ioctl", "io_destroy", "io_getevents", "io_pgetevents", "io_pgetevents_time64", "ioprio_get", "ioprio_set", "io_setup", "io_submit", "ipc", "kill", "landlock_add_rule", "landlock_create_ruleset", "landlock_restrict_self", "lchown", "lchown32", "lgetxattr", "link", "linkat", "listen", "listxattr", "llistxattr", "_llseek", "lremovexattr", "lseek", "lsetxattr", "lstat", "lstat64", "madvise", "map_shadow_stack", "membarrier", "memfd_create", "memfd_secret", "mincore", "mkdir", "mkdirat", "mknod", "mknodat", "mlock", "mlock2", "mlockall", "mmap", "mmap2", "mprotect", "mq_getsetattr", "mq_notify", "mq_open", "mq_timedreceive", "mq_timedreceive_time64", "mq_timedsend", "mq_timedsend_time64", "mq_unlink", "mremap", "msgctl", "msgget", "msgrcv", "msgsnd", "msync", "munlock", "munlockall", "munmap", "name_to_handle_at", "nanosleep", "newfstatat", "_newselect", "open", "openat", "openat2", "pause", "pidfd_open", "pidfd_send_signal", "pipe", "pipe2", "pkey_alloc", "pkey_free", "pkey_mprotect", "poll", "ppoll", "ppoll_time64", "prctl", "pread64", "preadv", "preadv2", "prlimit64", "process_mrelease", "pselect6", "pselect6_time64", "pwrite64", "pwritev", "pwritev2", "read", "readahead", "readlink", "readlinkat", "readv", "recv", "recvfrom", "recvmmsg", "recvmmsg_time64", "recvmsg", "remap_file_pages", "removexattr", "rename", "renameat", "renameat2", "restart_syscall", "rmdir", "rseq", "rt_sigaction", "rt_sigpending", "rt_sigprocmask", "rt_sigqueueinfo", "rt_sigreturn", "rt_sigsuspend", "rt_sigtimedwait", "rt_sigtimedwait_time64", "rt_tgsigqueueinfo", "sched_getaffinity", "sched_getattr", "sched_getparam", "sched_get_priority_max", "sched_get_priority_min", "sched_getscheduler", "sched_rr_get_interval", "sched_rr_get_interval_time64", "sched_setaffinity", "sched_setattr", "sched_setparam", "sched_setscheduler", "sched_yield", "seccomp", "select", "semctl", "semget", "semop", "semtimedop", "semtimedop_time64", "send", "sendfile", "sendfile64", "sendmmsg", "sendmsg", "sendto", "setfsgid", "setfsgid32", "setfsuid", "setfsuid32", "setgid", "setgid32", "setgroups", "setgroups32", "setitimer", "setpgid", "setpriority", "setregid", "setregid32", "setresgid", "setresgid32", "setresuid", "setresuid32", "setreuid", "setreuid32", "setrlimit", "set_robust_list", "setsid", "setsockopt", "set_thread_area", "set_tid_address", "setuid", "setuid32", "setxattr", "shmat", "shmctl", "shmdt", "shmget", "shutdown", "sigaltstack", "signalfd", "signalfd4", "sigprocmask", "sigreturn", "socketcall", "socketpair", "splice", "stat", "stat64", "statfs", "statfs64", "statx", "symlink", "symlinkat", "sync", "sync_file_range", "syncfs", "sysinfo", "tee", "tgkill", "time", "timer_create", "timer_delete", "timer_getoverrun", "timer_gettime", "timer_gettime64", "timer_settime", "timer_settime64", "timerfd_create", "timerfd_gettime", "timerfd_gettime64", "timerfd_settime", "timerfd_settime64", "times", "tkill", "truncate", "truncate64", "ugetrlimit", "umask", "uname", "unlink", "unlinkat", "utime", "utimensat", "utimensat_time64", "utimes", "vfork", "vmsplice", "wait4", "waitid", "waitpid", "write", "writev" ], "action": "SCMP_ACT_ALLOW" }, { "names": [ "process_vm_readv", "process_vm_writev", "ptrace" ], "action": "SCMP_ACT_ALLOW", "includes": { "minKernel": "4.8" } }, { "names": [ "socket" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 40, "op": "SCMP_CMP_NE" } ] }, { "names": [ "personality" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 0, "op": "SCMP_CMP_EQ" } ] }, { "names": [ "personality" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 8, "op": "SCMP_CMP_EQ" } ] }, { "names": [ "personality" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 131072, "op": "SCMP_CMP_EQ" } ] }, { "names": [ "personality" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 131080, "op": "SCMP_CMP_EQ" } ] }, { "names": [ "personality" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 4294967295, "op": "SCMP_CMP_EQ" } ] }, { "names": [ "sync_file_range2", "swapcontext" ], "action": "SCMP_ACT_ALLOW", "includes": { "arches": [ "ppc64le" ] } }, { "names": [ "arm_fadvise64_64", "arm_sync_file_range", "sync_file_range2", "breakpoint", "cacheflush", "set_tls" ], "action": "SCMP_ACT_ALLOW", "includes": { "arches": [ "arm", "arm64" ] } }, { "names": [ "arch_prctl" ], "action": "SCMP_ACT_ALLOW", "includes": { "arches": [ "amd64", "x32" ] } }, { "names": [ "modify_ldt" ], "action": "SCMP_ACT_ALLOW", "includes": { "arches": [ "amd64", "x32", "x86" ] } }, { "names": [ "s390_pci_mmio_read", "s390_pci_mmio_write", "s390_runtime_instr" ], "action": "SCMP_ACT_ALLOW", "includes": { "arches": [ "s390", "s390x" ] } }, { "names": [ "riscv_flush_icache" ], "action": "SCMP_ACT_ALLOW", "includes": { "arches": [ "riscv64" ] } }, { "names": [ "open_by_handle_at" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_DAC_READ_SEARCH" ] } }, { "names": [ "bpf", "clone", "clone3", "fanotify_init", "fsconfig", "fsmount", "fsopen", "fspick", "lookup_dcookie", "mount", "mount_setattr", "move_mount", "open_tree", "perf_event_open", "quotactl", "quotactl_fd", "setdomainname", "sethostname", "setns", "syslog", "umount", "umount2", "unshare" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_ADMIN" ] } }, { "names": [ "clone" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 0, "value": 2114060288, "op": "SCMP_CMP_MASKED_EQ" } ], "excludes": { "caps": [ "CAP_SYS_ADMIN" ], "arches": [ "s390", "s390x" ] } }, { "names": [ "clone" ], "action": "SCMP_ACT_ALLOW", "args": [ { "index": 1, "value": 2114060288, "op": "SCMP_CMP_MASKED_EQ" } ], "comment": "s390 parameter ordering for clone is different", "includes": { "arches": [ "s390", "s390x" ] }, "excludes": { "caps": [ "CAP_SYS_ADMIN" ] } }, { "names": [ "clone3" ], "action": "SCMP_ACT_ERRNO", "errnoRet": 38, "excludes": { "caps": [ "CAP_SYS_ADMIN" ] } }, { "names": [ "reboot" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_BOOT" ] } }, { "names": [ "chroot" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_CHROOT" ] } }, { "names": [ "delete_module", "init_module", "finit_module" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_MODULE" ] } }, { "names": [ "acct" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_PACCT" ] } }, { "names": [ "kcmp", "pidfd_getfd", "process_madvise", "process_vm_readv", "process_vm_writev", "ptrace" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_PTRACE" ] } }, { "names": [ "iopl", "ioperm" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_RAWIO" ] } }, { "names": [ "settimeofday", "stime", "clock_settime", "clock_settime64" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_TIME" ] } }, { "names": [ "vhangup" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_TTY_CONFIG" ] } }, { "names": [ "get_mempolicy", "mbind", "set_mempolicy", "set_mempolicy_home_node" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYS_NICE" ] } }, { "names": [ "syslog" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_SYSLOG" ] } }, { "names": [ "bpf" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_BPF" ] } }, { "names": [ "perf_event_open" ], "action": "SCMP_ACT_ALLOW", "includes": { "caps": [ "CAP_PERFMON" ] } } ] } ================================================ FILE: php/data/.gitkeep ================================================ ================================================ FILE: php/domain-validator.php ================================================ ================================================ FILE: php/psalm.xml ================================================ ================================================ FILE: php/public/automatic_reload.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { if (document.hasFocus()) { // hide reload button if the site reloads automatically let list = document.getElementsByClassName("reload button"); for (let i = 0; i < list.length; i++) { // list[i] is a node with the desired class name list[i].style.display = 'none'; } // set timeout for reload setTimeout(function(){ window.location.reload(1); }, 5000); } else { window.addEventListener("beforeunload", function() { document.getElementById('overlay').classList.add('loading') }); } }); ================================================ FILE: php/public/base_path.js ================================================ document.addEventListener("DOMContentLoaded", function() { basePath = document.getElementById("base_path") if (basePath) { // Remove '/containers' from the end of the path, to get the base path only basePath.value = window.location.pathname.slice(0, -11); } }); ================================================ FILE: php/public/before-unload.js ================================================ window.addEventListener("beforeunload", function() { document.getElementById('overlay').classList.add('loading') }); ================================================ FILE: php/public/containers-form-submit.js ================================================ document.addEventListener("DOMContentLoaded", function () { // Don't run if the expected form isn't present. if (document.getElementById('options-form') === null) { return; } // Hide submit button initially const optionsFormSubmit = document.querySelectorAll(".options-form-submit"); optionsFormSubmit.forEach(element => { element.style.display = 'none'; }); const communityFormSubmit = document.getElementById("community-form-submit"); communityFormSubmit.style.display = 'none'; // Store initial states for all checkboxes const initialStateOptionsContainers = {}; const initialStateCommunityContainers = {}; const optionsContainersCheckboxes = document.querySelectorAll("#options-form input[type='checkbox']"); const communityContainersCheckboxes = document.querySelectorAll("#community-form input[type='checkbox']"); // Office suite radio buttons const collaboraRadio = document.getElementById('office-collabora'); const onlyofficeRadio = document.getElementById('office-onlyoffice'); const noneRadio = document.getElementById('office-none'); const collaboraHidden = document.getElementById('collabora'); const onlyofficeHidden = document.getElementById('onlyoffice'); let initialOfficeSelection = null; optionsContainersCheckboxes.forEach(checkbox => { initialStateOptionsContainers[checkbox.id] = checkbox.checked; // Use checked property to capture actual initial state }); communityContainersCheckboxes.forEach(checkbox => { initialStateCommunityContainers[checkbox.id] = checkbox.checked; // Use checked property to capture actual initial state }); // Store initial office suite selection if (collaboraRadio && onlyofficeRadio && noneRadio) { if (collaboraRadio.checked) { initialOfficeSelection = 'collabora'; } else if (onlyofficeRadio.checked) { initialOfficeSelection = 'onlyoffice'; } else { initialOfficeSelection = 'none'; } } // Function to compare current states to initial states function checkForOptionContainerChanges() { let hasChanges = false; optionsContainersCheckboxes.forEach(checkbox => { if (checkbox.checked !== initialStateOptionsContainers[checkbox.id]) { hasChanges = true; } }); // Check office suite changes and sync to hidden inputs if (collaboraRadio && onlyofficeRadio && noneRadio && collaboraHidden && onlyofficeHidden) { let currentOfficeSelection = null; if (collaboraRadio.checked) { currentOfficeSelection = 'collabora'; collaboraHidden.value = 'on'; onlyofficeHidden.value = ''; } else if (onlyofficeRadio.checked) { currentOfficeSelection = 'onlyoffice'; collaboraHidden.value = ''; onlyofficeHidden.value = 'on'; } else { currentOfficeSelection = 'none'; collaboraHidden.value = ''; onlyofficeHidden.value = ''; } if (currentOfficeSelection !== initialOfficeSelection) { hasChanges = true; } } // Show or hide submit button based on changes optionsFormSubmit.forEach(element => { element.style.display = hasChanges ? 'block' : 'none'; }); } // Function to compare current states to initial states function checkForCommunityContainerChanges() { let hasChanges = false; communityContainersCheckboxes.forEach(checkbox => { if (checkbox.checked !== initialStateCommunityContainers[checkbox.id]) { hasChanges = true; } }); // Show or hide submit button based on changes communityFormSubmit.style.display = hasChanges ? 'block' : 'none'; } // Event listener to trigger visibility check on each change optionsContainersCheckboxes.forEach(checkbox => { checkbox.addEventListener("change", checkForOptionContainerChanges); }); communityContainersCheckboxes.forEach(checkbox => { checkbox.addEventListener("change", checkForCommunityContainerChanges); }); // Custom behaviors for specific options function handleTalkVisibility() { const talkRecording = document.getElementById("talk-recording"); if (document.getElementById("talk").checked) { talkRecording.disabled = false; } else { talkRecording.checked = false; talkRecording.disabled = true; } checkForOptionContainerChanges(); // Check changes after toggling Talk Recording } function handleDockerSocketProxyWarning() { if (document.getElementById("docker-socket-proxy").checked) { // TODO: remove the line below and uncomment the lines further down once https://github.com/nextcloud/app_api/pull/800 is included alert('⚠️ Warning! Enabling this container comes with possible Security problems since you are exposing the docker socket and all its privileges to the Nextcloud container. Enable this only if you are sure what you are doing!'); // alert('⚠️ The docker socket proxy container is deprecated. Please use the HaRP (High-availability Reverse Proxy for Nextcloud ExApps) instead!'); // document.getElementById("docker-socket-proxy").checked = false } } function handleHarpWarning() { if (document.getElementById("harp").checked) { alert('⚠️ Warning! Enabling this container comes with possible Security problems since you are exposing the docker socket and all its privileges to the HaRP container. Enable this only if you are sure what you are doing!'); document.getElementById("docker-socket-proxy").checked = false } } // Initialize event listeners for specific behaviors document.getElementById("talk").addEventListener('change', handleTalkVisibility); document.getElementById("docker-socket-proxy").addEventListener('change', handleDockerSocketProxyWarning); if (document.getElementById("harp")) { document.getElementById("harp").addEventListener('change', handleHarpWarning); } // Initialize talk-recording visibility on page load handleTalkVisibility(); // Ensure talk-recording is correctly initialized // Add event listeners for office suite radio buttons if (collaboraRadio && onlyofficeRadio && noneRadio) { collaboraRadio.addEventListener('change', checkForOptionContainerChanges); onlyofficeRadio.addEventListener('change', checkForOptionContainerChanges); noneRadio.addEventListener('change', checkForOptionContainerChanges); } // Initial call to check for changes checkForOptionContainerChanges(); checkForCommunityContainerChanges(); }); ================================================ FILE: php/public/disable-clamav.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Clamav let clamav = document.getElementById("clamav"); clamav.disabled = true; }); ================================================ FILE: php/public/disable-collabora.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Collabora const collabora = document.getElementById("office-collabora"); collabora.disabled = true; }); ================================================ FILE: php/public/disable-docker-socket-proxy.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Docker socket proxy let dockerSocketProxy = document.getElementById("docker-socket-proxy"); if (dockerSocketProxy) { dockerSocketProxy.disabled = true; } }); ================================================ FILE: php/public/disable-fulltextsearch.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Fulltextsearch let fulltextsearch = document.getElementById("fulltextsearch"); fulltextsearch.disabled = true; }); ================================================ FILE: php/public/disable-harp.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // HaRP let harp = document.getElementById("harp"); if (harp) { harp.disabled = true; } }); ================================================ FILE: php/public/disable-imaginary.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Imaginary let imaginary = document.getElementById("imaginary"); imaginary.disabled = true; }); ================================================ FILE: php/public/disable-onlyoffice.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // OnlyOffice const onlyoffice = document.getElementById("office-onlyoffice"); onlyoffice.disabled = true; }); ================================================ FILE: php/public/disable-talk-recording.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Talk-recording document.getElementById("talk-recording").disabled = true; }); ================================================ FILE: php/public/disable-talk.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Talk let talk = document.getElementById("talk"); talk.disabled = true; }); ================================================ FILE: php/public/disable-whiteboard.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // Whiteboard let whiteboard = document.getElementById("whiteboard"); whiteboard.disabled = true; }); ================================================ FILE: php/public/forms.js ================================================ "use strict"; function showPassword(id) { let passwordField = document.getElementById(id); if (passwordField.type === "password" && passwordField.value !== "") { passwordField.type = "text"; } else if (passwordField.type === "text" && passwordField.value === "") { passwordField.type = "password"; } } (function (){ let lastError; function showError(message) { const body = document.getElementsByTagName('body')[0] const toast = document.createElement("div") toast.className = "toast error" toast.prepend(message) if (lastError) { lastError.remove() } lastError = toast body.prepend(toast) setTimeout(toast.remove.bind(toast), 10000) } function handleEvent(e) { const xhr = e.target; if (xhr.status === 201) { window.location.replace(xhr.getResponseHeader('Location')); } else if (xhr.status === 422) { disableSpinner() showError(xhr.response); } else if (xhr.status === 500) { showError("Server error. Please check the mastercontainer logs for details. This page will reload after 10s automatically. Then you can check the mastercontainer logs."); // Reload after 10s since it is expected that the updated view is shown (e.g. after starting containers) setTimeout(function(){ window.location.reload(1); }, 10000); } else { // If the responose is not one of the above, we should reload to show the latest content window.location.reload(1); } } function enableSpinner() { document.getElementById('overlay').classList.add('loading'); } function disableSpinner() { document.getElementById('overlay').classList.remove('loading'); } function initForm(form) { function submit(event) { if (lastError) { lastError.remove() } let xhr = new XMLHttpRequest(); xhr.addEventListener('load', handleEvent); xhr.addEventListener('error', () => showError("Failed to talk to server.")); xhr.addEventListener('error', () => disableSpinner()); xhr.open(form.method, form.getAttribute("action")); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); enableSpinner(); xhr.send(new URLSearchParams(new FormData(form))); event.preventDefault(); } form.onsubmit = submit; } function initForms() { const forms = document.querySelectorAll('form.xhr') for (const form of forms) { initForm(form); } const overlayLogForms = document.querySelectorAll('form[target="overlay-log"]') for (const form of overlayLogForms) { form.onsubmit = function() { enableSpinner(); document.getElementById('overlay-log')?.classList.add('visible'); // Reload the page after the response was fully loaded into the iframe. document.querySelector('iframe[name="overlay-log"]').addEventListener('load', () => { location.reload(); }); }; } } if (document.readyState === 'loading') { // Loading hasn't finished yet document.addEventListener('DOMContentLoaded', initForms); } else { // `DOMContentLoaded` has already fired initForms(); } })() ================================================ FILE: php/public/index.php ================================================ get(\AIO\Data\DataConst::class); ini_set('session.save_path', $dataConst->GetSessionDirectory()); // Auto logout on browser close ini_set('session.cookie_lifetime', '0'); # Keep session for 24h max ini_set('session.gc_maxlifetime', '86400'); // Create app AppFactory::setContainer($container); $app = AppFactory::create(); $responseFactory = $app->getResponseFactory(); // Register Middleware On Container $container->set(Guard::class, function () use ($responseFactory) { $guard = new Guard($responseFactory); $guard->setPersistentTokenMode(true); return $guard; }); // Register Middleware To Be Executed On All Routes session_start(); $app->add(Guard::class); // Create Twig $twig = Twig::create(__DIR__ . '/../templates/', ['cache' => false]); $app->add(TwigMiddleware::create($app, $twig)); $twig->addExtension(new \AIO\Twig\CsrfExtension($container->get(Guard::class))); // Auth Middleware $app->add(new \AIO\Middleware\AuthMiddleware($container->get(\AIO\Auth\AuthManager::class))); // API $app->post('/api/docker/watchtower', AIO\Controller\DockerController::class . ':StartWatchtowerContainer'); $app->get('/api/docker/getwatchtower', AIO\Controller\DockerController::class . ':StartWatchtowerContainer'); $app->post('/api/docker/start', AIO\Controller\DockerController::class . ':StartContainer'); $app->post('/api/docker/backup', AIO\Controller\DockerController::class . ':StartBackupContainerBackup'); $app->post('/api/docker/backup-check', AIO\Controller\DockerController::class . ':StartBackupContainerCheck'); $app->post('/api/docker/backup-list', AIO\Controller\DockerController::class . ':StartBackupContainerList'); $app->post('/api/docker/backup-check-repair', AIO\Controller\DockerController::class . ':StartBackupContainerCheckRepair'); $app->post('/api/docker/backup-test', AIO\Controller\DockerController::class . ':StartBackupContainerTest'); $app->post('/api/docker/restore', AIO\Controller\DockerController::class . ':StartBackupContainerRestore'); $app->post('/api/docker/stop', AIO\Controller\DockerController::class . ':StopContainer'); $app->get('/api/docker/logs', AIO\Controller\DockerController::class . ':GetLogs'); $app->post('/api/auth/login', AIO\Controller\LoginController::class . ':TryLogin'); $app->get('/api/auth/getlogin', AIO\Controller\LoginController::class . ':GetTryLogin'); $app->post('/api/auth/logout', AIO\Controller\LoginController::class . ':Logout'); $app->post('/api/configuration', \AIO\Controller\ConfigurationController::class . ':SetConfig'); // Views $app->get('/containers', function (Request $request, Response $response, array $args) use ($container) { $view = Twig::fromRequest($request); $view->addExtension(new \AIO\Twig\ClassExtension()); /** @var \AIO\Data\ConfigurationManager $configurationManager */ $configurationManager = $container->get(\AIO\Data\ConfigurationManager::class); /** @var \AIO\Docker\DockerActionManager $dockerActionManager */ $dockerActionManager = $container->get(\AIO\Docker\DockerActionManager::class); /** @var \AIO\Controller\DockerController $dockerController */ $dockerController = $container->get(\AIO\Controller\DockerController::class); $dockerActionManager->ConnectMasterContainerToNetwork(); $dockerController->StartDomaincheckContainer(); // Check if bypass_mastercontainer_update is provided on the URL, a special developer mode to bypass a mastercontainer update and use local image. $params = $request->getQueryParams(); $bypass_mastercontainer_update = isset($params['bypass_mastercontainer_update']); $bypass_container_update = isset($params['bypass_container_update']); $skip_domain_validation = isset($params['skip_domain_validation']); return $view->render($response, 'containers.twig', [ 'domain' => $configurationManager->domain, 'apache_port' => $configurationManager->apachePort, 'borg_backup_host_location' => $configurationManager->borgBackupHostLocation, 'borg_remote_repo' => $configurationManager->borgRemoteRepo, 'borg_public_key' => $configurationManager->getBorgPublicKey(), 'nextcloud_password' => $configurationManager->getAndGenerateSecret('NEXTCLOUD_PASSWORD'), 'containers' => (new \AIO\ContainerDefinitionFetcher($container->get(\AIO\Data\ConfigurationManager::class), $container))->FetchDefinition(), 'borgbackup_password' => $configurationManager->getAndGenerateSecret('BORGBACKUP_PASSWORD'), 'is_mastercontainer_update_available' => ( $bypass_mastercontainer_update ? false : $dockerActionManager->IsMastercontainerUpdateAvailable() ), 'has_backup_run_once' => $configurationManager->hasBackupRunOnce(), 'is_backup_container_running' => $dockerActionManager->isBackupContainerRunning(), 'backup_exit_code' => $dockerActionManager->GetBackupcontainerExitCode(), 'is_instance_restore_attempt' => $configurationManager->instanceRestoreAttempt, 'borg_backup_mode' => $configurationManager->backupMode, 'was_start_button_clicked' => $configurationManager->wasStartButtonClicked, 'has_update_available' => $dockerActionManager->isAnyUpdateAvailable(), 'last_backup_time' => $configurationManager->getLastBackupTime(), 'backup_times' => $configurationManager->getBackupTimes(), 'current_channel' => $dockerActionManager->GetCurrentChannel(), 'is_clamav_enabled' => $configurationManager->isClamavEnabled, 'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled, 'is_collabora_enabled' => $configurationManager->isCollaboraEnabled, 'is_talk_enabled' => $configurationManager->isTalkEnabled, 'borg_restore_password' => $configurationManager->borgRestorePassword, 'daily_backup_time' => $configurationManager->getDailyBackupTime(), 'is_daily_backup_running' => $configurationManager->isDailyBackupRunning(), 'timezone' => $configurationManager->timezone, 'skip_domain_validation' => $configurationManager->shouldDomainValidationBeSkipped($skip_domain_validation), 'talk_port' => $configurationManager->talkPort, 'collabora_dictionaries' => $configurationManager->collaboraDictionaries, 'collabora_additional_options' => $configurationManager->collaboraAdditionalOptions, 'automatic_updates' => $configurationManager->areAutomaticUpdatesEnabled(), 'is_backup_section_enabled' => !$configurationManager->disableBackupSection, 'is_imaginary_enabled' => $configurationManager->isImaginaryEnabled, 'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled, 'additional_backup_directories' => $configurationManager->getAdditionalBackupDirectoriesString(), 'nextcloud_datadir' => $configurationManager->nextcloudDatadirMount, 'nextcloud_mount' => $configurationManager->nextcloudMount, 'nextcloud_upload_limit' => $configurationManager->nextcloudUploadLimit, 'nextcloud_max_time' => $configurationManager->nextcloudMaxTime, 'nextcloud_memory_limit' => $configurationManager->nextcloudMemoryLimit, 'is_dri_device_enabled' => $configurationManager->nextcloudEnableDriDevice, 'is_nvidia_gpu_enabled' => $configurationManager->enableNvidiaGpu, 'is_talk_recording_enabled' => $configurationManager->isTalkRecordingEnabled, 'is_docker_socket_proxy_enabled' => $configurationManager->isDockerSocketProxyEnabled, 'is_harp_enabled' => $configurationManager->isHarpEnabled, 'is_whiteboard_enabled' => $configurationManager->isWhiteboardEnabled, 'community_containers' => $configurationManager->listAvailableCommunityContainers(), 'community_containers_enabled' => $configurationManager->aioCommunityContainers, 'bypass_container_update' => $bypass_container_update, ]); })->setName('profile'); $app->get('/login', function (Request $request, Response $response, array $args) use ($container) { $view = Twig::fromRequest($request); /** @var \AIO\Docker\DockerActionManager $dockerActionManager */ $dockerActionManager = $container->get(\AIO\Docker\DockerActionManager::class); return $view->render($response, 'login.twig', [ 'is_login_allowed' => $dockerActionManager->isLoginAllowed(), ]); }); $app->get('/setup', function (Request $request, Response $response, array $args) use ($container) { $view = Twig::fromRequest($request); /** @var \AIO\Data\Setup $setup */ $setup = $container->get(\AIO\Data\Setup::class); if(!$setup->CanBeInstalled()) { return $view->render( $response, 'already-installed.twig' ); } return $view->render( $response, 'setup.twig', [ 'password' => $setup->Setup(), ] ); }); $app->get('/log', function (Request $request, Response $response, array $args) use ($container) { $params = $request->getQueryParams(); $id = $params['id'] ?? ''; if (!str_starts_with($id, 'nextcloud-aio-')) { throw new DI\NotFoundException(); } $view = Twig::fromRequest($request); return $view->render($response, 'log.twig', ['id' => $id]); }); // Auth Redirector $app->get('/', function (\Psr\Http\Message\RequestInterface $request, Response $response, array $args) use ($container) { /** @var \AIO\Auth\AuthManager $authManager */ $authManager = $container->get(\AIO\Auth\AuthManager::class); /** @var \AIO\Data\Setup $setup */ $setup = $container->get(\AIO\Data\Setup::class); if($setup->CanBeInstalled()) { return $response ->withHeader('Location', 'setup') ->withStatus(302); } if($authManager->IsAuthenticated()) { return $response ->withHeader('Location', 'containers') ->withStatus(302); } else { return $response ->withHeader('Location', 'login') ->withStatus(302); } }); $errorMiddleware = $app->addErrorMiddleware(false, true, true); // Set a custom Not Found handler, which doesn't pollute the app output with 404 errors. $errorMiddleware->setErrorHandler( \Slim\Exception\HttpNotFoundException::class, function (Request $request, Throwable $exception, bool $displayErrorDetails) use ($app) { $response = $app->getResponseFactory()->createResponse(); $response->getBody()->write('Not Found'); return $response->withStatus(404); }); $app->run(); ================================================ FILE: php/public/log-view.js ================================================ class LogViewer { // Configure the interval in seconds for autoloading log data. autoloadIntervalSec = 5; // Set to true to see some debug log statements in the browser console. debugLog = false; // Don't touch these, please. containerId; apiBaseUrl = 'api/docker/logs'; autoloadIntervalId = null; logElem; lastLogTimestamp = ''; autoloadingDisabledFromButton = false; loaderElem; dataLoadingLock; constructor() { const id = document.body.dataset.containerId; if (typeof(id) !== 'string' || !id.startsWith('nextcloud-aio-')) { throw new Exception('Invalid container ID'); } this.containerId = id; this.logElem = document.querySelector('pre'); this.loaderElem = document.querySelector('.loader'); this.initAutoloadingControls(); // Enable automatic log data loading. this.startAutoloading(); } startAutoloading() { // Load log data immediately. this.loadAndAppendLogData(); // Load new log data repeatedly. this.debug("Starting autoloading"); this.autoloadIntervalId = setInterval(() => { if (this.isAutoloadingEnabled()) { this.loadAndAppendLogData(); } }, 5000); } stopAutoloading() { this.debug("Stopping autoloading"); clearInterval(this.autoloadIntervalId); this.autoloadIntervalId = null; } isAutoloadingEnabled() { return !!this.autoloadIntervalId; } getUrl() { return `${this.apiBaseUrl}?id=${this.containerId}&since=${this.lastLogTimestamp}`; } debug(...args) { if (this.debugLog) { console.debug('LogViewer:', ...args); } } // Load log data and append it to the DOM. loadAndAppendLogData() { if (this.dataLoadingLock) { this.debug("Another log data loading request is still running, cancelling this request"); return; } this.debug("Loading new log data"); this.dataLoadingLock = true; this.loaderElem.classList.remove('hidden'); fetch(this.getUrl()) .then((response) => { if (!response.ok) { throw new Error("Error while fetching log data!"); } return response; }) .then((response) => response.text()) .then((text) => { text = text.trim(); if (text.length === 0) { this.debug("Received no new log data from server"); return; } this.debug("Received", Math.round(text.length / 1024), "KB of new log data from server"); this.logElem.append(text + "\n"); this.scrollToBottom(); this.lastLogTimestamp = text.split("\n").at(-1)?.split(' ')[0] ?? ''; }) .finally(() => { this.dataLoadingLock = false; this.loaderElem.classList.add('hidden'); this.debug("Finished log data loading"); }) .catch((err) => console.error(err)); } scrollToBottom() { window.scrollTo(0, document.body.scrollHeight); } initAutoloadingControls() { // Provide a button that allows to manually disable the autoloading. const button = document.getElementById('autoloading-control'); const statusElem = document.getElementById('autoloading-status'); if (!button) { return; } button.addEventListener('click', (event) => { event.preventDefault(); if (this.isAutoloadingEnabled()) { this.stopAutoloading(); statusElem.textContent = 'disabled'; button.textContent = 'Enable'; this.autoloadingDisabledFromButton = true; } else { this.startAutoloading(); statusElem.textContent = 'enabled'; button.textContent = 'Disable'; this.autoloadingDisabledFromButton = false; } }); // Load new data immediately if the window gets visible to the user again (unless autoloading has been // disabled). document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') { this.debug("Window became visible"); if (!this.autoloadingDisabledFromButton) { this.startAutoloading(); } } else { this.debug("Window became hidden"); this.stopAutoloading(); } }); } } document.addEventListener("DOMContentLoaded", () => { new LogViewer(); }); ================================================ FILE: php/public/robots.txt ================================================ User-agent: * Disallow: / ================================================ FILE: php/public/second-tab-warning.js ================================================ const channel = new BroadcastChannel('tab') channel.postMessage('second-tab') // note that listener is added after posting the message channel.addEventListener('message', (msg) => { if (msg.data === 'second-tab') { // message received from 2nd tab document.getElementById('overlay').classList.add('loading') alert('Cannot open multiple instances. You can use AIO here by reloading the page.') } }); ================================================ FILE: php/public/style.css ================================================ :root { --color-nextcloud-blue: #0082c9; --color-nextcloud-logo: var(--color-nextcloud-blue); --color-main-background: white; --color-input-background: white; --color-main-text: black; --color-main-border: black; --color-main-border-hover: var(--color-main-border); --color-error: #db0606; --color-error-hover: #df2525; --color-error-text: #c20505; --color-success: #46ba61; --color-running: #ffd000; --color-primary-element: #00679e; --color-primary-element-hover: #005a8a; --color-primary-element-text: #ffffff; --color-primary-element-light: #e5eff5; --color-primary-element-light-hover: #dbe4ea; --color-primary-element-light-text: #00293f; --color-border-maxcontrast: #7d7d7d; --color-loader: #f3f3f3; --color-disabled: #d3d3d3; /* light gray background for disabled checkboxes */ --color-border-disabled: #a9a9a9; /* darker gray border for disabled checkboxes */ --color-text-disabled: #a9a9a9; /* matching label text color for disabled checkboxes */ --border: .5px; --border-hover: 2px; --border-radius: 7px; --border-radius-large: 12px; --default-font-size: 13px; --checkbox-size: 16px; --max-width: 580px; --container-top-margin: 20px; --container-bottom-margin: 20px; --container-padding: 2px; --container-height-calculation-difference: calc(var(--container-top-margin) + var(--container-bottom-margin)); --main-height-calculation-difference: calc(var(--container-height-calculation-difference) + calc(var(--container-padding) * 2)); --main-padding: 50px; } /* Breakpoint calculation: 580px (max-width) + 100px (main-padding * 2) + 200px (additional space) = 880px Note: Unfortunately, it's not possible to calculate this dynamically using CSS variables in media queries */ @media only screen and (max-width: 880px) { :root { --container-top-margin: 50px; --container-bottom-margin: 0px; } } [data-theme="dark"] { --color-main-background: #171717; --color-input-background: #ebebeb; --color-main-text: #ebebeb; --color-nextcloud-logo: var(--color-main-text); --color-main-border: var(--color-border-maxcontrast); --color-main-border-hover: var(--color-main-text); --color-error: #ff3333; --color-error-hover: #ff6666; --color-error-text: #ff8080; --color-primary-element:#0091f2; --color-primary-element-hover:#079cff; --color-primary-element-text:#000000; --color-primary-element-light:#14232c; --color-primary-element-light-hover:#1e2d35; --color-primary-element-light-text:#99d3f9; --color-loader: var(--color-border-maxcontrast); --border-hover: var(--border); } html, body { padding: 0; margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; background-color: var(--color-main-background); color: var(--color-main-text); } a { text-decoration: none; color: var(--color-primary-element); } a:hover { color: var(--color-primary-element-hover); } a.button, input[type="submit"] { padding: 8px 16px; width: auto; height: 34px; cursor: pointer; background-color: var(--color-primary-element); font-weight: bold; border-radius: var(--border-radius); margin: 3px 3px 3px 0; font-size: var(--default-font-size); color: var(--color-primary-element-text); border: none; outline: none; } a.button:focus, input[type="submit"]:focus { outline: 2px solid var(--color-main-border); } a.button:hover, input[type="submit"]:hover { background-color: var(--color-primary-element-hover); } a.button.light:hover, input[type="submit"].light:hover { background-color: var(--color-primary-element-light); color: var(--color-primary-element-light-text); } a.button.light, input[type="submit"].light { background-color: var(--color-primary-element-light); } a.button.error, input[type="submit"].error { background-color: var(--color-error); } a.button.error:hover, input[type="submit"].error:hover { background-color: var(--color-error-hover); } summary { cursor: pointer; } ul { list-style: none; padding: 0; } li { padding-bottom: 5px; text-indent: 0; padding-left: 0; } span.error { background-color: var(--color-error); } div.toast.error { border-left-color: var(--color-error); } .status { display: inline-block; height: var(--checkbox-size); width: var(--checkbox-size); vertical-align: text-bottom; border-radius: 50% } span.success { background-color: var(--color-success); } span.running { background-color: var(--color-running); } div.toast.success { border-left-color: var(--color-success); } div.toast { border-left: 3px solid; right: 10px; min-width: 200px; box-shadow: 0 0 6px 0 rgba(77, 77, 77, 0.3); padding: 12px; margin-top: 45px; position: fixed; z-index: 1000; border-radius: var(--border-radius); background: var(--color-main-background) none; color: var(--color-main-text); } .nextcloud-logo { margin-left: auto; margin-right: auto; display: block; color: var(--color-nextcloud-logo); } .fallback-text { display: none; } svg:not(:has(use)) .fallback-text { display: block; } .login { padding: 50px; background-color: var(--color-main-background); color: var(--color-main-text); width: 500px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: var(--border-radius-large); } .login > .monospace { font-family: monospace, monospace, system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; font-size: 17px; } .login > form > input[type="password"], .login > form > input[type="text"], .login > form > input[type="submit"] { width: 100%; } .login > img { margin-left: auto; margin-right: auto; display: block; } .login a.button, .login input[type="submit"] { margin-left: auto; margin-right: auto; display: block; text-align: center; padding: 0px; align-content: center; } .wrapper { min-height: 100dvh; min-width: 100vw; position: fixed; width: 100vw; background-image: url("img/jo-myoung-hee-fluid.webp"); background-position: center; background-repeat: no-repeat; background-size: cover; box-sizing: border-box; overflow: hidden; } html[data-theme="dark"] .wrapper { background-image: url("img/jo-myoung-hee-fluid-dark.webp"); } form { margin: 0; } input[type="text"], input[type="password"], select { padding-left: 8px; padding-right: 8px; height: 34px; margin-bottom: 15px; border-radius: var(--border-radius); border: var(--border) solid var(--color-border-maxcontrast); background: var(--color-main-background); color: var(--color-main-text); } input[type="text"]:hover, input[type="password"]:hover, select:hover { border: var(--border-hover) solid var(--color-main-border-hover); } textarea { border-radius: var(--border-radius); border: .5px solid var(--color-main-border); max-width: 100%; } input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus { border: 1px solid var(--color-main-border); } /* Scroll bar for dark mode */ html[data-theme="dark"] ::-webkit-scrollbar { width: 8px; /* Width of the scroll bar */ } html[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: #444; /* Dark mode scrollbar thumb color */ border-radius: 4px; /* Rounded corners for the thumb */ } html[data-theme="dark"] ::-webkit-scrollbar-track { background-color: #333; /* Dark mode scrollbar track color */ } /* Scroll bar for light mode */ ::-webkit-scrollbar { width: 8px; /* Width of the scroll bar */ } ::-webkit-scrollbar-thumb { background-color: #888; /* Light mode scrollbar thumb color */ border-radius: 4px; /* Rounded corners for the thumb */ } ::-webkit-scrollbar-track { background-color: #f0f0f0; /* Light mode scrollbar track color */ } .container { margin: var(--container-top-margin) auto var(--container-bottom-margin) auto; padding: var(--container-padding); max-width: calc(var(--max-width) + calc(var(--main-padding) * 2) + 8px); background-color: var(--color-main-background); border-radius: var(--border-radius-large); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); max-height: calc(100dvh - var(--container-height-calculation-difference)); overflow: hidden; } main { padding-left: var(--main-padding); padding-right: var(--main-padding); background-color: transparent; /* transparent, since color comes from outer container */ color: var(--color-main-text); max-height: calc(100dvh - var(--main-height-calculation-difference)); overflow-y: auto; box-sizing: border-box; word-break: break-word; max-width: calc(var(--max-width) + calc(var(--main-padding) * 2)); margin: 0 auto; padding-bottom: var(--main-padding); } .logo { color: white; height: 50px; width: 62px; position: absolute; left: 12px; top: 1px; bottom: 1px; } header { position: fixed; top: 0; width: 100%; background-color: transparent; height: 50px; justify-content: space-between; align-items: center; display: flex; padding: 0 20px; z-index: 1000; } header > form { margin-left: auto; margin-right: 30px; } /* Standard styling for enabled checkboxes */ input[type="checkbox"]:not(:disabled) { width: var(--checkbox-size); height: var(--checkbox-size); -webkit-appearance: none; /* remove default styling */ -moz-appearance: none; appearance: none; border: 1px solid var(--color-primary-element); border-radius: 2px; cursor: pointer; position: relative; vertical-align: middle; /* align checkbox vertically with text */ margin-top: -1px; /* adjust for better alignment */ } /* Hover effects for enabled checkboxes */ input[type="checkbox"]:not(:disabled):hover { border-color: var(--color-primary-element-hover); } /* Checkmark styling for enabled checkboxes */ input[type="checkbox"]:checked:not(:disabled) { background-color: var(--color-primary-element); border-color: var(--color-border-maxcontrast); } input[type="checkbox"]:checked:not(:disabled)::after { content: ''; /* Creates a pseudo-element for the checkmark */ position: absolute; /* Positions it absolutely */ left: 4px; /* Positioning of the checkmark */ top: 0; /* Positioning of the checkmark */ width: 4px; /* Width of the checkmark */ height: 9px; /* Height of the checkmark */ border: solid white; /* Color of the checkmark */ border-width: 0 2px 3px 0; /* Creates the checkmark shape */ transform: rotate(45deg); /* Rotates to form a checkmark */ } /* Styling for disabled checkboxes (grayed out, no hover, no pointer) */ input[type="checkbox"]:disabled:not(:checked) { background-color: var(--color-disabled); border-color: var(--color-border-disabled); cursor: default; opacity: 0.5; /* Makes the checkbox appear faded */ } /* Styling for disabled checked checkboxes (no pointer) */ input[type="checkbox"]:disabled:checked { cursor: default; } input[type="checkbox"]:disabled:hover { border-color: var(--color-border-disabled); /* Keeps disabled state without hover effect */ } /* General Label styling */ label { cursor: pointer; margin-left: 4px; line-height: var(--checkbox-size); } /* Label cursor for disabled checkboxes */ input[type="checkbox"]:disabled + label { cursor: default; } /* Label styling for disabled, not checked checkboxes */ input[type="checkbox"]:disabled:not(:checked) + label { color: var(--color-text-disabled); } .loading { color: grey; } #overlay { position: fixed; /* Sit on top of the page content */ display: none; /* Hidden by default */ width: 100%; /* Full width (cover the whole page) */ height: 100%; /* Full height (cover the whole page) */ top: 0; left: 0; background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */ z-index: 2; } #overlay.loading { display: grid; justify-items: center; row-gap: 2rem; } #overlay #overlay-log.visible { visibility: visible; opacity: 1; transition: opacity 1s ease-in; } #overlay #overlay-log { visibility: hidden; opacity: 0; align-self: start; width: 300px; height: 200px; border-radius: var(--border-radius-large); border: solid thin rgb(192, 192, 192); } .overlay-iframe { padding: 1rem; } .loader { border: 16px solid var(--color-loader); border-radius: 50%; border-top: 16px solid var(--color-nextcloud-blue); width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; /* Safari */ animation: spin 2s linear infinite; align-self: end; } /* Safari */ @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* General theme button styling */ #theme-toggle { position: fixed; /* Keep the button in the same position */ right: 30px; /* Adjust the distance from the right */ bottom: 30px; /* Adjust the distance from the bottom */ background-color: transparent; /* Make the background transparent */ border: none; /* Remove border */ font-size: 36px; /* Adjust font size */ cursor: pointer; /* Change cursor to pointer */ outline: none; z-index: 9999; /* Ensures the icon is on top of every layer */ } /* Icon styling: default state */ #theme-icon { display: inline-block; border-radius: 50%; /* Round shape */ position: relative; /* For the pseudo-element positioning */ transition: box-shadow 0.3s, background-color 0.3s; /* Smooth transition for hover effect */ opacity: 0.6; /* Slightly transparent by default */ filter: grayscale(100%); /* Make the icon black and white */ } /* Create the inner glow effect with ::after */ #theme-icon::after { content: ''; /* Empty content for the pseudo-element */ position: absolute; top: 50%; left: 50%; width: 0px; /* Invisible dot */ height: 0px; /* Invisible dot */ background-color: transparent; /* Invisible by default */ border-radius: 50%; /* Circle shape */ transform: translate(-50%, -50%); /* Center the dot */ transition: box-shadow 0.3s, background-color 0.3s; /* Smooth transition for hover */ } /* Hover effect for both light and dark modes */ #theme-toggle:hover #theme-icon { position: relative; /* Ensures stacking order */ filter: grayscale(0%); /* Restore full color */ opacity: 1; /* Fully visible on hover */ } /* Inner glow when hovered */ #theme-toggle:hover #theme-icon::after { box-shadow: 0 0 40px 40px rgba(128, 128, 128, 0.4); /* Blur effect from inside */ background-color: rgba(128, 128, 128, 0.2); /* Light glow inside */ } /* Remove hover effects when not hovering */ #theme-toggle:not(:hover) #theme-icon { opacity: 0.6; /* Slightly transparent */ } /* Office Suite Feature Cards */ .office-suite-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0; align-items: stretch; } .office-radio { display: none; } .office-card { position: relative; border: 2px solid var(--color-border-maxcontrast); border-radius: var(--border-radius-large); padding: 20px; cursor: pointer; transition: all 0.3s ease; background-color: var(--color-main-background); display: flex; flex-direction: column; } .office-card-disabled { opacity: 50%; pointer-events: none; } .office-card:hover { border-color: var(--color-primary-element); box-shadow: 0 4px 12px rgba(0, 130, 201, 0.15); transform: translateY(-2px); } #office-collabora:checked + .office-card, #office-onlyoffice:checked + .office-card { border-color: var(--color-nextcloud-blue); background: linear-gradient(135deg, rgba(0, 130, 201, 0.08) 0%, rgba(0, 130, 201, 0.02) 100%); } [data-theme="dark"] #office-collabora:checked + .office-card, [data-theme="dark"] #office-onlyoffice:checked + .office-card { background: linear-gradient(135deg, rgba(0, 145, 242, 0.15) 0%, rgba(0, 145, 242, 0.03) 100%); } .office-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; } .office-card h4 { margin: 0; height: 24px; font-size: 18px; font-weight: 600; color: var(--color-main-text); } .office-checkmark { flex-shrink: 0; display: none; } #office-collabora:checked + .office-card .office-checkmark, #office-onlyoffice:checked + .office-card .office-checkmark { display: block; } .office-features { list-style: none; padding: 0; margin: 0; } .office-features li { position: relative; padding-left: 20px; margin-bottom: 4px; font-size: var(--default-font-size); line-height: 1.5; color: var(--color-main-text); } .office-features li::before { content: '•'; position: absolute; left: 6px; color: var(--color-nextcloud-blue); font-weight: bold; } .office-checkbox { position: absolute; opacity: 0; pointer-events: none; } .office-learn-more { display: inline-flex; align-items: center; margin-top: 12px; color: var(--color-primary-element); text-decoration: none; font-size: var(--default-font-size); font-weight: 500; transition: color 0.2s ease; } .office-learn-more:hover { color: var(--color-primary-element-hover); } .office-learn-more svg { transition: transform 0.2s ease; } .office-learn-more:hover svg { transform: translateX(3px); } .office-none-card { text-align: center; margin: 12px 0 20px 0; } .office-none-label { display: inline-flex; align-items: center; font-size: 13px; color: var(--color-primary-element); cursor: pointer; opacity: 0.7; transition: opacity 0.2s ease; padding: 8px 12px; border-radius: var(--border-radius); } .office-none-label:hover { opacity: 1; background-color: var(--color-primary-element-light); } #office-none:checked + .office-none-label { opacity: 1; font-weight: 600; } /* Responsive adjustments for mobile */ @media only screen and (max-width: 800px) { .office-suite-cards { grid-template-columns: 1fr; } } ================================================ FILE: php/public/timezone.js ================================================ document.addEventListener("DOMContentLoaded", function(event) { // timezone let timezone = document.getElementById("timezone"); if (timezone) { timezone.value = Intl.DateTimeFormat().resolvedOptions().timeZone } }); ================================================ FILE: php/public/toggle-dark-mode.js ================================================ // Function to toggle theme function toggleTheme() { const currentTheme = document.documentElement.getAttribute('data-theme'); const newTheme = (currentTheme === 'dark') ? '' : 'dark'; // Toggle between no theme and dark theme setThemeToDOM(newTheme); localStorage.setItem('theme', newTheme); // Change the icon based on the current theme setThemeIcon(newTheme); } function setThemeToDOM(value) { // Set the theme to the root document and all possible iframe documents (so they can adapt their styling, too). const documents = [document, Array.from(document.querySelectorAll('iframe')).map((iframe) => iframe.contentDocument)].flat() documents.forEach((doc) => doc.documentElement.setAttribute('data-theme', value)); } function getSavedTheme() { return localStorage.getItem('theme') ?? ''; } // Function to apply theme-icon update function setThemeIcon(theme) { if (theme === 'dark') { document.getElementById('theme-icon').textContent = '☀️'; // Sun icon for dark mode } else { document.getElementById('theme-icon').textContent = '🌙'; // Moon icon for light mode } } // Immediately apply the saved theme to avoid flickering setThemeToDOM(getSavedTheme()); // Apply theme when the page loads document.addEventListener('DOMContentLoaded', () => setThemeIcon(getSavedTheme())); ================================================ FILE: php/session/.gitkeep ================================================ ================================================ FILE: php/src/Auth/AuthManager.php ================================================ configurationManager->password, $password); } public function CheckToken(string $token) : bool { return hash_equals($this->configurationManager->aioToken, $token); } public function SetAuthState(bool $isLoggedIn) : void { if (!$this->IsAuthenticated() && $isLoggedIn === true) { $date = new DateTime(); $dateTime = $date->getTimestamp(); $_SESSION['date_time'] = $dateTime; $df = disk_free_space(DataConst::GetSessionDirectory()); if ($df !== false && (int)$df < 10240) { error_log(DataConst::GetSessionDirectory() . " has only less than 10KB free space. The login might not succeed because of that!"); } file_put_contents(DataConst::GetSessionDateFile(), (string)$dateTime); } $_SESSION[self::SESSION_KEY] = $isLoggedIn; } public function IsAuthenticated() : bool { return isset($_SESSION[self::SESSION_KEY]) && $_SESSION[self::SESSION_KEY] === true; } } ================================================ FILE: php/src/Auth/PasswordGenerator.php ================================================ words[random_int(0, 7775)]; } return $password; } } ================================================ FILE: php/src/Container/AioVariables.php ================================================ variables[] = $variable; } /** * @return string[] */ public function GetVariables() : array { return $this->variables; } } ================================================ FILE: php/src/Container/Container.php ================================================ dockerActionManager->GetAndGenerateSecretWrapper($this->uiSecret); } /** * @throws JsonException */ public function GetRunningState() : ContainerState { return $this->dockerActionManager->GetContainerRunningState($this); } /** * @throws JsonException */ public function GetRestartingState() : ContainerState { return $this->dockerActionManager->GetContainerRestartingState($this); } public function GetUpdateState() : VersionState { return $this->dockerActionManager->GetContainerUpdateState($this); } public function GetStartingState() : ContainerState { return $this->dockerActionManager->GetContainerStartingState($this); } } ================================================ FILE: php/src/Container/ContainerEnvironmentVariables.php ================================================ variables[] = $variable; } /** * @return string[] */ public function GetVariables() : array { return $this->variables; } } ================================================ FILE: php/src/Container/ContainerPort.php ================================================ ports[] = $port; } /** * @return ContainerPort[] */ public function GetPorts() : array { return $this->ports; } } ================================================ FILE: php/src/Container/ContainerState.php ================================================ volumes[] = $volume; } /** * @return ContainerVolume[] */ public function GetVolumes() : array { return $this->volumes; } } ================================================ FILE: php/src/Container/VersionState.php ================================================ FetchDefinition(); foreach ($containers as $container) { if ($container->identifier === $id) { return $container; } } throw new \Exception("The provided id " . $id . " was not found in the container definition."); } /** * @return array */ private function GetDefinition(): array { $data = json_decode((string)file_get_contents(DataConst::GetContainersDefinitionPath()), true, 512, JSON_THROW_ON_ERROR); $additionalContainerNames = []; foreach ($this->configurationManager->aioCommunityContainers as $communityContainer) { if ($communityContainer !== '') { $path = DataConst::GetCommunityContainersDirectory() . '/' . $communityContainer . '/' . $communityContainer . '.json'; $additionalData = json_decode((string)file_get_contents($path), true, 512, JSON_THROW_ON_ERROR); $data = array_merge_recursive($data, $additionalData); if (isset($additionalData['aio_services_v1'][0]['display_name']) && $additionalData['aio_services_v1'][0]['display_name'] !== '') { // Store container_name of community containers in variable for later $additionalContainerNames[] = $additionalData['aio_services_v1'][0]['container_name']; } } } $containers = []; foreach ($data['aio_services_v1'] as $entry) { if ($entry['container_name'] === 'nextcloud-aio-clamav') { if (!$this->configurationManager->isClamavEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-onlyoffice') { if (!$this->configurationManager->isOnlyofficeEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-collabora') { if (!$this->configurationManager->isCollaboraEnabled) { continue; } if ($this->configurationManager->isCollaboraSubscriptionEnabled()) { $entry['image'] = 'ghcr.io/nextcloud-releases/aio-collabora-online'; } } elseif ($entry['container_name'] === 'nextcloud-aio-talk') { if (!$this->configurationManager->isTalkEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-talk-recording') { if (!$this->configurationManager->isTalkRecordingEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-imaginary') { if (!$this->configurationManager->isImaginaryEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-fulltextsearch') { if (!$this->configurationManager->isFulltextsearchEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-docker-socket-proxy') { if (!$this->configurationManager->isDockerSocketProxyEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-harp') { if (!$this->configurationManager->isHarpEnabled) { continue; } } elseif ($entry['container_name'] === 'nextcloud-aio-whiteboard') { if (!$this->configurationManager->isWhiteboardEnabled) { continue; } } $ports = new ContainerPorts(); if (isset($entry['ports'])) { foreach ($entry['ports'] as $value) { $ports->AddPort( new ContainerPort( $value['port_number'], $value['ip_binding'], $value['protocol'] ) ); } } $volumes = new ContainerVolumes(); if (isset($entry['volumes'])) { foreach ($entry['volumes'] as $value) { if($value['source'] === '%BORGBACKUP_HOST_LOCATION%') { $value['source'] = $this->configurationManager->borgBackupHostLocation; if($value['source'] === '') { continue; } } if($value['source'] === '%NEXTCLOUD_MOUNT%') { $value['source'] = $this->configurationManager->nextcloudMount; if($value['source'] === '') { continue; } } elseif ($value['source'] === '%NEXTCLOUD_DATADIR%') { $value['source'] = $this->configurationManager->nextcloudDatadirMount; if ($value['source'] === '') { continue; } } elseif ($value['source'] === '%WATCHTOWER_DOCKER_SOCKET_PATH%') { $value['source'] = $this->configurationManager->dockerSocketPath; if($value['source'] === '') { continue; } } elseif ($value['source'] === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') { $value['source'] = $this->configurationManager->trustedCacertsDir; if($value['source'] === '') { continue; } } if ($value['destination'] === '%NEXTCLOUD_MOUNT%') { $value['destination'] = $this->configurationManager->nextcloudMount; if($value['destination'] === '') { continue; } } $volumes->AddVolume( new ContainerVolume( $value['source'], $value['destination'], $value['writeable'] ) ); } } $dependsOn = []; if (isset($entry['depends_on'])) { $valueDependsOn = $entry['depends_on']; if ($entry['container_name'] === 'nextcloud-aio-apache') { // Add community containers first and default ones last so that aio_variables works correctly $valueDependsOnTemp = []; foreach ($additionalContainerNames as $containerName) { $valueDependsOnTemp[] = $containerName; } $valueDependsOn = array_merge_recursive($valueDependsOnTemp, $valueDependsOn); } foreach ($valueDependsOn as $value) { if ($value === 'nextcloud-aio-clamav') { if (!$this->configurationManager->isClamavEnabled) { continue; } } elseif ($value === 'nextcloud-aio-onlyoffice') { if (!$this->configurationManager->isOnlyofficeEnabled) { continue; } } elseif ($value === 'nextcloud-aio-collabora') { if (!$this->configurationManager->isCollaboraEnabled) { continue; } } elseif ($value === 'nextcloud-aio-talk') { if (!$this->configurationManager->isTalkEnabled) { continue; } } elseif ($value === 'nextcloud-aio-talk-recording') { if (!$this->configurationManager->isTalkRecordingEnabled) { continue; } } elseif ($value === 'nextcloud-aio-imaginary') { if (!$this->configurationManager->isImaginaryEnabled) { continue; } } elseif ($value === 'nextcloud-aio-fulltextsearch') { if (!$this->configurationManager->isFulltextsearchEnabled) { continue; } } elseif ($value === 'nextcloud-aio-docker-socket-proxy') { if (!$this->configurationManager->isDockerSocketProxyEnabled) { continue; } } elseif ($value === 'nextcloud-aio-harp') { if (!$this->configurationManager->isHarpEnabled) { continue; } } elseif ($value === 'nextcloud-aio-whiteboard') { if (!$this->configurationManager->isWhiteboardEnabled) { continue; } } $dependsOn[] = $value; } } $variables = new ContainerEnvironmentVariables(); if (isset($entry['environment'])) { foreach ($entry['environment'] as $value) { $variables->AddVariable($value); } } $aioVariables = new AioVariables(); if (isset($entry['aio_variables'])) { foreach ($entry['aio_variables'] as $value) { $aioVariables->AddVariable($value); } } $displayName = ''; if (isset($entry['display_name'])) { $displayName = $entry['display_name']; } $restartPolicy = ''; if (isset($entry['restart'])) { $restartPolicy = $entry['restart']; } $maxShutdownTime = 10; if (isset($entry['stop_grace_period'])) { $maxShutdownTime = $entry['stop_grace_period']; } $internalPort = ''; if (isset($entry['internal_port'])) { $internalPort = $entry['internal_port']; } if (isset($entry['secrets'])) { // All secrets are registered with the configuration when they // are discovered so they can be later generated at time-of-use. foreach ($entry['secrets'] as $secret) { $this->configurationManager->registerSecret($secret); } } $uiSecret = ''; if (isset($entry['ui_secret'])) { $uiSecret = $entry['ui_secret']; } $devices = []; if (isset($entry['devices'])) { $devices = $entry['devices']; } $enableNvidiaGpu = false; if (isset($entry['enable_nvidia_gpu'])) { $enableNvidiaGpu = $entry['enable_nvidia_gpu']; } $capAdd = []; if (isset($entry['cap_add'])) { $capAdd = $entry['cap_add']; } $shmSize = -1; if (isset($entry['shm_size'])) { $shmSize = $entry['shm_size']; } $apparmorUnconfined = false; if (isset($entry['apparmor_unconfined'])) { $apparmorUnconfined = $entry['apparmor_unconfined']; } $backupVolumes = []; if (isset($entry['backup_volumes'])) { $backupVolumes = $entry['backup_volumes']; } $nextcloudExecCommands = []; if (isset($entry['nextcloud_exec_commands'])) { $nextcloudExecCommands = $entry['nextcloud_exec_commands']; } $readOnlyRootFs = false; if (isset($entry['read_only'])) { $readOnlyRootFs = $entry['read_only']; } $tmpfs = []; if (isset($entry['tmpfs'])) { $tmpfs = $entry['tmpfs']; } $init = true; if (isset($entry['init'])) { $init = $entry['init']; } $imageTag = '%AIO_CHANNEL%'; if (isset($entry['image_tag'])) { $imageTag = $entry['image_tag']; } $documentation = ''; if (isset($entry['documentation'])) { $documentation = $entry['documentation']; } $hideFromList = $entry['hide_from_list'] ?? false; $containers[] = new Container( $entry['container_name'], $displayName, $entry['image'], $restartPolicy, $maxShutdownTime, $ports, $internalPort, $volumes, $variables, $dependsOn, $uiSecret, $devices, $enableNvidiaGpu, $capAdd, $shmSize, $apparmorUnconfined, $backupVolumes, $nextcloudExecCommands, $readOnlyRootFs, $tmpfs, $init, $imageTag, $aioVariables, $documentation, $hideFromList, $this->container->get(DockerActionManager::class) ); } return $containers; } public function FetchDefinition(): array { return $this->GetDefinition(); } } ================================================ FILE: php/src/Controller/ConfigurationController.php ================================================ configurationManager->startTransaction(); if (isset($request->getParsedBody()['domain'])) { $domain = $request->getParsedBody()['domain'] ?? ''; $skipDomainValidation = isset($request->getParsedBody()['skip_domain_validation']); $this->configurationManager->setDomain($domain, $skipDomainValidation); } if (isset($request->getParsedBody()['current-master-password']) || isset($request->getParsedBody()['new-master-password'])) { $currentMasterPassword = $request->getParsedBody()['current-master-password'] ?? ''; $newMasterPassword = $request->getParsedBody()['new-master-password'] ?? ''; $this->configurationManager->changeMasterPassword($currentMasterPassword, $newMasterPassword); } if (isset($request->getParsedBody()['borg_backup_host_location']) || isset($request->getParsedBody()['borg_remote_repo'])) { $location = $request->getParsedBody()['borg_backup_host_location'] ?? ''; $borgRemoteRepo = $request->getParsedBody()['borg_remote_repo'] ?? ''; $this->configurationManager->setBorgLocationVars($location, $borgRemoteRepo); } if (isset($request->getParsedBody()['borg_restore_host_location']) || isset($request->getParsedBody()['borg_restore_remote_repo']) || isset($request->getParsedBody()['borg_restore_password'])) { $restoreLocation = $request->getParsedBody()['borg_restore_host_location'] ?? ''; $borgRemoteRepo = $request->getParsedBody()['borg_restore_remote_repo'] ?? ''; $borgPassword = $request->getParsedBody()['borg_restore_password'] ?? ''; $this->configurationManager->setBorgRestoreLocationVarsAndPassword($restoreLocation, $borgRemoteRepo, $borgPassword); } if (isset($request->getParsedBody()['daily_backup_time'])) { if (isset($request->getParsedBody()['automatic_updates'])) { $enableAutomaticUpdates = true; } else { $enableAutomaticUpdates = false; } if (isset($request->getParsedBody()['success_notification'])) { $successNotification = true; } else { $successNotification = false; } $dailyBackupTime = $request->getParsedBody()['daily_backup_time'] ?? ''; $this->configurationManager->setDailyBackupTime($dailyBackupTime, $enableAutomaticUpdates, $successNotification); } if (isset($request->getParsedBody()['delete_daily_backup_time'])) { $this->configurationManager->deleteDailyBackupTime(); } if (isset($request->getParsedBody()['additional_backup_directories'])) { $additionalBackupDirectories = $request->getParsedBody()['additional_backup_directories'] ?? ''; $this->configurationManager->setAdditionalBackupDirectories($additionalBackupDirectories); } if (isset($request->getParsedBody()['delete_timezone'])) { $this->configurationManager->deleteTimezone(); } if (isset($request->getParsedBody()['timezone'])) { $timezone = $request->getParsedBody()['timezone'] ?? ''; $this->configurationManager->timezone = $timezone; } if (isset($request->getParsedBody()['options-form'])) { $officeSuiteChoice = $request->getParsedBody()['office_suite_choice'] ?? ''; if ($officeSuiteChoice === 'collabora') { $this->configurationManager->isCollaboraEnabled = true; $this->configurationManager->isOnlyofficeEnabled = false; } elseif ($officeSuiteChoice === 'onlyoffice') { $this->configurationManager->isCollaboraEnabled = false; $this->configurationManager->isOnlyofficeEnabled = true; } else { $this->configurationManager->isCollaboraEnabled = false; $this->configurationManager->isOnlyofficeEnabled = false; } $this->configurationManager->isClamavEnabled = isset($request->getParsedBody()['clamav']); $this->configurationManager->isTalkEnabled = isset($request->getParsedBody()['talk']); $this->configurationManager->isTalkRecordingEnabled = isset($request->getParsedBody()['talk-recording']); $this->configurationManager->isImaginaryEnabled = isset($request->getParsedBody()['imaginary']); $this->configurationManager->isFulltextsearchEnabled = isset($request->getParsedBody()['fulltextsearch']); $this->configurationManager->isDockerSocketProxyEnabled = isset($request->getParsedBody()['docker-socket-proxy']); $this->configurationManager->isHarpEnabled = isset($request->getParsedBody()['harp']); $this->configurationManager->isWhiteboardEnabled = isset($request->getParsedBody()['whiteboard']); } if (isset($request->getParsedBody()['community-form'])) { $cc = $this->configurationManager->listAvailableCommunityContainers(); $enabledCC = []; /** * @psalm-suppress PossiblyNullIterator */ foreach ($request->getParsedBody() as $item) { if (array_key_exists($item , $cc)) { $enabledCC[] = $item; } } $this->configurationManager->aioCommunityContainers = $enabledCC; } if (isset($request->getParsedBody()['delete_collabora_dictionaries'])) { $this->configurationManager->deleteCollaboraDictionaries(); } if (isset($request->getParsedBody()['collabora_dictionaries'])) { $collaboraDictionaries = $request->getParsedBody()['collabora_dictionaries'] ?? ''; $this->configurationManager->collaboraDictionaries = $collaboraDictionaries; } if (isset($request->getParsedBody()['delete_collabora_additional_options'])) { $this->configurationManager->deleteAdditionalCollaboraOptions(); } if (isset($request->getParsedBody()['collabora_additional_options'])) { $additionalCollaboraOptions = $request->getParsedBody()['collabora_additional_options'] ?? ''; $this->configurationManager->collaboraAdditionalOptions = $additionalCollaboraOptions; } if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) { $this->configurationManager->deleteBorgBackupLocationItems(); } return $response->withStatus(201)->withHeader('Location', '.'); } catch (InvalidSettingConfigurationException $ex) { $response->getBody()->write($ex->getMessage()); return $response->withStatus(422); } finally { $this->configurationManager->commitTransaction(); } } } ================================================ FILE: php/src/Controller/DockerController.php ================================================ containerDefinitionFetcher->GetContainerById($id); // Start all dependencies first and then itself foreach($container->dependsOn as $dependency) { $this->PerformRecursiveContainerStart($dependency, $pullImage, $addToStreamingResponseBody); } // Don't start if container is already running // This is expected to happen if a container is defined in depends_on of multiple containers if ($container->GetRunningState() === ContainerState::Running) { error_log('Not starting ' . $id . ' because it was already started.'); return; } $this->dockerActionManager->DeleteContainer($container); $this->dockerActionManager->CreateVolumes($container); $this->dockerActionManager->PullImage($container, $pullImage, $addToStreamingResponseBody); $this->dockerActionManager->CreateContainer($container); $this->dockerActionManager->StartContainer($container, $addToStreamingResponseBody); $this->dockerActionManager->ConnectContainerToNetwork($container); } private function PerformRecursiveImagePull(string $id) : void { $container = $this->containerDefinitionFetcher->GetContainerById($id); // Pull all dependencies first and then itself foreach($container->dependsOn as $dependency) { $this->PerformRecursiveImagePull($dependency); } $this->dockerActionManager->PullImage($container, true); } public function PullAllContainerImages(): void { $id = self::TOP_CONTAINER; $this->PerformRecursiveImagePull($id); } public function GetLogs(Request $request, Response $response, array $args) : Response { $requestParams = $request->getQueryParams(); $id = ''; if (isset($requestParams['id']) && is_string($requestParams['id'])) { $id = $requestParams['id']; } if (str_starts_with($id, 'nextcloud-aio-')) { $since = $this->getTimestampForDockerLogsApiSince($requestParams['since'] ?? ''); $logs = $this->dockerActionManager->GetLogs($id, $since); } else { $logs = 'Container not found.'; } $body = $response->getBody(); $body->write($logs); return $response ->withStatus(200) ->withHeader('Content-Type', 'text/plain; charset=utf-8') ->withHeader('Content-Disposition', 'inline'); } public function StartBackupContainerBackup(Request $request, Response $response, array $args) : Response { // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $forceStopNextcloud = true; $this->startBackup($forceStopNextcloud, $addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function startBackup(bool $forceStopNextcloud = false, ?\Closure $addToStreamingResponseBody = null) : void { $this->configurationManager->backupMode = 'backup'; $id = self::TOP_CONTAINER; $this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody); $id = 'nextcloud-aio-borgbackup'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); } public function StartBackupContainerCheck(Request $request, Response $response, array $args) : Response { // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $this->checkBackup($addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function StartBackupContainerList(Request $request, Response $response, array $args) : Response { // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $this->listBackup($addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function checkBackup(?\Closure $addToStreamingResponseBody = null) : void { $this->configurationManager->backupMode = 'check'; $id = 'nextcloud-aio-borgbackup'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); } private function listBackup(?\Closure $addToStreamingResponseBody = null) : void { $this->configurationManager->backupMode = 'list'; $id = 'nextcloud-aio-borgbackup'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); } public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response { $this->configurationManager->startTransaction(); $this->configurationManager->backupMode = 'restore'; $this->configurationManager->selectedRestoreTime = $request->getParsedBody()['selected_restore_time'] ?? ''; $this->configurationManager->restoreExcludePreviews = isset($request->getParsedBody()['restore-exclude-previews']); $this->configurationManager->commitTransaction(); // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $id = self::TOP_CONTAINER; $forceStopNextcloud = true; $this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody); $id = 'nextcloud-aio-borgbackup'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function StartBackupContainerCheckRepair(Request $request, Response $response, array $args) : Response { $this->configurationManager->backupMode = 'check-repair'; // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $id = 'nextcloud-aio-borgbackup'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); // Restore to backup check which is needed to make the UI logic work correctly $this->configurationManager->backupMode = 'check'; // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response { $this->configurationManager->startTransaction(); $this->configurationManager->backupMode = 'test'; $this->configurationManager->instanceRestoreAttempt = false; $this->configurationManager->commitTransaction(); // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $id = self::TOP_CONTAINER; $this->PerformRecursiveContainerStop($id, true, $addToStreamingResponseBody); $id = 'nextcloud-aio-borgbackup'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function StartContainer(Request $request, Response $response, array $args) : Response { $uri = $request->getUri(); $host = $uri->getHost(); $port = $uri->getPort(); $path = $request->getParsedBody()['base_path'] ?? ''; if ($port === 8000) { error_log('The AIO_URL-port was discovered to be 8000 which is not expected. It is now set to 443.'); $port = 443; } if (isset($request->getParsedBody()['install_latest_major'])) { $installLatestMajor = '33'; } else { $installLatestMajor = ''; } $this->configurationManager->startTransaction(); $this->configurationManager->installLatestMajor = $installLatestMajor; // set AIO_URL $this->configurationManager->aioUrl = $host . ':' . (string)$port . $path; // set wasStartButtonClicked $this->configurationManager->wasStartButtonClicked = true; $this->configurationManager->commitTransaction(); // Do not pull container images in case 'bypass_container_update' is set via url params // Needed for local testing $pullImage = !isset($request->getParsedBody()['bypass_container_update']); if ($pullImage === false) { error_log('WARNING: Not pulling container images. Instead, using local ones.'); } // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); // Start container $this->startTopContainer($pullImage, $addToStreamingResponseBody); // Clear apcu cache in order to check if container updates are available // Temporarily disabled as it leads much faster to docker rate limits // apcu_clear_cache(); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function startTopContainer(bool $pullImage, ?\Closure $addToStreamingResponseBody = null) : void { $this->configurationManager->aioToken = bin2hex(random_bytes(24)); // Stop domaincheck since apache would not be able to start otherwise $this->StopDomaincheckContainer(); $id = self::TOP_CONTAINER; $this->PerformRecursiveContainerStart($id, $pullImage, $addToStreamingResponseBody); } public function StartWatchtowerContainer(Request $request, Response $response, array $args) : Response { // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $this->startWatchtower($addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function startWatchtower(?\Closure $addToStreamingResponseBody = null) : void { $id = 'nextcloud-aio-watchtower'; $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); } private function PerformRecursiveContainerStop(string $id, bool $forceStopNextcloud = false, ?\Closure $addToStreamingResponseBody = null) : void { $container = $this->containerDefinitionFetcher->GetContainerById($id); // This is a hack but no better solution was found for the meantime // Stop Collabora first to make sure it force-saves // See https://github.com/nextcloud/richdocuments/issues/3799 if ($id === self::TOP_CONTAINER && $this->configurationManager->isCollaboraEnabled) { $this->PerformRecursiveContainerStop('nextcloud-aio-collabora', false, $addToStreamingResponseBody); } if ($addToStreamingResponseBody !== null) { $addToStreamingResponseBody($container, "Stopping container"); } // Stop itself first and then all the dependencies if ($id !== 'nextcloud-aio-nextcloud') { $this->dockerActionManager->StopContainer($container); } else { // We want to stop the Nextcloud container after 10s and not wait for the configured stop_grace_period $this->dockerActionManager->StopContainer($container, $forceStopNextcloud); } foreach($container->dependsOn as $dependency) { $this->PerformRecursiveContainerStop($dependency, $forceStopNextcloud, $addToStreamingResponseBody); } } public function StopContainer(Request $request, Response $response, array $args) : Response { // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response); $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); $id = self::TOP_CONTAINER; $forceStopNextcloud = true; $this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody); // End streaming response $this->finalizeStreamingResponse($nonbufResp); return $nonbufResp; } public function stopTopContainer() : void { $id = self::TOP_CONTAINER; $this->PerformRecursiveContainerStop($id); } public function StartDomaincheckContainer() : void { # Don't start if domain is already set if ($this->configurationManager->domain !== '' || $this->configurationManager->wasStartButtonClicked) { return; } $id = 'nextcloud-aio-domaincheck'; $cacheKey = 'domaincheckWasStarted'; $domaincheckContainer = $this->containerDefinitionFetcher->GetContainerById($id); $apacheContainer = $this->containerDefinitionFetcher->GetContainerById(self::TOP_CONTAINER); // Don't start if apache is already running if ($apacheContainer->GetRunningState() === ContainerState::Running) { return; // Don't start if domaincheck is already running } elseif ($domaincheckContainer->GetRunningState() === ContainerState::Running) { $domaincheckWasStarted = apcu_fetch($cacheKey); // Start domaincheck again when 10 minutes are over by not returning here if($domaincheckWasStarted !== false && is_string($domaincheckWasStarted)) { return; } } $this->StopDomaincheckContainer(); try { $this->PerformRecursiveContainerStart($id); } catch (\Exception $e) { error_log('Could not start domaincheck container: ' . $e->getMessage()); } // Cache the start for 10 minutes apcu_add($cacheKey, '1', 600); } private function StopDomaincheckContainer() : void { $id = 'nextcloud-aio-domaincheck'; $this->PerformRecursiveContainerStop($id); } private function getStreamingResponseHtmlStart() : string { return << END; } private function startStreamingResponse(Response $response) : Response { $nonbufResp = $response ->withBody(new NonBufferedBody()) ->withHeader('Content-Type', 'text/html; charset=utf-8') ->withHeader('X-Accel-Buffering', 'no') ->withHeader('Content-Length', '-1') ->withHeader('Cache-Control', 'no-cache'); // Text written into this body is immediately sent to the client, without waiting for later content. $streamingResponseBody = $nonbufResp->getBody(); $streamingResponseBody->write($this->getStreamingResponseHtmlStart()); return $nonbufResp; } private function getAddToStreamingResponseBody(Response $nonbufResp) : ?\Closure { // Create a closure to pass around to the code, which should to the logging (because it e.g. decides // if it'll actually pull an image), but which should not need to know anything about the // wanted markup or formatting. $addToStreamingResponseBody = function (Container $container, string $message) use ($nonbufResp) : void { $nonbufResp->getBody()->write("
{$container->displayName}: {$message}
"); }; return $addToStreamingResponseBody; } private function finalizeStreamingResponse(Response $nonbufResp) : void { $nonbufResp->getBody()->write($this->getStreamingResponseHtmlEnd()); } private function getStreamingResponseHtmlEnd() : string { return "\n \n"; } private function getTimestampForDockerLogsApiSince(string $input) : string { if ($input === '') { return ''; } // We expect an RFC3339Nano string with Timezone UTC here, as docker will put out. // Unfortunately PHP doesn't support this format with nanoseconds, so we have to help // ourselves a little bit. // First we split off the nanoseconds. preg_match('/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})\.(\d{9}).*/', $input, $match); if (count($match) !== 3) { // The input doesn't match our expectations, it might be manipulated, we ignore it. return ''; } $datetime = \DateTimeImmutable::createFromFormat("Y-m-d\\TH:i:s", $match[1]); $nanoseconds = $match[2]; if ($datetime === false) { // Input was not parseable, it might be manipulated, we ignore it. return ''; } // Format the datetime as unix timestamp. $timestamp = $datetime->format('U'); // Increase the nanoseconds by 1, so we don't get the line with exactly the original datetime again. $nanoseconds = strval(intval($nanoseconds) + 1); // Now append the nanoseconds to the timestamp-string. return "{$timestamp}.{$nanoseconds}"; } } ================================================ FILE: php/src/Controller/LoginController.php ================================================ dockerActionManager->isLoginAllowed()) { $response->getBody()->write("The login is blocked since Nextcloud is running."); return $response->withHeader('Location', '.')->withStatus(422); } $password = $request->getParsedBody()['password'] ?? ''; if($this->authManager->CheckCredentials($password)) { $this->authManager->SetAuthState(true); return $response->withHeader('Location', '.')->withStatus(201); } $response->getBody()->write("The password is incorrect."); return $response->withHeader('Location', '.')->withStatus(422); } public function GetTryLogin(Request $request, Response $response, array $args) : Response { $token = $request->getQueryParams()['token'] ?? ''; if($this->authManager->CheckToken($token)) { $this->authManager->SetAuthState(true); return $response->withHeader('Location', '../..')->withStatus(302); } return $response->withHeader('Location', '../..')->withStatus(302); } public function Logout(Request $request, Response $response, array $args) : Response { $this->authManager->SetAuthState(false); return $response ->withHeader('Location', '../..') ->withStatus(302); } } ================================================ FILE: php/src/Cron/BackupNotification.php ================================================ get(\AIO\Docker\DockerActionManager::class); /** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */ $containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class); $id = 'nextcloud-aio-nextcloud'; $nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id); $backupExitCode = $dockerActionManager->GetBackupcontainerExitCode(); if ($backupExitCode === 0) { if (getenv('SEND_SUCCESS_NOTIFICATIONS') === "0") { error_log("Daily backup successful! Only logging successful backup and not sending backup notification since that has been disabled! You can get further info by looking at the backup logs in the AIO interface."); } else { $dockerActionManager->sendNotification($nextcloudContainer, 'Daily backup successful!', 'You can get further info by looking at the backup logs in the AIO interface.'); } } if ($backupExitCode > 0) { $dockerActionManager->sendNotification($nextcloudContainer, 'Daily backup failed!', 'You can get further info by looking at the backup logs in the AIO interface.'); } ================================================ FILE: php/src/Cron/CheckBackup.php ================================================ get(\AIO\Controller\DockerController::class); // Stop container and start backup check $dockerController->checkBackup(); ================================================ FILE: php/src/Cron/CheckFreeDiskSpace.php ================================================ get(\AIO\Docker\DockerActionManager::class); /** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */ $containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class); $id = 'nextcloud-aio-nextcloud'; $nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id); $df = disk_free_space(DataConst::GetDataDirectory()); if ($df !== false && (int)$df < 1024 * 1024 * 1024 * 5) { error_log("The drive that hosts the mastercontainer volume has less than 5 GB free space. Container updates and backups might not succeed due to that!"); $dockerActionManager->sendNotification($nextcloudContainer, 'Low on space!', 'The drive that hosts the mastercontainer volume has less than 5 GB free space. Container updates and backups might not succeed due to that!'); } ================================================ FILE: php/src/Cron/CreateBackup.php ================================================ get(\AIO\Controller\DockerController::class); // Stop container and start backup $dockerController->startBackup(); ================================================ FILE: php/src/Cron/OutdatedNotification.php ================================================ get(\AIO\Docker\DockerActionManager::class); /** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */ $containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class); $id = 'nextcloud-aio-nextcloud'; $nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id); $isNextcloudImageOutdated = $dockerActionManager->isNextcloudImageOutdated(); if ($isNextcloudImageOutdated === true) { $dockerActionManager->sendNotification($nextcloudContainer, 'AIO is outdated!', 'Please open the AIO interface or ask an administrator to update it. If you do not want to do it manually each time, you can enable the daily backup feature from the AIO interface which automatically updates all containers.', '/notify-all.sh'); } ================================================ FILE: php/src/Cron/PullContainerImages.php ================================================ get(\AIO\Controller\DockerController::class); // Pull all containers $dockerController->PullAllContainerImages(); ================================================ FILE: php/src/Cron/StartAndUpdateContainers.php ================================================ get(\AIO\Controller\DockerController::class); // Start apache $dockerController->startTopContainer(true); ================================================ FILE: php/src/Cron/StartContainers.php ================================================ get(\AIO\Controller\DockerController::class); // Start apache $dockerController->startTopContainer(false); ================================================ FILE: php/src/Cron/StopContainers.php ================================================ get(\AIO\Controller\DockerController::class); // Start apache $dockerController->stopTopContainer(); ================================================ FILE: php/src/Cron/UpdateMastercontainer.php ================================================ get(\AIO\Controller\DockerController::class); # Update the mastercontainer $dockerController->startWatchtower(); ================================================ FILE: php/src/Cron/UpdateNotification.php ================================================ get(\AIO\Docker\DockerActionManager::class); /** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */ $containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class); $id = 'nextcloud-aio-nextcloud'; $nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id); $isMastercontainerUpdateAvailable = $dockerActionManager->IsMastercontainerUpdateAvailable(); $isAnyUpdateAvailable = $dockerActionManager->isAnyUpdateAvailable(); if ($isMastercontainerUpdateAvailable === true) { $dockerActionManager->sendNotification($nextcloudContainer, 'Mastercontainer update available!', 'Please open your AIO interface to update it. If you do not want to do it manually each time, you can enable the daily backup feature from the AIO interface which also automatically updates the mastercontainer.'); } if ($isAnyUpdateAvailable === true) { $dockerActionManager->sendNotification($nextcloudContainer, 'Container updates available!', 'Please open your AIO interface to update them. If you do not want to do it manually each time, you can enable the daily backup feature from the AIO interface which also automatically updates your containers and your Nextcloud apps.'); } ================================================ FILE: php/src/Data/ConfigurationManager.php ================================================ $this->get('AIO_TOKEN', ''); set { $this->set('AIO_TOKEN', $value); } } public string $password { get => $this->get('password', ''); set { $this->set('password', $value); } } public bool $isDockerSocketProxyEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isDockerSocketProxyEnabled', false); set { $this->set('isDockerSocketProxyEnabled', $value); } } public bool $isHarpEnabled { get => $this->get('isHarpEnabled', false); set { $this->set('isHarpEnabled', $value); } } public bool $isWhiteboardEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isWhiteboardEnabled', true); set { $this->set('isWhiteboardEnabled', $value); } } public bool $restoreExcludePreviews { // Type-cast because old configs could have '1'/'' for this key. get => (bool) $this->get('restore-exclude-previews', false); set { $this->set('restore-exclude-previews', $value); } } public string $selectedRestoreTime { get => $this->get('selected-restore-time', ''); set { $this->set('selected-restore-time', $value); } } public string $backupMode { get => $this->get('backup-mode', ''); set { $this->set('backup-mode', $value); } } public bool $instanceRestoreAttempt { // Type-cast because old configs could have 1/'' for this key. get => (bool) $this->get('instance_restore_attempt', false); set { $this->set('instance_restore_attempt', $value); } } public string $aioUrl { get => $this->get('AIO_URL', ''); set { $this->set('AIO_URL', $value); } } public bool $wasStartButtonClicked { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('wasStartButtonClicked', false); set { $this->set('wasStartButtonClicked', $value); } } public string $installLatestMajor { // Type-cast because old configs could have integers for this key. get => (string) $this->get('install_latest_major', ''); set { $this->set('install_latest_major', $value); } } public bool $isClamavEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isClamavEnabled', false); set { $this->set('isClamavEnabled', $value); } } public bool $isOnlyofficeEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isOnlyofficeEnabled', false); set { $this->set('isOnlyofficeEnabled', $value); } } public bool $isCollaboraEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isCollaboraEnabled', true); set { $this->set('isCollaboraEnabled', $value); } } public bool $isTalkEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isTalkEnabled', true); set { $this->set('isTalkEnabled', $value); } } public bool $isTalkRecordingEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->isTalkEnabled && $this->get('isTalkRecordingEnabled', false); set { $this->set('isTalkRecordingEnabled', $this->isTalkEnabled && $value); } } public bool $isImaginaryEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isImaginaryEnabled', true); set { $this->set('isImaginaryEnabled', $value); } } public bool $isFulltextsearchEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isFulltextsearchEnabled', false); // Elasticsearch does not work on kernels without seccomp anymore. See https://github.com/nextcloud/all-in-one/discussions/5768 set { $this->set('isFulltextsearchEnabled', (!$this->collaboraSeccompDisabled && $value)); } } public string $domain { get => $this->get('domain', ''); set { $this->setDomain($value); } } public string $borgBackupHostLocation { get => $this->get('borg_backup_host_location', ''); set { $this->set('borg_backup_host_location', $value); } } public string $borgRemoteRepo { get => $this->get('borg_remote_repo', ''); set { $this->set('borg_remote_repo', $value); } } public string $borgRestorePassword { get => $this->get('borg_restore_password', ''); set { $this->set('borg_restore_password', $value); } } public string $apacheIpBinding { get => $this->getEnvironmentalVariableOrConfig('APACHE_IP_BINDING', 'apache_ip_binding', ''); set { $this->set('apache_ip_binding', $value); } } /** * @throws InvalidSettingConfigurationException */ public string $timezone { get => $this->get('timezone', ''); set { // This throws an exception if the validation fails. $this->validateTimezone($value); $this->set('timezone', $value); } } /** * @throws InvalidSettingConfigurationException */ public string $collaboraDictionaries { get => $this->get('collabora_dictionaries', ''); set { // This throws an exception if the validation fails. $this->validateCollaboraDictionaries($value); $this->set('collabora_dictionaries', $value); } } /** * @throws InvalidSettingConfigurationException */ public string $collaboraAdditionalOptions { get => $this->get('collabora_additional_options', ''); set { // This throws an exception if the validation fails. $this->validateCollaboraAdditionalOptions($value); $this->set('collabora_additional_options', $value); } } public array $aioCommunityContainers { get => explode(' ', $this->get('aio_community_containers', '')); set { $this->set('aio_community_containers', implode(' ', $value)); } } public string $turnDomain { get => $this->get('turn_domain', ''); set { $this->set('turn_domain', $value); } } public string $apachePort { get => $this->getEnvironmentalVariableOrConfig('APACHE_PORT', 'apache_port', '443'); set { $this->set('apache_port', $value); } } public string $talkPort { get => $this->getEnvironmentalVariableOrConfig('TALK_PORT', 'talk_port', '3478'); set { $this->set('talk_port', $value); } } public string $nextcloudMount { get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_MOUNT', 'nextcloud_mount', ''); set { $this->set('nextcloud_mount', $value); } } public string $nextcloudDatadirMount { get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_DATADIR', 'nextcloud_datadir', 'nextcloud_aio_nextcloud_data'); set { $this->set('nextcloud_datadir_mount', $value); } } public string $nextcloudUploadLimit { get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_UPLOAD_LIMIT', 'nextcloud_upload_limit', '16G'); set { $this->set('nextcloud_upload_limit', $value); } } public string $nextcloudMemoryLimit { get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_MEMORY_LIMIT', 'nextcloud_memory_limit', '512M'); set { $this->set('nextcloud_memory_limit', $value); } } public function getApacheMaxSize() : int { $uploadLimit = (int)rtrim($this->nextcloudUploadLimit, 'G'); return $uploadLimit * 1024 * 1024 * 1024; } public string $nextcloudMaxTime { get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_MAX_TIME', 'nextcloud_max_time', '3600'); set { $this->set('nextcloud_max_time', $value); } } public string $borgRetentionPolicy { get => $this->getEnvironmentalVariableOrConfig('BORG_RETENTION_POLICY', 'borg_retention_policy', '--keep-within=7d --keep-weekly=4 --keep-monthly=6'); set { $this->set('borg_retention_policy', $value); } } public string $fulltextsearchJavaOptions { get => $this->getEnvironmentalVariableOrConfig('FULLTEXTSEARCH_JAVA_OPTIONS', 'fulltextsearch_java_options', '-Xms512M -Xmx512M'); set { $this->set('fulltextsearch_java_options', $value); } } public string $dockerSocketPath { get => $this->getEnvironmentalVariableOrConfig('WATCHTOWER_DOCKER_SOCKET_PATH', 'docker_socket_path', '/var/run/docker.sock'); set { $this->set('docker_socket_path', $value); } } public string $trustedCacertsDir { get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_TRUSTED_CACERTS_DIR', 'trusted_cacerts_dir', ''); set { $this->set('trusted_cacerts_dir', $value); } } public string $nextcloudAdditionalApks { get => trim($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ADDITIONAL_APKS', 'nextcloud_additional_apks', 'imagemagick')); set { $this->set('nextcloud_addtional_apks', $value); } } public string $nextcloudAdditionalPhpExtensions { get => trim($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS', 'nextcloud_additional_php_extensions', 'imagick')); set { $this->set('nextcloud_additional_php_extensions', $value); } } public bool $collaboraSeccompDisabled { get => $this->booleanize($this->getEnvironmentalVariableOrConfig('COLLABORA_SECCOMP_DISABLED', 'collabora_seccomp_disabled', '')); set { $this->set('collabora_seccomp_disabled', $value); } } public bool $disableBackupSection { get => $this->booleanize($this->getEnvironmentalVariableOrConfig('AIO_DISABLE_BACKUP_SECTION', 'disable_backup_section', '')); set { $this->set('disable_backup_section', $value); } } public bool $nextcloudEnableDriDevice{ get => $this->booleanize($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_DRI_DEVICE', 'nextcloud_enable_dri_device', '')); set { $this->set('nextcloud_enable_dri_device', $value); } } public bool $enableNvidiaGpu { get => $this->booleanize($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_NVIDIA_GPU', 'enable_nvidia_gpu', '')); set { $this->set('enable_nvidia_gpu', $value); } } public bool $nextcloudKeepDisabledApps { get => $this->booleanize($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_KEEP_DISABLED_APPS', 'nextcloud_keep_disabled_apps', '')); set { $this->set('nextcloud_keep_disabled_apps', $value); } } private function getConfig() : array { if ($this->config === [] && file_exists(DataConst::GetConfigFile())) { $configContent = (string)file_get_contents(DataConst::GetConfigFile()); $this->config = json_decode($configContent, true, 512, JSON_THROW_ON_ERROR); } return $this->config; } private function get(string $key, mixed $fallbackValue = null) : mixed { return $this->getConfig()[$key] ?? $fallbackValue; } private function set(string $key, mixed $value) : void { $this->getConfig(); $this->config[$key] = $value; // Only write if this isn't called in between startTransaction() and commitTransaction(). if ($this->noWrite !== true) { $this->writeConfig(); } } /** * This allows to assign multiple attributes without saving the config to disk in between. It must be * followed by a call to commitTransaction(), which then writes all changes to disk. */ public function startTransaction() : void { $this->getConfig(); $this->noWrite = true; } /** * This allows to assign multiple attributes without saving the config to disk in between. */ public function commitTransaction() : void { try { $this->writeConfig(); } finally { $this->noWrite = false; } } public function getAndGenerateSecret(string $secretId) : string { if ($secretId === '') { return ''; } $secrets = $this->get('secrets', []); if (!isset($secrets[$secretId])) { $secrets[$secretId] = bin2hex(random_bytes(24)); $this->set('secrets', $secrets); } if ($secretId === 'BORGBACKUP_PASSWORD' && !file_exists(DataConst::GetBackupSecretFile())) { $this->doubleSafeBackupSecret($secrets[$secretId]); } return $secrets[$secretId]; } public function getRegisteredSecret(string $secretId) : string { if ($this->secrets[$secretId]) { return $this->getAndGenerateSecret($secretId); } throw new \Exception("The secret " . $secretId . " was not registered. Please check if it is defined in secrets of containers.json."); } public function registerSecret(string $secretId) : void { $this->secrets[$secretId] = true; } private function doubleSafeBackupSecret(string $borgBackupPassword) : void { file_put_contents(DataConst::GetBackupSecretFile(), $borgBackupPassword); } public function hasBackupRunOnce() : bool { if (!file_exists(DataConst::GetBackupKeyFile())) { return false; } else { return true; } } public function getLastBackupTime() : string { if (!file_exists(DataConst::GetBackupArchivesList())) { return ''; } $content = (string)file_get_contents(DataConst::GetBackupArchivesList()); $lastBackupLines = explode("\n", $content); $lastBackupLine = ""; if (count($lastBackupLines) >= 2) { $lastBackupLine = $lastBackupLines[sizeof($lastBackupLines) - 2]; } if ($lastBackupLine === "") { return ''; } $lastBackupTimes = explode(",", $lastBackupLine); $lastBackupTime = $lastBackupTimes[1]; if ($lastBackupTime === "") { return ''; } return $lastBackupTime; } public function getBackupTimes() : array { if (!file_exists(DataConst::GetBackupArchivesList())) { return []; } $content = (string)file_get_contents(DataConst::GetBackupArchivesList()); $backupLines = explode("\n", $content); $backupTimes = []; foreach($backupLines as $lines) { if ($lines !== "") { $backupTimesTemp = explode(',', $lines); $backupTimes[] = $backupTimesTemp[1]; } } // Reverse the array to list newest backup first $backupTimes = array_reverse($backupTimes); return $backupTimes; } public function getAioVersion() : string { $path = DataConst::GetAioVersionFile(); if ($path !== '' && file_exists($path)) { return trim((string)file_get_contents($path)); } return ''; } private function isx64Platform() : bool { if (php_uname('m') === 'x86_64') { return true; } else { return false; } } /** * @throws InvalidSettingConfigurationException * * We can't turn this into a private validation method because of the second argument. */ public function setDomain(string $domain, bool $skipDomainValidation) : void { // Validate that at least one dot is contained if (!str_contains($domain, '.')) { throw new InvalidSettingConfigurationException("Domain must contain at least one dot!"); } // Validate that no slashes are contained if (str_contains($domain, '/')) { throw new InvalidSettingConfigurationException("Domain must not contain slashes!"); } // Validate that no colons are contained if (str_contains($domain, ':')) { throw new InvalidSettingConfigurationException("Domain must not contain colons!"); } // Validate domain if (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) { throw new InvalidSettingConfigurationException("Domain is not a valid domain!"); } // Validate that it is not an IP-address if(filter_var($domain, FILTER_VALIDATE_IP)) { throw new InvalidSettingConfigurationException("Please enter a domain and not an IP-address!"); } // Skip domain validation if opted in to do so if ($this->shouldDomainValidationBeSkipped($skipDomainValidation)) { error_log('Skipping domain validation'); } else { $dnsRecordIP = gethostbyname($domain); if ($dnsRecordIP === $domain) { $dnsRecordIP = ''; } if (empty($dnsRecordIP)) { $record = dns_get_record($domain, DNS_AAAA); if (isset($record[0]['ipv6']) && !empty($record[0]['ipv6'])) { $dnsRecordIP = $record[0]['ipv6']; } } // Validate IP if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP)) { throw new InvalidSettingConfigurationException("DNS config is not set for this domain or the domain is not a valid domain! (It was found to be set to '" . $dnsRecordIP . "')"); } // Get the apache port $port = $this->apachePort; if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { if ($port === '443') { throw new InvalidSettingConfigurationException("It seems like the ip-address of the domain is set to an internal or reserved ip-address. This is not supported by the domain validation. (It was found to be set to '" . $dnsRecordIP . "'). Please set it to a public ip-address so that the domain validation can work or skip the domain validation!"); } else { error_log("Info: It seems like the ip-address of " . $domain . " is set to an internal or reserved ip-address. (It was found to be set to '" . $dnsRecordIP . "')"); } } // Check if port 443 is open $connection = @fsockopen($domain, 443, $errno, $errstr, 10); if ($connection) { fclose($connection); } else { throw new InvalidSettingConfigurationException("The domain is not reachable on Port 443 from within this container. Have you opened port 443/tcp in your router/firewall? If yes is the problem most likely that the router or firewall forbids local access to your domain. Or in other words: NAT loopback (Hairpinning) does not seem to work in your network. You can work around that by setting up a local DNS server and utilizing Split-Brain-DNS and configuring the daemon.json file of your docker daemon to use the local DNS server."); } // Get Instance ID $instanceID = $this->getAndGenerateSecret('INSTANCE_ID'); // set protocol if ($port !== '443') { $protocol = 'https://'; } else { $protocol = 'http://'; } // Check if response is correct $ch = curl_init(); if ($ch === false) { throw new InvalidSettingConfigurationException('Could not init curl! Please check the logs!'); } $testUrl = $protocol . $domain . ':443'; curl_setopt($ch, CURLOPT_URL, $testUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $response = (string)curl_exec($ch); # Get rid of trailing \n $response = str_replace("\n", "", $response); if ($response !== $instanceID) { error_log('The response of the connection attempt to "' . $testUrl . '" was: ' . $response); error_log('Expected was: ' . $instanceID); error_log('The error message was: ' . curl_error($ch)); $notice = "Domain does not point to this server or the reverse proxy is not configured correctly. See the mastercontainer logs for more details. ('sudo docker logs -f nextcloud-aio-mastercontainer')"; if ($port === '443') { $notice .= " If you should be using Cloudflare, make sure to disable the Cloudflare Proxy feature as it might block the domain validation. Same for any other firewall or service that blocks unencrypted access on port 443."; } else { error_log('Please follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#how-to-debug in order to debug things!'); } throw new InvalidSettingConfigurationException($notice); } } $this->startTransaction(); // Write domain // Don't set the domain via the attribute, or we create a loop. $this->set('domain', $domain); // Reset the borg restore password when setting the domain $this->borgRestorePassword = ''; $this->startTransaction(); $this->commitTransaction(); } public function getBaseDN() : string { $domain = $this->domain; if ($domain === "") { return ""; } return 'dc=' . implode(',dc=', explode('.', $domain)); } /** * @throws InvalidSettingConfigurationException */ public function setBorgLocationVars(string $location, string $repo) : void { $this->validateBorgLocationVars($location, $repo); $this->startTransaction(); $this->borgBackupHostLocation = $location; $this->borgRemoteRepo = $repo; $this->commitTransaction(); } private function validateBorgLocationVars(string $location, string $repo) : void { if ($location === '' && $repo === '') { throw new InvalidSettingConfigurationException("Please enter a path or a remote repo url!"); } elseif ($location !== '' && $repo !== '') { throw new InvalidSettingConfigurationException("Location and remote repo url are mutually exclusive!"); } if ($location !== '') { $isValidPath = false; if (str_starts_with($location, '/') && !str_ends_with($location, '/')) { $isValidPath = true; } elseif ($location === 'nextcloud_aio_backupdir') { $isValidPath = true; } if (!$isValidPath) { throw new InvalidSettingConfigurationException("The path must start with '/', and must not end with '/'! Another option is to use the docker volume name 'nextcloud_aio_backupdir'."); } // Prevent backup to be contained in Nextcloud Datadir as this will delete the backup archive upon restore // See https://github.com/nextcloud/all-in-one/issues/6607 if (str_starts_with($location . '/', rtrim($this->nextcloudDatadirMount, '/') . '/')) { throw new InvalidSettingConfigurationException("The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to " . $this->nextcloudDatadirMount); } } else { $this->validateBorgRemoteRepo($repo); } } private function validateBorgRemoteRepo(string $repo) : void { $commonMsg = "For valid urls, see the remote examples at https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls"; if ($repo === "") { // Ok, remote repo is optional } elseif (!str_contains($repo, "@")) { throw new InvalidSettingConfigurationException("The remote repo must contain '@'. $commonMsg"); } elseif (!str_contains($repo, ":")) { throw new InvalidSettingConfigurationException("The remote repo must contain ':'. $commonMsg"); } } public function deleteBorgBackupLocationItems() : void { // Delete the variables $this->startTransaction(); $this->borgBackupHostLocation = ''; $this->borgRemoteRepo = ''; $this->commitTransaction(); // Also delete the borg config file to be able to start over if (file_exists(DataConst::GetBackupKeyFile())) { if (unlink(DataConst::GetBackupKeyFile())) { error_log('borg.config file deleted to be able to start over.'); } } } /** * @throws InvalidSettingConfigurationException */ public function setBorgRestoreLocationVarsAndPassword(string $location, string $repo, string $password) : void { $this->validateBorgLocationVars($location, $repo); if ($password === '') { throw new InvalidSettingConfigurationException("Please enter the password!"); } $this->startTransaction(); $this->borgBackupHostLocation = $location; $this->borgRemoteRepo = $repo; $this->borgRestorePassword = $password; $this->instanceRestoreAttempt = true; $this->commitTransaction(); } /** * @throws InvalidSettingConfigurationException */ public function changeMasterPassword(string $currentPassword, string $newPassword) : void { if ($currentPassword === '') { throw new InvalidSettingConfigurationException("Please enter your current password."); } if ($currentPassword !== $this->password) { throw new InvalidSettingConfigurationException("The entered current password is not correct."); } if ($newPassword === '') { throw new InvalidSettingConfigurationException("Please enter a new password."); } if (strlen($newPassword) < 24) { throw new InvalidSettingConfigurationException("New passwords must be >= 24 digits."); } if (!preg_match("#^[a-zA-Z0-9 ]+$#", $newPassword)) { throw new InvalidSettingConfigurationException('Not allowed characters in the new password.'); } // All checks pass so set the password $this->set('password', $newPassword); } /** * @throws InvalidSettingConfigurationException */ private function writeConfig() : void { if(!is_dir(DataConst::GetDataDirectory())) { throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!"); } // Shouldn't happen, but as a precaution we won't write an empty config to disk. if ($this->config === []) { return; } $df = disk_free_space(DataConst::GetDataDirectory()); $content = json_encode($this->config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR); $size = strlen($content) + 10240; if ($df !== false && (int)$df < $size) { throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!"); } file_put_contents(DataConst::GetConfigFile(), $content); $this->config = []; } private function getEnvironmentalVariableOrConfig(string $envVariableName, string $configName, string $defaultValue) : string { $envVariableOutput = getenv($envVariableName); $configValue = $this->get($configName, ''); if ($envVariableOutput === false) { if ($configValue === '') { return $defaultValue; } return $configValue; } if (file_exists(DataConst::GetConfigFile())) { if ($envVariableOutput !== $configValue) { $this->set($configName, $envVariableOutput); } } return $envVariableOutput; } public function getBorgPublicKey() : string { if (!file_exists(DataConst::GetBackupPublicKey())) { return ""; } return trim((string)file_get_contents(DataConst::GetBackupPublicKey())); } public function getCollaboraSeccompPolicy() : string { $defaultString = '--o:security.seccomp='; if (!$this->collaboraSeccompDisabled) { return $defaultString . 'true'; } return $defaultString . 'false'; } /** * @throws InvalidSettingConfigurationException */ public function setDailyBackupTime(string $time, bool $enableAutomaticUpdates, bool $successNotification) : void { if ($time === "") { throw new InvalidSettingConfigurationException("The daily backup time must not be empty!"); } if (!preg_match("#^[0-1][0-9]:[0-5][0-9]$#", $time) && !preg_match("#^2[0-3]:[0-5][0-9]$#", $time)) { throw new InvalidSettingConfigurationException("You did not enter a correct time! One correct example is '04:00'!"); } if ($enableAutomaticUpdates === false) { $time .= PHP_EOL . 'automaticUpdatesAreNotEnabled'; } else { $time .= PHP_EOL; } if ($successNotification === false) { $time .= PHP_EOL . 'successNotificationsAreNotEnabled'; } else { $time .= PHP_EOL; } file_put_contents(DataConst::GetDailyBackupTimeFile(), $time); } public function getDailyBackupTime() : string { if (!file_exists(DataConst::GetDailyBackupTimeFile())) { return ''; } $dailyBackupFile = (string)file_get_contents(DataConst::GetDailyBackupTimeFile()); $dailyBackupFileArray = explode("\n", $dailyBackupFile); return $dailyBackupFileArray[0]; } public function areAutomaticUpdatesEnabled() : bool { if (!file_exists(DataConst::GetDailyBackupTimeFile())) { return false; } $dailyBackupFile = (string)file_get_contents(DataConst::GetDailyBackupTimeFile()); $dailyBackupFileArray = explode("\n", $dailyBackupFile); if (isset($dailyBackupFileArray[1]) && $dailyBackupFileArray[1] === 'automaticUpdatesAreNotEnabled') { return false; } else { return true; } } public function deleteDailyBackupTime() : void { if (file_exists(DataConst::GetDailyBackupTimeFile())) { unlink(DataConst::GetDailyBackupTimeFile()); } } /** * @throws InvalidSettingConfigurationException */ public function setAdditionalBackupDirectories(string $additionalBackupDirectories) : void { $additionalBackupDirectoriesArray = explode("\n", $additionalBackupDirectories); $validDirectories = ''; foreach($additionalBackupDirectoriesArray as $entry) { // Trim all unwanted chars on both sites $entry = trim($entry); if ($entry !== "") { if (!preg_match("#^/[.0-9a-zA-Z/_-]+$#", $entry) && !preg_match("#^[.0-9a-zA-Z_-]+$#", $entry)) { throw new InvalidSettingConfigurationException("You entered unallowed characters! Problematic is " . $entry); } $validDirectories .= rtrim($entry, '/') . PHP_EOL; } } if ($validDirectories === '') { unlink(DataConst::GetAdditionalBackupDirectoriesFile()); } else { file_put_contents(DataConst::GetAdditionalBackupDirectoriesFile(), $validDirectories); } } public function getAdditionalBackupDirectoriesString() : string { if (!file_exists(DataConst::GetAdditionalBackupDirectoriesFile())) { return ''; } return (string)file_get_contents(DataConst::GetAdditionalBackupDirectoriesFile()); } public function getAdditionalBackupDirectoriesArray() : array { $additionalBackupDirectories = $this->getAdditionalBackupDirectoriesString(); $additionalBackupDirectoriesArray = explode("\n", $additionalBackupDirectories); $additionalBackupDirectoriesArray = array_unique($additionalBackupDirectoriesArray, SORT_REGULAR); return $additionalBackupDirectoriesArray; } public function isDailyBackupRunning() : bool { return file_exists(DataConst::GetDailyBackupBlockFile()); } /** * @throws InvalidSettingConfigurationException */ private function validateTimezone(string $timezone) : void { if ($timezone === "") { throw new InvalidSettingConfigurationException("The timezone must not be empty!"); } if (!preg_match("#^[a-zA-Z0-9_\-\/\+]+$#", $timezone)) { throw new InvalidSettingConfigurationException("The entered timezone does not seem to be a valid timezone!"); } } /** * Provide an extra method since our `timezone` attribute setter prevents setting an empty timezone. */ public function deleteTimezone() : void { $this->set('timezone', ''); } public function shouldDomainValidationBeSkipped(bool $skipDomainValidation) : bool { if ($skipDomainValidation || getenv('SKIP_DOMAIN_VALIDATION') === 'true') { return true; } return false; } public function getApacheAdditionalNetwork() : string { $network = getenv('APACHE_ADDITIONAL_NETWORK'); if (is_string($network)) { return trim($network); } return ''; } public function getNextcloudStartupApps() : string { $apps = getenv('NEXTCLOUD_STARTUP_APPS'); if (is_string($apps)) { return trim($apps); } return 'deck twofactor_totp tasks calendar contacts notes'; } /** * @throws InvalidSettingConfigurationException */ private function validateCollaboraDictionaries(string $CollaboraDictionaries) : void { if ($CollaboraDictionaries === "") { throw new InvalidSettingConfigurationException("The dictionaries must not be empty!"); } if (!preg_match("#^[a-zA-Z_ ]+$#", $CollaboraDictionaries)) { throw new InvalidSettingConfigurationException("The entered dictionaries do not seem to be a valid!"); } } /** * Provide an extra method since the corresponding attribute setter prevents setting an empty value. */ public function deleteCollaboraDictionaries() : void { $this->set('collabora_dictionaries', ''); } /** * @throws InvalidSettingConfigurationException */ private function validateCollaboraAdditionalOptions(string $additionalCollaboraOptions) : void { if ($additionalCollaboraOptions === "") { throw new InvalidSettingConfigurationException("The additional options must not be empty!"); } if (!preg_match("#^--o:#", $additionalCollaboraOptions)) { throw new InvalidSettingConfigurationException("The entered options must start with '--o:'. So the config does not seem to be a valid!"); } } public function isCollaboraSubscriptionEnabled() : bool { return str_contains($this->collaboraAdditionalOptions, '--o:support_key='); } /** * Provide an extra method since the corresponding attribute setter prevents setting an empty value. */ public function deleteAdditionalCollaboraOptions() : void { $this->set('collabora_additional_options', ''); } public function listAvailableCommunityContainers() : array { $cc = []; $dir = scandir(DataConst::GetCommunityContainersDirectory()); if ($dir === false) { return $cc; } // Get rid of dots from the scandir command $dir = array_diff($dir, array('..', '.', 'readme.md')); foreach ($dir as $id) { $filePath = DataConst::GetCommunityContainersDirectory() . '/' . $id . '/' . $id . '.json'; $fileContents = apcu_fetch($filePath); if (!is_string($fileContents)) { $fileContents = file_get_contents($filePath); if (is_string($fileContents)) { apcu_add($filePath, $fileContents); } } $json = is_string($fileContents) ? json_decode($fileContents, true, 512, JSON_THROW_ON_ERROR) : false; if(is_array($json) && is_array($json['aio_services_v1'])) { foreach ($json['aio_services_v1'] as $service) { $documentation = is_string($service['documentation']) ? $service['documentation'] : ''; if (is_string($service['display_name'])) { $cc[$id] = [ 'id' => $id, 'name' => $service['display_name'], 'documentation' => $documentation ]; } break; } } } return $cc; } private function camelize(string $input, string $delimiter = '_') : string { if ($input === '') { throw new InvalidSettingConfigurationException('input cannot be empty!'); } if ($delimiter === '') { $delimiter = '_'; } return lcfirst(implode("", array_map('ucfirst', explode($delimiter, strtolower($input))))); } public function setAioVariables(array $input) : void { if ($input === []) { return; } $this->startTransaction(); foreach ($input as $variable) { if (!is_string($variable) || !str_contains($variable, '=')) { error_log("Invalid input: '$variable' is not a string or does not contain an equal sign ('=')"); continue; } $keyWithValue = $this->replaceEnvPlaceholders($variable); // Pad the result with nulls so psalm is happy (and we don't risk to run into warnings in case // the check for an equal sign from above gets changed). [$key, $value] = explode('=', $keyWithValue, 2) + [null, null]; $key = $this->camelize($key); if ($value === null) { error_log("Invalid input: '$keyWithValue' has no value after the equal sign"); } else if (!property_exists($this, $key)) { error_log("Error: '$key' is not a valid configuration key (in '$keyWithValue')"); } else { $this->$key = $value; } } $this->commitTransaction(); } // // Replaces placeholders in $envValue with their values. // E.g. "%NC_DOMAIN%:%APACHE_PORT" becomes "my.nextcloud.com:11000" public function replaceEnvPlaceholders(string $envValue): string { // $pattern breaks down as: // % - matches a literal percent sign // ([^%]+) - capture group that matches one or more characters that are NOT percent signs // % - matches the closing percent sign // // Assumes literal percent signs are always matched and there is no // escaping. $pattern = '/%([^%]+)%/'; $matchCount = preg_match_all($pattern, $envValue, $matches); if ($matchCount === 0) { return $envValue; } $placeholders = $matches[0]; // ["%PLACEHOLDER1%", "%PLACEHOLDER2%", ...] $placeholderNames = $matches[1]; // ["PLACEHOLDER1", "PLACEHOLDER2", ...] $placeholderPatterns = array_map(static fn(string $p) => '/' . preg_quote($p) . '/', $placeholders); // ["/%PLACEHOLDER1%/", ...] $placeholderValues = array_map($this->getPlaceholderValue(...), $placeholderNames); // ["val1", "val2"] // Guaranteed to be non-null because we found the placeholders in the preg_match_all. return (string) preg_replace($placeholderPatterns, $placeholderValues, $envValue); } private function getPlaceholderValue(string $placeholder) : string { return match ($placeholder) { 'NC_DOMAIN' => $this->domain, 'NC_BASE_DN' => $this->getBaseDN(), 'AIO_TOKEN' => $this->aioToken, 'BORGBACKUP_REMOTE_REPO' => $this->borgRemoteRepo, 'BORGBACKUP_MODE' => $this->backupMode, 'AIO_URL' => $this->aioUrl, 'SELECTED_RESTORE_TIME' => $this->selectedRestoreTime, 'RESTORE_EXCLUDE_PREVIEWS' => $this->restoreExcludePreviews ? '1' : '', 'APACHE_PORT' => $this->apachePort, 'APACHE_IP_BINDING' => $this->apacheIpBinding, 'TALK_PORT' => $this->talkPort, 'TURN_DOMAIN' => $this->turnDomain, 'NEXTCLOUD_MOUNT' => $this->nextcloudMount, 'BACKUP_RESTORE_PASSWORD' => $this->borgRestorePassword, 'CLAMAV_ENABLED' => $this->isClamavEnabled ? 'yes' : '', 'TALK_RECORDING_ENABLED' => $this->isTalkRecordingEnabled ? 'yes' : '', 'ONLYOFFICE_ENABLED' => $this->isOnlyofficeEnabled ? 'yes' : '', 'COLLABORA_ENABLED' => $this->isCollaboraEnabled ? 'yes' : '', 'TALK_ENABLED' => $this->isTalkEnabled ? 'yes' : '', 'UPDATE_NEXTCLOUD_APPS' => ($this->isDailyBackupRunning() && $this->areAutomaticUpdatesEnabled()) ? 'yes' : '', 'TIMEZONE' => $this->timezone === '' ? 'Etc/UTC' : $this->timezone, 'COLLABORA_DICTIONARIES' => $this->collaboraDictionaries === '' ? 'de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru' : $this->collaboraDictionaries, 'IMAGINARY_ENABLED' => $this->isImaginaryEnabled ? 'yes' : '', 'FULLTEXTSEARCH_ENABLED' => $this->isFulltextsearchEnabled ? 'yes' : '', 'DOCKER_SOCKET_PROXY_ENABLED' => $this->isDockerSocketProxyEnabled ? 'yes' : '', 'HARP_ENABLED' => $this->isHarpEnabled ? 'yes' : '', 'NEXTCLOUD_UPLOAD_LIMIT' => $this->nextcloudUploadLimit, 'NEXTCLOUD_MEMORY_LIMIT' => $this->nextcloudMemoryLimit, 'NEXTCLOUD_MAX_TIME' => $this->nextcloudMaxTime, 'BORG_RETENTION_POLICY' => $this->borgRetentionPolicy, 'FULLTEXTSEARCH_JAVA_OPTIONS' => $this->fulltextsearchJavaOptions, 'NEXTCLOUD_TRUSTED_CACERTS_DIR' => $this->trustedCacertsDir, 'ADDITIONAL_DIRECTORIES_BACKUP' => $this->getAdditionalBackupDirectoriesString() !== '' ? 'yes' : '', 'BORGBACKUP_HOST_LOCATION' => $this->borgBackupHostLocation, 'APACHE_MAX_SIZE' => (string)($this->getApacheMaxSize()), 'COLLABORA_SECCOMP_POLICY' => $this->getCollaboraSeccompPolicy(), 'NEXTCLOUD_STARTUP_APPS' => $this->getNextcloudStartupApps(), 'NEXTCLOUD_ADDITIONAL_APKS' => $this->nextcloudAdditionalApks, 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS' => $this->nextcloudAdditionalPhpExtensions, 'INSTALL_LATEST_MAJOR' => $this->installLatestMajor ? 'yes' : '', 'REMOVE_DISABLED_APPS' => $this->nextcloudKeepDisabledApps ? '' : 'yes', // Allow to get local ip-address of database container which allows to talk to it even in host mode (the container that requires this needs to be started first then) 'AIO_DATABASE_HOST' => gethostbyname('nextcloud-aio-database'), // Allow to get local ip-address of caddy container and add it to trusted proxies automatically 'CADDY_IP_ADDRESS' => in_array('caddy', $this->aioCommunityContainers, true) ? gethostbyname('nextcloud-aio-caddy') : '', 'WHITEBOARD_ENABLED' => $this->isWhiteboardEnabled ? 'yes' : '', 'AIO_VERSION' => $this->getAioVersion(), default => $this->getRegisteredSecret($placeholder), }; } private function booleanize(mixed $value) : bool { return in_array($value, [true, 'true'], true); } } ================================================ FILE: php/src/Data/DataConst.php ================================================ CanBeInstalled()) { return ''; } $password = $this->passwordGenerator->GeneratePassword(8); $this->configurationManager->password = $password; return $password; } public function CanBeInstalled() : bool { return !file_exists(DataConst::GetConfigFile()); } } ================================================ FILE: php/src/DependencyInjection.php ================================================ set( DockerHubManager::class, new DockerHubManager() ); $container->set( GitHubContainerRegistryManager::class, new GitHubContainerRegistryManager() ); $container->set( \AIO\Data\ConfigurationManager::class, new \AIO\Data\ConfigurationManager() ); $container->set( \AIO\Docker\DockerActionManager::class, new \AIO\Docker\DockerActionManager( $container->get(\AIO\Data\ConfigurationManager::class), $container->get(\AIO\ContainerDefinitionFetcher::class), $container->get(DockerHubManager::class), $container->get(GitHubContainerRegistryManager::class) ) ); $container->set( \AIO\Auth\PasswordGenerator::class, new \AIO\Auth\PasswordGenerator() ); $container->set( \AIO\Auth\AuthManager::class, new \AIO\Auth\AuthManager($container->get(\AIO\Data\ConfigurationManager::class)) ); $container->set( \AIO\Data\Setup::class, new \AIO\Data\Setup( $container->get(\AIO\Auth\PasswordGenerator::class), $container->get(\AIO\Data\ConfigurationManager::class) ) ); return $container; } } ================================================ FILE: php/src/Docker/DockerActionManager.php ================================================ guzzleClient = new Client(['curl' => [CURLOPT_UNIX_SOCKET_PATH => '/var/run/docker.sock']]); } private function BuildApiUrl(string $url): string { $apiVersion = getenv('DOCKER_API_VERSION'); if ($apiVersion === false || empty($apiVersion)) { $apiVersion = self::API_VERSION; } else { $apiVersion = 'v'. $apiVersion; } return sprintf('http://127.0.0.1/%s/%s', $apiVersion, $url); } private function BuildImageName(Container $container): string { $tag = $container->imageTag; if ($tag === '%AIO_CHANNEL%') { $tag = $this->GetCurrentChannel(); } return $container->containerName . ':' . $tag; } public function GetContainerRunningState(Container $container): ContainerState { $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($container->identifier))); try { $response = $this->guzzleClient->get($url); } catch (RequestException $e) { if ($e->getCode() === 404) { return ContainerState::ImageDoesNotExist; } throw $e; } $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR); if ($responseBody['State']['Running'] === true) { return ContainerState::Running; } else { return ContainerState::Stopped; } } public function GetContainerRestartingState(Container $container): ContainerState { $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($container->identifier))); try { $response = $this->guzzleClient->get($url); } catch (RequestException $e) { if ($e->getCode() === 404) { return ContainerState::ImageDoesNotExist; } throw $e; } $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR); if ($responseBody['State']['Restarting'] === true) { return ContainerState::Restarting; } else { return ContainerState::NotRestarting; } } public function GetContainerUpdateState(Container $container): VersionState { $tag = $container->imageTag; if ($tag === '%AIO_CHANNEL%') { $tag = $this->GetCurrentChannel(); } $runningDigests = $this->GetRepoDigestsOfContainer($container->identifier); if ($runningDigests === null) { return VersionState::Different; } $remoteDigest = $this->GetLatestDigestOfTag($container->containerName, $tag); if ($remoteDigest === null) { return VersionState::Equal; } foreach ($runningDigests as $runningDigest) { if ($runningDigest === $remoteDigest) { return VersionState::Equal; } } return VersionState::Different; } public function GetContainerStartingState(Container $container): ContainerState { $runningState = $this->GetContainerRunningState($container); if ($runningState === ContainerState::Stopped || $runningState === ContainerState::ImageDoesNotExist) { return $runningState; } $containerName = $container->identifier; $internalPort = $container->internalPorts; if ($internalPort === '%APACHE_PORT%') { $internalPort = $this->configurationManager->apachePort; } elseif ($internalPort === '%TALK_PORT%') { $internalPort = $this->configurationManager->talkPort; } if ($internalPort !== "" && $internalPort !== 'host') { $connection = @fsockopen($containerName, (int)$internalPort, $errno, $errstr, 0.2); if ($connection) { fclose($connection); return ContainerState::Running; } else { return ContainerState::Starting; } } else { return ContainerState::Running; } } public function DeleteContainer(Container $container): void { $url = $this->BuildApiUrl(sprintf('containers/%s?v=true', urlencode($container->identifier))); try { $this->guzzleClient->delete($url); } catch (RequestException $e) { if ($e->getCode() !== 404) { throw $e; } } } public function GetLogs(string $id, string $since = ''): string { $url = $this->BuildApiUrl( sprintf( 'containers/%s/logs?stdout=true&stderr=true×tamps=true&since=%s', urlencode($id), $since )); $responseBody = (string)$this->guzzleClient->get($url)->getBody(); $response = ""; $separator = "\r\n"; $line = strtok($responseBody, $separator); $response = substr((string)$line, 8) . $separator; while ($line !== false) { $line = strtok($separator); $response .= substr((string)$line, 8) . $separator; } return $response; } public function StartContainer(Container $container, ?\Closure $addToStreamingResponseBody = null): void { $url = $this->BuildApiUrl(sprintf('containers/%s/start', urlencode($container->identifier))); try { if ($addToStreamingResponseBody !== null) { $addToStreamingResponseBody($container, "Starting container"); } $this->guzzleClient->post($url); } catch (RequestException $e) { throw new \Exception("Could not start container " . $container->identifier . ": " . $e->getResponse()?->getBody()->getContents()); } } public function CreateVolumes(Container $container): void { $url = $this->BuildApiUrl('volumes/create'); foreach ($container->volumes->GetVolumes() as $volume) { $forbiddenChars = [ '/', ]; if ($volume->name === 'nextcloud_aio_nextcloud_datadir' || $volume->name === 'nextcloud_aio_backupdir') { return; } $firstChar = substr($volume->name, 0, 1); if (!in_array($firstChar, $forbiddenChars)) { $this->guzzleClient->request( 'POST', $url, [ 'json' => [ 'name' => $volume->name, ], ] ); } } } public function CreateContainer(Container $container): void { $volumes = []; foreach ($container->volumes->GetVolumes() as $volume) { // // NEXTCLOUD_MOUNT gets added via bind-mount later on // if ($container->identifier === 'nextcloud-aio-nextcloud') { // if ($volume->name === $this->configurationManager->nextcloudMount) { // continue; // } // } $volumeEntry = $volume->name . ':' . $volume->mountPoint; if ($volume->isWritable) { $volumeEntry = $volumeEntry . ':' . 'rw'; } else { $volumeEntry = $volumeEntry . ':' . 'ro'; } $volumes[] = $volumeEntry; } $requestBody = [ 'Image' => $this->BuildImageName($container), ]; if (count($volumes) > 0) { $requestBody['HostConfig']['Binds'] = $volumes; } $this->configurationManager->setAioVariables($container->aioVariables->GetVariables()); $envs = $container->containerEnvironmentVariables->GetVariables(); // Special thing for the nextcloud container if ($container->identifier === 'nextcloud-aio-nextcloud') { $envs[] = $this->GetAllNextcloudExecCommands(); } foreach ($envs as $key => $env) { $envs[$key] = $this->configurationManager->replaceEnvPlaceholders($env); } if (count($envs) > 0) { $requestBody['Env'] = $envs; } $requestBody['HostConfig']['RestartPolicy']['Name'] = $container->restartPolicy; $requestBody['HostConfig']['ReadonlyRootfs'] = $container->readOnlyRootFs; $exposedPorts = []; if ($container->internalPorts !== 'host') { foreach ($container->ports->GetPorts() as $value) { $port = $value->port; $protocol = $value->protocol; if ($port === '%APACHE_PORT%') { $port = $this->configurationManager->apachePort; // Do not expose udp if AIO is in reverse proxy mode if ($port !== '443' && $protocol === 'udp') { continue; } } else if ($port === '%TALK_PORT%') { $port = $this->configurationManager->talkPort; } $portWithProtocol = $port . '/' . $protocol; $exposedPorts[$portWithProtocol] = null; } $requestBody['HostConfig']['NetworkMode'] = 'nextcloud-aio'; } else { $requestBody['HostConfig']['NetworkMode'] = 'host'; } if (count($exposedPorts) > 0) { $requestBody['ExposedPorts'] = $exposedPorts; foreach ($container->ports->GetPorts() as $value) { $port = $value->port; $protocol = $value->protocol; if ($port === '%APACHE_PORT%') { $port = $this->configurationManager->apachePort; // Do not expose udp if AIO is in reverse proxy mode if ($port !== '443' && $protocol === 'udp') { continue; } } else if ($port === '%TALK_PORT%') { $port = $this->configurationManager->talkPort; // Skip publishing talk tcp port if it is set to 443 if ($port === '443' && $protocol === 'tcp') { continue; } } $ipBinding = $value->ipBinding; if ($ipBinding === '%APACHE_IP_BINDING%') { $ipBinding = $this->configurationManager->apacheIpBinding; // Do not expose if AIO is in internal network mode if ($ipBinding === '@INTERNAL') { continue; } } $portWithProtocol = $port . '/' . $protocol; $requestBody['HostConfig']['PortBindings'][$portWithProtocol] = [ [ 'HostPort' => $port, 'HostIp' => $ipBinding, ] ]; } } $devices = []; foreach ($container->devices as $device) { if ($device === '/dev/dri' && !$this->configurationManager->nextcloudEnableDriDevice) { continue; } $devices[] = ["PathOnHost" => $device, "PathInContainer" => $device, "CgroupPermissions" => "rwm"]; } if (count($devices) > 0) { $requestBody['HostConfig']['Devices'] = $devices; } if ($container->enableNvidiaGpu && $this->configurationManager->enableNvidiaGpu) { $requestBody['HostConfig']['Runtime'] = 'nvidia'; $requestBody['HostConfig']['DeviceRequests'] = [ [ "Driver" => "nvidia", "Count" => 1, "Capabilities" => [["gpu"]], ] ]; } $shmSize = $container->shmSize; if ($shmSize > 0) { $requestBody['HostConfig']['ShmSize'] = $shmSize; } $tmpfs = []; foreach ($container->tmpfs as $tmp) { $mode = ""; if (str_contains($tmp, ':')) { $mode = explode(':', $tmp)[1]; $tmp = explode(':', $tmp)[0]; } $tmpfs[$tmp] = $mode; } if (count($tmpfs) > 0) { $requestBody['HostConfig']['Tmpfs'] = $tmpfs; } $requestBody['HostConfig']['Init'] = $container->init; $maxShutDownTime = $container->maxShutdownTime; if ($maxShutDownTime > 0) { $requestBody['StopTimeout'] = $maxShutDownTime; } $capAdds = $container->capAdd; if (count($capAdds) > 0) { $requestBody['HostConfig']['CapAdd'] = $capAdds; } // Disable arp spoofing if (!in_array('NET_RAW', $capAdds, true)) { $requestBody['HostConfig']['CapDrop'] = ['NET_RAW']; } // Disable SELinux for AIO containers so that it does not break them $requestBody['HostConfig']['SecurityOpt'] = ["label:disable"]; if ($container->apparmorUnconfined) { $requestBody['HostConfig']['SecurityOpt'] = ["apparmor:unconfined", "label:disable"]; } $mounts = []; // Special things for the backup container which should not be exposed in the containers.json if (str_starts_with($container->identifier, 'nextcloud-aio-borgbackup')) { // Additional backup directories foreach ($this->getAllBackupVolumes() as $additionalBackupVolumes) { if ($additionalBackupVolumes !== '') { $mounts[] = ["Type" => "volume", "Source" => $additionalBackupVolumes, "Target" => "/nextcloud_aio_volumes/" . $additionalBackupVolumes, "ReadOnly" => false]; } } // Make volumes read only in case of borgbackup container. The viewer makes them writeable $isReadOnly = $container->identifier === 'nextcloud-aio-borgbackup'; foreach ($this->configurationManager->getAdditionalBackupDirectoriesArray() as $additionalBackupDirectories) { if ($additionalBackupDirectories !== '') { if (!str_starts_with($additionalBackupDirectories, '/')) { $mounts[] = ["Type" => "volume", "Source" => $additionalBackupDirectories, "Target" => "/docker_volumes/" . $additionalBackupDirectories, "ReadOnly" => $isReadOnly]; } else { $mounts[] = ["Type" => "bind", "Source" => $additionalBackupDirectories, "Target" => "/host_mounts" . $additionalBackupDirectories, "ReadOnly" => $isReadOnly, "BindOptions" => ["NonRecursive" => true]]; } } } // Special things for the talk container which should not be exposed in the containers.json } elseif ($container->identifier === 'nextcloud-aio-talk') { // This is needed due to a bug in libwebsockets used in Janus which cannot handle unlimited ulimits $requestBody['HostConfig']['Ulimits'] = [["Name" => "nofile", "Hard" => 200000, "Soft" => 200000]]; // // Special things for the nextcloud container which should not be exposed in the containers.json // } elseif ($container->identifier === 'nextcloud-aio-nextcloud') { // foreach ($container->volumes->GetVolumes() as $volume) { // if ($volume->name !== $this->configurationManager->nextcloudMount) { // continue; // } // $mounts[] = ["Type" => "bind", "Source" => $volume->name, "Target" => $volume->mountPoint, "ReadOnly" => !$volume->isWritable, "BindOptions" => [ "Propagation" => "rshared"]]; // } // Special things for the caddy community container } elseif ($container->identifier === 'nextcloud-aio-caddy') { $requestBody['HostConfig']['ExtraHosts'] = ['host.docker.internal:host-gateway']; // Special things for the collabora container which should not be exposed in the containers.json } elseif ($container->identifier === 'nextcloud-aio-collabora') { if (!$this->configurationManager->collaboraSeccompDisabled) { // Load reference seccomp profile for collabora $seccompProfile = (string)file_get_contents(DataConst::GetCollaboraSeccompProfilePath()); $requestBody['HostConfig']['SecurityOpt'] = ["label:disable", "seccomp=$seccompProfile"]; } // Additional Collabora options if ($this->configurationManager->collaboraAdditionalOptions !== '') { // Split the list of Collabora options, which are stored as a string but must be assigned as an array. // To avoid problems with whitespace or dashes in option arguments we use a regular expression // that splits the string at every position where a whitespace is followed by '--o:'. // The leading whitespace is removed in the split but the following characters are not. // Example: "--o:example_config1='some thing' --o:example_config2=something-else" -> ["--o:example_config1='some thing'", "--o:example_config2=something-else"] $regEx = '/\s+(?=--o:)/'; $requestBody['Cmd'] = preg_split($regEx, rtrim($this->configurationManager->collaboraAdditionalOptions)); } } if (count($mounts) > 0) { $requestBody['HostConfig']['Mounts'] = $mounts; } // All AIO-managed containers should not be updated externally via watchtower but gracefully by AIO's backup and update feature. // Also DIUN should not send update notifications. See https://crazymax.dev/diun/providers/docker/#docker-labels // Additionally set a default org.label-schema.vendor and com.docker.compose.project $requestBody['Labels'] = ["com.centurylinklabs.watchtower.enable" => "false", "wud.watch" => "false", "diun.enable" => "false", "org.label-schema.vendor" => "Nextcloud", "com.docker.compose.project" => "nextcloud-aio"]; // Containers should have a fixed host name. See https://github.com/nextcloud/all-in-one/discussions/6589 $requestBody['Hostname'] = $container->identifier; $url = $this->BuildApiUrl('containers/create?name=' . $container->identifier); try { $this->guzzleClient->request( 'POST', $url, [ 'json' => $requestBody ] ); } catch (RequestException $e) { throw new \Exception("Could not create container " . $container->identifier . ": " . $e->getResponse()?->getBody()->getContents()); } } public function isRegistryReachable(Container $container): bool { $tag = $container->imageTag; if ($tag === '%AIO_CHANNEL%') { $tag = $this->GetCurrentChannel(); } $remoteDigest = $this->GetLatestDigestOfTag($container->containerName, $tag); if ($remoteDigest === null) { return false; } else { return true; } } public function PullImage(Container $container, bool $pullImage = true, ?\Closure $addToStreamingResponseBody = null): void { // Skip database image pull if the last shutdown was not clean if ($container->identifier === 'nextcloud-aio-database') { if ($this->GetDatabasecontainerExitCode() > 0) { $pullImage = false; error_log('Not pulling the latest database image because the container was not correctly shut down.'); } } // Check if registry is reachable in order to make sure that we do not try to pull an image if it is down // and try to mitigate issues that are arising due to that if ($pullImage) { if (!$this->isRegistryReachable($container)) { $pullImage = false; error_log('Not pulling the ' . $container->containerName . ' image for the ' . $container->identifier . ' container because the registry does not seem to be reachable.'); } } // Do not continue if $pullImage is false if (!$pullImage) { return; } $imageName = $this->BuildImageName($container); $encodedImageName = urlencode($imageName); $url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', $encodedImageName)); $imageIsThere = true; try { if ($addToStreamingResponseBody) { $addToStreamingResponseBody($container, "Pulling image"); } $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $encodedImageName)); $this->guzzleClient->get($imageUrl)->getBody()->getContents(); } catch (\Throwable $e) { $imageIsThere = false; } $maxRetries = 3; for ($attempt = 1; $attempt <= $maxRetries; $attempt++) { try { $this->guzzleClient->post($url); break; } catch (RequestException $e) { $message = "Could not pull image " . $imageName . " (attempt $attempt/$maxRetries): " . $e->getResponse()?->getBody()->getContents(); if ($attempt === $maxRetries) { if ($imageIsThere === false) { throw new \Exception($message); } else { error_log($message); } } else { error_log($message . ' Retrying...'); sleep(1); } } } } private function isContainerUpdateAvailable(string $id): string { $container = $this->containerDefinitionFetcher->GetContainerById($id); $updateAvailable = ""; if ($container->GetUpdateState() === VersionState::Different) { $updateAvailable = '1'; } foreach ($container->dependsOn as $dependency) { $updateAvailable .= $this->isContainerUpdateAvailable($dependency); } return $updateAvailable; } public function isAnyUpdateAvailable(): bool { // return early if instance is not installed if (!$this->configurationManager->wasStartButtonClicked) { return false; } $id = 'nextcloud-aio-apache'; if ($this->isContainerUpdateAvailable($id) !== "") { return true; } else { return false; } } private function getBackupVolumes(string $id): string { $container = $this->containerDefinitionFetcher->GetContainerById($id); $backupVolumes = ''; foreach ($container->backupVolumes as $backupVolume) { $backupVolumes .= $backupVolume . ' '; } foreach ($container->dependsOn as $dependency) { $backupVolumes .= $this->getBackupVolumes($dependency); } return $backupVolumes; } private function getAllBackupVolumes(): array { $id = 'nextcloud-aio-apache'; $backupVolumesArray = explode(' ', $this->getBackupVolumes($id)); return array_unique($backupVolumesArray); } private function GetNextcloudExecCommands(string $id): string { $container = $this->containerDefinitionFetcher->GetContainerById($id); $nextcloudExecCommands = ''; foreach ($container->nextcloudExecCommands as $execCommand) { $nextcloudExecCommands .= $execCommand . PHP_EOL; } foreach ($container->dependsOn as $dependency) { $nextcloudExecCommands .= $this->GetNextcloudExecCommands($dependency); } return $nextcloudExecCommands; } private function GetAllNextcloudExecCommands(): string { $id = 'nextcloud-aio-apache'; return 'NEXTCLOUD_EXEC_COMMANDS=' . $this->GetNextcloudExecCommands($id); } private function GetRepoDigestsOfContainer(string $containerName): ?array { try { $containerUrl = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName)); $containerOutput = json_decode($this->guzzleClient->get($containerUrl)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); $imageName = $containerOutput['Image']; $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName)); $imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); if (!isset($imageOutput['RepoDigests'])) { error_log('RepoDigests is not set of container ' . $containerName); return null; } if (!is_array($imageOutput['RepoDigests'])) { error_log('RepoDigests of ' . $containerName . ' is not an array which is not allowed!'); return null; } $repoDigestArray = []; $oneDigestGiven = false; foreach ($imageOutput['RepoDigests'] as $repoDigest) { $digestPosition = strpos($repoDigest, '@'); if ($digestPosition === false) { error_log('Somehow the RepoDigest of ' . $containerName . ' does not contain a @.'); return null; } $repoDigestArray[] = substr($repoDigest, $digestPosition + 1); $oneDigestGiven = true; } if ($oneDigestGiven) { return $repoDigestArray; } return null; } catch (\Exception $e) { return null; } } private function GetCurrentImageName(): string { $cacheKey = 'aio-image-name'; $imageName = apcu_fetch($cacheKey); if ($imageName !== false && is_string($imageName)) { return $imageName; } $containerName = 'nextcloud-aio-mastercontainer'; $url = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName)); try { $output = json_decode($this->guzzleClient->get($url)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); $imageNameArray = explode(':', $output['Config']['Image']); if (count($imageNameArray) === 2) { $imageName = $imageNameArray[0]; } else { error_log("Unexpected image name was found when getting the current image name of the mastercontainer. You probably did not follow the documentation correctly. Changing the image name to the default 'ghcr.io/nextcloud-releases/all-in-one'."); $imageName = 'ghcr.io/nextcloud-releases/all-in-one'; } apcu_add($cacheKey, $imageName); return $imageName; } catch (\Exception $e) { error_log('Could not get current imageName ' . $e->getMessage()); } return 'nextcloud/all-in-one'; } public function GetCurrentChannel(): string { $cacheKey = 'aio-ChannelName'; $channelName = apcu_fetch($cacheKey); if ($channelName !== false && is_string($channelName)) { return $channelName; } $containerName = 'nextcloud-aio-mastercontainer'; $url = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName)); try { $output = json_decode($this->guzzleClient->get($url)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); $tagArray = explode(':', $output['Config']['Image']); if (count($tagArray) === 2) { $tag = $tagArray[1]; } else { error_log("No tag was found when getting the current channel. You probably did not follow the documentation correctly. Changing the channel to the default 'latest'."); $tag = 'latest'; } apcu_add($cacheKey, $tag); return $tag; } catch (\Exception $e) { error_log('Could not get current channel ' . $e->getMessage()); } return 'latest'; } public function IsMastercontainerUpdateAvailable(): bool { $imageName = $this->GetCurrentImageName(); $containerName = 'nextcloud-aio-mastercontainer'; $tag = $this->GetCurrentChannel(); $runningDigests = $this->GetRepoDigestsOfContainer($containerName); if ($runningDigests === null) { return true; } $remoteDigest = $this->GetLatestDigestOfTag($imageName, $tag); if ($remoteDigest === null) { return false; } foreach ($runningDigests as $runningDigest) { if ($remoteDigest === $runningDigest) { return false; } } return true; } public function sendNotification(Container $container, string $subject, string $message, string $file = '/notify.sh'): void { if ($this->GetContainerStartingState($container) === ContainerState::Running) { $containerName = $container->identifier; // schedule the exec $url = $this->BuildApiUrl(sprintf('containers/%s/exec', urlencode($containerName))); $response = json_decode( $this->guzzleClient->request( 'POST', $url, [ 'json' => [ 'AttachStdout' => true, 'Tty' => true, 'Cmd' => [ 'bash', $file, $subject, $message ], ], ] )->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR, ); $id = $response['Id']; // start the exec $url = $this->BuildApiUrl(sprintf('exec/%s/start', $id)); $this->guzzleClient->request( 'POST', $url, [ 'json' => [ 'Detach' => false, 'Tty' => true, ], ] ); } } private function DisconnectContainerFromBridgeNetwork(string $id): void { $url = $this->BuildApiUrl( sprintf('networks/%s/disconnect', 'bridge') ); try { $this->guzzleClient->request( 'POST', $url, [ 'json' => [ 'container' => $id, ], ] ); } catch (RequestException $e) { } } private function ConnectContainerIdToNetwork(string $id, string $internalPort, string $network = 'nextcloud-aio', bool $createNetwork = true, string $alias = ''): void { if ($internalPort === 'host') { return; } if ($createNetwork) { $url = $this->BuildApiUrl('networks/create'); try { $this->guzzleClient->request( 'POST', $url, [ 'json' => [ 'Name' => $network, 'CheckDuplicate' => true, 'Driver' => 'bridge', 'Internal' => false, ] ] ); } catch (RequestException $e) { // 409 is undocumented and gets thrown if the network already exists. if ($e->getCode() !== 409) { throw new \Exception("Could not create the nextcloud-aio network: " . $e->getResponse()?->getBody()->getContents()); } } } $url = $this->BuildApiUrl( sprintf('networks/%s/connect', $network) ); $jsonPayload = ['Container' => $id]; if ($alias !== '') { $jsonPayload['EndpointConfig'] = ['Aliases' => [$alias]]; } try { $this->guzzleClient->request( 'POST', $url, [ 'json' => $jsonPayload ] ); } catch (RequestException $e) { // 403 is undocumented and gets thrown if a specific container is already part of a network if ($e->getCode() !== 403) { throw $e; } } } public function ConnectMasterContainerToNetwork(): void { $this->ConnectContainerIdToNetwork('nextcloud-aio-mastercontainer', ''); // Don't disconnect here since it slows down the initial login by a lot. Is getting done during cron.sh instead. // $this->DisconnectContainerFromBridgeNetwork('nextcloud-aio-mastercontainer'); } public function ConnectContainerToNetwork(Container $container): void { // Add a secondary alias for domaincheck container, to keep it as similar to actual apache controller as possible. // If a reverse-proxy is relying on container name as hostname this allows it to operate as usual and still validate the domain // The domaincheck container and apache container are never supposed to be active at the same time because they use the same APACHE_PORT anyway, so this doesn't add any new constraints. $alias = ($container->identifier === 'nextcloud-aio-domaincheck') ? 'nextcloud-aio-apache' : ''; $this->ConnectContainerIdToNetwork($container->identifier, $container->internalPorts, alias: $alias); if ($container->identifier === 'nextcloud-aio-apache' || $container->identifier === 'nextcloud-aio-domaincheck') { $apacheAdditionalNetwork = $this->configurationManager->getApacheAdditionalNetwork(); if ($apacheAdditionalNetwork !== '') { $this->ConnectContainerIdToNetwork($container->identifier, $container->internalPorts, $apacheAdditionalNetwork, false, $alias); } } } public function StopContainer(Container $container, bool $forceStopContainer = false): void { if ($forceStopContainer) { $maxShutDownTime = 10; } else { $maxShutDownTime = $container->maxShutdownTime; } $url = $this->BuildApiUrl(sprintf('containers/%s/stop?t=%s', urlencode($container->identifier), $maxShutDownTime)); try { $this->guzzleClient->post($url); } catch (RequestException $e) { if ($e->getCode() !== 404 && $e->getCode() !== 304) { throw $e; } } } public function GetBackupcontainerExitCode(): int { $containerName = 'nextcloud-aio-borgbackup'; $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($containerName))); try { $response = $this->guzzleClient->get($url); } catch (RequestException $e) { if ($e->getCode() === 404) { return -1; } throw $e; } $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR); $exitCode = $responseBody['State']['ExitCode']; if (is_int($exitCode)) { return $exitCode; } else { return -1; } } public function GetDatabasecontainerExitCode(): int { $containerName = 'nextcloud-aio-database'; $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($containerName))); try { $response = $this->guzzleClient->get($url); } catch (RequestException $e) { if ($e->getCode() === 404) { return -1; } throw $e; } $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR); $exitCode = $responseBody['State']['ExitCode']; if (is_int($exitCode)) { return $exitCode; } else { return -1; } } public function isLoginAllowed(): bool { $id = 'nextcloud-aio-apache'; $apacheContainer = $this->containerDefinitionFetcher->GetContainerById($id); if ($this->GetContainerStartingState($apacheContainer) === ContainerState::Running) { return false; } return true; } public function isBackupContainerRunning(): bool { $id = 'nextcloud-aio-borgbackup'; $backupContainer = $this->containerDefinitionFetcher->GetContainerById($id); if ($this->GetContainerRunningState($backupContainer) === ContainerState::Running) { return true; } return false; } private function GetCreatedTimeOfNextcloudImage(string $imageName): ?string { $imageName = $imageName . ':' . $this->GetCurrentChannel(); try { $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName)); $imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); if (!isset($imageOutput['Created'])) { error_log('Created is not set of image ' . $imageName); return null; } return str_replace('T', ' ', (string)$imageOutput['Created']); } catch (\Exception $e) { return null; } } public function GetAndGenerateSecretWrapper(string $secretId): string { return $this->configurationManager->getAndGenerateSecret($secretId); } public function isNextcloudImageOutdated(): bool { $createdTime = $this->GetCreatedTimeOfNextcloudImage('ghcr.io/nextcloud-releases/aio-nextcloud'); if ($createdTime === null) { $createdTime = $this->GetCreatedTimeOfNextcloudImage('nextcloud/aio-nextcloud'); } if ($createdTime === null) { return false; } // If the image is older than 90 days, it is outdated. if ((time() - (60 * 60 * 24 * 90)) > strtotime($createdTime)) { return true; } return false; } public function GetLatestDigestOfTag(string $imageName, string $tag): ?string { $prefix = 'ghcr.io/'; if (str_starts_with($imageName, $prefix)) { return $this->gitHubContainerRegistryManager->GetLatestDigestOfTag(str_replace($prefix, '', $imageName), $tag); } else { return $this->dockerHubManager->GetLatestDigestOfTag($imageName, $tag); } } } ================================================ FILE: php/src/Docker/DockerHubManager.php ================================================ guzzleClient = new Client(); } public function GetLatestDigestOfTag(string $name, string $tag) : ?string { $cacheKey = 'dockerhub-manifest-' . $name . $tag; $cachedVersion = apcu_fetch($cacheKey); if($cachedVersion !== false && is_string($cachedVersion)) { return $cachedVersion; } // If one of the links below should ever become outdated, we can still upgrade the mastercontainer via the webinterface manually by opening '/api/docker/getwatchtower' try { $authTokenRequest = $this->guzzleClient->request( 'GET', 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:' . $name . ':pull' ); $body = $authTokenRequest->getBody()->getContents(); $decodedBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if(isset($decodedBody['token'])) { $authToken = $decodedBody['token']; $manifestRequest = $this->guzzleClient->request( 'HEAD', 'https://registry-1.docker.io/v2/'.$name.'/manifests/' . $tag, [ 'headers' => [ 'Accept' => 'application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json', 'Authorization' => 'Bearer ' . $authToken, ], ] ); $responseHeaders = $manifestRequest->getHeader('docker-content-digest'); if(count($responseHeaders) === 1) { $latestVersion = $responseHeaders[0]; apcu_add($cacheKey, $latestVersion, 600); return $latestVersion; } } error_log('Could not get digest of container ' . $name . ':' . $tag); return null; } catch (\Exception $e) { error_log('Could not get digest of container ' . $name . ':' . $tag . ' ' . $e->getMessage()); return null; } } } ================================================ FILE: php/src/Docker/GitHubContainerRegistryManager.php ================================================ guzzleClient = new Client(); } public function GetLatestDigestOfTag(string $name, string $tag): ?string { $cacheKey = 'ghcr-manifest-' . $name . $tag; $cachedVersion = apcu_fetch($cacheKey); if ($cachedVersion !== false && is_string($cachedVersion)) { return $cachedVersion; } // If one of the links below should ever become outdated, we can still upgrade the mastercontainer via the webinterface manually by opening '/api/docker/getwatchtower' try { $authTokenRequest = $this->guzzleClient->request( 'GET', 'https://ghcr.io/token?scope=repository:' . $name . ':pull' ); $body = $authTokenRequest->getBody()->getContents(); $decodedBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if (isset($decodedBody['token'])) { $authToken = $decodedBody['token']; $manifestRequest = $this->guzzleClient->request( 'HEAD', 'https://ghcr.io/v2/' . $name . '/manifests/' . $tag, [ 'headers' => [ 'Accept' => 'application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json', 'Authorization' => 'Bearer ' . $authToken, ], ] ); $responseHeaders = $manifestRequest->getHeader('docker-content-digest'); if (count($responseHeaders) === 1) { $latestVersion = $responseHeaders[0]; apcu_add($cacheKey, $latestVersion, 600); return $latestVersion; } } error_log('Could not get digest of container ' . $name . ':' . $tag); return null; } catch (\Exception $e) { error_log('Could not get digest of container ' . $name . ':' . $tag . ' ' . $e->getMessage()); return null; } } } ================================================ FILE: php/src/Middleware/AuthMiddleware.php ================================================ getUri()->getPath(), $publicRoutes)) { if(!$this->authManager->IsAuthenticated()) { $status = 302; // Check the url of the request: split the string by '/' and count the number of elements // Note that the path that gets to this middleware is not aware of any base path managed by a reverse proxy, so if the url is 'https://example.com/AIO/somepage', the path will be 'https://mastercontainer/somepage' if (count(explode('/', $request->getUri()->getPath())) < 2) { // If there are less than 2 elements it means we are somewhere in the root folder (no '/', so no subfolder), so we redirect to the same folder level to offload the redirection to the appropriate page to 'index.php' (specifically, once in the root level the login page will be loaded since we are not authenticated) $location = '.'; } else { // If there are 2 or more elements it means we are in a subfolder, so we need to go back to the root folder // In the best case we need to go back by 1 level only $location = '..'; // In the worst case we need to go back by n levels, where n is the number of elements - 2 (the first element is not a folder, the second element is already accounted for by the initial '..') for ($i = 1; $i < count(explode('/', $request->getUri()->getPath())) - 2; $i++) { // For each extra level we need to go back by another level $location = $location . '/..'; } } $headers = ['Location' => $location]; $response = new Response($status, $headers); return $response; } } $response = $handler->handle($request); return $response; } } ================================================ FILE: php/src/Twig/ClassExtension.php ================================================ csrf->getTokenNameKey(); $csrfValueKey = $this->csrf->getTokenValueKey(); $csrfName = $this->csrf->getTokenName(); $csrfValue = $this->csrf->getTokenValue(); return [ 'csrf' => [ 'keys' => [ 'name' => $csrfNameKey, 'value' => $csrfValueKey ], 'name' => $csrfName, 'value' => $csrfValue ] ]; } } ================================================ FILE: php/templates/already-installed.twig ================================================ {% extends "layout.twig" %} {% block body %} {% endblock %} ================================================ FILE: php/templates/components/container-state.twig ================================================ {# @var c \App\Containers\Container #}
  • {% if c.GetStartingState().value == 'starting' %} {{ c.displayName }} (Starting) {% elseif c.GetRunningState().value == 'running' %} {{ c.displayName }} (Running) {% else %} {{ c.displayName }} (Stopped) {% endif %} {% if c.documentation != '' %} (docs) {% endif %} {% if c.GetUpdateState().value == 'different' %} ⚠️ Update available {% endif %} {% if c.GetUiSecret() != '' %}
    Show password for {{ c.displayName }}
    {% endif %}
  • ================================================ FILE: php/templates/containers.twig ================================================ {% extends "layout.twig" %} {% block body %}
    {% set aio_version = include('includes/aio-version.twig') %}

    Nextcloud AIO v{{ aio_version }}

    {# Add 2nd tab warning #} {# timezone-prefill #} {# js for optional containers and additional containers forms #} {% set hasBackupLocation = borg_backup_host_location or borg_remote_repo %} {% set isAnyRunning = false %} {% set isAnyRestarting = false %} {% set isWatchtowerRunning = false %} {% set isDomaincheckRunning = false %} {% set isBackupOrRestoreRunning = false %} {% set isApacheStarting = false %} {# Setting newMajorVersion to '' will hide corresponding options/elements, can be set to an integer like 26 in order to show corresponding elements. If set, also increase installLatestMajor in https://github.com/nextcloud/all-in-one/blob/main/php/src/Controller/DockerController.php #} {% set newMajorVersionString = '26 Winter' %} {% set oldMajorVersionString = '25 Autumn' %} {% if is_backup_container_running == true %} {% if borg_backup_mode == 'backup' or borg_backup_mode == 'restore' %} {% set isBackupOrRestoreRunning = true %} {% endif %} {% endif %} {% for container in containers %} {% if container.hideFromList != true and container.GetRunningState().value == 'running' %} {% set isAnyRunning = true %} {% endif %} {% if container.hideFromList != true and container.GetRestartingState().value == 'restarting' %} {% set isAnyRestarting = true %} {% endif %} {% if container.identifier == 'nextcloud-aio-watchtower' and container.GetRunningState().value == 'running' %} {% set isWatchtowerRunning = true %} {% endif %} {% if container.identifier == 'nextcloud-aio-domaincheck' and container.GetRunningState().value == 'running' %} {% set isDomaincheckRunning = true %} {% endif %} {% if container.identifier == 'nextcloud-aio-apache' and container.GetStartingState().value == 'starting' %} {% set isApacheStarting = true %} {% endif %} {% endfor %} {% if is_daily_backup_running == true %}

    Daily backup currently running. (Mastercontainer logs) (Borg backup container logs)

    {% if automatic_updates == true %}

    This will update your containers, the mastercontainer and, on Saturdays, your Nextcloud apps if the backup is successful.

    {% if is_mastercontainer_update_available == true %}

    When the mastercontainer is updated it will restart, making it unavailable for a moment. (Logs)

    {% endif %} {% endif %} {% if has_update_available == false %}

    The whole process should not take more than a few minutes.

    {% elseif automatic_updates == true %}

    The whole process can take a while as your containers will be updated.

    {% endif %}

    Reload ↻

    If the daily backup is stuck somehow, you can unstick it by running sudo docker exec nextcloud-aio-mastercontainer rm /mnt/docker-aio-config/data/daily_backup_running and afterwards reloading this interface.

    {% elseif isWatchtowerRunning == true %}

    Mastercontainer update currently running. Once the update is complete the mastercontainer will restart, making it unavailable for a moment. Please wait until it's done. (Logs)

    Reload ↻

    {% else %} {% if is_backup_container_running == false and domain == "" %} {% if isDomaincheckRunning == false %}

    Domaincheck container is not running

    This is not expected. Most likely this happened because port {{ apache_port }} is already in use on your server. You can check the mastercontainer logs and domaincheck container logs for further clues. You should be able to resolve this by adjusting the APACHE_PORT by following the reverse proxy documentation. Advice: have a detailed look at the changed docker run command for AIO.

    {% elseif is_mastercontainer_update_available == true %}

    Mastercontainer update

    ⚠️ A mastercontainer update is available. Please click on the button below to update it. Afterwards, you will be able to proceed with the setup.

    {% else %} {% if not hasBackupLocation %}

    The official Nextcloud installation method. Nextcloud All-in-One provides easy deployment and maintenance with most features included in this one Nextcloud instance.

    You can either create a new AIO instance or restore a former AIO instance from backup. See the two sections below.

    {{ include('includes/aio-config.twig') }}

    New AIO instance

    {% if apache_port == '443' %}

    AIO is currently in "normal mode" which means that it handles the TLS proxying itself. This also means that it cannot be installed behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). If you want to run AIO behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else), see the reverse proxy documentation. Advice: have a detailed look at the changed docker run command for AIO.

    {% else %}

    AIO is currently in "reverse proxy mode" which means that it can be installed behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) and does not do the TLS proxying itself.

    {% endif %}

    Please type in the domain that will be used for Nextcloud and submit it.

    {% if skip_domain_validation == true %}

    Please note: The domain validation is disabled so any domain will be accepted here! Make sure you do not make a typo here as you will not be able to change it afterwards!

    {% endif %}
    {% if skip_domain_validation == true %} {% endif %}
    {% if skip_domain_validation == false %}

    Make sure that this server is reachable on port 443 (port 443/tcp is open/forwarded in your firewall/router and 443/udp as well if you want to enable http3) and that you've correctly set up the DNS config for the domain that you enter (set the A record to your public ipv4-address and if you need ipv6, set the AAAA record to your public ipv6-address. A CNAME record is, of course, also possible). You should see hints on what went wrong in the top right corner if your domain is not accepted.

    Click here for further hints

    If you do not have a domain yet, you can get one for free e.g. from duckdns.org and others. Recommended is to use Tailscale

    If you have a dynamic public IP-address, you can use e.g. DDclient with a compatible domain provider for DNS updates.

    If you only want to install AIO locally without exposing it to the public internet or if you cannot do so, feel free to follow this documentation.

    If you should be using Cloudflare Proxy for your domain, make sure to disable the Proxy feature temporarily as it might block the domain validation attempts.

    {% if apache_port != '443' %}

    If you run into issues with your domain being accepted, see these steps for how to debug things.

    {% endif %}

    Hint: If the domain validation fails but you are completely sure that you've configured everything correctly, you may skip the domain validation by following this documentation.

    {% endif %}

    Restore former AIO instance from backup

    You can alternatively restore a former AIO instance from backup.

    {% endif %} {% if is_instance_restore_attempt == false %} {% if hasBackupLocation %} {% if borg_backup_mode in ['test', 'check'] %} {% if backup_exit_code > 0 %}

    Last {{ borg_backup_mode }} failed! (Logs)

    {% if borg_backup_mode == 'test' %}

    Please adjust the path and/or the encryption password in order to make it work!

    {% elseif borg_backup_mode == 'check' %}

    The backup archive seems to be corrupt. Please try to use a different intact backup archive or try to fix it by following this documentation

    Reveal repair option

    Below is the option to repair the integrity of your backup. Please note: Please only use this after you have read the documentation above! (It will run the command 'borg check --repair' for you.)

    {% endif %} {% elseif backup_exit_code == 0 %}

    Last {{ borg_backup_mode }} successful! (Logs)

    {% if borg_backup_mode == 'test' %}

    Feel free to check the integrity of the backup archive below before starting the restore process in order to make ensure that the restore will work. This can take a long time though depending on the size of the backup archive and is thus not required.

    {% endif %}

    Choose the backup that you want to restore and click on the button below to restore the selected backup. This will restore the whole AIO instance. Please note that the current AIO passphrase will be kept and the previous AIO passphrase will not be restored from backup!

    Important: If the backup that you want to restore contained any community container, you need to restore the same backup a second time after this attempt so that the community container data is also correctly restored.



    {% endif %} {% elseif borg_backup_mode == 'restore' %} {% if backup_exit_code > 0 %}

    Last restore failed! (Logs)

    The restore process has unexpectedly failed! Please adjust the path and encryption password, test it and try to restore again!

    {% endif %} {% endif %} {% endif %} {% if not hasBackupLocation or borg_backup_mode not in ['test', 'check', ''] or backup_exit_code > 0 %} {% if borg_remote_repo and backup_exit_code > 0 %}

    You may still need to authorize this pubkey on your borg remote:
    {{ borg_public_key }}
    To try again, resubmit your location and rerun the test.

    {% endif %}

    Please enter the location of the backup archive on your host or a remote borg repo url if stored remotely; and the encryption password of the backup archive below and submit all values:




    {{ include('includes/backup-dirs.twig') }}

    ⚠️ Please note that the backup archive must be located in a subfolder of the folder that you enter here and the subfolder which contains the archive must be named 'borg', or the backup container will not be able to find the backup archive!

    {% endif %} {% else %}

    Everything set! Click on the button below to test the path and encryption password:

    {% endif %} {% endif %}

    How to reset the AIO instance?

    If something should be going wrong, for example during the initial installation, you can reset the instance by following this documentation.

    {% endif %} {% if was_start_button_clicked == true %} {% if current_channel starts with 'latest' or current_channel starts with 'beta' or current_channel starts with 'develop' %}

    You are running the {{ current_channel }} channel. (Logs)

    {% else %}

    No channel was found. This means that AIO is not able to update itself and its component and will also not be able to report about updates. Updates need to be done externally.

    {% endif %} {% endif %} {% if is_backup_container_running == true %}

    Backup container is currently running: {{ borg_backup_mode }} (Logs)

    Reload ↻

    {% endif %} {% if domain != "" %} {% if isAnyRunning == true %} {% if isApacheStarting != true %} {% if hasBackupLocation %}
    Click here to reveal the initial Nextcloud credentials {% endif %}

    Initial Nextcloud username: admin

    {% if hasBackupLocation %} {# nextcloud_password needs to be duplicated due to a bug in Firefox. See https://github.com/nextcloud/all-in-one/issues/638. #}

    Initial Nextcloud password: {{ nextcloud_password }}

    {% else %}

    Initial Nextcloud password: {{ nextcloud_password }}

    {% endif %}

    Open your Nextcloud ↗

    {% if not hasBackupLocation %}

    If your Nextcloud does not open when clicking the button above, see this documentation

    {% endif %} {% else %} {% if isAnyRestarting == false %}

    Containers are currently starting. You might inspect the container logs by clicking on Starting next to each container for further details.

    Reload ↻

    {% else %}

    It seems at least one container was not able to start correctly and is currently restarting.

    To break this endless loop, you can stop the containers below and investigate the issue in the container logs before starting the containers again.

    {% endif %} {% endif %} {% endif %} {% if isApacheStarting == false and is_backup_container_running == false %} {{ include('includes/aio-config.twig') }} {% endif %} {% if was_start_button_clicked == true %}

    Containers

      {# @var containers \AIO\Container\Container[] #} {% for container in containers %} {% if container.hideFromList != true %} {% include 'components/container-state.twig' with {'c': container} only %} {% endif %} {% endfor %}
    {% if has_update_available == true %} {% if is_mastercontainer_update_available == false %}

    ⚠️ Container updates are available. Click on Stop containers and Start and update containers to update them. You should consider creating a backup first.

    {% endif %} {% else %} {% if is_mastercontainer_update_available == false %}

    Your containers are up-to-date.

    {% if newMajorVersionString != '' and isAnyRunning == true and isApacheStarting != true %}
    Note about Nextcloud Hub {{ newMajorVersionString }}

    If you haven't upgraded to Nextcloud Hub {{ newMajorVersionString }} yet and want to do that now, feel free to follow this documentation

    {% endif %} {% endif %} {% endif %} {% endif %} {% if isAnyRunning == true %} {% if isApacheStarting != true %} {% if is_mastercontainer_update_available == true %}

    ⚠️ A mastercontainer update is available. Please click on the button below to stop your containers in order to update the mastercontainer.

    {% if current_channel starts with 'latest' %}

    You can find the changelog here

    {% elseif current_channel starts with 'beta' %}

    You can find the changelog here

    {% elseif current_channel starts with 'develop' %}

    You can find all changes here

    {% endif %} {% endif %}
    {% endif %} {% else %} {% if isBackupOrRestoreRunning == true %}

    Restore or Backup currently running. Cannot start the containers until Restore or Backup is complete.

    {% else %} {% if was_start_button_clicked == false %}

    Clicking on the button below will download all docker containers and start them. This can take a long time depending on your internet connection. Since the overall size is a few GB, this can take around 5-10 min or more. Please be patient!

    {% endif %} {% if is_mastercontainer_update_available == true %}

    ⚠️ A mastercontainer update is available. Please click on the button below to update it.

    {% else %} {% if was_start_button_clicked == false %}
    {% if newMajorVersionString != '' %}
    {% endif %}
    {% elseif has_update_available == false %}
    {% if bypass_container_update == true %} {% endif %}
    {% else %}
    {% if bypass_container_update == true %} {% endif %}
    {% endif %} {% endif %} {% endif %} {% endif %} {% if was_start_button_clicked == true %} {% if is_backup_section_enabled == false %}

    Backup and restore

    The backup section is disabled via environmental variable.

    {% else %} {% if is_backup_container_running == false and not hasBackupLocation and isApacheStarting != true %}

    Backup and restore

    Please enter the directory path below where backups will be created on the host system and submit it. It's best to choose a location on a separate drive and not on your root drive.

    To store backups remotely instead, fill in the remote borg repo url and submit it. You will be provided with an SSH public key for authorization at the remote afterwards.



    {{ include('includes/backup-dirs.twig') }} {% endif %} {% endif %} {% if is_backup_section_enabled == true %} {% if hasBackupLocation %} {% if is_backup_container_running == false %}

    Backup and restore

    {% if backup_exit_code > 0 %}

    Last {{ borg_backup_mode }} failed! (Logs)

    {% if borg_backup_mode == "check" %}

    The backup check was not successful. This might indicate a corrupt archive (look at the logs). If that should be the case, you can try to fix it by following this documentation

    Reveal repair option

    Below is the option to repair the integrity of your backup. Please note: Please only use this after you have read the documentation above! (It will run the command 'borg check --repair' for you.)

    {% endif %} {% if has_backup_run_once == false %}

    The initial backup was not successful.

    {% if borg_remote_repo %}

    You may still need to authorize this pubkey on your borg remote:
    {{ borg_public_key }}
    To try again, click Create backup.

    {% endif %}

    You may change the backup path again since the initial backup was not successful. After submitting the new value, you need to click on Create Backup to test the new value.



    {% endif %} {% elseif backup_exit_code == 0 %} {% if borg_backup_mode == "backup" %}

    Last {{ borg_backup_mode }} successful on {{ last_backup_time }} UTC! (Logs)

    {% else %}

    Last {{ borg_backup_mode }} successful! (Logs)

    {% endif %} {% endif %} {% endif %} {% if is_backup_container_running == false and isApacheStarting == false %} {% if has_backup_run_once == true %}
    Click here to reveal all backup options (including an option for automatic updates) {% endif %}

    Backup information

    This is your encryption password for backups: {{ borgbackup_password }}

    Please save this password in a safe place. You won't be able to restore from backup if you lose this password!

    All important data from your Nextcloud AIO instance such as the database, your files and the mastercontainer's configuration files, will be backed up.

    The backup uses a tool called BorgBackup, a well-known server backup tool that efficiently backs up your files and encrypts them on the fly.

    By using this tool, backups are incremental, differential, compressed and encrypted – so only the first backup will take a while. Further backups should be fast as only changes are taken into account.

    {% if borg_remote_repo != '' %}

    Backups get created remotely at:
    {{ borg_remote_repo }} {% if has_backup_run_once == true %}
    Your borg ssh public key is:
    {{ borg_public_key }} {% endif %}

    {% else %}

    Backups will be created in the following directory on the host: {{ borg_backup_host_location }}/borg

    {% endif %}

    Be aware that this solution does not backup files and folders that are mounted into Nextcloud using the external storage app, but you can add further Docker volumes and host paths that you want to back up after the initial backup is done.

    For information about backup retention, see this.

    Daily backups can be enabled after the initial backup is done. Enabling this also allows you to enable an option to update all containers, Nextcloud, and its apps automatically.

    For further documentation and options on this backup solution refer to this section and below.

    {% if isApacheStarting != true %}

    Backup creation

    Clicking on the button below will create a backup.

    {% if has_backup_run_once == true %}

    Backup Viewer

    There is now a community container that allows to access your backups in a web session. See this documentation.

    Backup check

    Click on the button below to perform a backup integrity check. This is an option that verifies that your backup is intact. It shouldn't be needed in most situations.

    Backup restore

    Choose the backup that you want to restore and click on the button below to restore the selected backup. This will overwrite all your files with the chosen backup so you should consider creating a backup first. You can run an integrity check before restoring your files but this shouldn't be needed in most situations. Please note that this will not restore additionally chosen backup directories! The restore process should be pretty fast as rsync, which only transfers changed files, is used to restore the chosen backup.

    Update backup list

    Click here to reveal this option

    If you use an external snapshot tool to restore the server that runs AIO, you might run into a problem that the above listed available backups are not up-to-date to restore your server from. You can click the button below to update this list.

    Daily backup and automatic updates

    {% if daily_backup_time == "" %}

    By entering a time below and submitting it, you can enable daily backups. It will create them at the entered time in 24h format. E.g. 04:00 will create backups at 4 am UTC and 16:00 at 4 pm UTC. When creating the backup, containers will be stopped and restarted after the backup is complete.



    {% else %}

    Daily backups will be created at {{ daily_backup_time }} UTC. A notification about the result of the backup will be sent.

    {% if automatic_updates == true %} Also your containers, the mastercontainer and, on Saturdays, your Nextcloud apps will be automatically updated. {% endif %}

    To change your backup time first disable Daily Backups, then enter your new backup time, and then re-enable them.

    {% endif %}

    Back up additional directories and docker volumes of your host

    Below you can enter directories and docker volumes of your host that will be backed up into the same borg backup archive. Make sure to press the submit button after changing anything.

    Each line and entry needs to start with a slash or letter/digit. Only a-z, A-Z, ., 0-9, _, -, and / are allowed. If the entry begins with a letter/digit slashes are not supported. Two valid entries are /directory/on/the/host and my_custom_docker_volume. You need to make sure that all given directories exist or the backup container will fail to start!

    Be sure to individually specify all storage that you want to back up as storage will not be mounted recursively. E.g. providing / as additional backup directory will only back up files and folders that are stored on the root partition and not on the EFI partition or any other. Excluded by the backup will be caches and a few other directories. If you want to back up the root partition you should make sure to stop all services before the backup so it can run correctly. For automating this see this documentation

    Please note that the chosen directories/volumes will not be restored when you restore your instance, so this would need to be done manually.

    {% if additional_backup_directories != "" %}

    This option is currently set. You can disable it again by clearing the field and submitting your changes.

    {% endif %} {% endif %}

    Reset backup location

    If the configured backup host location {{ borg_backup_host_location }} {% if borg_remote_repo %} or the remote repo {{ borg_remote_repo }} {% endif %} is wrong or if you want to reset the backup location due to other reasons, you can do so by clicking on the button below.

    {% endif %} {% if has_backup_run_once == true %}
    {% endif %} {% endif %} {% endif %} {% endif %} {% if is_backup_container_running == false %} {% if isApacheStarting == false %}

    AIO passphrase change

    Click here to change your AIO passphrase

    You can change your AIO passphrase below:

    The new passphrase needs to be at least 24 characters long. Allowed characters are the latin characters a-z, A-Z, 0-9 and spaces.

    {% endif %} {% endif %} {% endif %} {% if is_backup_container_running == false %} {{ include('includes/optional-containers.twig') }}

    Timezone change

    {% if isAnyRunning == true %} {% if timezone != "" %}

    The timezone for Nextcloud is currently set to {{ timezone }}.

    {% endif %}

    Please note: You can change the timezone when your containers are stopped.

    {% else %} {% if timezone == "" %}

    To get the correct time values for certain Nextcloud features, set the timezone for Nextcloud to the one that your users mainly use. Please note that this setting does not apply to the mastercontainer and any backup option.

    You can configure the timezone for Nextcloud below (Do not forget to submit the value!):

    You need to make sure that the timezone that you enter is valid. An example is Europe/Berlin. You can get valid values by looking at the 'TZ identifier' column of this list: click here. The default is Etc/UTC if nothing is entered.

    {% else %}

    The timezone for Nextcloud is currently set to {{ timezone }}. You can change the timezone by clicking on the button below.

    {% endif %} {% endif %} {{ include('includes/community-containers.twig') }} {% endif %} {% endif %} {% endif %} {% if isApacheStarting == true or is_backup_container_running == true or isWatchtowerRunning == true or is_daily_backup_running == true %} {% else %} {% endif %}
    {% endblock %} ================================================ FILE: php/templates/includes/aio-config.twig ================================================
    Click here to view the current AIO config and documentation links {% if was_start_button_clicked == true %}

    Nextcloud's config.php file is stored in the nextcloud_aio_nextcloud Docker volume and can be edited by following the config.php documentation.

    You can run Nextcloud's usual occ commands by following the occ documentation.

    {% endif %}

    {% if nextcloud_datadir starts with '/' %} Nextcloud's datadir is getting stored in the {{ nextcloud_datadir }} directory. {% else %} Nextcloud's datadir is getting stored in the {{ nextcloud_datadir }} Docker volume. {% endif %} See the NEXTCLOUD_DATADIR documentation on how to change this.

    {% if nextcloud_mount == '' %} The Nextcloud container is confined and local external storage in Nextcloud is disabled. {% else %} The Nextcloud container is getting access to the {{ nextcloud_mount }} directory and local external storage in Nextcloud is enabled. {% endif %} See the NEXTCLOUD_MOUNT documentation on how to change this.

    Nextcloud has an upload limit of {{ nextcloud_upload_limit }} configured (for public link uploads. Bigger uploads are always possible when users are logged in). See the NEXTCLOUD_UPLOAD_LIMIT documentation on how to change this.

    For Nextcloud, a memory limit of {{ nextcloud_memory_limit }} per PHP process is configured. See the NEXTCLOUD_MEMORY_LIMIT documentation on how to change this.

    Nextcloud has a timeout of {{ nextcloud_max_time }} seconds configured (important for big file uploads). See the NEXTCLOUD_MAX_TIME documentation on how to change this.

    {% if is_dri_device_enabled == true and is_nvidia_gpu_enabled == true %} Hardware acceleration is enabled with the /dev/dri device and the Nvidia runtime. {% elseif is_dri_device_enabled == true %} Hardware acceleration is enabled with the /dev/dri device. {% elseif is_nvidia_gpu_enabled == true %} Hardware acceleration is enabled with the Nvidia runtime. {% else %} Hardware acceleration is not enabled. It's recommended to enable hardware transcoding for better performance. {% endif %} See the hardware acceleration documentation on how to change this.

    For further documentation on AIO, refer to this page. You can use the browser search [CTRL]+[F] to search through the documentation. Additional documentation can be found here.

    ================================================ FILE: php/templates/includes/aio-version.twig ================================================ 12.9.0 ================================================ FILE: php/templates/includes/backup-dirs.twig ================================================

    The folder path that you enter must start with / and must not end with /.

    An example for Linux is /mnt/backup.

    On Synology it could be /volume1/docker/nextcloud/backup.

    For macOS it may be /var/backup.

    On Windows it might be /run/desktop/mnt/host/c/backup. (This path is equivalent to 'C:\backup' on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with '/run/desktop/mnt/host/'. Append to that the exact location on your windows host, e.g. 'c/backup' which is equivalent to 'C:\backup'.) ⚠️ Please note: This does not work with external drives like USB or network drives and only with internal drives like SATA or NVME drives.

    Another option is to enter a specific volume name here: nextcloud_aio_backupdir. This volume needs to be created beforehand manually by you in order to be able to use it. See this documentation for an example.

    ================================================ FILE: php/templates/includes/community-containers.twig ================================================

    Community Containers

    In this section you can enable or disable optional Community Containers that are not included by default in the main installation. These containers are provided by the community and can be useful for various purposes and are automatically integrated in AIOs backup solution and update mechanisms.

    ⚠️ Caution: Community Containers are maintained by the community and not officially by Nextcloud. Some containers may not be compatible with your system, may not work as expected or may discontinue. Use them at your own risk. Please read the documentation for each container first before adding any as some are also incompatible between each other! Never add all of them at the same time!

    {% if isAnyRunning == true %}

    Please note: You can enable or disable the options below only when your containers are stopped.

    {% else %}

    Please note: Make sure to save your changes by clicking Save changes below the list of Community Containers. The changes will not be auto-saved.

    {% endif %}
    Show/Hide available Community Containers
    {% for cc in community_containers %}

    {% endfor %}
    ================================================ FILE: php/templates/includes/optional-containers.twig ================================================

    Optional containers

    In this section you can enable or disable optional containers.

    {% if isAnyRunning == true %}

    Please note: You can enable or disable the options below only when your containers are stopped.

    {% else %}

    Please note: Make sure to save your changes by clicking Save changes below the list of optional containers. The changes will not be auto-saved.

    {% endif %}

    Office Suite

    {% if isAnyRunning == false %}

    Choose your preferred office suite. Only one can be enabled at a time.

    {% endif %}
    {% if isAnyRunning == false %}
    {% endif %}

    Additional Optional Containers

    {#

    #}

    Minimal system requirements: When any optional container is enabled, at least 2GB RAM, a dual-core CPU and 40GB system storage are required. When enabling ClamAV, Nextcloud Talk Recording-server or Fulltextsearch, at least 3GB RAM are required. For Talk Recording-server additional 2 vCPUs are required. When enabling everything, at least 5GB RAM and a quad-core CPU are required. Recommended are at least 1GB more RAM than the minimal requirement. For further advice and recommendations see this documentation

    {% if isAnyRunning == true %} {% endif %} {% if is_collabora_enabled == true and isAnyRunning == false and was_start_button_clicked == true %}

    Nextcloud Office dictionaries

    {% if collabora_dictionaries == "" %}

    In order to get the correct dictionaries in Nextcloud Office, you may configure the dictionaries below:

    You need to make sure that the dictionaries that you enter are valid. An example is de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru.

    {% else %}

    The dictionaries for Nextcloud Office are currently set to {{ collabora_dictionaries }}. You can reset them again by clicking on the button below.

    {% endif %}

    Additional Nextcloud Office options

    {% if collabora_additional_options == "" %}

    You can configure additional options for Nextcloud Office below.

    (This can be used for configuring the net.content_security_policy and more. Make sure to submit the value!)

    You need to make sure that the options that you enter are valid. An example is --o:net.content_security_policy=frame-ancestors *.example.com:*;.

    {% else %}

    The additioinal options for Nextcloud Office are currently set to {{ collabora_additional_options }}. You can reset them again by clicking on the button below.

    {% endif %} {% endif %} ================================================ FILE: php/templates/layout.twig ================================================ AIO
    {% block body %}{% endblock %}
    ================================================ FILE: php/templates/log.twig ================================================
    Automatic loading of new log data is enabled.
    {{ logContent }}
    ================================================ FILE: php/templates/login.twig ================================================ {% extends "layout.twig" %} {% block body %} {% endblock %} ================================================ FILE: php/templates/setup.twig ================================================ {% extends "layout.twig" %} {% block body %} {% endblock %} ================================================ FILE: php/tests/.gitignore ================================================ # Playwright node_modules/ /test-results/ /playwright-report/ /blob-report/ /playwright/.cache/ ================================================ FILE: php/tests/package.json ================================================ { "name": "nextcloud-aio-mastercontainer-tests", "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { "@playwright/test": "^1.56.1" } } ================================================ FILE: php/tests/playwright.config.js ================================================ import { defineConfig, devices } from '@playwright/test' /** * @see https://playwright.dev/docs/test-configuration */ export default defineConfig({ testDir: './tests', fullyParallel: false, forbidOnly: !!process.env.CI, retries: 0, workers: 1, reporter: [ ['list'], ['html'], ], use: { baseURL: process.env.BASE_URL ?? 'http://localhost:8080', trace: 'on', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'], ignoreHTTPSErrors: true, }, }, ], }) ================================================ FILE: php/tests/tests/initial-setup.spec.js ================================================ import { test, expect } from '@playwright/test'; import { writeFileSync } from 'node:fs' test('Initial setup', async ({ page: setupPage }) => { test.setTimeout(10 * 60 * 1000) // Extract initial password await setupPage.goto('./setup'); const password = await setupPage.locator('#initial-password').innerText() const containersPagePromise = setupPage.waitForEvent('popup'); await setupPage.getByRole('link', { name: 'Open Nextcloud AIO login ↗' }).click(); const containersPage = await containersPagePromise; // Log in and wait for redirect await containersPage.locator('#master-password').click(); await containersPage.locator('#master-password').fill(password); await containersPage.getByRole('button', { name: 'Log in' }).click(); await containersPage.waitForURL('./containers'); // Reject IP addresses await containersPage.locator('#domain').click(); await containersPage.locator('#domain').fill('1.1.1.1'); await containersPage.getByRole('button', { name: 'Submit domain' }).click(); await expect(containersPage.locator('body')).toContainText('Please enter a domain and not an IP-address!'); // Accept example.com (requires disabled domain validation) await containersPage.locator('#domain').click(); await containersPage.locator('#domain').fill('example.com'); await containersPage.getByRole('button', { name: 'Submit domain' }).click(); // Disable all additional containers await containersPage.locator('#talk').uncheck(); await containersPage.getByRole('checkbox', { name: 'Whiteboard' }).uncheck(); await containersPage.getByRole('checkbox', { name: 'Imaginary' }).uncheck(); await containersPage.getByText('Disable office suite').click(); await containersPage.getByRole('button', { name: 'Save changes' }).last().click(); await expect(containersPage.locator('#talk')).not.toBeChecked() await expect(containersPage.getByRole('checkbox', { name: 'Whiteboard' })).not.toBeChecked() await expect(containersPage.getByRole('checkbox', { name: 'Imaginary' })).not.toBeChecked() await expect(containersPage.locator('#office-none')).toBeChecked() // Reject invalid time zones await containersPage.locator('#timezone').click(); await containersPage.locator('#timezone').fill('Invalid time zone'); containersPage.once('dialog', dialog => { console.log(`Dialog message: ${dialog.message()}`) dialog.accept() }); await containersPage.getByRole('button', { name: 'Submit timezone' }).click(); await expect(containersPage.locator('body')).toContainText('The entered timezone does not seem to be a valid timezone!') // Accept valid time zone await containersPage.locator('#timezone').click(); await containersPage.locator('#timezone').fill('Europe/Berlin'); containersPage.once('dialog', dialog => { console.log(`Dialog message: ${dialog.message()}`) dialog.accept() }); await containersPage.getByRole('button', { name: 'Submit timezone' }).click(); // Start containers and wait for starting message await containersPage.getByRole('button', { name: 'Download and start containers' }).click(); await expect(containersPage.getByRole('main')).toContainText('Containers are currently starting.', { timeout: 5 * 60 * 1000 }); await expect(containersPage.getByRole('link', { name: 'Open your Nextcloud ↗' })).toBeVisible({ timeout: 3 * 60 * 1000 }); await expect(containersPage.getByRole('link', { name: 'Open your Nextcloud ↗' })).toHaveAttribute('href', 'https://example.com'); // Extract initial nextcloud password await expect(containersPage.getByRole('main')).toContainText('Initial Nextcloud password:') const initialNextcloudPassword = await containersPage.locator('#initial-nextcloud-password').innerText(); // Set backup location and create backup const borgBackupLocation = `/mnt/test/aio-${Math.floor(Math.random() * 2147483647)}` await containersPage.locator('#borg_backup_host_location').click(); await containersPage.locator('#borg_backup_host_location').fill(borgBackupLocation); await containersPage.getByRole('button', { name: 'Submit backup location' }).click(); containersPage.once('dialog', dialog => { console.log(`Dialog message: ${dialog.message()}`) dialog.accept() }); await containersPage.getByRole('button', { name: 'Create backup' }).click(); await expect(containersPage.getByRole('main')).toContainText('Backup container is currently running:', { timeout: 3 * 60 * 1000 }); await expect(containersPage.getByRole('main')).toContainText('Last backup successful on', { timeout: 3 * 60 * 1000 }); await containersPage.getByText('Click here to reveal all backup options').click(); await expect(containersPage.locator('#borg-backup-password')).toBeVisible(); const borgBackupPassword = await containersPage.locator('#borg-backup-password').innerText(); // Assert that all containers are stopped await expect(containersPage.getByRole('button', { name: 'Start containers' })).toBeVisible(); // Save passwords for restore backup test writeFileSync('test_data.json', JSON.stringify({ initialNextcloudPassword, borgBackupLocation, borgBackupPassword, })) }); ================================================ FILE: php/tests/tests/restore-instance.spec.js ================================================ import { test, expect } from '@playwright/test'; import { readFileSync } from 'node:fs'; test('Restore instance', async ({ page: setupPage }) => { test.setTimeout(10 * 60 * 1000) // Load passwords from previous test const { initialNextcloudPassword, borgBackupLocation, borgBackupPassword, } = JSON.parse(readFileSync('test_data.json')) // Extract initial password await setupPage.goto('./setup'); const password = await setupPage.locator('#initial-password').innerText() const containersPagePromise = setupPage.waitForEvent('popup'); await setupPage.getByRole('link', { name: 'Open Nextcloud AIO login ↗' }).click(); const containersPage = await containersPagePromise; // Log in and wait for redirect await containersPage.locator('#master-password').click(); await containersPage.locator('#master-password').fill(password); await containersPage.getByRole('button', { name: 'Log in' }).click(); await containersPage.waitForURL('./containers'); // Reject example.com (requires enabled domain validation) await containersPage.locator('#domain').click(); await containersPage.locator('#domain').fill('example.com'); await containersPage.getByRole('button', { name: 'Submit domain' }).click(); await expect(containersPage.locator('body')).toContainText('Domain does not point to this server or the reverse proxy is not configured correctly.', { timeout: 15 * 1000 }); // Reject invalid backup location await containersPage.locator('#borg_restore_host_location').click(); await containersPage.locator('#borg_restore_host_location').fill('/mnt/test/aio-incorrect-path'); await containersPage.locator('#borg_restore_password').click(); await containersPage.locator('#borg_restore_password').fill(borgBackupPassword); await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click() await containersPage.getByRole('button', { name: 'Test path and encryption' }).click(); await expect(containersPage.getByRole('main')).toContainText('Last test failed!', { timeout: 60 * 1000 }); // Reject invalid backup password await containersPage.locator('#borg_restore_host_location').click(); await containersPage.locator('#borg_restore_host_location').fill(borgBackupLocation); await containersPage.locator('#borg_restore_password').click(); await containersPage.locator('#borg_restore_password').fill('foobar'); await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click() await containersPage.getByRole('button', { name: 'Test path and encryption' }).click(); await expect(containersPage.getByRole('main')).toContainText('Last test failed!', { timeout: 60 * 1000 }); // Accept correct backup location and password await containersPage.locator('#borg_restore_host_location').click(); await containersPage.locator('#borg_restore_host_location').fill(borgBackupLocation); await containersPage.locator('#borg_restore_password').click(); await containersPage.locator('#borg_restore_password').fill(borgBackupPassword); await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click() await containersPage.getByRole('button', { name: 'Test path and encryption' }).click(); // Check integrity and restore backup await containersPage.getByRole('button', { name: 'Check backup integrity' }).click(); await expect(containersPage.getByRole('main')).toContainText('Last check successful!', { timeout: 5 * 60 * 1000 }); containersPage.once('dialog', dialog => { console.log(`Dialog message: ${dialog.message()}`) dialog.accept() }); await containersPage.getByRole('button', { name: 'Restore selected backup' }).click(); await expect(containersPage.getByRole('main')).toContainText('Backup container is currently running:', { timeout: 1 * 60 * 1000 }); // Verify a successful backup restore await expect(containersPage.getByRole('main')).toContainText('Last restore successful!', { timeout: 3 * 60 * 1000 }); await expect(containersPage.getByRole('main')).toContainText('⚠️ Container updates are available. Click on Stop containers and Start and update containers to update them. You should consider creating a backup first.'); containersPage.once('dialog', dialog => { console.log(`Dialog message: ${dialog.message()}`) dialog.accept() }); await containersPage.getByRole('button', { name: 'Start and update containers' }).click(); await expect(containersPage.getByRole('link', { name: 'Open your Nextcloud ↗' })).toBeVisible({ timeout: 8 * 60 * 1000 }); await expect(containersPage.getByRole('main')).toContainText(initialNextcloudPassword); // Verify that containers are all stopped await containersPage.getByRole('button', { name: 'Stop containers' }).click(); await expect(containersPage.getByRole('button', { name: 'Start containers' })).toBeVisible({ timeout: 60 * 1000 }); }); ================================================ FILE: readme.md ================================================ # Nextcloud All-in-One > [!NOTE] > Nextcloud AIO is actively looking for contributors. See [the forum post](https://help.nextcloud.com/t/nextcloud-aio-is-looking-for-contributors/205234). The official Nextcloud installation method. Nextcloud AIO provides easy deployment and maintenance with most features included in this one Nextcloud instance. Included are: - Nextcloud - High performance backend for Nextcloud Files (Client Push) - Redis & APCU for performant caching - PostgreSQL as database - Nextcloud Office (optional) - High performance backend for Nextcloud Talk and TURN-server (optional) - Nextcloud Talk Recording-server (optional) - Backup solution (optional, based on [BorgBackup](https://github.com/borgbackup/borg#what-is-borgbackup)) - Imaginary (optional, for previews of heic, heif, illustrator, pdf, svg, tiff and webp) - ClamAV (optional, Antivirus backend for Nextcloud) - Fulltextsearch (optional) - Whiteboard (optional) - Docker Socket Proxy (optional, needed for [Nextcloud App API](https://github.com/cloud-py-api/app_api#nextcloud-appapi)) - [Community containers](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers)
    And much more: - Simple web interface included that enables easy installation and maintenance - [Easy updates included](https://github.com/nextcloud/all-in-one#how-to-update-the-containers) - Update and backup notifications included - Daily backups can be enabled from the AIO interface which also allows updating all containers, Nextcloud and its apps afterwards automatically - Instance restore from backup archive via the AIO interface included (you only need the archive and the password in order to restore the whole instance on a new AIO instance) - APCu as local cache - Redis as distributed cache and for file locking - Postgresql as database - PHP-FPM with performance-optimized config (e.g. Opcache and JIT enabled by default) - A+ security in Nextcloud security scan - Ready to be used behind existing [Reverse proxies](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md) - Can be used behind [Cloudflare Tunnel](https://github.com/nextcloud/all-in-one#how-to-run-nextcloud-behind-a-cloudflare-tunnel) - Can be used via [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) - Ready for big file uploads up to 10 GB on public links, [adjustable](https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud) (logged in users can upload much bigger files using the webinterface or the mobile/desktop clients since chunking is used in that case) - PHP and web server timeouts set to 3600s, [adjustable](https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud) (important for big file uploads) - Defaults to a max of 512 MB RAM per PHP process, [adjustable](https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud) - Automatic TLS included (by using Let's Encrypt) - Brotli compression enabled by default for javascript, css and svg files which reduces Nextcloud load times - HTTP/2 and HTTP/3 enabled - "Pretty URLs" for Nextcloud are enabled by default (removes the index.php from all links) - Video previews work out of the box and when Imaginary is enabled, many recent image formats as well! - Only one domain and not multiple domains are required for everything to work (usually you would need to have one domain for each service which is much more complex) - [Adjustable location](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) of Nextcloud's datadir (e.g. good for easy file-sharing with host system on Windows and MacOS) - By default confined (good for security) but can [allow access to additional storages](https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host) in order to enable the usage of the local external storage feature - Possibility included to [adjust default installed Nextcloud apps](https://github.com/nextcloud/all-in-one#how-to-change-the-nextcloud-apps-that-are-installed-on-the-first-startup) - Nextcloud installation is not read only - that means you can apply patches if you should need them (instead of having to wait for the next release for them getting applied) - `ffmpeg`, `smbclient` and `nodejs` are included by default - Possibility included to [permanently add additional OS packages into the Nextcloud container](https://github.com/nextcloud/all-in-one#how-to-change-the-nextcloud-apps-that-are-installed-on-the-first-startup) without having to build your own Docker image - Possibility included to [permanently add additional PHP extensions into the Nextcloud container](https://github.com/nextcloud/all-in-one#how-to-add-php-extensions-permanently-to-the-nextcloud-container) without having to build your own Docker image - Possibility included to [pass the needed device for hardware transcoding](https://github.com/nextcloud/all-in-one#how-to-enable-hardware-acceleration-for-nextcloud) to the Nextcloud container - Possibility included to [store all docker related files on a separate drive](https://github.com/nextcloud/all-in-one#how-to-store-the-filesinstallation-on-a-separate-drive) - [LDAP can be used as user backend for Nextcloud](https://github.com/nextcloud/all-in-one/tree/main#ldap) - Migration from any former Nextcloud installation to AIO is possible. See [this documentation](https://github.com/nextcloud/all-in-one/blob/main/migration.md). - Migration in the other direction (e.g. from AIO to a VM-based installation) is also possible. - [Fail2Ban can be added](https://github.com/nextcloud/all-in-one#fail2ban) - [phpMyAdmin, Adminer or pgAdmin can be added](https://github.com/nextcloud/all-in-one#phpmyadmin-adminer-or-pgadmin) - [Mail server can be added](https://github.com/nextcloud/all-in-one#mail-server) - Nextcloud can be [accessed locally via the domain](https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally) - Can [be installed locally](https://github.com/nextcloud/all-in-one/blob/main/local-instance.md) (if you don't want or cannot make the instance publicly reachable) - [IPv6-ready](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md) - Can be used with [Docker rootless](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md) (good for additional security) - Runs on all platforms Docker supports (e.g. also on Windows and Macos) - Included containers easy to debug by having the possibility to check their logs directly from the AIO interface - [Docker-compose ready](./compose.yaml) - Can be installed [without a container having access to the docker socket](https://github.com/nextcloud/all-in-one/tree/main/manual-install) - Can be installed with [Docker Swarm](https://github.com/nextcloud/all-in-one#can-i-run-this-with-docker-swarm) - Can be installed with [Kubernetes](https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart) - Almost all included containers Alpine Linux based (good for security and size) - Many of the included containers run as non-root user (good for security) - Many of the included containers have a read-only root-FS (good for security) - Included containers run in its own docker network (good for security) and only really necessary ports are exposed on the host - [Multiple instances on one server](https://github.com/nextcloud/all-in-one/blob/main/multiple-instances.md) are doable without having to deal with VMs - Adjustable backup path or remote borg repository from the AIO interface (good to put the backups e.g. on a different drive if using a local backup path) - Possibility included to also back up external Docker Volumes or Host paths (can be used for host backups) - Borg backup can be completely managed from the AIO interface, including backup creation, backup restore, backup integrity check and integrity-repair - Other forms of [remote backup](https://github.com/nextcloud/all-in-one#are-remote-borg-backups-supported) are indirectly possible - Updates and backups can be [run from an external script](https://github.com/nextcloud/all-in-one#how-to-stopstartupdate-containers-or-trigger-the-daily-backup-from-a-script-externally). See [this documentation](https://github.com/nextcloud/all-in-one#how-to-enable-automatic-updates-without-creating-a-backup-beforehand) for a complete example.
    ## Screenshots | First setup | After installation | |---|---| | ![image](https://github.com/user-attachments/assets/6ef5d7b5-86f2-402c-bc6c-b633af2ca7dd) | ![image](https://github.com/user-attachments/assets/939d0fdf-436f-433d-82d3-27548263a040) | ## How to use this? The steps below are written for Linux. For platform-specific guidance see: - macOS: [How to run AIO on macOS?](#how-to-run-aio-on-macos) - Windows: [How to run AIO on Windows?](#how-to-run-aio-on-windows) - Unraid: [How to run AIO on Unraid?](#how-to-run-aio-on-unraid) - Synology DSM: [How to run AIO on Synology DSM?](#how-to-run-aio-on-synology-dsm) - TrueNAS SCALE: [Can I run AIO on TrueNAS SCALE?](#can-i-run-aio-on-truenas-scale) > [!IMPORTANT] > These instructions assume there is no existing web server or reverse proxy (for example Apache, Nginx, Caddy, or Cloudflare Tunnel) that you intend to place in front of AIO. If you plan to run AIO behind an existing web server or reverse proxy, follow the AIO reverse proxy documentation: [Reverse proxy docs](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md) You're encouraged to skim the attached [FAQ](#faq). While we've tried to make things straightforward, Nextcloud is a large and flexible platform. Reading the FAQ will save you time, particularly if edge cases come up. > [!TIP] > Don't worry about getting everything perfect on the first try — test deployments are cheap and disposable. 1. Install Docker on your Linux host by following the official documentation: [Docker install — supported platforms](https://docs.docker.com/engine/install/#supported-platforms) > [!WARNING] > Snap-based Docker installations are not supported. Make sure you are not using a snap-based Docker installation (generally only applicable to Ubuntu). To check, run: > ```sh > sudo docker info | grep "Docker Root Dir" | grep "/var/snap/docker/" > ``` > If you see the following output: > ``` > /var/snap/docker/ > ``` > you should migrate to a standard Docker installation and remove the snap-based package before proceeding: [Install Docker on Ubuntu](https://docs.docker.com/engine/install/ubuntu/). > > ⚠️ To avoid losing data or interrupting services, only remove the Docker snap after you are certain you're not running any existing containers in it. > > Consult the official Docker documentation or other guides for instructions on migrating existing containers. Once you are certain it's safe, remove the snap-based Docker installation with: > ```sh > sudo snap remove docker > ``` 2. If you need IPv6 support, enable it by following: [Docker IPv6 support for AIO](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md) 3. AIO uses a special `mastercontainer` to orchestrate the various pieces of the Nextcloud stack. To start AIO, launch the `mastercontainer` with the command below: ```sh # For Linux and without a web server or reverse proxy already in place: sudo docker run \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 80:80 \ --publish 8080:8080 \ --publish 8443:8443 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ ghcr.io/nextcloud-releases/all-in-one:latest ```
    Explanation of the command - `sudo docker run` — starts a new Docker container. Omit `sudo` if your user is in the `docker` group. - `--init` — runs an init process inside the container to handle zombie processes. - `--sig-proxy=false` — prevents Ctrl+C in the attached terminal from stopping the container. - `--name nextcloud-aio-mastercontainer` — the container name. Do not change this name; mastercontainer updates rely on it. - `--restart always` — ensures the container restarts automatically with the Docker daemon. - `--publish 80:80` — publishes container port 80 on host port 80 (used for ACME http-challenge when obtaining certificates). Not required if you run AIO behind a reverse proxy. - `--publish 8080:8080` — publishes the AIO interface (self-signed certificate) on host port 8080. You may map a different host port if 8080 is in use (e.g. `--publish 8081:8080`). - `--publish 8443:8443` — publishes the AIO interface with a valid certificate on host port 8443 (requires ports 80 and 8443 to be reachable and a domain pointing to your server). Not required if you run AIO behind a reverse proxy. - `--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config` — stores mastercontainer configuration in the named Docker volume. Do not change this volume name; built-in backups depend on it. - `--volume /var/run/docker.sock:/var/run/docker.sock:ro` — mounts the Docker socket (read-only) so the mastercontainer can manage other containers. On Windows/macOS or when using rootless Docker, this path may need adjustment; see the platform-specific docs. If you change the socket path, also set `WATCHTOWER_DOCKER_SOCKET_PATH` accordingly. If you prefer not to expose the socket, see the manual-install documentation: [Manual install without docker socket access](https://github.com/nextcloud/all-in-one/tree/main/manual-install) - `ghcr.io/nextcloud-releases/all-in-one:latest` — the mastercontainer image. Additional options can be set with environment variables (for example `--env NEXTCLOUD_DATADIR="/mnt/ncdata"` to change Nextcloud's datadir on first startup). See the Customization section and example compose file: [compose.yaml](https://github.com/nextcloud/all-in-one/blob/main/compose.yaml) for more options.
    > [!TIP] > If you want Nextcloud’s data directory in a different location than the default Docker volume, see "How to change the default location of Nextcloud's Datadir" in this README: [How to change the default location of Nextcloud's Datadir](#how-to-change-the-default-location-of-nextclouds-datadir) > [!NOTE] > For production usage (and ease of upgrades and changes), we suggest using the example [Compose file](https://github.com/nextcloud/all-in-one/blob/main/compose.yaml) rather than `docker run`. 4. After the initial startup, open the Nextcloud AIO interface on port 8080 of this server **by IP address**, for example: ```txt https://192.168.5.5:8080 ``` > [!CAUTION] > Use an IP address (not a domain) when accessing the AIO interface on port 8080. Accessing via a domain may work temporarily but is likely to break later due to HSTS. Port 8080 uses a self-signed certificate that you must accept in your browser. It is also possible to obtain a valid certificate automatically if your firewall/router forwards ports 80 and 8443 and you point a domain to your server. In that case, access the AIO interface using the dedicated port for this purpose (8443), for example: ```txt https://your-domain-that-points-to-this-server.tld:8443 ``` 5. If you enable Nextcloud Talk, open port `3478/TCP` and `3478/UDP` in your firewall/router for the Talk (TURN) container. # FAQ - [TOC](#faq) - [Where can I find additional documentation?](#where-can-i-find-additional-documentation) - [How does it work?](#how-does-it-work) - [How to contribute?](#how-to-contribute) - [How many users are possible?](#how-many-users-are-possible) - [Network](#network) - [Are reverse proxies supported?](#are-reverse-proxies-supported) - [Which ports are mandatory to be open in your firewall/router?](#which-ports-are-mandatory-to-be-open-in-your-firewallrouter) - [Explanation of used ports](#explanation-of-used-ports) - [Notes on Cloudflare (proxy/tunnel)](#notes-on-cloudflare-proxytunnel) - [How to run Nextcloud behind a Cloudflare Tunnel?](#how-to-run-nextcloud-behind-a-cloudflare-tunnel) - [How to run Nextcloud via Tailscale?](#how-to-run-nextcloud-via-tailscale) - [How to get Nextcloud running using the ACME DNS-challenge?](#how-to-get-nextcloud-running-using-the-acme-dns-challenge) - [How to run Nextcloud locally? No domain wanted, or wanting intranet access within your LAN.](#how-to-run-nextcloud-locally-no-domain-wanted-or-wanting-intranet-access-within-your-lan) - [Can I use an ip-address for Nextcloud instead of a domain?](#can-i-use-an-ip-address-for-nextcloud-instead-of-a-domain) - [Can I run AIO offline or in an airgapped system?](#can-i-run-aio-offline-or-in-an-airgapped-system) - [Are self-signed certificates supported for Nextcloud?](#are-self-signed-certificates-supported-for-nextcloud) - [Can I use AIO with multiple domains?](#can-i-use-aio-with-multiple-domains) - [Are other ports than the default 443 for Nextcloud supported?](#are-other-ports-than-the-default-443-for-nextcloud-supported) - [Can I run Nextcloud in a subdirectory on my domain?](#can-i-run-nextcloud-in-a-subdirectory-on-my-domain) - [How can I access Nextcloud locally?](#how-can-i-access-nextcloud-locally) - [How to overwrite the local DNS resolution for some domains or add extra hosts to the containers?](#how-to-overwrite-the-local-dns-resolution-for-some-domains-or-add-extra-hosts-to-the-containers) - [How to skip the domain validation?](#how-to-skip-the-domain-validation) - [How to resolve firewall problems with Fedora Linux, RHEL OS, CentOS, SUSE Linux and others?](#how-to-resolve-firewall-problems-with-fedora-linux-rhel-os-centos-suse-linux-and-others) - [What can I do to fix the internal or reserved ip-address error?](#what-can-i-do-to-fix-the-internal-or-reserved-ip-address-error) - [How to adjust the MTU size of the docker network](#how-to-adjust-the-mtu-size-of-the-docker-network) - [Infrastructure](#infrastructure) - [Which CPU architectures are supported?](#which-cpu-architectures-are-supported) - [Disrecommended VPS providers](#disrecommended-vps-providers) - [Recommended VPS](#recommended-vps) - [Note on storage options](#note-on-storage-options) - [Are there known problems when SELinux is enabled?](#are-there-known-problems-when-selinux-is-enabled) - [Customization](#customization) - [How to adjust the internally used docker api version?](#how-to-adjust-the-internally-used-docker-api-version) - [How to change the default location of Nextcloud's Datadir?](#how-to-change-the-default-location-of-nextclouds-datadir) - [How to configure custom UID/GID?](#how-to-configure-custom-uidgid) - [How to move the appdata folder from the datadir to an ssd to improve the performance?](#how-to-move-the-appdata-folder-from-the-datadir-to-an-ssd-to-improve-the-performance) - [How to store the files/installation on a separate drive?](#how-to-store-the-filesinstallation-on-a-separate-drive) - [How to limit the resource usage of AIO?](#how-to-limit-the-resource-usage-of-aio) - [How to allow the Nextcloud container to access directories on the host?](#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host) - [How to adjust the Talk port?](#how-to-adjust-the-talk-port) - [How to adjust the upload limit for Nextcloud?](#how-to-adjust-the-upload-limit-for-nextcloud) - [How to adjust the max execution time for Nextcloud?](#how-to-adjust-the-max-execution-time-for-nextcloud) - [How to adjust the PHP memory limit for Nextcloud?](#how-to-adjust-the-php-memory-limit-for-nextcloud) - [How to change the Nextcloud apps that are installed on the first startup?](#how-to-change-the-nextcloud-apps-that-are-installed-on-the-first-startup) - [How to add OS packages permanently to the Nextcloud container?](#how-to-add-os-packages-permanently-to-the-nextcloud-container) - [How to add PHP extensions permanently to the Nextcloud container?](#how-to-add-php-extensions-permanently-to-the-nextcloud-container) - [What about the pdlib PHP extension for the facerecognition app?](#what-about-the-pdlib-php-extension-for-the-facerecognition-app) - [How to enable hardware acceleration for Nextcloud?](#how-to-enable-hardware-acceleration-for-nextcloud) - [With open source drivers MESA for AMD, Intel and **new** drivers `Nouveau` for Nvidia](#with-open-source-drivers-mesa-for-amd-intel-and-new-drivers-nouveau-for-nvidia) - [With proprietary drivers for Nvidia :warning: BETA](#with-proprietary-drivers-for-nvidia-warning-beta) - [How to keep disabled apps?](#how-to-keep-disabled-apps) - [How to trust user-defined Certification Authorities (CA)?](#how-to-trust-user-defined-certification-authorities-ca) - [How to disable Collabora's Seccomp feature?](#how-to-disable-collaboras-seccomp-feature) - [How to adjust the Fulltextsearch Java options?](#how-to-adjust-the-fulltextsearch-java-options) - [Guides](#guides) - [How to run AIO on macOS?](#how-to-run-aio-on-macos) - [How to run AIO on Windows?](#how-to-run-aio-on-windows) - [How to run AIO on Unraid?](#how-to-run-aio-on-unraid) - [How to run AIO on Synology DSM](#how-to-run-aio-on-synology-dsm) - [How to run AIO with Portainer?](#how-to-run-aio-with-portainer) - [Can I run AIO on TrueNAS SCALE?](#can-i-run-aio-on-truenas-scale) - [How to run `occ` commands?](#how-to-run-occ-commands) - [How to resolve `Security & setup warnings displays the "missing default phone region" after initial install`?](#how-to-resolve-security--setup-warnings-displays-the-missing-default-phone-region-after-initial-install) - [How to run multiple AIO instances on one server?](#how-to-run-multiple-aio-instances-on-one-server) - [Bruteforce protection FAQ](#bruteforce-protection-faq) - [How to switch the channel?](#how-to-switch-the-channel) - [How to update the containers?](#how-to-update-the-containers) - [How to easily log in to the AIO interface?](#how-to-easily-log-in-to-the-aio-interface) - [How to change the domain?](#how-to-change-the-domain) - [How to properly reset the instance?](#how-to-properly-reset-the-instance) - [Can I use a CIFS/SMB share as Nextcloud's datadir?](#can-i-use-a-cifssmb-share-as-nextclouds-datadir) - [Can I run this with Docker swarm?](#can-i-run-this-with-docker-swarm) - [Can I run this with Kubernetes?](#can-i-run-this-with-kubernetes) - [How to run this with Docker rootless?](#can-i-run-this-with-podman-instead-of-docker) - [Can I run this with Podman instead of Docker?](#can-i-run-this-with-podman-instead-of-docker) - [Access/Edit Nextcloud files/folders manually](#accessedit-nextcloud-filesfolders-manually) - [How to edit Nextclouds config.php file with a texteditor?](#how-to-edit-nextclouds-configphp-file-with-a-texteditor) - [How to change default files by creating a custom skeleton directory?](#how-to-change-default-files-by-creating-a-custom-skeleton-directory) - [How to adjust the version retention policy and trashbin retention policy?](#how-to-adjust-the-version-retention-policy-and-trashbin-retention-policy) - [How to enable automatic updates without creating a backup beforehand?](#how-to-enable-automatic-updates-without-creating-a-backup-beforehand) - [Securing the AIO interface from unauthorized ACME challenges](#securing-the-aio-interface-from-unauthorized-acme-challenges) - [How to migrate from an already existing Nextcloud installation to Nextcloud AIO?](#how-to-migrate-from-an-already-existing-nextcloud-installation-to-nextcloud-aio) - [Backup](#backup) - [What is getting backed up by AIO's backup solution?](#what-is-getting-backed-up-by-aios-backup-solution) - [How to adjust borgs retention policy?](#how-to-adjust-borgs-retention-policy) - [How to migrate from AIO to AIO?](#how-to-migrate-from-aio-to-aio) - [Are remote borg backups supported?](#are-remote-borg-backups-supported) - [Failure of the backup container in LXC containers](#failure-of-the-backup-container-in-lxc-containers) - [How to create the backup volume on Windows?](#how-to-create-the-backup-volume-on-windows) - [Pro-tip: Backup archives access](#pro-tip-backup-archives-access) - [Delete backup archives manually](#delete-backup-archives-manually) - [Sync local backups regularly to another drive](#sync-local-backups-regularly-to-another-drive) - [How to exclude Nextcloud's data directory or the preview folder from backup?](#how-to-exclude-nextclouds-data-directory-or-the-preview-folder-from-backup) - [How to stop/start/update containers or trigger the daily backup from a script externally?](#how-to-stopstartupdate-containers-or-trigger-the-daily-backup-from-a-script-externally) - [How to disable the backup section?](#how-to-disable-the-backup-section) - [Addons](#addons) - [Fail2ban](#fail2ban) - [LDAP](#ldap) - [Netdata](#netdata) - [USER_SQL](#user_sql) - [phpMyAdmin, Adminer or pgAdmin](#phpmyadmin-adminer-or-pgadmin) - [Mail server](#mail-server) - [Miscellaneous](#miscellaneous) - [Requirements for integrating new containers](#requirements-for-integrating-new-containers) - [Update policy](#update-policy) - [How often are update notifications sent?](#how-often-are-update-notifications-sent) - [Huge docker logs](#huge-docker-logs) ### Where can I find additional documentation? Some of the documentation is available on [GitHub Discussions](https://github.com/nextcloud/all-in-one/discussions/categories/wiki). ### How does it work? Nextcloud AIO is inspired by projects like Portainer that manage the docker daemon by talking to it through the docker socket directly. This concept allows a user to install only one container with a single command that does the heavy lifting of creating and managing all containers that are needed in order to provide a Nextcloud installation with most features included. It also makes updating a breeze and is not bound to the host system (and its slow updates) anymore as everything is in containers. Additionally, it is very easy to handle from a user perspective because a simple interface for managing your Nextcloud AIO installation is provided. ### How to contribute? See [this issue](https://github.com/nextcloud/all-in-one/issues/5251) for a list of feature requests that need help by contributors. ### How many users are possible? Up to 100 users are free, more are possible with [Nextcloud Enterprise](https://nextcloud.com/all-in-one/) ## Network ### Are reverse proxies supported? Yes. Please refer to the following documentation on this: [reverse-proxy.md](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md) ### Which ports are mandatory to be open in your firewall/router? Only those (if you access the Mastercontainer Interface internally via port 8080): - `443/TCP` for the Apache container - `443/UDP` if you want to enable http3 for the Apache container - `3478/TCP` and `3478/UDP` for the Talk container ### Explanation of used ports - `8080/TCP`: Mastercontainer Interface with self-signed certificate (works always, also if only access via IP-address is possible, e.g. `https://ip.address.of.this.server:8080/`) ⚠️ **Important:** do always use an ip-address if you access this port and not a domain as HSTS might block access to it later! (It is also expected that this port uses a self-signed certificate due to security concerns which you need to accept in your browser) - `80/TCP`: redirects to Nextcloud (is used for getting the certificate via ACME http-challenge for the Mastercontainer) - `8443/TCP`: Mastercontainer Interface with valid certificate (only works if port 80 and 8443 are open/forwarded in your firewall/router and you point a domain to your server. It generates a valid certificate then automatically and access via e.g. `https://public.domain.com:8443/` is possible.) - `443/TCP`: will be used by the Apache container later on and needs to be open/forwarded in your firewall/router - `443/UDP`: will be used by the Apache container later on and needs to be open/forwarded in your firewall/router if you want to enable http3 - `3478/TCP` and `3478/UDP`: will be used by the Turnserver inside the Talk container and needs to be open/forwarded in your firewall/router ### Notes on Cloudflare (proxy/tunnel) Since Cloudflare Proxy/Tunnel comes with a lot of limitations which are listed below, it is rather recommended to switch to [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if possible. - Cloudflare Proxy and Cloudflare Tunnel both require Cloudflare to perform TLS termination on their side and thus decrypt all the traffic on their infrastructure. This is a privacy concern and you will need to look for other solutions if it's unacceptable for you. - Using Cloudflare Tunnel might potentially slow down Nextcloud since local access via the configured domain is not possible because TLS termination is in that case offloaded to Cloudflare's infrastructure. There is no way to disable this behavior in Cloudflare Tunnel. - It is known that the domain validation may not work correctly behind Cloudflare since Cloudflare might block the validation attempt. You can simply skip it in that case by following: https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation - Make sure to [disable Cloudflares Rocket Loader feature](https://help.nextcloud.com/t/login-page-not-working-solved/149417/8) as otherwise Nextcloud's login prompt will not be shown. - Cloudflare only supports uploading files up to 100 MB in the free plan, if you try to upload bigger files you will get an error (413 - Payload Too Large) if no chunking is used (e.g. for public uploads in the web, or if chunks are configured to be bigger than 100 MB in the clients or the web). If you need to upload bigger files, you need to disable the proxy option in your DNS settings. Note that this will both disable Cloudflare DDoS protection and Cloudflare Tunnel as these services require the proxy option to be enabled. - If using Cloudflare Tunnel and the Nextcloud Desktop Client [Set Chunking on Nextcloud Desktop Client](https://github.com/nextcloud/desktop/issues/4271#issuecomment-1159578065) - Cloudflare only allows a max timeout of 100s for requests which is not configurable. This means that any server-side processing e.g. for assembling chunks for big files during upload that take longer than 100s will simply not work. See https://github.com/nextcloud/server/issues/19223. If you need to upload big files reliably, you need to disable the proxy option in your DNS settings. Note that this will both disable Cloudflare DDoS protection and Cloudflare Tunnel as these services require the proxy option to be enabled. - It is known that the in AIO included collabora (Nextcloud Office) does not work out of the box behind Cloudflare. To make it work, you need to add all [Cloudflare IP-ranges](https://www.cloudflare.com/ips/) to the wopi-allowlist in `https://yourdomain.com/settings/admin/richdocuments` - Cloudflare Proxy might block the Turnserver for Nextcloud Talk from working correctly. You might want to disable Cloudflare Proxy thus. See https://github.com/nextcloud/all-in-one/discussions/2463#discussioncomment-5779981 - The built-in turn-server for Nextcloud Talk will not work behind Cloudflare Tunnel since it needs a separate port (by default 3478 or as chosen) available on the same domain. If you still want to use the feature, you will need to install your own turnserver or use a publicly available one and adjust and test your stun and turn settings in `https://yourdomain.com/settings/admin/talk`. - If you get an error in Nextcloud's admin overview that the HSTS header is not set correctly, you might need to enable it in Cloudflare manually. - If you are using AIO's built-in Reverse Proxy and don't use your own, then the certificate issuing may possibly not work out-of-the-box because Cloudflare might block the attempt. In that case you need to disable the Proxy feature at least temporarily in order to make it work. Note that this isn't an option if you need Cloudflare Tunnel as disabling the proxy would also disable Cloudflare Tunnel which would in turn make your server unreachable for the verification. See https://github.com/nextcloud/all-in-one/discussions/1101. ### How to run Nextcloud behind a Cloudflare Tunnel? Although it does not seems like it is the case but from AIO perspective a Cloudflare Tunnel works like a reverse proxy. So please follow the [reverse proxy documentation](./reverse-proxy.md) where is documented how to make it run behind a Cloudflare Tunnel. However please see the [caveats](https://github.com/nextcloud/all-in-one#notes-on-cloudflare-proxytunnel) before proceeding. ### How to run Nextcloud via Tailscale? For a reverse proxy example guide for Tailscale, see this guide by [@Perseus333](https://github.com/Perseus333): https://github.com/nextcloud/all-in-one/discussions/6817 ### How to get Nextcloud running using the ACME DNS-challenge? You can install AIO behind an external reverse proxy where is also documented how to get it running using the ACME DNS-challenge for getting a valid certificate for AIO. See the [reverse proxy documentation](./reverse-proxy.md). (Meant is the `Caddy with ACME DNS-challenge` section). Also see https://github.com/dani-garcia/vaultwarden/wiki/Running-a-private-vaultwarden-instance-with-Let%27s-Encrypt-certs#getting-a-custom-caddy-build for additional docs on this topic. ### How to run Nextcloud locally? No domain wanted, or wanting intranet access within your LAN. If you do not want to open Nextcloud to the public internet, you may have a look at the following documentation on how to set it up locally: [local-instance.md](./local-instance.md), but keep in mind you're still required to have https working properly. ### Can I use an ip-address for Nextcloud instead of a domain? No and it will not be added. If you only want to run it locally, you may have a look at the following documentation: [local-instance.md](./local-instance.md). Recommended is to use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817). ### Can I run AIO offline or in an airgapped system? No. This is not possible and will not be added due to multiple reasons: update checks, app installs via app-store, downloading additional docker images on demand and more. ### Are self-signed certificates supported for Nextcloud? No and they will not be. If you want to run it locally, without opening Nextcloud to the public internet, please have a look at the [local instance documentation](./local-instance.md). Recommended is to use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817). ### Can I use AIO with multiple domains? No and it will not be added. However you can use [this feature](https://github.com/nextcloud/all-in-one/blob/main/multiple-instances.md) in order to create multiple AIO instances, one for each domain. ### Are other ports than the default 443 for Nextcloud supported? No and they will not be. If port 443 and/or 80 is blocked for you, you may use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if you want to publish it online. If you already run a different service on port 443, please use a dedicated domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md). However in all cases the Nextcloud interface will redirect you to port 443. ### Can I run Nextcloud in a subdirectory on my domain? No and it will not be added. Please use a dedicated (sub-)domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md). Alternatively, you may use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if you want to publish it online. ### How can I access Nextcloud locally? Please note that local access is not possible if you are running AIO behind Cloudflare Tunnel since TLS proxying is in that case offloaded to Cloudflares infrastructure. You can fix this by setting up your own reverse proxy that handles TLS proxying locally and will make the steps below work. Please make sure that if you are running AIO behind a reverse proxy, that the reverse proxy is configured to use port 443 on the server that runs it. Otherwise the steps below will not work. Now that this is out of the way, the recommended way how to access Nextcloud locally, is to set up a local dns-server like a pi-hole and set up a custom dns-record for that domain that points to the internal ip-adddress of your server that runs Nextcloud AIO. Below are some guides: - https://www.howtogeek.com/devops/how-to-run-your-own-dns-server-on-your-local-network/ - https://help.nextcloud.com/t/need-help-to-configure-internal-access/156075/6 - https://howchoo.com/pi/pi-hole-setup together with https://web.archive.org/web/20221203223505/https://docs.callitkarma.me/posts/PiHole-Local-DNS/ - https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html Apart from that there is now a community container that can be added to the AIO stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers/pi-hole ### How to overwrite the local DNS resolution for some domains or add extra hosts to the containers? For some use cases, you might need to overwrite the local DNS resolution of some domains inside the containers. On Linux, you can do so either by using a local DNS server as described in the section above and add a local DNS entry into the dns server and make your containers use that DNS server. Another solution on Linux, depending on your network and docker configuration, it might also work to simply edit the `/etc/hosts` file. Add your custom entry like `172.18.0.1 mail.example.com` as additional line to the file and restart docker which should automatically push the entry to all docker containers. ### How to skip the domain validation? If you are completely sure that you've configured everything correctly and are not able to pass the domain validation, you may skip the domain validation by adding `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). Alternatively, if the container is already running, reload the AIO interface with the param `skip_domain_validation` to skip the domain validation on the fly: e.g. `https://ip.address.of.the.server:8080/containers?skip_domain_validation`. ### How to resolve firewall problems with Fedora Linux, RHEL OS, CentOS, SUSE Linux and others? It is known that Linux distros that use [firewalld](https://firewalld.org) as their firewall daemon have problems with docker networks. In case the containers are not able to communicate with each other, you may change your firewalld to use the iptables backend by running: ``` sudo sed -i 's/FirewallBackend=nftables/FirewallBackend=iptables/g' /etc/firewalld/firewalld.conf sudo systemctl restart firewalld docker ``` Afterwards it should work.
    See https://dev.to/ozorest/fedora-32-how-to-solve-docker-internal-network-issue-22me for more details on this. This limitation is even mentioned on the official firewalld website: https://firewalld.org/#who-is-using-it ### What can I do to fix the internal or reserved ip-address error? If you get an error during the domain validation which states that your ip-address is an internal or reserved ip-address, you can fix this by first making sure that your domain indeed has the correct public ip-address that points to the server and then adding `--add-host yourdomain.com:` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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) which will allow the domain validation to work correctly. And so that you know: even if the `A` record of your domain should change over time, this is no problem since the mastercontainer will not make any attempt to access the chosen domain after the initial domain validation. ### How to adjust the MTU size of the docker network You can adjust the MTU size of the docker network by creating it beforehand with the custom MTU: ``` docker network create --driver bridge --opt com.docker.network.driver.mtu=1440 nextcloud-aio ``` When you open the AIO interface for the first time after you execute the `docker run` command, it will automatically connect to the `nextcloud-aio` network with the custom MTU. Keep in mind that if you previously started the mastercontainer without creating the network with the extra options, you will need to remove the old `nextcloud-aio` network and recreate it with the new configuration. If you want to use docker compose, you can check out the comments in the `compose.yaml` file for more details. ## Infrastructure ### Which CPU architectures are supported? You can check this on Linux by running: `uname -m` - x86_64/x64/amd64 - aarch64/arm64/armv8 ### Disrecommended VPS providers - *Older* Strato VPS using Virtuozzo caused problems though ones from Q3 2023 and later should work. If your VPS has a `/proc/user_beancounters` file and a low `numproc` limit set in it your server will likely misbehave once it reaches this limit which is very quickly reached by AIO, see [here](https://github.com/nextcloud/all-in-one/discussions/1747#discussioncomment-4716164). - Hostingers VPS seem to miss a specific Kernel feature which is required for AIO to run correctly. See [here](https://help.nextcloud.com/t/help-installing-nc-via-aio-on-vps/153956). ### Recommended VPS In general recommended VPS are those that are KVM/non-virtualized as Docker should work best on them. ### Note on storage options - SD-cards are disrecommended for AIO since they cripple the performance and they are not meant for many write operations which is needed for the database and other parts - SSD storage is recommended - HDD storage should work as well but is of course much slower than SSD storage ### Are there known problems when SELinux is enabled? Yes. If SELinux is enabled, you might need to add the `--security-opt label:disable` option to the docker run command of the mastercontainer in order to allow it to access the docker socket (or `security_opt: ["label:disable"]` in compose.yaml). See https://github.com/nextcloud/all-in-one/discussions/485 ## Customization ### How to adjust the internally used docker api version? If you run an outdated or too new docker version, you might run into problems with the by AIO internally used docker api version. To fix this, you can specify the api version manually. You can do so by adding `--env DOCKER_API_VERSION=1.44` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). This variable excepts a string based on the pattern `[0-9].[0-9]+`, so e.g. `1.44`. ⚠️ However 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. ### How to change the default location of Nextcloud's Datadir? > [!WARNING] > Do not set or adjust this value after the initial Nextcloud installation is done! If you still want to do it afterwards, see [this](https://github.com/nextcloud/all-in-one/discussions/890#discussioncomment-3089903) on how to do it. You can configure the Nextcloud container to use a specific directory on your host as data directory. You can do so by adding the environmental variable `NEXTCLOUD_DATADIR` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). Allowed values for that variable are strings that start with `/` and are not equal to `/`. The chosen directory or volume will then be mounted to `/mnt/ncdata` inside the container. - An example for Linux is `--env NEXTCLOUD_DATADIR="/mnt/ncdata"`. ⚠️ Please note: If you should be using an external BTRFS drive that is mounted to `/mnt/ncdata`, make sure to choose a subfolder like e.g. `/mnt/ncdata/nextcloud` as datadir, since the root folder is not suited as datadir in that case. See https://github.com/nextcloud/all-in-one/discussions/2696. - On macOS it might be `--env NEXTCLOUD_DATADIR="/var/nextcloud-data"` - For Synology it may be `--env NEXTCLOUD_DATADIR="/volume1/docker/nextcloud/data"`. - On Windows it might be `--env NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ncdata"`. (This path is equivalent to `C:\ncdata` on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with `/run/desktop/mnt/host/`. Append to that the exact location on your windows host, e.g. `c/ncdata` which is equivalent to `C:\ncdata`.) ⚠️ **Please note**: This does not work with external drives like USB or network drives and only with internal drives like SATA or NVME drives. - Another option is to provide a specific volume name here with: `--env NEXTCLOUD_DATADIR="nextcloud_aio_nextcloud_datadir"`. This volume needs to be created beforehand manually by you in order to be able to use it. e.g. on Windows with: ``` docker volume create ^ --driver local ^ --name nextcloud_aio_nextcloud_datadir ^ -o device="/host_mnt/e/your/data/path" ^ -o type="none" ^ -o o="bind" ``` In this example, it would mount `E:\your\data\path` into the volume so for a different location you need to adjust `/host_mnt/e/your/data/path` accordingly. ### How to configure custom UID/GID? There are two ways to configure custom UIDs or GIDs that will be used inside the installation. The first and recommended solution is to use Nextcloud's external storage app and use its functionality to add a connection into Nextcloud. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html Another solution if you really need to use host mounts is to use a bind mount to map custom permissions to the directory. You can do so by editing the `/etc/fstab` file on your Linux server and create an entry like the following to the file: ``` /source/path /target/path/where/the/source/directory/will/be/mounted/on/the/server fuse.bindfs force-user=33,force-group=33,allow_other 0 0 ``` Then use `sudo mount /target/path/where/the/source/directory/will/be/mounted/on/the/server` to mount it directly. You can afterwards use `--env NEXTCLOUD_DATADIR="/target/path/where/the/source/directory/will/be/mounted/on/the/server"` as described in the section above. ### How to move the appdata folder from the datadir to an ssd to improve the performance? If the datadir in your setup is configured to be placed on an HDD or network FS like SMB or NFS, you can follow the steps below to change the location of the appdata folder to be located on an SSD in order to improve the performance of the setup. > [!NOTE] > The following steps only work if you already configured and used NEXTCLOUD_DATADIR as mentioned [two sections above](#how-to-change-the-default-location-of-nextclouds-datadir). > In this example here, we assume that you used `NEXTCLOUD_DATADIR="/target/path/`. After the initial installation is done and all datadir files of Nextcloud are stored inside the configured `/target/path` directory, you will also see an `appdata_*` folder in there that stores app-related data. You can now move that folder to a faster SSD if the target dir is not already positioned on an SSD by first using `rsync` to sync the files a location on an SSD. Afterwards rename the appdata folder in the datadir to something like `appdata_*-backup`. Afterwards add the following line to `/etc/fstab`: ``` /source/path/on/ssd /target/path/ fuse.bindfs force-user=33,force-group=33,allow_other 0 0 ``` Do not forget to adjust `` to the correct `appdata_*` name that your installation initially created automatically. Then use `sudo mount /target/path/` to mount it directly. Afterwards things should be speed up. ### How to store the files/installation on a separate drive? You can move the whole docker library and all its files including all Nextcloud AIO files and folders to a separate drive by first mounting the drive in the host OS (NTFS is not supported and ext4 is recommended as FS) and then following this tutorial: https://www.guguweb.com/2019/02/07/how-to-move-docker-data-directory-to-another-location-on-ubuntu/
    (Of course docker needs to be installed first for this to work.) ⚠️ If you encounter errors from richdocuments in your Nextcloud logs, check in your Collabora container if the message "Capabilities are not set for the coolforkit program." appears. If so, follow these steps: 1. Stop all the containers from the AIO Interface. 2. Go to your terminal and delete the Collabora container (`docker rm nextcloud-aio-collabora`) AND the Collabora image (`docker image rm nextcloud/aio-collabora`). 3. You might also want to prune your Docker (`docker system prune -a`) (no data will be lost). 4. Restart your containers from the AIO Interface. This should solve the problem. ### How to limit the resource usage of AIO? In some cases, you might want to limit the overall resource usage of AIO. You can do so by following [this documentation](https://github.com/nextcloud/all-in-one/discussions/7273). Another possibility is to use the [manual installation](./manual-install/). ### How to allow the Nextcloud container to access directories on the host? By default, the Nextcloud container is confined and cannot access directories on the host OS. You might want to change this when you are planning to use local external storage in Nextcloud to store some files outside the data directory and can do so by adding the environmental variable `NEXTCLOUD_MOUNT` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). Allowed values for that variable are strings that start with `/` and are not equal to `/`. - Two examples for Linux are `--env NEXTCLOUD_MOUNT="/mnt/"` and `--env NEXTCLOUD_MOUNT="/media/"`. - On macOS it might be `--env NEXTCLOUD_MOUNT="/Volumes/your_drive/"` - For Synology it may be `--env NEXTCLOUD_MOUNT="/volume1/"`. - On Windows it might be `--env NEXTCLOUD_MOUNT="/run/desktop/mnt/host/d/your-folder/"`. (This path is equivalent to `D:\your-folder` on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with `/run/desktop/mnt/host/`. Append to that the exact location on your windows host, e.g. `d/your-folder/` which is equivalent to `D:\your-folder`.) ⚠️ **Please note**: This does not work with external drives like USB or network drives and only with internal drives like SATA or NVME drives. After using this option, please make sure to apply the correct permissions to the directories that you want to use in Nextcloud. E.g. `sudo chown -R 33:0 /mnt/your-drive-mountpoint` and `sudo chmod -R 750 /mnt/your-drive-mountpoint` should make it work on Linux when you have used `--env NEXTCLOUD_MOUNT="/mnt/"`. On Windows you could do this e.g. with `docker exec -it nextcloud-aio-nextcloud chown -R 33:0 /run/desktop/mnt/host/d/your-folder/` and `docker exec -it nextcloud-aio-nextcloud chmod -R 750 /run/desktop/mnt/host/d/your-folder/`. You can then navigate to `https://your-nc-domain.com/settings/apps/disabled`, activate the external storage app, navigate to `https://your-nc-domain.com/settings/admin/externalstorages` and add a local external storage directory that will be accessible inside the container at the same place that you've entered. E.g. `/mnt/your-drive-mountpoint` will be mounted to `/mnt/your-drive-mountpoint` inside the container, etc. Be aware though that these locations will not be covered by the built-in backup solution - but you can add further Docker volumes and host paths that you want to back up after the initial backup is done. > [!NOTE] > If you can't see the type "local storage" in the external storage admin options, a restart of the containers from the AIO interface may be required. ### How to adjust the Talk port? By default will the talk container use port `3478/UDP` and `3478/TCP` for connections. This should be set to something higher than 1024! You can adjust the port by adding e.g. `--env TALK_PORT=3478` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 adjusting the port to your desired value. Best is to use a port over 1024, so e.g. 3479 to not run into this: https://github.com/nextcloud/all-in-one/discussions/2517 ### How to adjust the upload limit for Nextcloud? By default, public uploads to Nextcloud are limited to a max of 16G (logged in users can upload much bigger files using the webinterface or the mobile/desktop clients, since chunking is used in that case). You can adjust the upload limit by providing `--env NEXTCLOUD_UPLOAD_LIMIT=16G` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 start with a number and end with `G` e.g. `16G`. ### How to adjust the max execution time for Nextcloud? By default, uploads to Nextcloud are limited to a max of 3600s. You can adjust the upload time limit by providing `--env NEXTCLOUD_MAX_TIME=3600` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 be a number e.g. `3600`. ### How to adjust the PHP memory limit for Nextcloud? By default, each PHP process in the Nextcloud container is limited to a max of 512 MB. You can adjust the memory limit by providing `--env NEXTCLOUD_MEMORY_LIMIT=512M` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 start with a number and end with `M` e.g. `1024M`. ### How to change the Nextcloud apps that are installed on the first startup? You might want to adjust the Nextcloud apps that are installed upon the first startup of the Nextcloud container. You can do so by adding `--env NEXTCLOUD_STARTUP_APPS="deck twofactor_totp tasks calendar contacts notes"` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 be a string with small letters a-z, 0-9, spaces and hyphens or '_'. You can disable shipped and by default enabled apps by adding a hyphen in front of the appid. E.g. `-contactsinteraction`. ### How to add OS packages permanently to the Nextcloud container? Some Nextcloud apps require additional external dependencies that must be bundled within Nextcloud container in order to work correctly. As we cannot put each and every dependency for all apps into the container - as this would make the project quickly unmaintainable - there is an official way in which you can add additional dependencies into the Nextcloud container. However note that doing this is disrecommended since we do not test Nextcloud apps that require external dependencies. You can do so by adding `--env NEXTCLOUD_ADDITIONAL_APKS="imagemagick dependency2 dependency3"` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 be a string with small letters a-z, digits 0-9, spaces, dots and hyphens or '_'. You can find available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.23. By default `imagemagick` is added. If you want to keep it, you need to specify it as well. ### How to add PHP extensions permanently to the Nextcloud container? Some Nextcloud apps require additional php extensions that must be bundled within Nextcloud container in order to work correctly. As we cannot put each and every dependency for all apps into the container - as this would make the project quickly unmaintainable - there is an official way in which you can add additional php extensions into the Nextcloud container. However note that doing this is disrecommended since we do not test Nextcloud apps that require additional php extensions. You can do so by adding `--env NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS="imagick extension1 extension2"` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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 be a string with small letters a-z, digits 0-9, spaces, dots and hyphens or '_'. You can find available extensions here: https://pecl.php.net/packages.php. By default `imagick` is added. If you want to keep it, you need to specify it as well. ### What about the pdlib PHP extension for the facerecognition app? The [facerecognition app](https://apps.nextcloud.com/apps/facerecognition) requires the pdlib PHP extension to be installed. Unfortunately, it is not available on PECL nor via PHP core, so there is no way to add this into AIO currently. However you can use [this community container](https://github.com/nextcloud/all-in-one/tree/main/community-containers/facerecognition) in order to run facerecognition. ### How to enable hardware acceleration for Nextcloud? Some container can use GPU acceleration to increase performance like [memories app](https://apps.nextcloud.com/apps/memories) allows to enable hardware transcoding for videos. #### With open source drivers MESA for AMD, Intel and **new** drivers `Nouveau` for Nvidia > [!WARNING] > This only works if the `/dev/dri` device is present on the host! If it does not exist on your host, don't proceed as otherwise the Nextcloud container will fail to start! If you are unsure about this, better do not proceed with the instructions below. Make sure that your driver is correctly configured on the host. A list of supported device can be fond in [MESA 3D documentation](https://docs.mesa3d.org/systems.html). This method use the [Direct Rendering Infrastructure](https://dri.freedesktop.org/wiki/) with the access to the `/dev/dri` device. In order to use that, you need to add `--env NEXTCLOUD_ENABLE_DRI_DEVICE=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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) which will mount the `/dev/dri` device into the container. #### With proprietary drivers for Nvidia :warning: BETA > [!WARNING] > This only works if the Nvidia Toolkit is installed on the host and an NVIDIA GPU is enabled! Make sure that it is correctly configured on the host. If it does not exist on your host, don't proceed as otherwise the Nextcloud container will fail to start! If you are unsure about this, better do not proceed with the instructions below. > > This feature is in beta. Since the proprietary, we haven't a lot of user using proprietary drivers, we can't guarantee the stability of this feature. Your feedback is welcome. This method use the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html) with the nvidia runtime. In order to use that, you need to add `--env NEXTCLOUD_ENABLE_NVIDIA_GPU=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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) which will enable the nvidia runtime. If you're using WSL2 and want to use the NVIDIA runtime, please follow the instructions to [install the NVIDIA Container Toolkit meta-version in WSL](https://docs.nvidia.com/cuda/wsl-user-guide/index.html#cuda-support-for-wsl-2). ### How to keep disabled apps? In certain situations you might want to keep Nextcloud apps that are disabled in the AIO interface and not uninstall them if they should be installed in Nextcloud. You can do so by adding `--env NEXTCLOUD_KEEP_DISABLED_APPS=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). > [!WARNING] > Doing this might cause unintended problems in Nextcloud if an app that requires an external dependency is still installed but the external dependency not for example. ### How to trust user-defined Certification Authorities (CA)? > [!NOTE] > Please note, that this feature is only intended to make LDAPS connections with self-signed certificates work. It will not make other interconnectivity between the different containers work, as they expect a valid publicly trusted certificate like one from Let's Encrypt. For some applications it might be necessary to establish a secure connection to another host/server which is using a certificate issued by a Certification Authority that is not trusted out of the box. An example could be configuring LDAPS against a domain controller (Active Directory or Samba-based) of an organization. You can make the Nextcloud container trust any Certification Authority by providing the environmental variable `NEXTCLOUD_TRUSTED_CACERTS_DIR` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). The value of the variables should be set to the absolute paths of the directory on the host, which contains one or more Certification Authorities certificates. You should use X.509 certificates, Base64 encoded. (Other formats may work but have not been tested!) All the certificates in the directory will be trusted. When using `docker run`, the environmental variable can be set with `--env NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts`. In order for the value to be valid, the path should start with `/` and not end with `/` and point to an existing **directory**. Pointing the variable directly to a certificate **file** will not work and may also break things. ### How to disable Collabora's Seccomp feature? The Collabora container enables Seccomp by default, which is a security feature of the Linux kernel. On systems without this kernel feature enabled, you need to provide `--env COLLABORA_SECCOMP_DISABLED=true` to the initial docker run command in order to make it work. 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 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. ## Guides ### How to run AIO on macOS? > [!NOTE] > On macOS, it is recommended to use OrbStack instead of Docker Desktop which has much better compatibility with docker for Linux compared to Docker Desktop. See https://orbstack.dev/ Generally, on macOS, there is only one thing different for the docker run command in comparison to Linux: instead of using `--volume /var/run/docker.sock:/var/run/docker.sock:ro`, you need to use `--volume /var/run/docker.sock.raw:/var/run/docker.sock:ro` to run it after you installed [Docker Desktop](https://www.docker.com/products/docker-desktop/) (and don't forget to [enable ipv6](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md) if you should need that). Apart from that it should work and behave the same like on Linux. Also, you may be interested in adjusting Nextcloud's Datadir to store the files on the host system. See [this documentation](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) on how to do it. ### How to run AIO on Windows? On Windows, install [Docker Desktop](https://www.docker.com/products/docker-desktop/) (and don't forget to [enable ipv6](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md) if you should need that) and run the following command in the command prompt: ``` docker run ^ --init ^ --sig-proxy=false ^ --name nextcloud-aio-mastercontainer ^ --restart always ^ --publish 80:80 ^ --publish 8080:8080 ^ --publish 8443:8443 ^ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^ --volume //var/run/docker.sock:/var/run/docker.sock:ro ^ ghcr.io/nextcloud-releases/all-in-one:latest ``` Also, you may be interested in adjusting Nextcloud's Datadir to store the files on the host system. See [this documentation](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) on how to do it. > [!NOTE] > Almost all commands in this project's documentation use `sudo docker ...`. Since `sudo` is not available on Windows, you simply remove `sudo` from the commands and they should work. ### How to run AIO on Unraid? Generally on Unraid, before installing Nextcloud AIO, you should make sure to specify a directory for all docker related files instead of using the default docker image before continuing the installation process. See this guide for more details: https://forums.unraid.net/topic/103924-how-to-turn-my-docker-file-to-a-docker-folder/#comment-962317 Additionally, you might need to create a custom user script to start all sibling containers of AIO automatically whenever the server reboots (since the docker plugin in Unraid does not respect the normal docker restart-policy that is configured for all AIO containers). See the User scripts docs: https://docs.unraid.net/unraid-os/using-unraid-to/run-docker-containers/managing-and-customizing-containers/#user-scripts-plugin. You would need to use a script like the one below and use the schedule option `@reboot` to start the containers automatically. ```bash #!/bin/bash # Wait 120 seconds for other server components to start correctly sleep 120 # Execute the actual command docker exec --env START_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh ``` Apart from that, the installation of AIO should work like on "normal" Linux. So refer to the Linux instructions for installation. ### How to run AIO on Synology DSM On Synology, there are two things different in comparison to Linux: instead of using `--volume /var/run/docker.sock:/var/run/docker.sock:ro`, you need to use `--volume /volume1/docker/docker.sock:/var/run/docker.sock:ro` to run it. You also need to add `--env WATCHTOWER_DOCKER_SOCKET_PATH="/volume1/docker/docker.sock"`to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/all-in-one:latest`). Additionally, you likely need to adjust the internally used api version. See [this documentation](#how-to-adjust-the-internally-used-docker-api-version). Apart from that it should work and behave the same like on Linux. Obviously the Synology Docker GUI will not work with that so you will need to either use SSH or create a user-defined script task in the task scheduler as the user 'root' in order to run the command. > [!NOTE] > It is possible that the docker socket on your Synology is located in `/var/run/docker.sock` like the default on Linux. Then you can just use the Linux command without having to change anything - you will notice this when you try to start the container and it says that the bind mount failed. E.g. `docker: Error response from daemon: Bind mount failed: '/volume1/docker/docker.sock' does not exists.` Also, you may be interested in adjusting Nextcloud's Datadir to store the files on the host system. See [this documentation](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) on how to do it. You'll also need to adjust Synology's firewall, see below:
    Click here to expand The Synology DSM is vulnerable to attacks with it's open ports and login interfaces, which is why a firewall setup is always recommended. If a firewall is activated it is necessary to have exceptions for ports 80,443, the subnet of the docker bridge which includes the Nextcloud containers, your public static IP (if you don't use DDNS) and if applicable your NC-Talk ports 3478 TCP+UDP: ![Screenshot 2023-01-19 at 14 13 48](https://user-images.githubusercontent.com/70434961/213677995-71a9f364-e5d2-49e5-831e-4579f217c95c.png) If you have the NAS setup on your local network (which is most often the case) you will need to setup the Synology DNS to be able to access Nextcloud from your network via its domain. Also don't forget to add the new DNS to your DHCP server and your fixed IP settings: ![Screenshot 2023-01-20 at 12 13 44](https://user-images.githubusercontent.com/70434961/213683295-0b39a2bd-7a26-414c-a408-127dd4f07826.png)
    ### How to run AIO with Portainer? The easiest way to run it with Portainer on Linux is to use Portainer's stacks feature and use [this docker-compose file](./compose.yaml) in order to start AIO correctly. ### Can I run AIO on TrueNAS SCALE? With the Truenas Scale Release 24.10.0 (which was officially released on October 29th 2024 as a stable release) IX Systems ditched the Kubernetes integration and implemented a fully working docker environment. For a more complete guide, see this guide by @zybster: https://github.com/nextcloud/all-in-one/discussions/5506 On older TrueNAS SCALE releases with Kubernetes environment, there are two ways to run AIO. The preferred one is to run AIO inside a VM. This is necessary since they do not expose the docker socket for containers on the host, you also cannot use docker-compose on it thus and it is also not possible to run custom helm-charts that are not explicitly written for TrueNAS SCALE. Another but untested way is to install Portainer on your TrueNAS SCALE from here https://truecharts.org/charts/stable/portainer/installation-notes and add the Helm-chart repository https://nextcloud.github.io/all-in-one/ into Portainer by following https://docs.portainer.io/user/kubernetes/helm. More docs on AIOs Helm Chart are available here: https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart#nextcloud-aio-helm-chart. ### How to run `occ` commands? Simply run the following: `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ your-command`. Of course `your-command` needs to be exchanged with the command that you want to run. **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ### How to resolve `Security & setup warnings displays the "missing default phone region" after initial install`? Simply run the following command: `sudo docker exec --user www-data nextcloud-aio-nextcloud php occ config:system:set default_phone_region --value="yourvalue"`. Of course you need to modify `yourvalue` based on your location. Examples are `DE`, `US` and `GB`. See this list for more codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ### How to run multiple AIO instances on one server? See [multiple-instances.md](./multiple-instances.md) for some documentation on this. ### Bruteforce protection FAQ Nextcloud features a built-in bruteforce protection which may get triggered and will block an ip-address or disable a user. You can unblock an ip-address by running `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ security:bruteforce:reset ` and enable a disabled user by running `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ user:enable `. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#security for further information. **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ### How to switch the channel? You can switch to a different channel like e.g. the beta channel or from the beta channel back to the latest channel by stopping the mastercontainer, removing it (no data will be lost) and recreating the container using the same command that you used initially to create the mastercontainer. You simply need to change the last line `ghcr.io/nextcloud-releases/all-in-one:latest` to `ghcr.io/nextcloud-releases/all-in-one:beta` and vice versa. ⚠️ In some rare occurrences, you might need to run `docker pull ghcr.io/nextcloud-releases/all-in-one:latest` or `docker pull ghcr.io/nextcloud-releases/all-in-one:beta` first before being able to use the image. ### How to update the containers? If we push new containers to `latest`, you will see in the AIO interface below the `containers` section that new container updates were found. In this case, just press `Stop containers` and `Start and update containers` in order to update the containers. The mastercontainer has its own update procedure though. See below. And don't forget to back up the current state of your instance using the built-in backup solution before starting the containers again! Otherwise you won't be able to restore your instance easily if something should break during the update. If a new `mastercontainer` update was found, you'll see a note below the `Stop containers` button that allows to show the changelog. If you click that button and the containers are stopped, you will see a new button that allows to update the mastercontainer. After doing so and after the update is gone through, you will have the option again to `Start and update containers`. It is recommended to create a backup before clicking the `Start and update containers` button. Additionally, there is a cronjob that runs once a day that checks for container and mastercontainer updates and sends a notification to all Nextcloud admins if a new update was found. ### How to easily log in to the AIO interface? If your Nextcloud is running and you are logged in as admin in your Nextcloud, you can easily log in to the AIO interface by opening `https://yourdomain.tld/settings/admin/overview` which will show a button on top that enables you to log in to the AIO interface by just clicking on this button. > [!Note] > You can change the domain/ip-address/port of the button by simply stopping the containers, visiting the AIO interface from the correct and desired domain/ip-address/port and clicking once on `Start containers`. ### How to change the domain? > [!NOTE] > Editing the configuration.json manually and making a mistake may break your instance so please create a backup first! If you set up a new AIO instance, you need to enter a domain. Currently there is no way to change this domain afterwards from the AIO interface. So in order to change it, you need to edit the configuration.json manually using `sudo docker run -it --rm --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config:rw alpine sh -c "apk add --no-cache nano && nano /mnt/docker-aio-config/data/configuration.json"`, substitute each occurrence of your old domain with your new domain and save and write out the file. Afterwards restart your containers from the AIO interface and everything should work as expected if the new domain is correctly configured.
    If you are running AIO behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else), you need to obviously also change the domain in your reverse proxy config. Additionally, after restarting the containers, you need to open the admin settings and update some values manually that cannot be changed automatically. Here is a list of some known places: - `https://your-nc-domain.com/settings/admin/talk` for Turn/Stun server and Signaling Server if you enabled Talk via the AIO interface - `https://your-nc-domain.com/settings/admin/theming` for the theming URL - `https://your-nc-domain.com/settings/admin/app_api` for the deploy daemon if you enabled the App API via the AIO interface ### How to properly reset the instance? If something goes unexpected routes during the initial installation, you might want to reset the AIO installation to be able to start from scratch. > [!NOTE] > If you already have it running and have data on your instance, you should not follow these instructions as it will delete all data that is coupled to your AIO instance. Here is how to reset the AIO instance properly: 1. Stop all containers if they are running from the AIO interface 1. Stop the mastercontainer with `sudo docker stop nextcloud-aio-mastercontainer` 1. If the domaincheck container is still running, stop it with `sudo docker stop nextcloud-aio-domaincheck` 1. Check that no AIO containers are running anymore by running `sudo docker ps --format {{.Names}}`. If no `nextcloud-aio` containers are listed, you can proceed with the steps below. If there should be some, you will need to stop them with `sudo docker stop ` until no one is listed anymore. 1. Check which containers are stopped: `sudo docker ps --filter "status=exited"` 1. Now remove all these stopped containers with `sudo docker container prune` 1. Delete the docker network with `sudo docker network rm nextcloud-aio` 1. Check which volumes are dangling with `sudo docker volume ls --filter "dangling=true"` 1. Now remove all these dangling volumes: `sudo docker volume prune --filter all=1` (on Windows you might need to remove some volumes afterwards manually with `docker volume rm nextcloud_aio_backupdir`, `docker volume rm nextcloud_aio_nextcloud_datadir`). 1. If you've configured `NEXTCLOUD_DATADIR` to a path on your host instead of the default volume, you need to clean that up as well. (E.g. by simply deleting the directory). 1. Make sure that no volumes are remaining with `sudo docker volume ls --format {{.Name}}`. If no `nextcloud-aio` volumes are listed, you can proceed with the steps below. If there should be some, you will need to remove them with `sudo docker volume rm ` until no one is listed anymore. 1. Optional: You can remove all docker images with `sudo docker image prune -a`. 1. And you are done! Now feel free to start over with the recommended docker run command! ### Can I use a CIFS/SMB share as Nextcloud's datadir? Sure. Add this to the `/etc/fstab` file on the host system:
    ` cifs rw,mfsymlinks,seal,credentials=,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0`
    (Of course you need to modify ``, `` and `` for your specific case.) One example could look like this:
    `//your-storage-host/subpath /mnt/storagebox cifs rw,mfsymlinks,seal,credentials=/etc/storage-credentials,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0`
    and add into `/etc/storage-credentials`: ``` username= password= ``` (Of course you need to modify `` and `` for your specific case.) Now you can use `/mnt/storagebox` as Nextcloud's datadir like described in the section [here](#how-to-change-the-default-location-of-nextclouds-datadir). > [!NOTE] > You also might want to move the appdata dir after the initial installation is done to improve the performance. See [this section](#how-to-move-the-appdata-folder-from-the-datadir-to-an-ssd-to-improve-the-performance) ### Can I run this with Docker swarm? Yes. For that to work, you need to use and follow the [manual-install documentation](./manual-install/). ### Can I run this with Kubernetes? Yes. For that to work, you need to use and follow the [helm-chart documentation](./nextcloud-aio-helm-chart/). ### How to run this with Docker rootless? You can run AIO also with docker rootless. How to do this is documented here: [docker-rootless.md](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md) ### Can I run this with Podman instead of Docker? Since Podman is not 100% compatible with the Docker API, Podman is not supported (since that would add yet another platform where the maintainer would need to test on). However you can use and follow the [manual-install documentation](./manual-install/) to get AIO's containers running with Podman or use Docker rootless, as described in the above section. Also there is this now: https://github.com/nextcloud/all-in-one/discussions/3487 ### Access/Edit Nextcloud files/folders manually The files and folders that you add to Nextcloud are by default stored in the following docker directory: `nextcloud_aio_nextcloud:/mnt/ncdata/` (usually `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/` on linux host systems). If needed, you can modify/add/delete files/folders there but **ATTENTION**: be very careful when doing so because you might corrupt your AIO installation! Best is to create a backup using the built-in backup solution before editing/changing files/folders in there because you will then be able to restore your instance to the backed up state. After you are done modifying/adding/deleting files/folders, don't forget to apply the correct permissions by running: `sudo docker exec nextcloud-aio-nextcloud chown -R 33:0 /mnt/ncdata/` and `sudo docker exec nextcloud-aio-nextcloud chmod -R 750 /mnt/ncdata/` and rescan the files with `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all`. **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ### How to edit Nextclouds config.php file with a texteditor? You can edit Nextclouds config.php file directly from the host with your favorite text editor. E.g. like this: `sudo docker run -it --rm --volume nextcloud_aio_nextcloud:/var/www/html:rw alpine sh -c "apk add --no-cache nano && nano /var/www/html/config/config.php"`. Make sure to not break the file though which might corrupt your Nextcloud instance otherwise. In best case, create a backup using the built-in backup solution before editing the file. **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ### How to change default files by creating a custom skeleton directory? All users see a set of [default files and folders](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/default_files_configuration.html) as dictated by Nextcloud's configuration. To change these default files and folders a custom skeleton directory must first be created; this can be accomplished by copying your skeleton files `sudo docker cp --follow-link /path/to/nextcloud/skeleton/ nextcloud-aio-nextcloud:/mnt/ncdata/skeleton/`, applying the correct permissions with `sudo docker exec nextcloud-aio-nextcloud chown -R 33:0 /mnt/ncdata/skeleton/` and `sudo docker exec nextcloud-aio-nextcloud chmod -R 750 /mnt/ncdata/skeleton/` and setting the skeleton directory option with `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:system:set skeletondirectory --value="/mnt/ncdata/skeleton"`. Further information is available in the Nextcloud documentation on [configuration parameters for the skeleton directory](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#skeletondirectory). ### How to adjust the version retention policy and trashbin retention policy? By default, AIO sets the `versions_retention_obligation` and `trashbin_retention_obligation` both to `auto, 30` which means that versions and items in the trashbin get deleted after 30 days. If you want to change this, see https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/file_versioning.html. ### How to enable automatic updates without creating a backup beforehand? If you have an external backup solution, you might want to enable automatic updates without creating a backup first. However note that doing this is disrecommended since you will not be able to easily create and restore a backup from the AIO interface anymore and you need to make sure to shut down all the containers properly before creating the backup, e.g. by stopping them from the AIO interface first. But anyhow, is here a guide that helps you automate the whole procedure:
    Click here to expand ```bash #!/bin/bash # Stop the containers docker exec --env STOP_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh # Below is optional if you run AIO in a VM which will shut down the VM afterwards # poweroff ```
    You can simply copy and paste the script into a file e.g. named `shutdown-script.sh` e.g. here: `/root/shutdown-script.sh`. Afterwards apply the correct permissions with `sudo chown root:root /root/shutdown-script.sh` and `sudo chmod 700 /root/shutdown-script.sh`. Then you can create a cronjob that runs it on a schedule e.g. runs the script at `04:00` each day like this: 1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano). 1. Add the following new line to the crontab if not already present: `0 4 * * * /root/shutdown-script.sh` which will run the script at 04:00 each day. 1. save and close the crontab (when using nano the shortcuts for this are `Ctrl + o` and then `Enter` to save, and close the editor with `Ctrl + x`). **After that is in place, you should schedule a backup from your backup solution that creates a backup after AIO is shut down properly. Hint: If your backup runs on the same host, make sure to at least back up all docker volumes and additionally Nextcloud's datadir if it is not stored in a docker volume.** **Afterwards, you can create a second script that automatically updates the containers:**
    Click here to expand ```bash #!/bin/bash # Run container update once if ! docker exec --env AUTOMATIC_UPDATES=1 nextcloud-aio-mastercontainer /daily-backup.sh; then while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-watchtower$"; do echo "Waiting for watchtower to stop" sleep 30 done while ! docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-mastercontainer$"; do echo "Waiting for Mastercontainer to start" sleep 30 done # Run container update another time to make sure that all containers are updated correctly. docker exec --env AUTOMATIC_UPDATES=1 nextcloud-aio-mastercontainer /daily-backup.sh fi ```
    You can simply copy and paste the script into a file e.g. named `automatic-updates.sh` e.g. here: `/root/automatic-updates.sh`. Afterwards apply the correct permissions with `sudo chown root:root /root/automatic-updates.sh` and `sudo chmod 700 /root/automatic-updates.sh`. Then you can create a cronjob that runs e.g. at `05:00` each day like this: 1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano). 1. Add the following new line to the crontab if not already present: `0 5 * * * /root/automatic-updates.sh` which will run the script at 05:00 each day. 1. save and close the crontab (when using nano the shortcuts for this are `Ctrl + o` then `Enter` to save, and close the editor with `Ctrl + x`). ### Securing the AIO interface from unauthorized ACME challenges [By design](https://github.com/nextcloud/all-in-one/discussions/4882#discussioncomment-9858384), Caddy that runs inside the mastercontainer, which handles automatic TLS certificate generation for the AIO interface on port 8443, is configured to accept traffic on any valid domain in order to make the AIO interface as convenient to use as possible. However due to this, it is vulnerable to receiving DNS challenges for arbitrary hostnames from anyone on the internet. While this does not compromise your server's security, it can result in cluttered logs and rejected certificate renewal attempts due to rate limit abuse. To mitigate this issue, it is recommended to place the AIO interface behind a VPN and/or limit its public exposure. ### How to migrate from an already existing Nextcloud installation to Nextcloud AIO? Please see the following documentation on this: [migration.md](https://github.com/nextcloud/all-in-one/blob/main/migration.md) ## Backup Nextcloud AIO provides a backup solution based on [BorgBackup](https://github.com/borgbackup/borg#what-is-borgbackup). These backups act as a restore point in case the installation gets corrupted. By using this tool, backups are incremental, differential, compressed and encrypted – so only the first backup will take a while. Further backups should be fast as only changes are taken into account. It is recommended to create a backup before any container update. By doing this, you will be safe regarding any possible complication during updates because you will be able to restore the whole instance with basically one click. For local backups, the restore process should be pretty fast as rsync is used to restore the chosen backup which only transfers changed files and deletes additional ones. For remote borg backups, the whole backup archive is extracted from the remote, which depending on how clever `borg extract` is, may require downloading the whole archive. If you connect an external drive to your host, and choose the backup directory to be on that drive, you are also kind of safe against drive failures of the drive where the docker volumes are stored on.
    How to do the above step for step 1. Mount an external/backup HDD to the host OS using the built-in functionality or udev rules or whatever way you prefer. (E.g. follow this video: https://www.youtube.com/watch?v=2lSyX4D3v_s) and mount the drive in best case in `/mnt/backup`. 2. If not already done, fire up the docker container and set up Nextcloud as per the guide. 3. Now open the AIO interface. 4. Under backup section, add your external disk mountpoint as backup directory, e.g. `/mnt/backup`. 5. Click on `Create Backup` which should create the first backup on the external disk.
    If you want to back up directly to a remote borg repository:
    How to do the above step for step 1. Create your borg repository at the remote. Note down the repository URL for later. 2. Open the AIO interface 3. Under backup section, leave the local path blank and fill in the url to your borg repository that you noted down earlier. 4. Click on `Create backup`, this will create an ssh key pair and fail because the remote doesn't trust this key yet. Copy the public key shown in AIO and add it to your authorized keys on the remote. 5. Try again to create a backup, this time it should succeed.
    Backups can be created and restored in the AIO interface using the buttons `Create Backup` and `Restore selected backup`. Additionally, a backup check is provided that checks the integrity of your backups but it shouldn't be needed in most situations. The backups themselves get encrypted with an encryption key that gets shown to you in the AIO interface. Please save that at a safe place as you will not be able to restore from backup without this key. Daily backups can get enabled after the initial backup is done. Enabling this also allows to enable an option that allows to automatically update all containers, Nextcloud and its apps. Be aware that this solution does not back up files and folders that are mounted into Nextcloud using the external storage app - but you can add further Docker volumes and host paths that you want to back up after the initial backup is done. --- ### What is getting backed up by AIO's backup solution? Backed up will get all important data of your Nextcloud AIO instance required to restore the instance, like the database, your files and configuration files of the mastercontainer and else. Files and folders that are mounted into Nextcloud using the external storage app are not getting backed up. There is currently no way to exclude the data directory because it would require hacks like running files:scan and would make the backup solution much more unreliable (since the database and your files/folders need to stay in sync). If you still don't want your datadirectory to be backed up, see https://github.com/nextcloud/all-in-one#how-to-enable-automatic-updates-without-creating-a-backup-beforehand for options (there is a hint what needs to be backed up in which order). ### How to adjust borgs retention policy? The built-in borg-based backup solution has by default a retention policy of `--keep-within=7d --keep-weekly=4 --keep-monthly=6`. See https://borgbackup.readthedocs.io/en/stable/usage/prune.html for what these values mean. You can adjust the retention policy by providing `--env BORG_RETENTION_POLICY="--keep-within=7d --keep-weekly=4 --keep-monthly=6"` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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. ⚠️ Please make sure that this value is valid, otherwise backup pruning will bug out! Also, don't include the `-a` or `--glob-archives` option, since AIO already provides it and you can't override it. See https://github.com/nextcloud/all-in-one/pull/7616 ### How to migrate from AIO to AIO? If you have the borg backup feature enabled, you can copy it over to the new host and restore from the backup. This guide assumes the new installation data dir will be on `/mnt/datadir`, you can adjust the steps if it's elsewhere. 1. Set the DNS entry to 60 seconds TTL if applicable 1. On your current installation, use the AIO interface to: 1. Update AIO and all containers 1. Stop all containers (from now on, your cloud is down) 1. Create a current borg backup 1. Note the path where the backups are stored and the encryption password 1. Navigate to the backup folder 1. Create archive of the backup so it's easier to copy: `tar -czvf borg.tar.gz borg` 1. Copy the archive over to the new host: `scp borg.tar.gz user@new.host:/mnt`. Make sure to replace `user` with your actual user and `new.host` with the IP or domain of the actual host. You can also use another way to copy the archive. 1. Switch to the new host 1. Go to the folder you put the backup archive and extract it with `tar -xf borg.tar.gz` 1. Follow the installation guide to create a new aio instance, but do not start the containers yet (the `docker run` or `docker compose up -d` command) 1. Change the DNS entry to the new host's IP 1. Configure your reverse proxy if you use one 1. Start the AIO container and open the new AIO interface in your browser 1. Make sure to save the newly generated passphrase and enter it in the next step 1. Select the "Restore former AIO instance from backup" option and enter the encryption password from the old backup and the path in which the extracted `borg` folder lies in (without the borg part) and hit `Submit location and password` 1. Choose the latest backup in the dropdown and hit `Restore selected backup` 1. Wait until the backup is restored 1. Start the containers in the AIO interface ### Are remote borg backups supported? Backing up directly to a remote borg repository is supported. This avoids having to store a local copy of your backups, supports append-only borg keys to counter ransomware and allows using the AIO interface to manage your backups. Some alternatives, which do not have all the above benefits: - Mount a network FS like SSHFS, SMB or NFS in the directory that you enter in AIO as backup directory - Use rsync or rclone for syncing the borg backup archive that AIO creates locally to a remote target (make sure to lock the backup archive correctly before starting the sync; search for "aio-lockfile"; you can find a local example script here: https://github.com/nextcloud/all-in-one#sync-local-backups-regularly-to-another-drive) - You can find a well written guide that uses rclone and e.g. BorgBase for remote backups here: https://github.com/nextcloud/all-in-one/discussions/2247 - Here is another one that utilizes borgmatic and BorgBase for remote backups: https://github.com/nextcloud/all-in-one/discussions/4391 - create your own backup solution using a script and borg, borgmatic or any other to backup tool for backing up to a remote target (make sure to stop and start the AIO containers correctly following https://github.com/nextcloud/all-in-one#how-to-enable-automatic-updates-without-creating-a-backup-beforehand) --- ### Failure of the backup container in LXC containers If you are running AIO in a LXC container, you need to make sure that FUSE is enabled in the LXC container settings. Also, if using Alpine Linux as host OS, make sure to add fuse via `apk add fuse`. Otherwise the backup container will not be able to start as FUSE is required for it to work. --- ### How to create the backup volume on Windows? As stated in the AIO interface, it is possible to use a docker volume as backup target. Before you can use that, you need to create it first. Here is an example how to create one on Windows: ``` docker volume create ^ --driver local ^ --name nextcloud_aio_backupdir ^ -o device="/host_mnt/e/your/backup/path" ^ -o type="none" ^ -o o="bind" ``` In this example, it would mount `E:\your\backup\path` into the volume so for a different location you need to adjust `/host_mnt/e/your/backup/path` accordingly. Afterwards enter `nextcloud_aio_backupdir` in the AIO interface as backup location. --- ### Pro-tip: Backup archives access You can open the BorgBackup archives on your host by following these steps:
    (instructions for Ubuntu Desktop) Alternatively, there is now a community container that allows to access your backups in a web session: https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer. ```bash # Install borgbackup on the host sudo apt update && sudo apt install borgbackup # In any shell where you use borg, you must first export this variable # If you are using the default backup location /mnt/backup/borg export BORG_REPO='/mnt/backup/borg' # or if you are using a remote repository export BORG_REPO='user@host:/path/to/repo' # Mount the archives to /tmp/borg sudo mkdir -p /tmp/borg && sudo borg mount "$BORG_REPO" /tmp/borg # After entering your repository key successfully, you should be able to access all archives in /tmp/borg # You can now do whatever you want by syncing them to a different place using rsync or doing other things # E.g. you can open the file manager on that location by running: xhost +si:localuser:root && sudo nautilus /tmp/borg # When you are done, simply close the file manager and run the following command to unmount the backup archives: sudo umount /tmp/borg ``` --- ### Delete backup archives manually You can delete BorgBackup archives on your host manually by following these steps:
    (instructions for Debian based OS' like Ubuntu) Alternatively, there is now a community container that allows to access your backups in a web session: https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer. ```bash # Install borgbackup on the host sudo apt update && sudo apt install borgbackup # In any shell where you use borg, you must first export this variable # If you are using the default backup location /mnt/backup/borg export BORG_REPO='/mnt/backup/borg' # or if you are using a remote repository export BORG_REPO='user@host:/path/to/repo' # List all archives (if you are using the default backup location /mnt/backup/borg) sudo borg list # After entering your repository key successfully, you should now see a list of all backup archives # An example backup archive might be called 20220223_174237-nextcloud-aio # Then you can simply delete the archive with: sudo borg delete --stats --progress "::20220223_174237-nextcloud-aio" # If borg 1.2.0 or higher is installed, you then need to run borg compact in order to clean up the freed space sudo borg --version # If version number of the command above is higher than 1.2.0 you need to run the command below: sudo borg compact ``` After doing so, make sure to update the backup archives list in the AIO interface!
    You can do so by clicking on the `Update backup list` button in the `Update backup list` section inside the `Backup and restore` section. --- ### Sync local backups regularly to another drive For increased backup security, you might consider syncing the local backup repository regularly to another drive. To do that, first add the drive to `/etc/fstab` so that it is able to get automatically mounted and then create a script that does all the things automatically. Here is an example for such a script:
    Click here to expand ```bash #!/bin/bash # Please modify all variables below to your needings: SOURCE_DIRECTORY="/mnt/backup/borg" DRIVE_MOUNTPOINT="/mnt/backup-drive" TARGET_DIRECTORY="/mnt/backup-drive/borg" ######################################## # Please do NOT modify anything below! # ######################################## if [ "$EUID" -ne 0 ]; then echo "Please run as root" exit 1 fi if ! [ -d "$SOURCE_DIRECTORY" ]; then echo "The source directory does not exist." exit 1 fi if [ -z "$(ls -A "$SOURCE_DIRECTORY/")" ]; then echo "The source directory is empty which is not allowed." exit 1 fi if ! [ -d "$DRIVE_MOUNTPOINT" ]; then echo "The drive mountpoint must be an existing directory" exit 1 fi if ! grep -q "$DRIVE_MOUNTPOINT" /etc/fstab; then echo "Could not find the drive mountpoint in the fstab file. Did you add it there?" exit 1 fi if ! mountpoint -q "$DRIVE_MOUNTPOINT"; then mount "$DRIVE_MOUNTPOINT" if ! mountpoint -q "$DRIVE_MOUNTPOINT"; then echo "Could not mount the drive. Is it connected?" exit 1 fi fi if [ -f "$SOURCE_DIRECTORY/lock.roster" ]; then echo "Cannot run the script as the backup archive is currently changed. Please try again later." exit 1 fi mkdir -p "$TARGET_DIRECTORY" if ! [ -d "$TARGET_DIRECTORY" ]; then echo "Could not create target directory" exit 1 fi if [ -f "$SOURCE_DIRECTORY/aio-lockfile" ]; then echo "Not continuing because aio-lockfile already exists." exit 1 fi touch "$SOURCE_DIRECTORY/aio-lockfile" if ! rsync --stats --archive --human-readable --delete "$SOURCE_DIRECTORY/" "$TARGET_DIRECTORY"; then echo "Failed to sync the backup repository to the target directory." exit 1 fi rm "$SOURCE_DIRECTORY/aio-lockfile" rm "$TARGET_DIRECTORY/aio-lockfile" umount "$DRIVE_MOUNTPOINT" if docker ps --format "{{.Names}}" | grep "^nextcloud-aio-nextcloud$"; then docker exec nextcloud-aio-nextcloud bash /notify.sh "Rsync backup successful!" "Synced the backup repository successfully." else echo "Synced the backup repository successfully." fi ```
    You can simply copy and paste the script into a file e.g. named `backup-script.sh` e.g. here: `/root/backup-script.sh`. Do not forget to modify the variables to your requirements! Afterwards apply the correct permissions with `sudo chown root:root /root/backup-script.sh` and `sudo chmod 700 /root/backup-script.sh`. Then you can create a cronjob that runs e.g. at `20:00` each week on Sundays like this: 1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano). 1. Add the following new line to the crontab if not already present: `0 20 * * 7 /root/backup-script.sh` which will run the script at 20:00 on Sundays each week. 1. save and close the crontab (when using nano are the shortcuts for this `Ctrl + o` -> `Enter` and close the editor with `Ctrl + x`). ### How to exclude Nextcloud's data directory or the preview folder from backup? In order to speed up the backups and to keep the backup archives small, you might want to exclude Nextcloud's data directory or its preview folder from backup. > [!WARNING] > However please note that you will run into problems if the database and the data directory or preview folder get out of sync. **So please only read further, if you have an additional external backup of the data directory!** See [this guide](#how-to-enable-automatic-updates-without-creating-a-backup-beforehand) for example. > [!TIP] > A better option is to use the external storage app inside Nextcloud as the data connected via the external storage app is not backed up by AIO's backup solution. See [this documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html) on how to configure the app. If you still want to proceed, you can exclude the data directory by simply creating a `.noaiobackup` file in the root directory of the specified `NEXTCLOUD_DATADIR` target. The same logic is implemented for the preview folder that is located inside the data directory, inside the `appdata_*/preview` folder. So simply create a `.noaiobackup` file in there if you want to exclude the preview folder. After doing a restore via the AIO interface, you might run into problems due to the data directory and database being out of sync. You might be able to fix this by running `occ files:scan --all` and `occ maintenance:repair` and `occ files:scan-app-data`. See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands. If only the preview folder is excluded, the command `occ files:scan-app-data preview` should be used. ### How to stop/start/update containers or trigger the daily backup from a script externally? > [!WARNING] > The below script will only work after the initial setup of AIO. So you will always need to first visit the AIO interface, type in your domain and start the containers the first time or restore an older AIO instance from its borg backup before you can use the script. You can do so by running the `/daily-backup.sh` script that is stored in the mastercontainer. It accepts the following environment variables: - `AUTOMATIC_UPDATES` if set to `1`, it will automatically stop the containers, update them and start them including the mastercontainer. If the mastercontainer gets updated, this script's execution will stop as soon as the mastercontainer gets stopped. You can then wait until it is started again and run the script with this flag again in order to update all containers correctly afterwards. - `DAILY_BACKUP` if set to `1`, it will automatically stop the containers and create a backup. If you want to start them again afterwards, you may have a look at the `START_CONTAINERS` option. - `STOP_CONTAINERS` if set to `1`, it will automatically stop the containers at the start of the script. Implied by `DAILY_BACKUP=1`. - `START_CONTAINERS` if set to `1`, it will automatically start the containers at the end of the script, without updating them. Implied by `AUTOMATIC_UPDATES=1`. - `CHECK_BACKUP` if set to `1`, it will start the integrity check of all borg backups made by AIO. Note that the backup check is non blocking so containers can be kept running while the check lasts. That means you can't pass `DAILY_BACKUP=1` at the same time. The output of the check can be found in the logs of the container `nextcloud-aio-borgbackup`. One example to do a backup would be `sudo docker exec -it --env DAILY_BACKUP=1 nextcloud-aio-mastercontainer /daily-backup.sh`, which you can run via a cronjob or put it in a script. Likewise to do a backup check would be `sudo docker exec --env DAILY_BACKUP=0 --env CHECK_BACKUP=1 --env STOP_CONTAINERS=0 nextcloud-aio-mastercontainer /daily-backup.sh`. > [!NOTE] > None of the option returns error codes. So you need to check for the correct result yourself. ### How to disable the backup section? If you already have a backup solution in place, you may want to hide the backup section. You can do so by adding `--env AIO_DISABLE_BACKUP_SECTION=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/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). ## Addons ### Fail2ban You can configure your server to block certain ip-addresses using fail2ban as bruteforce protection. Here is how to set it up: https://docs.nextcloud.com/server/stable/admin_manual/installation/harden_server.html#setup-fail2ban. The logpath of AIO is by default `/var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/nextcloud.log`. Do not forget to add `chain=DOCKER-USER` to your nextcloud jail config (`nextcloud.local`) otherwise the nextcloud service running on docker will still be accessible even if the IP is banned. Also, you may change the blocked ports to cover all AIO ports: by default `80,443,8080,8443,3478` (see [this](https://github.com/nextcloud/all-in-one#explanation-of-used-ports)). Apart from that there is now a community container that can be added to the AIO stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban ### LDAP It is possible to connect to an existing LDAP server. You need to make sure that the LDAP server is reachable from the Nextcloud container. Then you can enable the LDAP app and configure LDAP in Nextcloud manually. If you don't have a LDAP server yet, recommended is to use this docker container: https://hub.docker.com/r/nitnelave/lldap. Make sure here as well that Nextcloud can talk to the LDAP server. The easiest way is by adding the LDAP docker container to the docker network `nextcloud-aio`. Then you can connect to the LDAP container by its name from the Nextcloud container. There is now a community container which allows to easily add LLDAP to AIO: https://github.com/nextcloud/all-in-one/tree/main/community-containers/lldap ### Netdata Netdata allows you to monitor your server using a GUI. You can install it by following https://learn.netdata.cloud/docs/agent/packaging/docker#create-a-new-netdata-agent-container. Apart from that there is now a way for the community to add containers: https://github.com/nextcloud/all-in-one/discussions/392#discussioncomment-7133563 ### USER_SQL If you want to use the user_sql app, the easiest way is to create an additional database container and add it to the docker network `nextcloud-aio`. Then the Nextcloud container should be able to talk to the database container using its name. ### phpMyAdmin, Adminer or pgAdmin It is possible to install any of these to get a GUI for your AIO database. The pgAdmin container is recommended. You can get some docs on it here: https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html. For the container to connect to the aio-database, you need to connect the container to the docker network `nextcloud-aio` and use `nextcloud-aio-database` as database host, `oc_nextcloud` as database username and the password that you get when running `sudo docker exec nextcloud-aio-nextcloud grep dbpassword config/config.php` as the password. Apart from that there is now a way for the community to add containers: https://github.com/nextcloud/all-in-one/discussions/3061#discussioncomment-7307045 **Please note:** If you do not have CLI access to the server, you can now run docker commands via a web session by using this community container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management ### Mail server You can configure one yourself by using either of these four recommended projects: [Docker Mailserver](https://github.com/docker-mailserver/docker-mailserver/#docker-mailserver), [Mailu](https://github.com/Mailu/Mailu), [Maddy Mail Server](https://github.com/foxcpp/maddy#maddy-mail-server), [Mailcow](https://github.com/mailcow/mailcow-dockerized#mailcow-dockerized-------) or [Stalwart](https://stalw.art/). There is now a community container which allows to easily add Stalwart Mail server to AIO: https://github.com/nextcloud/all-in-one/tree/main/community-containers/stalwart ## Miscellaneous ### Requirements for integrating new containers For integrating new containers, they must pass specific requirements for being considered to get integrated in AIO itself. Even if not considered, we may add some documentation on it. Also there is this now: https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers What are the requirements? 1. New containers must be related to Nextcloud. Related means that there must be a feature in Nextcloud that gets added by adding this container. 2. It must be optionally installable. Disabling and enabling the container from the AIO interface must work and must not produce any unexpected side-effects. 3. The feature that gets added into Nextcloud by adding the container must be maintained by the Nextcloud GmbH. 4. It must be possible to run the container without big quirks inside docker containers. Big quirks means e.g. needing to change the capabilities or security options. 5. The container should not mount directories from the host into the container: only docker volumes should be used. 6. The container must be usable by more than 90% of the users (e.g. not too high system requirements and such) 7. No additional setup should be needed after adding the container - it should work completely out of the box. 8. If the container requires being exposed, only subfolders are supported. So the container should not require its own (sub-)domain and must be able to run in a subfolder. ### Update policy This project values stability over new features. That means that when a new major Nextcloud update gets introduced, we will wait at least until the first patch release, e.g. `24.0.1` is out before upgrading to it. Also we will wait with the upgrade until all important apps are compatible with the new major version. Minor or patch releases for Nextcloud and all dependencies as well as all containers will be updated to new versions as soon as possible but we try to give all updates first a good test round before pushing them. That means that it can take around 2 weeks before new updates reach the `latest` channel. If you want to help testing, you can switch to the `beta` channel by following [this documentation](#how-to-switch-the-channel) which will also give you the updates earlier. ### How often are update notifications sent? AIO ships its own update notifications implementation. It checks if container updates are available. If so, it sends a notification with the title `Container updates available!` on saturdays to Nextcloud users that are part of the `admin` group. If the Nextcloud container image should be older than 90 days (~3 months) and thus badly outdated, AIO sends a notification to all Nextcloud users with the title `AIO is outdated!`. Thus admins should make sure to update the container images at least once every 3 months in order to make sure that the instance gets all security bugfixes as soon as possible. ### Huge docker logs If you should run into issues with huge docker logs, you can adjust the log size by following https://docs.docker.com/config/containers/logging/local/#usage. However for the included AIO containers, this should usually not be needed because almost all of them have the log level set to warn so they should not produce many logs.
    Badges [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/nextcloud/all-in-one)
    ================================================ FILE: reverse-proxy.md ================================================ # Using a reverse proxy or secure tunnel to access Nextcloud AIO ## Introduction This guide explains how to connect to Nextcloud AIO securely via HTTPS (TLS) using a reverse proxy or a secure tunneling platform. It covers several potential scenarios: - **Integrated**: AIO's built-in reverse proxy with automatic HTTPS - **External**: An external reverse proxy (such as Caddy or Nginx or Cloudflare Proxy) - **Secure tunnel**: Tunneling services for private network access or public access without port forwarding (such as Tailscale Serve or Cloudflare Tunnel) ## Choosing Your Approach > [!TIP] > If AIO's internal reverse proxy meets your needs, you may not need to set up your own reverse proxy. See the next section to assess whether this is the case. > [!NOTE] > If your goal is to use AIO purely locally, refer to the [Local instance documentation](https://github.com/nextcloud/all-in-one/blob/main/local-instance.md). Local instance setups don't require domain validation. ### When to use each approach | Approach | Best for | Requirements | Inbound Ports Required | |----------|----------|--------------|---------------| | **Integrated** | Simple setups, single service on port 443 | Public IP, dedicated port 443 | Yes (443) | | **External Reverse Proxy** (including Cloudflare Proxy) | Multiple services, existing web server, or users wanting DDoS protection | Existing reverse proxy, willingness to set one up, or Cloudflare account | Yes (443) | | **Cloudflare Tunnel** | No port forwarding possible/desired, public access | Cloudflare account | No | | **Tailscale Serve** | Private access (tailnet only) | Tailscale account | No | | **Tailscale Funnel** | Public access via Tailscale | Tailscale account | No | ## Implementation Details ### Integrated: Using AIO's internal reverse proxy with built-in HTTPS support Nextcloud AIO is secured with TLS (HTTPS) out of the box via its internal reverse proxy. The integrated HTTPS support works well if your goal is to make AIO accessible from the public Internet and to ensure all traffic is encrypted with HTTPS. Requirements: - A public IP address that is reachable from the Internet (it does **not** need to be static, but it must not be behind carrier-grade NAT, which some ISPs use to share IP addresses among multiple customers). - Port `443/tcp` on that IP must be available for AIO's exclusive use, and it must be opened/forwarded on your internet-facing firewall/router to the AIO host.[^talkPort] **If AIO's integrated HTTPS support and internal reverse proxy meet your requirements, you do not need to proceed further. Follow the [standard Nextcloud AIO instructions](https://github.com/nextcloud/all-in-one#how-to-use-this).** ### External: Using AIO with an external reverse proxy (e.g., *Caddy, Nginx, Cloudflare Proxy*) **When you use an external reverse proxy, you disable AIO's built-in HTTPS support** because your reverse proxy will handle HTTPS/TLS certificates and encryption instead. This approach is necessary when: - Port 443 is already in use by another service - You want to run multiple web services on the same IP address - You already have an existing reverse proxy infrastructure A reverse proxy (or a web server acting as a reverse proxy) enables multiple web applications to share the same IP address and/or port (for example `443/tcp`) by directing traffic based on each application's hostname (often called "virtual hosts"). Incoming requests reach the reverse proxy and are then forwarded to the appropriate internal IP address, port, or container based on the requested hostname. **Types of external reverse proxies:** - **Self-hosted** (Caddy, Nginx, Apache, Traefik, HAProxy, etc.) - You manage the reverse proxy on your own server or separate server - **Cloudflare Proxy** (orange-clouded DNS) - Cloudflare provides the reverse proxy at their edge network with DDoS protection and CDN benefits. This is distinct from Cloudflare Tunnel, though Tunnel can optionally use these proxy features when publishing routes. Most notably, an external reverse proxy allows you to: - share one external IP address among multiple hostnames/web applications, and - use a different internal port than the externally used port. Using an existing external reverse proxy is required in particular if port `443/tcp` on your public IP is already in use by another web application or by an existing web server/reverse proxy (for example Caddy or Nginx). > [!NOTE] > Cloudflare **Tunnel** and Cloudflare **Proxy** are different approaches: > - **Cloudflare Tunnel** doesn't require opening any inbound ports on your firewall. > - **Cloudflare Proxy** still requires port 443 exposed on your server. > [!TIP] > Examples of web servers or reverse proxies you might already be running include Apache, Caddy, Nginx, Traefik, and HAProxy — but only if they are bound to port `443/tcp` on the IP address you plan to associate with AIO. > [!NOTE] > An external reverse proxy can also facilitate other routing approaches, but Nextcloud AIO only supports having its own dedicated hostname (e.g., `cloud.example.com`). You cannot run it in a subfolder like `example.com/nextcloud/`.[^shared] ### Secure tunnel: Using AIO with a secure tunneling service (*Tailscale, Cloudflare*) Cloudflare and Tailscale offer secure tunneling services that let you access your Nextcloud without opening ports on your firewall. #### Private network access For Nextcloud AIO, you can use: - **Cloudflare Tunnel (`cloudflared`)** - Secure outbound-only tunnels that don't require exposing ports - **Tailscale Serve** - Expose services privately on your Tailscale network (tailnet only) Both options provide private network access to your Nextcloud AIO instance. #### Public Internet access (without port forwarding) To make your Nextcloud AIO instance accessible from the public Internet (not just your private network), you can use: - **Cloudflare Tunnel** with public routes enabled (which combines Cloudflare Tunnel with Cloudflare's proxy features) - **Tailscale Funnel** - Expose services to the public Internet via Tailscale's infrastructure **Comparison of Cloudflare and Tailscale options:** | Feature | Access Scope | Inbound Ports Required | Use Case | |---------|--------------|----------------|----------| | **Cloudflare Tunnel** | Public Internet | None | Public access without port forwarding | | **Tailscale Serve** | Your Tailscale network only | None | Private access for you and invited users | | **Tailscale Funnel** | Public Internet | None | Public access through Tailscale | > [!TIP] > Because of how [Cloudflare's Tunnel/Proxy operate](https://github.com/nextcloud/all-in-one/tree/main#notes-on-cloudflare-proxytunnel), we recommend using Tailscale with Nextcloud when possible. Tailscale typically offers better performance and fewer trade-offs/limitations for Nextcloud. > > **For private/personal use**: [Tailscale Serve](https://tailscale.com/kb/1312/serve) is ideal - it keeps your Nextcloud completely private to your tailnet. > > **For public access without port forwarding**: Use [Tailscale Funnel](https://tailscale.com/kb/1223/funnel). ## Configuration and Deployment > [!NOTE] > These instructions assume you already have a domain name pointing to your server's public IP address. If you don't have a domain yet, see the recommendations below. ### Quick overview To run Nextcloud AIO behind an external reverse proxy or secure tunneling/proxying service (instead of using AIO's integrated reverse proxy), the basic process is: 1. Configure your web server or reverse proxy with the specific settings for AIO. 2. Specify the port that AIO's integrated Apache container will use. 3. Open the AIO interface and validate your domain. The sections below provide detailed instructions for each step. > [!TIP] > If you don't have a domain yet, we recommend using [an approach using Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817). If you don't have an external reverse proxy yet, we recommend [Caddy](https://github.com/nextcloud/all-in-one/discussions/575). ### Step-by-Step Instructions The process to run Nextcloud AIO behind a reverse proxy has three required steps and three optional steps: **Required steps:** 1. **Configure** your web server or reverse proxy with the specific settings for AIO. See ["Configuring your reverse proxy"](#1-configure-the-reverse-proxy) below. 2. **Specify** the port that AIO's integrated Apache container will use via the environment variable `APACHE_PORT`, and update the `docker run` command or your Compose file accordingly. See ["Use this startup command"](#2-use-this-startup-command) below. - *Optional*: Limit the access to the Apache container. See ["Limit the access to the Apache container"](#3-limit-the-access-to-the-apache-container). 3. **Open** the AIO interface at port `8080`, enter your domain, and validate it. See ["Open the AIO interface"](#4-open-the-aio-interface) below. **Optional steps:** 4. Configure additional settings if your reverse proxy uses an IP address to connect to AIO. See ["Configure AIO for IP-based reverse proxies"](#5-optional-configure-aio-for-reverse-proxies-that-connect-to-nextcloud-using-an-ip-address-and-not-localhost-nor-127001). 5. Get a valid certificate for the AIO interface. See ["Get a valid certificate for the AIO interface"](#6-optional-get-a-valid-certificate-for-the-aio-interface). 6. Debug things if needed. See ["How to debug things"](#7-how-to-debug-things). > [!NOTE] > If you run into troubles, see [the debug section](#7-how-to-debug-things). > [!IMPORTANT] > If you need HTTPS between Nextcloud and the reverse proxy (because the reverse proxy runs on a different server), you have two options: > > 1. **Add a local reverse proxy**: Install another reverse proxy on the same server as AIO to handle HTTPS (typically with self-signed certificates) > 2. **Use a VPN**: Create a VPN tunnel between the AIO server and the reverse proxy server to encrypt the connection > [!NOTE] > Since the Apache container gets created by the mastercontainer, there is **NO** way to provide custom Docker labels or custom environmental variables for the Apache container. So please do not attempt to do this because it will fail! ### 1. Configure the reverse proxy #### Adapting the sample web server configurations below 1. Replace `` with the domain on which you want to run Nextcloud. 1. Adjust the port `11000` to match your chosen `APACHE_PORT`. 1. Adjust `localhost` or `127.0.0.1` to point to the Nextcloud server IP or domain depending on where the reverse proxy is running. See the following options.
    On the same server without a container For this setup, the default sample configurations with `localhost:$APACHE_PORT` should work.
    On the same server in a Docker container The reverse-proxy container needs to be connected to the nextcloud containers. This can be achieved one of these 3 ways: 1. Utilize host networking instead of docker bridge networking: Specify `--network host` option (or `network_mode: host` for docker-compose) as setting for the reverse proxy container to connect it to the host network. If you are using a firewall on the server, you need to open ports 80 and 443 for the reverse proxy manually. With this setup, the default sample configurations with reverse-proxy pointing to `localhost:$APACHE_PORT` should work directly. 1. Connect nextcloud's external-facing containers to the reverse-proxy's docker network by specifying env variable APACHE_ADDITIONAL_NETWORK. With this setup, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache.nextcloud-aio:$APACHE_PORT`. ⚠️⚠️⚠️ Note, the specified network must already exist before Nextcloud AIO is started. Otherwise it will fail to start the container because the network is not existing. 1. Connect the reverse-proxy container to the `nextcloud-aio` network by specifying it as a secondary (external) network for the reverse proxy container. With this setup also, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache.nextcloud-aio:$APACHE_PORT` .
    On a different server (in container or not) Use the private ip-address of the host that shall be running AIO. So e.g. `private.ip.address.of.aio.server:$APACHE_PORT` instead of `localhost:$APACHE_PORT`. If you are not sure how to retrieve that, you can run: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'` on the server that shall be running AIO (the commands only work on Linux).
    ##### Apache
    click here to expand **Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! Add this as a new Apache site config: (The config below assumes that you are using certbot to get your certificates. You need to create them first in order to make it work.) ``` ServerName RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{SERVER_NAME} = RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] ServerName # Reverse proxy based on https://httpd.apache.org/docs/current/mod/mod_proxy_wstunnel.html RewriteEngine On ProxyPreserveHost On RequestHeader set X-Real-IP %{REMOTE_ADDR}s AllowEncodedSlashes NoDecode # Adjust the two lines below to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below ProxyPass / http://localhost:11000/ nocanon ProxyPassReverse / http://localhost:11000/ RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteCond %{THE_REQUEST} "^[a-zA-Z]+ /(.*) HTTP/\d+(\.\d+)?$" RewriteRule .? "ws://localhost:11000/%1" [P,L,UnsafeAllow3F] # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below # Enable h2, h2c and http1.1 Protocols h2 h2c http/1.1 # Solves slow upload speeds caused by http2 H2WindowSize 5242880 # TLS SSLEngine on SSLProtocol -all +TLSv1.2 +TLSv1.3 SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305 SSLHonorCipherOrder off SSLSessionTickets off # If running apache on a subdomain (eg. nextcloud.example.com) of a domain that already has an wildcard ssl certificate from certbot on this machine, # the in the below lines should be replaced with just the domain (eg. example.com), not the subdomain. # In this case the subdomain should already be secured without additional actions SSLCertificateFile /etc/letsencrypt/live//fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live//privkey.pem # Disable HTTP TRACE method. TraceEnable off Require all denied # Support big file uploads LimitRequestBody 0 Timeout 86400 ProxyTimeout 86400 ``` ⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration. To make the config work you can run the following command: `sudo a2enmod rewrite proxy proxy_http proxy_wstunnel ssl headers http2`
    ##### Caddy (recommended)
    click here to expand **Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/575#discussion-4055615) for a more complete but possibly outdated example. Add this to your Caddyfile: ``` https://:443 { reverse_proxy localhost:11000 # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below } ``` The Caddyfile is a text file called `Caddyfile` (no extension) which – if you should be running Caddy inside a container – should usually be created in the same location as your `compose.yaml` file prior to starting the container. ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration. **Advice:** You may have a look at [this](https://github.com/nextcloud/all-in-one/discussions/575#discussion-4055615) for a more complete example.
    ##### Caddy with ACME DNS-challenge
    click here to expand You can get AIO running using the ACME DNS-challenge. Here is how to do it. 1. Follow [this documentation](https://caddy.community/t/how-to-use-dns-provider-modules-in-caddy-2/8148) in order to get a Caddy build that is compatible with your domain provider's DNS challenge. 1. Add this to your Caddyfile: ``` https://:443 { reverse_proxy localhost:11000 # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below tls { dns } } ``` ⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration. You also need to adjust `` and `` to match your case. 1. Now continue with [point 2](#2-use-this-startup-command) but additionally, add `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/all-in-one:latest`) which will disable the domain validation (because it is known that the domain validation will not work when using the DNS-challenge since no port is publicly opened). **Advice:** In order to make it work in your home network, you may add the internal ipv4-address of your reverse proxy as A DNS-record to your domain and disable the dns-rebind-protection in your router. Another way it to set up a local dns-server like a pi-hole and set up a custom dns-record for that domain that points to the internal ip-adddress of your reverse proxy (see https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally). If both is not possible, you may add the domain to the hosts file which is needed then for any devices that shall use the server.
    ##### OpenLiteSpeed
    click here to expand You can find the OpenLiteSpeed reverse proxy guide by @MorrowShore here: https://github.com/nextcloud/all-in-one/discussions/6370
    ##### Citrix ADC VPX / Citrix Netscaler
    click here to expand For a reverse proxy example guide for Citrix ADC VPX / Citrix Netscaler, see this guide by @esmith443: https://github.com/nextcloud/all-in-one/discussions/2452
    ##### Cloudflare Tunnel
    click here to expand **Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/2845#discussioncomment-6423237) for a more complete but possibly outdated example. Although it does not seem like it is the case but from AIO perspective a Cloudflare Tunnel works like a reverse proxy. Please see the [caveats](https://github.com/nextcloud/all-in-one#notes-on-cloudflare-proxytunnel) before proceeding. Here is then how to make it work: 1. Install the Cloudflare Tunnel on the same machine where AIO will be running on and point the Tunnel with the domain that you want to use for AIO to `http://localhost:11000`.
    ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration. 1. Now continue with [point 2](#2-use-this-startup-command) but add `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command - which will disable the domain validation (because it is known that the domain validation will not work behind a Cloudflare Tunnel). **Advice:** Make sure to [disable Cloudflare's Rocket Loader feature](https://help.nextcloud.com/t/login-page-not-working-solved/149417/8) as otherwise Nextcloud's login prompt will not be shown.
    ##### HAProxy
    click here to expand **Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! Here is an example HaProxy config: ``` global chroot /var/haproxy log /var/run/log audit debug lua-prepend-path /tmp/haproxy/lua/?.lua ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305 ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305 ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 ssl-default-server-options ssl-min-ver TLSv1.2 no-tls-tickets defaults log global option redispatch -1 retries 3 default-server init-addr last,libc # Frontend: LetsEncrypt_443 () frontend LetsEncrypt_443 bind 0.0.0.0:443 name 0.0.0.0:443 ssl crt-list /tmp/haproxy/ssl/605f6609f106d1.17683543.certlist mode http option http-keep-alive default_backend acme_challenge_backend option forwardfor # tuning options timeout client 30s # logging options # ACL: find_acme_challenge acl acl_605f6d4b6453d2.03059920 path_beg -i /.well-known/acme-challenge/ # ACL: Nextcloud acl acl_60604e669c3ca4.13013327 hdr(host) -i # ACTION: redirect_acme_challenges use_backend acme_challenge_backend if acl_605f6d4b6453d2.03059920 # ACTION: Nextcloud use_backend Nextcloud if acl_60604e669c3ca4.13013327 # Frontend: LetsEncrypt_80 () frontend LetsEncrypt_80 bind 0.0.0.0:80 name 0.0.0.0:80 mode tcp default_backend acme_challenge_backend # tuning options timeout client 30s # logging options # ACL: find_acme_challenge acl acl_605f6d4b6453d2.03059920 path_beg -i /.well-known/acme-challenge/ # ACTION: redirect_acme_challenges use_backend acme_challenge_backend if acl_605f6d4b6453d2.03059920 # Frontend (DISABLED): 1_HTTP_frontend () # Frontend (DISABLED): 1_HTTPS_frontend () # Frontend (DISABLED): 0_SNI_frontend () # Backend: acme_challenge_backend (Added by Let's Encrypt plugin) backend acme_challenge_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server acme_challenge_host 127.0.0.1:43580 # Backend: Nextcloud () backend Nextcloud mode http balance source server Nextcloud localhost:11000 # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below ``` ⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### Nginx, Freenginx, Openresty, Angie
    click here to expand **Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/588#discussioncomment-2811152) for a more complete but possibly outdated example. **Disclaimer:** This config was tested and should normally work on all modern Nginx versions. Improvements to the config are very welcome! Add the below template to your Nginx config. **Note:** please check your Nginx version by running: `nginx -v` and adjust the lines marked with version notes to fit your version. ``` map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; listen [::]:80; # comment to disable IPv6 if ($scheme = "http") { return 301 https://$host$request_uri; } if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; } listen 443 ssl http2; # for nginx versions below v1.25.1 listen [::]:443 ssl http2; # for nginx versions below v1.25.1 - comment to disable IPv6 # listen 443 ssl; # for nginx v1.25.1+ # listen [::]:443 ssl; # for nginx v1.25.1+ - keep comment to disable IPv6 # http2 on; # uncomment to enable HTTP/2 - supported on nginx v1.25.1+ # listen 443 quic reuseport; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ - please remove "reuseport" if there is already another quic listener on port 443 with enabled reuseport # listen [::]:443 quic reuseport; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ - please remove "reuseport" if there is already another quic listener on port 443 with enabled reuseport - keep comment to disable IPv6 # http3 on; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ # quic_gso on; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ # quic_retry on; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ # quic_bpf on; # improves HTTP/3 / QUIC - supported on nginx v1.25.0+, if nginx runs as a docker container you need to give it privileged permission to use this option # add_header Alt-Svc 'h3=":443"; ma=86400'; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ proxy_buffering off; proxy_request_buffering off; client_max_body_size 0; client_body_buffer_size 512k; # http3_stream_buffer_size 512k; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+ proxy_read_timeout 86400s; server_name ; location / { proxy_pass http://127.0.0.1:11000$request_uri; # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header Early-Data $ssl_early_data; # Websocket proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } # If running nginx on a subdomain (eg. nextcloud.example.com) of a domain that already has an wildcard ssl certificate from certbot on this machine, # the in the below lines should be replaced with just the domain (eg. example.com), not the subdomain. # In this case the subdomain should already be secured without additional actions ssl_certificate /etc/letsencrypt/live//fullchain.pem; # managed by certbot on host machine ssl_certificate_key /etc/letsencrypt/live//privkey.pem; # managed by certbot on host machine ssl_dhparam /etc/dhparam; # curl -L https://ssl-config.mozilla.org/ffdhe2048.txt -o /etc/dhparam ssl_early_data on; ssl_session_timeout 1d; ssl_session_cache shared:SSL:10m; ssl_protocols TLSv1.2 TLSv1.3; ssl_ecdh_curve x25519:x448:secp521r1:secp384r1:secp256r1; ssl_prefer_server_ciphers on; ssl_conf_command Options PrioritizeChaCha; ssl_ciphers TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256; } ``` ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### NPMplus (Fork of Nginx-Proxy-Manager - NPM)
    click here to expand ⚠️ **Please note:** This is not needed when running NPMplus as a community container. First, make sure the environmental variables `PUID` and `PGID` in the `compose.yaml` file for NPM are either unset or set to `0`.
    If you need to change the GID/PID then please add `net.ipv4.ip_unprivileged_port_start=0` at the end of `/etc/sysctl.conf`.
    Note: this will cause that a non root user can bind privileged ports. Second, see these screenshots for a working config: image image image image ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### Nginx-Proxy-Manager - NPM
    click here to expand **Hint:** You may have a look at [this guide](https://github.com/nextcloud/all-in-one/discussions/588#discussioncomment-3040493) for a more complete but possibly oudated example. First, make sure the environmental variables `PUID` and `PGID` in the `compose.yaml` file for NPM are either unset or set to `0`.
    If you need to change the GID/PID then please add `net.ipv4.ip_unprivileged_port_start=0` at the end of `/etc/sysctl.conf`.
    Note: this will cause that a non root user can bind privileged ports. Second, see these screenshots for a working config: ![grafik](https://user-images.githubusercontent.com/75573284/213889707-b7841ca0-3ea7-4321-acf6-50e1c1649442.png) ![grafik](https://user-images.githubusercontent.com/75573284/213889724-1ab32264-3e0c-4d83-b067-9fe9d1672fb2.png) ![grafik](https://github.com/nextcloud/all-in-one/assets/24786786/fecbb5ef-d2f4-4e0f-bc4b-82207e2c2809) ![grafik](https://user-images.githubusercontent.com/75573284/213889746-87dbe8c5-4d1f-492f-b251-bbf82f1510d0.png) ``` client_body_buffer_size 512k; proxy_read_timeout 86400s; client_max_body_size 0; ``` ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration. Also change `@` to a mail address of yours.
    ##### Nginx-Proxy
    click here to expand This section refers to the dedicated project named `nginx-proxy`. See its [GitHub repo](https://github.com/nginx-proxy/nginx-proxy). If you should be looking for Nginx, see the `Nginx, Freenginx, Openresty, Angie` section in this docu. Unfortunately, it is not possible to configure `nginx-proxy` in a way that works because it completely relies on environmental variables of the docker containers itself. Providing these variables does not work as stated above. If you really want to use AIO, we recommend you to switch to caddy. It is simply amazing!
    Apart from that, there is a [manual-install](https://github.com/nextcloud/all-in-one/tree/main/manual-install).
    ##### Node.js with Express
    click here to expand **Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! For Node.js, we will use the npm package `http-proxy`. WebSockets must be handled separately. This example only uses `http`, but if your Express server already uses a `https` server, then follow the same instructions for `https`. ```js const HttpProxy = require('http-proxy'); const express = require('express'); const http = require('http'); const app = express(); const proxy = HttpProxy.createProxyServer({ target: 'http://localhost:11000', // Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below // Timeout can be changed to your liking. timeout: 1000 * 60 * 3, proxyTimeout: 1000 * 60 * 3, // Not 100% certain whether autoRewrite is necessary, but enabling it SEEMS to make it behave more stably. autoRewrite: true, // Do not enable followRedirects. followRedirects: false, }); // Handle errors with proxy.web and proxy.ws function onProxyError(err, req, res, target) { // Handle errors however you like. Here's an example: if (err.code === 'ECONNREFUSED') { return res.status(503).send('Nextcloud server is currently not running. It may be down for temporary maintenance.'); } // other errors else { console.error(err); return res.status(500).send(String(err)); } } app.use((req, res) => { proxy.web(req, res, {}, onProxyError); }); const httpServer = http.createServer(app); httpServer.listen('80'); // Listen for an upgrade to a WebSocket connection. httpServer.on('upgrade', (req, socket, head) => { proxy.ws(req, socket, head, {}, onProxyError); }); ``` If you are using the Express package `vhost` for your app, you can use `proxy.web` inside the vhosted express function (see the following code snippet), but `proxy.ws` still needs to be done "globally" on your http server. Nextcloud should automatically ignore websocket requests for other domains. ```js const HttpProxy = require('http-proxy'); const express = require('express'); const http = require('http'); const myNextcloudApp = express(); const myOtherApp = express(); const vhost = express(); // Definitions for proxy and onProxyError unchanged. (see above) myNextcloudApp.use((req, res) => { proxy.web(req, res, {}, onProxyError); }); vhost.use(vhostFunc('', myNextcloudApp)); const httpServer = http.createServer(app); httpServer.listen('80'); // Listen for an upgrade to a WebSocket connection. httpServer.on('upgrade', (req, socket, head) => { proxy.ws(req, socket, head, {}, onProxyError); }); ``` ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### Synology Reverse Proxy
    click here to expand **Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! See these screenshots for a working config: ![image](https://user-images.githubusercontent.com/89748315/192525606-48cab54b-866e-4964-90a8-15e71bd362fb.png) ![image](https://user-images.githubusercontent.com/70434961/213193789-fa936edc-e307-4e6a-9a53-ae26d1bf2f42.jpg) ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### Tailscale (Serve)
    Click here to expand Tailscale can be used to provide private access to your Nextcloud AIO instance without opening ports on your firewall. With **Tailscale Serve**, your Nextcloud is accessible only to devices on your Tailscale network (tailnet) via a secure HTTPS domain. For a detailed setup guide using Tailscale Serve with Nextcloud AIO, see this guide by [@Perseus333](https://github.com/Perseus333): https://github.com/nextcloud/all-in-one/discussions/6817 The guide covers: - Setting up system-wide (non-containerized) Tailscale as a reverse proxy - Configuring Nextcloud AIO to work with Tailscale Serve - Using Tailscale's MagicDNS to provide automatic HTTPS certificates - Private access via your tailnet (e.g., `yourserver.tail0a12b3.ts.net`) ⚠️ **Please note:** This guide covers **Tailscale Serve** for private tailnet access. If you need public Internet access, consider using **Tailscale Funnel**.
    ##### Traefik 2
    click here to expand **Hint:** You may have a look at [this video](https://www.youtube.com/watch?v=VLPSRrLMDmA) for a more complete but possibly outdated example. **Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! Traefik's building blocks (router, service, middlewares) need to be defined using dynamic configuration similar to [this](https://doc.traefik.io/traefik/providers/file/#configuration-examples) official Traefik configuration example. Using **docker labels _won't work_** because of the nature of the project. The examples below define the dynamic configuration in YAML files. If you rather prefer TOML, use a YAML to TOML converter. 1. In Traefik's static configuration define a [file provider](https://doc.traefik.io/traefik/providers/file/) for dynamic providers: ```yml # STATIC CONFIGURATION entryPoints: https: address: ":443" # Create an entrypoint called "https" that uses port 443 transport: respondingTimeouts: readTimeout: 24h # Allows uploads > 100MB; prevents connection reset due to chunking (public upload-only links) # If you want to enable HTTP/3 support, uncomment the line below # http3: {} certificatesResolvers: # Define "letsencrypt" certificate resolver letsencrypt: acme: storage: /letsencrypt/acme.json # Defines the path where certificates should be stored email: # Where LE sends notification about certificates expiring tlschallenge: true providers: file: directory: "/path/to/dynamic/conf" # Adjust the path according your needs. watch: true # Enable HTTP/3 feature by uncommenting the lines below. Don't forget to route 443 UDP to Traefik (Firewall\NAT\Traefik Container) # experimental: # http3: true ``` 1. Declare the router, service and middlewares for Nextcloud in `/path/to/dynamic/conf/nextcloud.yml`: ```yml http: routers: nextcloud: rule: "Host(``)" entrypoints: - "https" service: nextcloud middlewares: - nextcloud-chain tls: certresolver: "letsencrypt" services: nextcloud: loadBalancer: servers: - url: "http://localhost:11000" # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below middlewares: nextcloud-secure-headers: headers: hostsProxyHeaders: - "X-Forwarded-Host" referrerPolicy: "same-origin" https-redirect: redirectscheme: scheme: https nextcloud-chain: chain: middlewares: # - ... (e.g. rate limiting middleware) - https-redirect - nextcloud-secure-headers ``` --- ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### Traefik 3
    click here to expand **Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! Traefik's building blocks (router, service, middlewares) need to be defined using dynamic configuration similar to [this](https://doc.traefik.io/traefik/providers/file/#configuration-examples) official Traefik configuration example. Using **docker labels _won't work_** because of the nature of the project. The examples below define the dynamic configuration in YAML files. If you rather prefer TOML, use a YAML to TOML converter. 1. In Traefik's static configuration define a [file provider](https://doc.traefik.io/traefik/providers/file/) for dynamic providers: ```yml # STATIC CONFIGURATION entryPoints: https: address: ":443" # Create an entrypoint called "https" that uses port 443 transport: respondingTimeouts: readTimeout: 24h # Allows uploads > 100MB; prevents connection reset due to chunking (public upload-only links) http: # Required for Nextcloud to correctly handle encoded URL characters (%2F, %3F and %25 in this case) in newer Traefik versions (v3.6.4+). encodedCharacters: allowEncodedSlash: true allowEncodedQuestionMark: true allowEncodedPercent: true # If you want to enable HTTP/3 support, uncomment the line below # http3: {} certificatesResolvers: # Define "letsencrypt" certificate resolver letsencrypt: acme: storage: /letsencrypt/acme.json # Defines the path where certificates should be stored email: # Where LE sends notification about certificates expiring tlschallenge: true providers: file: directory: "/path/to/dynamic/conf" # Adjust the path according your needs. watch: true ``` 2. Declare the router, service and middlewares for Nextcloud in `/path/to/dynamic/conf/nextcloud.yml`: ```yml http: routers: nextcloud: rule: "Host(``)" entrypoints: - "https" service: nextcloud middlewares: - nextcloud-chain tls: certresolver: "letsencrypt" services: nextcloud: loadBalancer: servers: - url: "http://localhost:11000" # Adjust to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below middlewares: nextcloud-secure-headers: headers: hostsProxyHeaders: - "X-Forwarded-Host" referrerPolicy: "same-origin" https-redirect: redirectscheme: scheme: https nextcloud-chain: chain: middlewares: # - ... (e.g. rate limiting middleware) - https-redirect - nextcloud-secure-headers ``` --- ⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### IIS with ARR and URL Rewrite
    click here to expand **Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome! **Please note:** Using IIS as a reverse proxy comes with some limitations: - A maximum upload size of 4GiB, in the example configuration below the limit is set to 2GiB. #### Prerequisites 1. **Windows Server** with IIS installed. 2. [**Application Request Routing (ARR)**](https://www.iis.net/downloads/microsoft/application-request-routing) and [**URL Rewrite**](https://www.iis.net/downloads/microsoft/url-rewrite) modules installed. 3. [**WebSocket Protocol**](https://learn.microsoft.com/en-us/iis/configuration/system.webserver/websocket) feature enabled. For information on how to set up IIS as a reverse proxy please refer to [this](https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing). There are also information on how to use the IIS Manager [here](https://learn.microsoft.com/en-us/iis/). The following configuration example assumes the following: * A site has been created that is configured with HTTPS support and the desired host name. * A server farm named `nc-server-farm` has been created and is pointing to the Nextcloud server. * No global Rewrite Rules has been created for the `nc-server-farm` server farm. Add the following `web.config` file to the root of the site you created as the reverse proxy. ```xml ``` ⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.
    ##### Others
    click here to expand Config examples for other reverse proxies are currently not documented. Pull requests are welcome!
    ### 2. Use this startup command After adjusting your reverse proxy config, use the following command to start AIO:
    (For a `compose.yaml` example, see the example further [below](#inspiration-for-a-docker-compose-file).) ``` # For Linux: sudo docker run \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 8080:8080 \ --env APACHE_PORT=11000 \ --env APACHE_IP_BINDING=0.0.0.0 \ --env APACHE_ADDITIONAL_NETWORK="" \ --env SKIP_DOMAIN_VALIDATION=false \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ ghcr.io/nextcloud-releases/all-in-one:latest ```
    Explanation of the command - `sudo docker run` This command spins up a new docker container. Docker commands can optionally be used without `sudo` if the user is added to the docker group (this is not the same as docker rootless, see FAQ in the normal readme). - `--init` This option makes sure that no zombie-processes are created, ever. See [the Docker documentation](https://docs.docker.com/reference/cli/docker/container/run/#init). - `--sig-proxy=false` This option allows to exit the container shell that gets attached automatically when using `docker run` by using `[CTRL] + [C]` without shutting down the container. - `--name nextcloud-aio-mastercontainer` This is the name of the container. This line is not allowed to be changed, since mastercontainer updates would fail. - `--restart always` This is the "restart policy". `always` means that the container should always get started with the Docker daemon. See the Docker documentation for further detail about restart policies: https://docs.docker.com/config/containers/start-containers-automatically/ - `--publish 8080:8080` This means that port 8080 of the container should get published on the host using port 8080. This port is used for the AIO interface and uses a self-signed certificate by default. You can also use a different host port if port 8080 is already used on your host, for example `--publish 8081:8080` (only the first port can be changed for the host, the second port is for the container and must remain at 8080). - `--env APACHE_PORT=11000` This is the port that is published on the host that runs Docker and Nextcloud AIO at which the reverse proxy should point at. - `--env APACHE_IP_BINDING=0.0.0.0` This can be modified to allow access to the published port on the host only from certain ip-addresses. [See this documentation](#3-limit-the-access-to-the-apache-container) - `--env APACHE_ADDITIONAL_NETWORK=""` This can be used to put the sibling apache container that is created by AIO into a specified network - useful if your reverse proxy runs as a container on the same host. [See this documentation](#adapting-the-sample-web-server-configurations-below) - `--env SKIP_DOMAIN_VALIDATION=false` This can be set to `true` if the domain validation does not work and you are sure that you configured everything correctly after you followed [the debug documentation](#7-how-to-debug-things). Also see [this documentation](https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation). - `--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config` This means that the files that are created by the mastercontainer will be stored in a docker volume that is called `nextcloud_aio_mastercontainer`. This line is not allowed to be changed, since built-in backups would fail later on. - `--volume /var/run/docker.sock:/var/run/docker.sock:ro` The docker socket is mounted into the container which is used for spinning up all the other containers and for further features. It needs to be adjusted on Windows/macOS and on docker rootless. See the applicable documentation on this. If adjusting, don't forget to also set `WATCHTOWER_DOCKER_SOCKET_PATH`! If you dislike this, see https://github.com/nextcloud/all-in-one/tree/main/manual-install. - `ghcr.io/nextcloud-releases/all-in-one:latest` This is the docker container image that is used. - Further options can be set using environment variables, for example `--env NEXTCLOUD_DATADIR="/mnt/ncdata"` (This is an example for Linux. See [this](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) for other OS' and for an explanation of what this value does. This specific one needs to be specified upon the first startup if you want to change it to a specific path instead of the default Docker volume). To see explanations and examples for further variables (like changing the location of Nextcloud's datadir or mounting some locations as external storage into the Nextcloud container), read through this readme and look at the docker-compose file: https://github.com/nextcloud/all-in-one/blob/main/compose.yaml
    Note: you may be interested in adjusting Nextcloud’s datadir to store the files in a different location than the default docker volume. See [this documentation](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) on how to do it. You should also think about limiting the Apache container to listen only on localhost in case the reverse proxy is running on the same host and in the host network, by providing an additional environmental variable to this docker run command. See [point 3](#3-limit-the-access-to-the-apache-container). On macOS see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-macos.
    Command for Windows On Windows, install [Docker Desktop](https://www.docker.com/products/docker-desktop/) (and don't forget to [enable ipv6](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md) if you should need that) and run the following command in the command prompt: ``` docker run ^ --init ^ --sig-proxy=false ^ --name nextcloud-aio-mastercontainer ^ --restart always ^ --publish 8080:8080 ^ --env APACHE_PORT=11000 ^ --env APACHE_IP_BINDING=0.0.0.0 ^ --env APACHE_ADDITIONAL_NETWORK="" ^ --env SKIP_DOMAIN_VALIDATION=false ^ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^ --volume //var/run/docker.sock:/var/run/docker.sock:ro ^ ghcr.io/nextcloud-releases/all-in-one:latest ``` Also, you may be interested in adjusting Nextcloud's Datadir to store the files on the host system. See [this documentation](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) on how to do it.
    On Synology DSM see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-synology-dsm ### Inspiration for a docker-compose file Simply translate the docker run command into a docker-compose file. You can have a look at [this file](https://github.com/nextcloud/all-in-one/blob/main/compose.yaml) for some inspiration but you will need to modify it either way. You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588 ### 3. Limit the access to the Apache container Use this environment variable during the initial startup of the mastercontainer to make the apache container only listen on localhost: `--env APACHE_IP_BINDING=127.0.0.1`. **Attention:** This is only recommended to be set if you use `localhost` in your reverse proxy config to connect to your AIO instance. If you use an ip-address instead of localhost, you should set it to `0.0.0.0`. ### 4. Open the AIO interface After starting AIO, you should be able to access the AIO Interface via `https://ip.address.of.the.host:8080` and type in and validate the domain that you have configured.
    ⚠️ **Important:** do always use an ip-address if you access this port and not a domain as HSTS might block access to it later! (It is also expected that this port uses a self-signed certificate due to security concerns which you need to accept in your browser)
    Enter your domain in the AIO interface that you've used in the reverse proxy config and you should be done. Please do not forget to open/forward port `3478/TCP` and `3478/UDP` in your firewall/router for the Talk container! ### 5. Optional: Configure AIO for reverse proxies that connect to nextcloud not using localhost nor 127.0.0.1 If your reverse proxy connects to nextcloud not using localhost or 127.0.0.1, you must add said IP as trusted proxy to the installation. See the step below: Add the IP it uses connect to AIO to the Nextcloud trusted_proxies like this: ``` sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:system:set trusted_proxies 2 --value=ip.address.of.proxy ``` #### Collabora WOPI allow list If your reverse proxy connects to Nextcloud with an IP address that is different from the one for your domain* and you are using the Collabora server then you must also add the IP to the WOPI request allow list via `Administration Settings > Administration > Office > Allow list for WOPI requests`. *: For example, the reverse proxy has a public globally routable IP and connects to your AIO instance via Tailscale with an IP in the `100.64.0.0/10` range, or you are using a Cloudflare tunnel ([cloudflare notes](https://github.com/nextcloud/all-in-one#notes-on-cloudflare-proxytunnel): You must add all [Cloudflare IP-Ranges](https://www.cloudflare.com/ips/) to the WOPI allowlist.) #### External reverse proxies connecting via VPN (e.g. Tailscale) If your reverse proxy is outside your LAN and connecting via VPN such as Tailscale, you may want to set `APACHE_IP_BINDING=AIO.VPN.host.IP` to ensure only traffic coming from the VPN can connect. ### 6. Optional: get a valid certificate for the AIO interface If you want to also access your AIO interface publicly with a valid certificate, you can add e.g. the following config to your Caddyfile: ``` https://:8443 { reverse_proxy https://localhost:8080 { header_up Host {host} transport http { tls_insecure_skip_verify } } } ``` ⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration. Afterwards should the AIO interface be accessible via `https://ip.address.of.the.host:8443`. You can alternatively change the domain to a different subdomain by using `https://:443` instead of `https://:8443` in the Caddyfile and use that to access the AIO interface. ### 7. How to debug things? If something does not work, follow the steps below: 1. Make sure to exactly follow the whole reverse proxy documentation step-for-step from top to bottom! 1. Make sure that you used the `docker run` command that is described in this reverse proxy documentation. **Hint:** make sure that you have set the `APACHE_PORT` via e.g. `--env APACHE_PORT=11000` during the docker run command! 1. Make sure to set the `APACHE_IP_BINDING` variable correctly. If in doubt, set it to `--env APACHE_IP_BINDING=0.0.0.0` 1. Make sure that all ports to which your reverse proxy is pointing match the chosen `APACHE_PORT`. 1. Make sure to follow [this](#adapting-the-sample-web-server-configurations-below) to adapt the example configurations to your specific setup! 1. Make sure that the mastercontainer is able to spawn other containers. You can do so by checking that the mastercontainer indeed has access to the Docker socket which might not be positioned in one of the suggested directories like `/var/run/docker.sock` but in a different directory, based on your OS and the way how you installed Docker. The mastercontainer logs should help figuring this out. You can have a look at them by running `sudo docker logs nextcloud-aio-mastercontainer` after the container is started the first time. 1. Check if after the mastercontainer was started, the reverse proxy if running inside a container, can reach the provided apache port. You can test this by running `nc -z localhost 11000; echo $?` from inside the reverse proxy container. If the output is `0`, everything works. Alternatively you can of course use instead of `localhost` the ip-address of the host here for the test. 1. Make sure that you are not behind CGNAT. If that is the case, you will not be able to open ports properly. In that case you might use a Cloudflare Tunnel! 1. If you use Cloudflare, you might need to skip the domain validation anyways since it is known that Cloudflare might block the validation attempts. In that case, see the last option below! 1. If your reverse proxy is configured to use the host network (as recommended in the above docs) or running on the host, make sure that you've configured your firewall to open port 443 (and 80)! 1. Check if you have a public IPv4- and public IPv6-address. If you only have a public IPv6-address (e.g. due to DS-Lite), make sure to enable IPv6 in Docker and your whole networking infrastructure (e.g. also by adding an AAAA DNS-entry to your domain)! 1. [Enable Hairpin NAT in your router](https://github.com/nextcloud/all-in-one/discussions/5849) or [set up a local DNS server and add a custom dns-record](https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally) that allows the server to reach itself locally 1. Try to configure everything from scratch - if it still does not work by following https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance. 1. As last resort, you may disable the domain validation by adding `--env SKIP_DOMAIN_VALIDATION=true` to the docker run command. But only use this if you are completely sure that you've correctly configured everything! Also see [this documentation](https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation). ### 8. Removing the reverse proxy If you, at some point, want to remove the reverse proxy, here are some general steps: 1. Stop all running containers in the AIO Interface. 2. Stop and remove the mastercontainer. ``` sudo docker stop nextcloud-aio-mastercontainer sudo docker rm nextcloud-aio-mastercontainer ``` 3. Remove the software and configuration file that you used for the reverse proxy (see section 1). 4. Restart the mastercontainer with the [docker run command from the main readme](https://github.com/nextcloud/all-in-one#how-to-use-this) but add the two options: ``` --env APACHE_IP_BINDING=0.0.0.0 \ --env APACHE_PORT=443 \ ``` Do this *before* the last line of the run command! *The first command ensures that the Apache container is listening on all available network interfaces and the second command configures it to listen to port 443.* 5. Restart all other containers in the AIO interface. --- ## Footnotes: [^talkPort]: Ports 3478/TCP and 3478/UDP are also required if using Nextcloud Talk (but they're less likely to conflict with existing services). [^shared]: Other Nextcloud Server deployment methods (but not AIO) can be deployed behind shared hostnames and accessed via subfolder-based URLs. For example, this is supported with Bare Metal (Archive) and the micro-services Docker image, among others. Note that pure subfolder deployments are less and less required these days, with the broad support for virtual host based access (including at the reverse proxy level), which easily facilitates port IP address and external port sharing. ================================================ FILE: tests/QA/001-initial-setup.md ================================================ # Initial setup - [ ] Verify that after starting the test container, you can access the AIO interface using https://internal.ip.address:8080 - [ ] After clicking the self-signed-certificate warning away, it should show the setup page with an explanation what AIO is and the initial passphrase and a button that contains a link to the AIO login page - [ ] After copying the passphrase and clicking on this button, it should open a new tab with the login page - [ ] The login page should show an input field that allows to enter the AIO passphrase and a `Log in` button - [ ] After pasting the passphrase into the input field and clicking on this button, you should be logged in - [ ] You should now see the containers page and you should see three sections: one general section which explains what AIO is, one `New AIO instance` section and one section that allows to restore the whole AIO instance from backup. You can now continue with [002-new-instance.md](./002-new-instance.md) or [010-restore-instance.md](./010-restore-instance.md). ================================================ FILE: tests/QA/002-new-instance.md ================================================ # New instance For the below to work, it is important that you have a domain that you point onto your testserver and open port 443 in your router/firewall. - [ ] The `New AIO instance` section should show an input field that allows to enter a domain that will be used for Nextcloud later on as well as a short explanation regarding dynamic DNS - [ ] Now test a few examples in the input box: - [ ] Entering `djfslkklk` should report that DNS config is not set or the domain is not in a valid format - [ ] Entering `https://sdjflkjk.cpm` should report that this is not a valid domain - [ ] Entering `10.0.0.1` should report that ip-addresses are not supported - [ ] Entering `nextcloud.com` should report that the domain does not point to this server - [ ] Entering the domain that does point to your server e.g. `yourdomain.com` should finally redirect you to the next screen (if you did not configure your domain yet or did not open port 443, it should report that to you) - [ ] Now you should see a button `Start containers` and an explanation which points out that clicking on the button will start the containers and that this can take a long time. - [ ] Below that you should see a section `Optional addons` which shows a checkbox list with addons that can be enabled or disabled. - [ ] Collabora, Imaginary, Talk and Whiteboard should be enabled, the rest disabled - [ ] Unchecking/Checking any of these should insert a button that allows to save the set config - [ ] Checking OnlyOffice and Collabora at the same time should show a warning that this is not supported and should not saving the new config - [ ] Recommended is to uncheck all options now - [ ] Clicking on the save button should reload the page and activate the new config - [ ] Clickig on the `Start containers` button should finally reveal a big spinning wheel that should block all elements on the side of being clicked. - [ ] After waiting a few minutes, it should reload and show a new page - [ ] On top of the page should be shown which channel you are running - [ ] Below that, it should show that containers are currently starting - [ ] Below that it should show a section with Containers: Apache, Database, Nextcloud and Redis and that your containers are up-to-date - [ ] On the bottom should be the Optional addons section shown but with disabled checkboxes (not clickable) - [ ] A automatic reload every 5s should happen until all Containers are started (as long as this window is focused) - [ ] After waiting a bit longer it should instead of the advice that your containers are currently running show the initial Nextcloud credentials (username, password) and below that a button that allows to open the Nextcloud interface in a new tab - [ ] Clicking on that button should open the Nextcloud interface in a new tab and you should be able to log in using the provided credentials - [ ] Below the Containers section it should show a `Stop containers` button - [ ] Below the Containers section and above the Optional Addons section, you should see a Backup and restore section and an AIO password change section You can now continue with [003-automatic-login.md](./003-automatic-login.md). ================================================ FILE: tests/QA/003-automatic-login.md ================================================ # Automatic login - [ ] After you log in to Nextcloud using the provided initial credentials, open https://yourdomain.com/settings/admin/overview - [ ] There you should see a Nextcloud AIO section and a button that allows to log into the AIO interface. - [ ] Clicking on this button should open the AIO interface in a new tab and should automatically log you in - [ ] All sessions in other tabs that are currently open should be closed (you can verify by reloading all other AIO tabs) You can now continue with [004-initial-backup.md](./004-initial-backup.md). ================================================ FILE: tests/QA/004-initial-backup.md ================================================ # Initial backup - [ ] In the Backup and restore section, you should now see two input boxes where for one you should type in the path where the backup should get created and some explanation below or the other type in a remote ssh location - [ ] First, check a local backup: - [ ] Enter `/` which should send an error - [ ] Enter `/mnt/` or `/media/` or `/host_mnt/` or `/var/backups/` should send an error as well - [ ] Accepted should be `/mnt/backup`, `/media/backup`, `/host_mnt/c/backup` and `/var/backups`. - [ ] The side should now reload - [ ] In the Backup restore section you should now see a Backup information section with important info like the encryption password, the backup location and more. - [ ] Also you should see a Backup creation section that contains a `Create backup` button. - [ ] Clicking on the `Create backup` button should open a window prompt that allows to cancel the operation. - [ ] Canceling should return to the website, confirming should reveal the big spinner again which should block the website again. - [ ] After a while you should see the information that Backup container is currently running - [ ] another option are remote backups via SSH using borgbackup. The remote borg repo URL must contain both `@` and `:`. The process works as follows: 1. You enter a remote borg repo URL (e.g. `ssh://user@host:port/path/to/repo` or `user@host:/path/to/repo`). 2. On the first connection attempt, a SSH key pair is generated automatically and the public key is displayed. 3. You add the public key to the `~/.ssh/authorized_keys` file on the remote server so that AIO can connect to it. 4. Once authorized, AIO can create and restore backups on the remote server. - [ ] Enter `user` (no `@` and no `:`) which should send an error - [ ] Enter `user@host` (no `:`) which should send an error - [ ] Enter `userhost:/path` (no `@`) which should send an error - [ ] Accepted should be `ssh://user@host:22/path/to/repo` or `user@host:/path/to/repo` - [ ] Both a local backup location and a remote repo URL should not be accepted at the same time - [ ] The page should now reload - [ ] Now click on `Create backup` - [ ] After the first failed backup attempt with a remote repo, the SSH public key for borg should be shown so it can be authorized on the remote server - [ ] After authorizing the server on the remote, scroll down and click on `Create backup` again to create another backup. This time it should succeed. - [ ] The initial Nextcloud credentials on top of the page that are visible when the containers are running should now be hidden in a details tag - [ ] After a while and a few automatic reloads (as long as the side is focused), you should be redirected to the usual page and seen in the Backup and restore section that the last backup was successful. - [ ] Below that you should see a details tag that allows to reveal all backup options You can now continue with [020-backup-and-restore.md](.//020-backup-and-restore.md) ================================================ FILE: tests/QA/010-restore-instance.md ================================================ # Restore instance For the below to work, you need a backup archive of an AIO instance and the location on the test machine and the password for the backup archive. You can get one here: [backup-archive](./assets/backup-archive/) - [ ] The section that allows to restore the whole AIO instance from backup should show three input fields: one that allows to enter a location where the backup archive is located and one that allows to enter a remote ssh path and one that allows to enter password of the archive. It should also show a short explanation regarding the path requirements - [ ] First, check restoring from a local backup location: - [ ] Entering an incorrect path and/or password should let you continue and test your settings in the next step - [ ] Clicking on the test button should after a reload bring you back to the initial screen where it should say that the test was unsuccessful. Also you should be able to have a look at the backup container logs for investigation what exactly failed. - [ ] You should also now see the input boxes again where you can change the path and password, confirm it and bring you again to the screen where you can test your settings. - [ ] Entering the correct path to the backup archive and the correct password here should: - [ ] Should reload and should hide all options except the option to test the path and password - [ ] After the test you should see the options to check the integrity of the backup and a list of backup archives that you can choose from to restore your instance - [ ] Clicking on either option should show a window prompt that lets you cancel the operation - [ ] Clicking on the integrity check option should check the integrity and report that the backup integrity is good after a while which should then only show the option to choose the backup archive that should be restored - [ ] Choosing the restore option should finally restore your files. - [ ] After waiting a while it should reload the page and should show the usual container interface again with the state of your containers (stopped) and the option to start and update the containers again. - [ ] Next, check restoring from a remote backup location via SSH. The remote borg repo URL must contain both `@` and `:`. The restore process works as follows: 1. You enter a remote borg repo URL (e.g. `ssh://user@host:port/path/to/repo` or `user@host:/path/to/repo`) and the backup password. 2. On the first connection attempt, a SSH key pair is generated automatically and the public key is displayed. 3. You add the public key to the `~/.ssh/authorized_keys` file on the remote server so that AIO can connect to it. 4. Once authorized, AIO can list and restore backups from the remote server. - [ ] Enter an invalid remote repo URL (e.g. `user` without `@` and `:`) which should send an error - [ ] Enter a valid remote borg repo URL and the correct backup password: - [ ] Should reload and should hide all options except the option to test the path and password - [ ] After the first failed connection attempt, the SSH public key for borg should be shown so it can be authorized on the remote server - [ ] After authorizing the key on the remote server, scroll down and click on the test button again. This time it should succeed and show the options to check the integrity and list backup archives - [ ] After the test you should see the options to check the integrity of the backup and a list of backup archives that you can choose from to restore your instance - [ ] Clicking on either option should show a window prompt that lets you cancel the operation - [ ] Clicking on the integrity check option should check the integrity and report that the backup integrity is good after a while which should then only show the option to choose the backup archive that should be restored - [ ] Choosing the restore option should finally restore your files. - [ ] After waiting a while it should reload the page and should show the usual container interface again with the state of your containers (stopped) and the option to start and update the containers again. - [ ] Clicking on `Start and update containers` should show a window prompt that you should create a backup. Canceling should cancel the operation, confirming should reveal the big spinner again. - [ ] After waiting a bit, all containers should be green and your instance should be fully functional again You can now continue with [020-backup-and-restore.md](./020-backup-and-restore.md) ================================================ FILE: tests/QA/020-backup-and-restore.md ================================================ # Backup and restore - [ ] Expanding all backup options in the Backup and restore sectioin should reveal a Backup information section, Backup creation section, Backup check section, Backup restore section and a Daily backup section as well as a additional backup location section - [ ] The backup restore section should list all available backup archives and list them from most recent to least recent. - [ ] Clicking on either option of Create backup, Check backup integrity or Restore selected backup should run the corresponding action and report after a while in the last check, backup or restore was successful. - [ ] Daily backup creatio should allow to enter a time in 24h format e.g. `04:00` should be accepted, `24:00` or `dfjlk` not. - [ ] Submitting a time here should reload the page and reveal at the same place the option to delete the setting again. - [ ] When the time of the automatic backup has come (you can test it by choosing a time that is e.g. only a minute away), it should automatically log you out (you can verify by reloading) and after you log in again you should see that the automatic backup is currently running. - [ ] After a while you should see that your container are starting and in the Backup and restore section you should see that the backup was successful - [ ] When entering additional backup directories, it should allow e.g. `/etc` and `nextcloud_aio_mastercontainer` but not `nextcloud/test`. Running a backup with this should back up these directories/volumes successfully. You can now continue with [030-aio-password-change.md](./030-aio-password-change.md) ================================================ FILE: tests/QA/030-aio-password-change.md ================================================ # AIO passphrase change - [ ] In the AIO passphrase change section you should see two input fields. And below the requirements for a new passphrase - [ ] When entering nothing it should report that you need to enter your current AIO passphrase - [ ] When entering a false passphrase, it should report that to you - [ ] After entering your current passphrase and leaving the new passphrase empty it should report that you need to enter a new passphrase - [ ] After entering a new passphrase shorter than 24 characters or not allowed characters, it should report that the passphrase requirements are not met. - [ ] `sdfjlksj` should not be accepted - [ ] `jdsfklöjiroewoäsadjkfölk` should not be accepted - [ ] `sdjlfj SDJFLK 32489 sdjklf` should be accepted, which should reload the page You can now continue with [040-login-behavior.md](./040-login-behavior.md) ================================================ FILE: tests/QA/040-login-behavior.md ================================================ # Login behavior - [ ] When opening the AIO interface in a new tab while the apache container is running, it should report on the login page that Nextcloud is running and you should use the automatic login - [ ] When the apache container is stopped, you should see here an input field that allows you to enter the AIO passphrase which should log you in - [ ] Starting and stopping the containers multiple times should every time produce a new token that is used in the admin overview in Nextcloud as link in the button to log you into the AIO interface. (see [003-automatic-login.md](./003-automatic-login.md)) You can now continue with [050-optional-addons.md](./050-optional-addons.md) ================================================ FILE: tests/QA/050-optional-addons.md ================================================ # Optional addons - [ ] Close to the bottom of the page in the AIO interface, you should see the optional addons section - [ ] You should be able to change optional addons when containers are stopped and not change them when containers are running - [ ] Enabling either of the options should start a new container with the same or comparable name and should also list them in the containers section - [ ] After all containers are started with the new config active, you should verify that the options were automatically activated/deactivated. - [ ] ClamAV by trying to upload a testvirus to Nextcloud https://www.eicar.org/?page_id=3950 - [ ] Collabora by trying to open a .docx or .odt file in Nextcloud - [ ] Nextcloud Talk by opening the Talk app in Nextcloud, creating a new chat and trying to join a call in this chat. Also verifying in the settings that the HPB and turn server work. - [ ] Imaginary by having a look if when uploading a new picture in Nextcloud, it adds some log entries to the container - [ ] Fulltextsearch by trying to search for a heading inside a file in Nextcloud - [ ] Talk-recording by starting a call and trying to record something - [ ] When Collabora is enabled - [ ] It should show below the Optional Addons section a section where you can change the dictionaries for collabora. `de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru` should be a valid setting. E.g. `de.De` not. If already set, it should show a button that allows to remove the setting again. - [ ] Also, you should see an input field that allows to enter additional collabora options. E.g. `net.content_security_policy=false` should not be accepted, but `--o:net.content_security_policy="frame-ancestors *.example.com:*;"` should. You can now continue with [055-community-containers.md](./055-community-containers.md) ================================================ FILE: tests/QA/055-community-containers.md ================================================ # Community Containers - [ ] At the very bottom of the page, there should be a Community Containers section - [ ] The section should show a details element that allows to reveal the list of available community containers - [ ] When containers are running, the checkboxes should be disabled and a notice should inform the user that changes can only be made when containers are stopped - [ ] When containers are stopped, checkboxes should be enabled - [ ] Enabling a community container and clicking `Save changes` should show a confirmation dialog - [ ] Canceling the confirmation dialog should not save the changes - [ ] Confirming should save the changes and reload the page - [ ] After saving, the enabled community container should appear in the containers section and start along with the other containers when `Start containers` is clicked - [ ] Disabling a previously enabled community container and saving should remove it from the containers section after stopping and starting containers You can now continue with [060-environmental-variables.md](./060-environmental-variables.md) ================================================ FILE: tests/QA/060-environmental-variables.md ================================================ # Environmental variables - [ ] When starting the mastercontainer with `--env APACHE_PORT=11000` on a clean instance, the domaincheck container should be started with that same port published. That makes sure that also the Apache container will use that port later on. Using a value here that is not a port will not allow the mastercontainer to start correctly. However `@INTERNAL` is also an allowed value which skips publishing the port on the host for internal usage inside a bridged network for example. - [ ] When starting the mastercontainer with `--env APACHE_IP_BINDING=127.0.0.1` on a clean instance, the domaincheck container's apache port should only listen on localhost on the host. Using a value here that is not a number or dot will not allow the mastercontainer to start correctly. - [ ] When starting the mastercontainer with `--env APACHE_ADDITIONAL_NETWORK=frontend_net` on a clean instance, the domaincheck and subsequently the apache containers should be connected to the specified `frontend_net` docker network, in addition to the default `nextcloud-aio` network. Specifying the network that doesn't already exist will not allow the mastercontainer to start correctly. - [ ] When starting the mastercontainer with `--env TALK_PORT=3479` on a clean instance, the talk container should use this port later on. Using a value here that is not a port will not allow the mastercontainer to start correctly. Also it should stop if apache_port and talk_port are set to the same value. - [ ] Make also sure that reverse proxies work by following https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#reverse-proxy-documentation and following [001-initial-setup.md](./001-initial-setup.md) and [002-new-instance.md](./002-new-instance.md) - [ ] When starting the mastercontainer with `--env SKIP_DOMAIN_VALIDATION=true` on a clean instance, it should skip the domain verification. So it should accept any domain that you type in then. - [ ] When starting the mastercontainer with `--env DOCKER_API_VERSION=1.44` it should use the mentioned docker API version internally for all requests - [ ] When starting the mastercontainer with `--env NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_UPLOAD_LIMIT=11G` it should change Nextclouds upload limit to 11G. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud for allowed values. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_MEMORY_LIMIT=1024M` it should change Nextclouds PHP memory limit to 1024M. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud for allowed values. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_MAX_TIME=4000` it should change Nextclouds upload max time 4000s. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud for allowed values. - [ ] When starting the mastercontainer with `--env BORG_RETENTION_POLICY="--keep-within=1d --keep-weekly=1 --keep-monthly=1"` it should change borgs retention policy to the defined one. This can be checked when creating a backup and looking at the logs. - [ ] When starting the mastercontainer with `--env FULLTEXTSEARCH_JAVA_OPTIONS="-Xms1024M -Xmx1024M"` it should change Elasticsearchs `ES_JAVA_OPTS` options to the defined one. This can be checked by checking the `ES_JAVA_OPTS` variable for the nextcloud-aio-fulltextsearch container. - [ ] When starting the mastercontainer with `--env WATCHTOWER_DOCKER_SOCKET_PATH="$XDG_RUNTIME_DIR/docker.sock"` it should map `$XDG_RUNTIME_DIR/docker.sock` to `/var/run/docker.sock` inside the watchtower container which allow to update the mastercontainer on docker rootless. - [ ] When starting the mastercontainer with `--env AIO_DISABLE_BACKUP_SECTION=true` it should hide the backup section that gets shown after AIO is set up (everything of [020-backup-and-restore](./020-backup-and-restore.md)) and simply show that the backup section is disabled. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts`, the resulting nextcloud container should trust all the Certification Authorities, whose certificates are included in the directory `/path/to/my/cacerts` on the host. See https://github.com/nextcloud/all-in-one#how-to-trust-user-defined-certification-authorities-ca - [ ] When starting the mastercontainer with `--env COLLABORA_SECCOMP_DISABLED=true`, the resulting collabora container should have `--o:security.seccomp=false` applied to it. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_STARTUP_APPS=deck`, the resulting Nextcloud should have only installed the deck app and not the other apps that get installed by default. Default are `deck twofactor_totp tasks calendar contacts notes`. - [ ] When starting the mastercontainer with `--env NEXTCLOUD_ADDITIONAL_APKS=zip`, the resulting Nextcloud container should have the zip package installed and not imagemagick. - [ ] 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_ENABLE_NVIDIA_GPU=true`, the resulting Nextcloud container should have the nvidia gpu device mounted into the container. (Only works if a Nvidia GPU and runtime is installed 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. You can now continue with [070-timezone-change.md](./070-timezone-change.md) ================================================ FILE: tests/QA/070-timezone-change.md ================================================ # Timezone change - [ ] At the very bottom of the page you should see the timezone change section - [ ] When the containers are stopped, you should be able to change it and set/reset it - [ ] If not already set, it should show an input field where you can enter a timezone - [ ] `Europe/Berlin` should be accepted, e.g. `Europe Berlin` not - [ ] When it is set, it should show that it is set to which timezone and display a button that allows to reset it again which does this on a press - [ ] When it is set, running `date` inside Nextcloud related containers should return the correct timezone You can now continue with [080-daily-backup-script.md](./080-daily-backup-script.md) ================================================ FILE: tests/QA/080-daily-backup-script.md ================================================ # Daily backup script The script is delivered within the mastercontainer and allows to run a few things like daily backup and container updates from an external script. You can find the documentation on this here which needs to work as documented: https://github.com/nextcloud/all-in-one#how-to-stopstartupdate-containers-or-trigger-the-daily-backup-from-a-script-externally ================================================ FILE: tests/QA/assets/backup-archive/readme.md ================================================ # Backup archive The backup archive was moved here because of Git LFS limitations: https://cloud.nextcloud.com/s/m5DF3AjRs72kWKY ================================================ FILE: tests/QA/readme.md ================================================ # QA test plans In this folder are manual test plans for QA located that allow to manually step through certain features and make sure that everything works as expected. For a test instance, you should make sure that all potentially breaking changes are merged, build new containers by following https://github.com/nextcloud/all-in-one/blob/main/develop.md#how-to-build-new-containers, stop a potential old instance, remove it and delete all volumes. Afterwards start a new clean test instance by following https://github.com/nextcloud/all-in-one/blob/main/develop.md#developer-channel. Best is to start testing with [001-initial-setup.md](./001-initial-setup.md). ================================================ FILE: zizmor.yml ================================================ rules: excessive-permissions: disable: true dangerous-triggers: ignore: - build_images.yml artipacked: disable: true secrets-outside-env: ignore: - promote-to-beta.yml - promote-to-latest.yml - publish-to-aws.yml - publish-to-digitalocean.yml