[
  {
    "path": ".gitattributes",
    "content": "* text=auto\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/Bug_report.md",
    "content": "---\nname: 🐛 Bug report - no questions and no support!\nabout: 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\nlabels: 0. Needs triage\n---\n\n<!---\n- Before submitting a bug report, please read through the documentation available at https://github.com/nextcloud/all-in-one#faq\n- Additional documentation is available here: https://github.com/nextcloud/all-in-one/discussions/categories/wiki\n- You should also read through existing questions and their answer here: https://github.com/nextcloud/all-in-one/discussions/categories/questions\n- Additional threads can be found here: https://help.nextcloud.com/tag/aio\n- Existing feature requests are listed here: https://github.com/nextcloud/all-in-one/discussions/categories/ideas\n--->\n\n<!--- Please fill out the whole template below -->\n### Steps to reproduce\n1.\n2.\n3.\n\n### Expected behavior <!--- Tell us what should happen -->\n\n### Actual behavior <!--- Tell us what happens instead -->\n\n\n### Other information\n#### Host OS <!--- (the host OS on which you are trying to install AIO on) -->\n\n#### Output of `sudo docker info`\n\n#### Docker run command or docker-compose file that you used\n\n#### Output of `sudo docker logs nextcloud-aio-mastercontainer`\n\n#### Output of `sudo docker inspect nextcloud-aio-mastercontainer`\n\n#### Output of `sudo docker ps -a`\n\n#### Other valuable info <!--- (like additional logs, screenshots & Co.) -->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/Feature_request.md",
    "content": "---\nname: 📖 Existing feature/documentation enhancement\nabout: Suggest an enhancement of an existing feature/documentation - for other types, please use the feature request option below\nlabels: 0. Needs triage\n---\n\n<!--- Please fill out the whole template below -->\n### Is your feature request related to a problem? Please describe. \n<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->\n\n### Describe the solution you'd like\n<!--- A clear and concise description of what you want to happen. -->\n\n### Describe alternatives you've considered\n<!--- A clear and concise description of any alternative solutions or features you've considered. -->\n\n### Additional context\n<!--- Add any other context or screenshots about the feature request below. -->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n    - name: 📘 Documentation on Nextcloud AIO\n      url: https://github.com/nextcloud/all-in-one#faq\n      about: Please read the docs first before submitting any report or request!\n    - name: ⛑️ Questions and support\n      url: https://help.nextcloud.com/tag/aio\n      about: For questions, support and help\n    - name: 💡 Suggest a new feature or discuss one\n      url:  https://github.com/nextcloud/all-in-one/discussions/categories/ideas\n      about: For new feature requests and discussion of existing ones\n    - name: 💼 Nextcloud Enterprise\n      url: https://portal.nextcloud.com/\n      about: If you are a Nextcloud Enterprise customer, or need Professional support, so it can be resolved directly by our dedicated engineers more quickly\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n- package-ecosystem: \"github-actions\"\n  directory: \".github/workflows\"\n  schedule:\n    interval: \"daily\"\n    time: \"12:00\"\n  open-pull-requests-limit: 10\n  rebase-strategy: \"disabled\"\n  labels:\n  - 3. to review\n  - dependencies\n  cooldown:\n    default-days: 7\n- package-ecosystem: composer\n  directory: \"/php/\"\n  schedule:\n    interval: \"daily\"\n    time: \"12:00\"\n  open-pull-requests-limit: 10\n  rebase-strategy: \"auto\"\n  labels:\n  - 3. to review\n  - dependencies\n- package-ecosystem: \"docker\"\n  directories:\n    - \"/Containers/alpine\"\n    - \"/Containers/apache\"\n    - \"/Containers/borgbackup\"\n    - \"/Containers/clamav\"\n    - \"/Containers/collabora\"\n    - \"/Containers/docker-socket-proxy\"\n    - \"/Containers/domaincheck\"\n    - \"/Containers/fulltextsearch\"\n    - \"/Containers/imaginary\"\n    - \"/Containers/mastercontainer\"\n    - \"/Containers/nextcloud\"\n    - \"/Containers/notify-push\"\n    - \"/Containers/onlyoffice\"\n    - \"/Containers/postgresql\"\n    - \"/Containers/redis\"\n    - \"/Containers/talk\"\n    - \"/Containers/talk-recording\"\n    - \"/Containers/watchtower\"\n    - \"/Containers/whiteboard\"\n  schedule:\n    interval: \"daily\"\n    time: \"04:00\"\n  open-pull-requests-limit: 10\n  rebase-strategy: \"disabled\"\n  labels:\n  - 3. to review\n  - dependencies\n  ignore:\n    - dependency-name: \"php\"\n      update-types: [\"version-update:semver-major\", \"version-update:semver-minor\"]\n    - dependency-name: \"postgres\"\n      update-types: [\"version-update:semver-major\"]\n    - dependency-name: \"redis\"\n      update-types: [\"version-update:semver-major\"]\n    - dependency-name: \"elasticsearch\"\n      update-types: [\"version-update:semver-major\"]\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "<!--\n  - 🚨 SECURITY INFO\n  -\n  - Before sending a pull request that fixes a security issue please report it via our HackerOne page (https://hackerone.com/nextcloud) following our security policy (https://nextcloud.com/security/). This allows us to coordinate the fix and release without potentially exposing all Nextcloud servers and users in the meantime.\n-->\n"
  },
  {
    "path": ".github/release.yml",
    "content": "changelog:\n  categories:\n    - title: 🏕 New features and other improvements\n      labels:\n        - enhancement\n    - title: 🐞 Fixed bugs\n      labels:\n        - bug\n    - title: 👒 Updated dependencies\n      labels:\n        - dependencies\n    - title: 📄 Improved documentation\n      labels:\n        - documentation\n"
  },
  {
    "path": ".github/workflows/codespell.yml",
    "content": "name: 'Codespell'\n\non:\n  pull_request:\n  push:\n    branches:\n      - main\n\njobs:\n  codespell:\n    name: Check spelling\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check out code\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - name: Check spelling\n        uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2\n        with:\n          check_filenames: true\n          check_hidden: true\n"
  },
  {
    "path": ".github/workflows/collabora.yml",
    "content": "name: collabora-update\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  collabora-update:\n    name: update collabora\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - name: Run collabora-profile-update\n      run: |\n        rm -f php/cool-seccomp-profile.json\n        wget https://raw.githubusercontent.com/CollaboraOnline/online/refs/heads/main/docker/cool-seccomp-profile.json\n        mv cool-seccomp-profile.json php/\n        \n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: collabora-seccomp-update automated change\n        signoff: true\n        title: collabora seccomp update\n        body: Automated collabora seccomp profile update\n        labels: dependencies, 3. to review\n        milestone: next\n        branch: collabora-seccomp-update\n"
  },
  {
    "path": ".github/workflows/community-containers.yml",
    "content": "name: Validate community containers\n\non:\n  pull_request:\n    paths:\n      - 'community-containers/**'\n  push:\n    branches:\n      - main\n    paths:\n      - 'community-containers/**'\n\njobs:\n  validator-community-containers:\n    name: Validate community containers\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - name: Validate structure\n        run: |\n          CONTAINERS=\"$(find ./community-containers -mindepth 1 -maxdepth 1 -type d)\"\n          mapfile -t CONTAINERS <<< \"$CONTAINERS\"\n          for container in \"${CONTAINERS[@]}\"; do\n            container=\"$(echo \"$container\" | sed 's|./community-containers/||')\"\n            if ! [ -f ./community-containers/\"$container\"/\"$container.json\" ]; then\n                echo \".json file must be named like its parent folder $container\"\n                FAIL=1\n            fi\n            if ! [ -f ./community-containers/\"$container\"/readme.md ]; then\n                echo \"There must be a readme.md file in the folder!\"\n                FAIL=1\n            fi\n            if [ -n \"$FAIL\" ]; then\n                exit 1\n            fi\n          done\n"
  },
  {
    "path": ".github/workflows/dependency-updates.yml",
    "content": "name: dependency-updates\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  dependency_updates:\n    name: Run dependency update script\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2\n      with:\n        php-version: 8.5\n        extensions: apcu\n    - name: Run dependency update script\n      run: |\n        set -x\n        cd ./php\n        composer update --with-all-dependencies\n        # Disable dependency updates for now\n        # set +e\n        # ALL_LINES=\"$(composer outdated | grep -v \"^$\\|Direct dependencies\\|Everything up to date\\|Transitive dependencies\")\"\n        # set -e\n        # while [ -n \"$ALL_LINES\" ]; do\n        #   CURRENT_LINE=\"$(echo \"$ALL_LINES\" | head -1)\"\n        #   composer require \"$(echo \"$CURRENT_LINE\" | awk '{print $1}')\" \"^$(echo \"$CURRENT_LINE\" | awk '{print $4}')\" --with-all-dependencies\n        #   ALL_LINES=\"$(echo \"$ALL_LINES\" | sed '1d')\"\n        # done\n        # echo \"outdated dependencies:\n        # $(composer outdated)\"\n    - name: Update apcu\n      run: |\n        # APCU\n        apcu_version=\"$(\n          git ls-remote --tags https://github.com/krakjoe/apcu.git \\\n            | cut -d/ -f3 \\\n            | grep -viE -- 'rc|b' \\\n            | sed -E 's/^v//' \\\n            | sort -V \\\n            | tail -1\n        )\"\n        sed -i \"s|pecl install APCu.*\\;|pecl install APCu-$apcu_version\\;|\" ./Containers/mastercontainer/Dockerfile\n\n        # CADDY_REMOTE_HOST_HASH\n        CADDY_REMOTE_HOST_HASH=\"$(\n          git ls-remote https://github.com/muety/caddy-remote-host master \\\n            | cut -f1 \\\n            | tail -1\n        )\"\n        sed -i \"s|^ARG CADDY_REMOTE_HOST_HASH.*$|ARG CADDY_REMOTE_HOST_HASH=$CADDY_REMOTE_HOST_HASH|\" ./Containers/mastercontainer/Dockerfile\n\n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: php dependency updates\n        signoff: true\n        title: PHP dependency updates\n        body: Automated php dependency updates since dependabot does not support grouped updates\n        labels: dependencies, 3. to review\n        milestone: next\n        branch: aio-dependency-update\n"
  },
  {
    "path": ".github/workflows/docker-lint.yml",
    "content": "name: Docker Lint\n\non:\n  pull_request:\n    paths:\n      - 'Containers/**'\n  push:\n    branches:\n      - main\n    paths:\n      - 'Containers/**'\n\npermissions:\n  contents: read\n\nconcurrency: \n  group: docker-lint-${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\njobs:\n  docker-lint:\n    runs-on: ubuntu-latest\n\n    name: docker-lint\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n\n      - name: Install hadolint\n        run: |\n          sudo wget https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -O /usr/bin/hadolint\n          sudo chmod +x /usr/bin/hadolint\n\n      - name: run lint\n        run: |\n          DOCKERFILES=\"$(find ./Containers -name Dockerfile)\"\n          mapfile -t DOCKERFILES <<< \"$DOCKERFILES\"\n          for file in \"${DOCKERFILES[@]}\"; do\n            # DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`\n            # 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\n            hadolint \"$file\" --ignore DL3018 --ignore DL4006 | tee -a ./hadolint.log\n          done\n          if grep -q \"DL[0-9]\\+\\|SC[0-9]\\+\" ./hadolint.log; then\n            exit 1\n          fi\n"
  },
  {
    "path": ".github/workflows/fail-on-prerelease.yml",
    "content": "name: Block if prerelease is present\n\non:\n  pull_request:\n\npermissions:\n  contents: read\n\njobs:\n  check-latest-release:\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Check latest published release isn't a prerelease\"\n        uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v6\n        with:\n          script: |\n            const tags = await github.rest.repos.listTags({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              per_page: 1\n            });\n\n            if (!tags.data || tags.data.length === 0) {\n              core.info('No tags found for this repository; skipping prerelease check.');\n              return;\n            }\n\n            const latestTag = tags.data[0].name;\n            core.info(`Latest tag found: ${latestTag}`);\n\n            try {\n              const { data } = await github.rest.repos.getReleaseByTag({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                tag: latestTag\n              });\n\n              if (data.prerelease) {\n                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.`);\n              } else {\n                core.info(`Release for tag ${latestTag} (${data.tag_name}) is not a prerelease.`);\n              }\n\n            } catch (err) {\n              if (err.status === 404) {\n                core.info(`No release found for tag ${latestTag}; skipping prerelease check.`);\n              } else {\n                throw err;\n              }\n            }\n"
  },
  {
    "path": ".github/workflows/helm-release.yml",
    "content": "\nname: Helm Chart Releaser\n\non:\n  push:\n    branches:\n      - main\n    paths:\n      - 'nextcloud-aio-helm-chart/**'\n\njobs:\n  release:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n\n      - name: Turnstyle\n        uses: softprops/turnstyle@e565d2d86403c5d23533937e95980570545e5586 # v2\n        with:\n          continue-after-seconds: 180\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN  }}\n\n      - name: Fetch history\n        run: git fetch --prune --unshallow\n\n      - name: Configure Git\n        run: |\n          git config user.name \"$GITHUB_ACTOR\"\n          git config user.email \"$GITHUB_ACTOR@users.noreply.github.com\"\n\n      # See https://github.com/helm/chart-releaser-action/issues/6\n      - name: Set up Helm\n        uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4\n        with:\n          version: v3.6.3\n\n      - name: Run Helm Lint\n        run: |\n          helm lint ./nextcloud-aio-helm-chart\n\n      - name: Run chart-releaser\n        uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0\n        with:\n          mark_as_latest: false\n          charts_dir: .\n        env:\n          CR_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n          CR_RELEASE_NAME_TEMPLATE: \"helm-chart-{{ .Version }}\"\n          CR_SKIP_EXISTING: true\n"
  },
  {
    "path": ".github/workflows/imaginary-update.yml",
    "content": "name: imaginary-update\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  run_update:\n    name: update to latest imaginary commit on master branch\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - name: Run imaginary-update\n      run: |\n        # Imaginary\n        imaginary_version=\"$(\n          git ls-remote https://github.com/h2non/imaginary master \\\n            | cut -f1 \\\n            | tail -1\n        )\"\n        sed -i \"s|^ENV IMAGINARY_HASH.*$|ENV IMAGINARY_HASH=$imaginary_version|\" ./Containers/imaginary/Dockerfile\n        \n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: imaginary-update automated change\n        signoff: true\n        title: Imaginary update\n        body: Automated Imaginary container update\n        labels: dependencies, 3. to review\n        milestone: next\n        branch: imaginary-container-update\n"
  },
  {
    "path": ".github/workflows/json-validator.yml",
    "content": "name: Json Validator\n\non:\n  pull_request:\n    paths:\n      - '**.json'\n  push:\n    branches:\n      - main\n    paths:\n      - '**.json'\n\njobs:\n  json-validator:\n    name: Json Validator\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - name: Validate Json\n        run: |\n          sudo apt-get update\n          sudo apt-get install python3-venv -y --no-install-recommends\n          python3 -m venv venv\n          . venv/bin/activate\n          pip3 install json-spec\n          if ! json validate --schema-file=php/containers-schema.json --document-file=php/containers.json; then\n            exit 1\n          fi\n          JSON_FILES=\"$(find ./community-containers -name '*.json')\"\n          mapfile -t JSON_FILES <<< \"$JSON_FILES\"\n          for file in \"${JSON_FILES[@]}\"; do\n            json validate --schema-file=php/containers-schema.json --document-file=\"$file\" 2>&1 | tee -a ./json-validator.log\n          done\n          if grep -q \"document does not validate with schema.\\|invalid JSONFile\" ./json-validator.log; then\n            exit 1\n          fi\n"
  },
  {
    "path": ".github/workflows/lint-helm.yml",
    "content": "name: Lint Helm Charts\n\non:\n  workflow_dispatch:\n  pull_request:\n    paths:\n      - 'nextcloud-aio-helm-chart/**'\n\njobs:\n  lint-helm:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n        with:\n          fetch-depth: 0\n\n      - name: Install Helm\n        uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4\n        with:\n          version: v3.11.1\n\n      - name: Lint charts\n        run: helm lint nextcloud-aio-helm-chart\n"
  },
  {
    "path": ".github/workflows/lint-php.yml",
    "content": "# This workflow is provided via the organization template repository\n#\n# https://github.com/nextcloud/.github\n# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization\n#\n# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors\n# SPDX-License-Identifier: MIT\n\nname: Lint php\n\non:\n  pull_request:\n    paths:\n      - 'php/**'\n  push:\n    branches:\n      - main\n    paths:\n      - 'php/**'\n\npermissions:\n  contents: read\n\nconcurrency:\n  group: lint-php-${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\njobs:\n  php-lint:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        php-versions: [ \"8.5\" ]\n\n    name: php-lint\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n        with:\n          persist-credentials: false\n\n      - name: Set up php ${{ matrix.php-versions }}\n        uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2.36.0\n        with:\n          php-version: ${{ matrix.php-versions }}\n          coverage: none\n          ini-file: development\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Lint\n        run: cd php && composer run lint\n\n  summary:\n    permissions:\n      contents: none\n    runs-on: ubuntu-latest-low\n    needs: php-lint\n\n    if: always()\n\n    name: php-lint-summary\n\n    steps:\n      - name: Summary status\n        run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi\n"
  },
  {
    "path": ".github/workflows/lint-yaml.yml",
    "content": "# This workflow is provided via the organization template repository\n#\n# https://github.com/nextcloud/.github\n# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization\n#\n# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors\n# SPDX-License-Identifier: MIT\n\nname: Lint YAML\n\non: \n  pull_request:\n    paths:\n      - '**.yml'\n\npermissions:\n  contents: read\n\njobs:\n  yaml-lint:\n    runs-on: ubuntu-latest\n\n    name: yaml\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.1\n        with:\n          persist-credentials: false\n\n      - name: GitHub action templates lint\n        uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1\n        with:\n          file_or_dir: .github/workflows\n          config_data: |\n            line-length: warning\n\n      - name: Install the latest version of uv\n        uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1\n\n      - name: Check GitHub actions\n        run: uvx zizmor --min-severity medium .github/workflows/*.yml\n"
  },
  {
    "path": ".github/workflows/lock-threads.yml",
    "content": "name: 'Lock Threads'\n\non:\n  schedule:\n    - cron: '0 0 * * *'\n\npermissions:\n  issues: write\n\nconcurrency:\n  group: lock\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # v5\n        with: \n          issue-inactive-days: '14'\n          process-only: 'issues'\n"
  },
  {
    "path": ".github/workflows/nextcloud-update.yml",
    "content": "# Inspired by https://github.com/nextcloud/docker/blob/master/.github/workflows/update-sh.yml\nname: nextcloud-update\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  run_update_sh:\n    name: Run nextcloud-update script\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - name: Run nextcloud-update script\n      run: |\n        # Inspired by https://github.com/nextcloud/docker/blob/master/update.sh\n\n        # APCU\n        apcu_version=\"$(\n          git ls-remote --tags https://github.com/krakjoe/apcu.git \\\n            | cut -d/ -f3 \\\n            | grep -viE -- 'rc|b' \\\n            | sed -E 's/^v//' \\\n            | sort -V \\\n            | tail -1\n        )\"\n        sed -i \"s|\\(pecl install[^;]*APCu-\\)[0-9.]*|\\1$apcu_version|\" ./Containers/nextcloud/Dockerfile\n        \n        # Memcached\n        memcached_version=\"$(\n          git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \\\n            | cut -d/ -f3 \\\n            | grep -viE -- 'rc|b' \\\n            | sed -E 's/^[rv]//' \\\n            | sort -V \\\n            | tail -1\n        )\"\n        sed -i \"s|\\(pecl install[^;]*memcached-\\)[0-9.]*|\\1$memcached_version|\" ./Containers/nextcloud/Dockerfile\n        \n        # Redis\n        redis_version=\"$(\n          git ls-remote --tags https://github.com/phpredis/phpredis.git \\\n            | cut -d/ -f3 \\\n            | grep -viE '[a-z]' \\\n            | tr -d '^{}' \\\n            | sort -V \\\n            | tail -1\n        )\"\n        sed -i \"s|\\(pecl install[^;]*redis-\\)[0-9.]*|\\1$redis_version|\" ./Containers/nextcloud/Dockerfile\n        \n        # Imagick\n        imagick_version=\"$(\n          git ls-remote --tags https://github.com/imagick/imagick.git \\\n            | cut -d/ -f3 \\\n            | grep -viE '[a-z]' \\\n            | tr -d '^{}' \\\n            | sort -V \\\n            | tail -1\n        )\"\n        sed -i \"s|\\(pecl install[^;]*imagick-\\)[0-9.]*|\\1$imagick_version|\" ./Containers/nextcloud/Dockerfile\n\n        # Igbinary\n        igbinary_version=\"$(\n          git ls-remote --tags https://github.com/igbinary/igbinary.git \\\n            | cut -d/ -f3 \\\n            | grep -viE '[a-z]' \\\n            | tr -d '^{}' \\\n            | sort -V \\\n            | tail -1\n        )\"\n        sed -i \"s|\\(pecl install[^;]*igbinary-\\)[0-9.]*|\\1$igbinary_version|\" ./Containers/nextcloud/Dockerfile\n\n        # Nextcloud\n        NC_MAJOR=\"$(grep \"ENV NEXTCLOUD_VERSION\" ./Containers/nextcloud/Dockerfile | grep -oP '[23][0-9]')\"\n        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)\n        if [ -n \"$NCVERSION\" ]; then\n          sed -i \"s|^ENV NEXTCLOUD_VERSION.*|ENV NEXTCLOUD_VERSION=$NCVERSION|\" ./Containers/nextcloud/Dockerfile\n        fi\n\n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: nextcloud-update automated change\n        signoff: true\n        title: Nextcloud dependency update\n        body: Automated Nextcloud container update\n        labels: dependencies, 3. to review\n        milestone: next\n        branch: nextcloud-container-update\n"
  },
  {
    "path": ".github/workflows/php-deprecation-detector.yml",
    "content": "name: PHP Deprecation Detector\n# See https://github.com/wapmorgan/PhpDeprecationDetector\n\non:\n  pull_request:\n    paths:\n      - 'php/**'\n  push:\n    branches:\n      - main\n    paths:\n      - 'php/**'\n\njobs:\n  phpdd:\n    name: PHP Deprecation Detector\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - name: Set up php\n        uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2\n        with:\n          php-version: 8.5\n          extensions: apcu\n          coverage: none\n\n      - name: Run script\n        run: |\n          set -x\n          cd php\n          composer install\n          composer run php-deprecation-detector | tee -i ./phpdd.log\n          if grep \"Total issues:\" ./phpdd.log; then\n            exit 1\n          fi\n"
  },
  {
    "path": ".github/workflows/playwright-on-push.yml",
    "content": "name: Playwright Tests on push\n\non:\n  pull_request:\n    paths:\n      - 'php/**'\n  push:\n    branches:\n      - main\n    paths:\n      - 'php/**'\n\nconcurrency:\n  group: playwright-${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\nenv:\n  BASE_URL: https://localhost:8080\n\njobs:\n  test:\n    timeout-minutes: 60\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n\n      - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6\n        with:\n          node-version: lts/*\n\n      - name: Install dependencies\n        run: cd php/tests && npm ci\n\n      - name: Install Playwright Browsers\n        run: cd php/tests && npx playwright install --with-deps chromium\n\n      - name: Set up php 8.5\n        uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2.36.0\n        with:\n          extensions: apcu\n          php-version: 8.5\n          coverage: none\n          ini-file: development\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Adjust some things and fix permissions\n        run: |\n          cd php\n          rm -r ./data\n          rm -r ./session\n          composer install --no-dev\n          composer clear-cache\n          sudo chmod 777 -R ./\n\n      - name: Start fresh development server\n        run: |\n          docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true\n          docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true\n          docker pull ghcr.io/nextcloud-releases/all-in-one:develop\n          docker run \\\n            -d \\\n            --init \\\n            --name nextcloud-aio-mastercontainer \\\n            --restart always \\\n            --publish 8080:8080 \\\n            --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n            --volume ./php:/var/www/docker-aio/php \\\n            --volume /var/run/docker.sock:/var/run/docker.sock:ro \\\n            --env SKIP_DOMAIN_VALIDATION=true \\\n            --env APACHE_PORT=11000 \\\n            ghcr.io/nextcloud-releases/all-in-one:develop\n          echo Waiting for 10 seconds for the development container to start ...\n          sleep 10\n\n      - name: Run Playwright tests for initial setup\n        run: |\n          cd php/tests\n          export DEBUG=pw:api\n          if ! npx playwright test tests/initial-setup.spec.js; then\n            docker logs nextcloud-aio-mastercontainer\n            docker logs nextcloud-aio-borgbackup\n            exit 1\n          fi\n\n      - name: Start fresh development server\n        run: |\n          docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true\n          docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true\n          docker run \\\n            -d \\\n            --init \\\n            --name nextcloud-aio-mastercontainer \\\n            --restart always \\\n            --publish 8080:8080 \\\n            --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n            --volume ./php:/var/www/docker-aio/php \\\n            --volume /var/run/docker.sock:/var/run/docker.sock:ro \\\n            --env SKIP_DOMAIN_VALIDATION=false \\\n            --env APACHE_PORT=11000 \\\n            ghcr.io/nextcloud-releases/all-in-one:develop\n          echo Waiting for 10 seconds for the development container to start ...\n          sleep 10\n\n      - name: Run Playwright tests for backup restore\n        run: |\n          cd php/tests \n          export DEBUG=pw:api\n          if ! npx playwright test tests/restore-instance.spec.js; then\n            docker logs nextcloud-aio-mastercontainer\n            docker logs nextcloud-aio-borgbackup\n            exit 1\n          fi\n\n      - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0\n        if: ${{ !cancelled() }}\n        with:\n          name: playwright-report\n          path: php/tests/playwright-report/\n          retention-days: 14\n          overwrite: true\n"
  },
  {
    "path": ".github/workflows/playwright-on-workflow-dispatch.yml",
    "content": "name: Playwright Tests\n\non:\n  workflow_dispatch:\n\nenv:\n  BASE_URL: https://localhost:8080\n\njobs:\n  test:\n    timeout-minutes: 60\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n\n      - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6\n        with:\n          node-version: lts/*\n\n      - name: Install dependencies\n        run: cd php/tests && npm ci\n\n      - name: Install Playwright Browsers\n        run: cd php/tests && npx playwright install --with-deps chromium\n\n      - name: Start fresh development server\n        run: |\n          docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true\n          docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true\n          docker pull ghcr.io/nextcloud-releases/all-in-one:develop\n          docker run \\\n            -d \\\n            --init \\\n            --name nextcloud-aio-mastercontainer \\\n            --restart always \\\n            --publish 8080:8080 \\\n            --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n            --volume /var/run/docker.sock:/var/run/docker.sock:ro \\\n            --env SKIP_DOMAIN_VALIDATION=true \\\n            --env APACHE_PORT=11000 \\\n            ghcr.io/nextcloud-releases/all-in-one:develop\n          echo Waiting for 10 seconds for the development container to start ...\n          sleep 10\n\n      - name: Run Playwright tests for initial setup\n        run: |\n          cd php/tests\n          export DEBUG=pw:api\n          if ! npx playwright test tests/initial-setup.spec.js; then\n            docker logs nextcloud-aio-mastercontainer\n            docker logs nextcloud-aio-borgbackup\n            exit 1\n          fi\n\n      - name: Start fresh development server\n        run: |\n          docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true\n          docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true\n          docker run \\\n            -d \\\n            --init \\\n            --name nextcloud-aio-mastercontainer \\\n            --restart always \\\n            --publish 8080:8080 \\\n            --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n            --volume /var/run/docker.sock:/var/run/docker.sock:ro \\\n            --env SKIP_DOMAIN_VALIDATION=false \\\n            --env APACHE_PORT=11000 \\\n            ghcr.io/nextcloud-releases/all-in-one:develop\n          echo Waiting for 10 seconds for the development container to start ...\n          sleep 10\n\n      - name: Run Playwright tests for backup restore\n        run: |\n          cd php/tests \n          export DEBUG=pw:api\n          if ! npx playwright test tests/restore-instance.spec.js; then\n            docker logs nextcloud-aio-mastercontainer\n            docker logs nextcloud-aio-borgbackup\n            exit 1\n          fi\n\n      - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0\n        if: ${{ !cancelled() }}\n        with:\n          name: playwright-report\n          path: php/tests/playwright-report/\n          retention-days: 14\n          overwrite: true\n"
  },
  {
    "path": ".github/workflows/psalm-update-baseline.yml",
    "content": "name: Update Psalm baseline\n\non:\n  workflow_dispatch:\n  schedule:\n    - cron: '5 4 * * *'\n\njobs:\n  update-psalm-baseline:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n\n      - name: Set up php\n        uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2\n        with:\n          php-version: 8.5\n          extensions: apcu\n          coverage: none\n          ini-file: development\n\n      - name: Run script\n        run: |\n          set -x\n          cd php\n          composer install\n          composer run psalm:update-baseline\n          git clean -f lib/composer\n          git checkout composer.json composer.lock lib/composer\n        continue-on-error: true\n\n      - name: Create Pull Request\n        uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          commit-message: Update psalm baseline\n          committer: GitHub <noreply@github.com>\n          author: nextcloud-command <nextcloud-command@users.noreply.github.com>\n          signoff: true\n          branch: automated/noid/psalm-baseline-update\n          title: '[Automated] Update psalm-baseline.xml'\n          milestone: next\n          body: |\n            Auto-generated update psalm-baseline.xml with fixed psalm warnings\n          labels: |\n            3. to review, dependencies\n"
  },
  {
    "path": ".github/workflows/psalm.yml",
    "content": "# This workflow is provided via the organization template repository\n#\n# https://github.com/nextcloud/.github\n# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization\n#\n# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors\n# SPDX-License-Identifier: MIT\n\nname: Static analysis\n\non:\n  pull_request:\n    paths:\n      - 'php/**'\n  push:\n    branches:\n      - main\n    paths:\n      - 'php/**'\n\nconcurrency:\n  group: psalm-${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\npermissions:\n  contents: read\n\njobs:\n  static-analysis:\n    runs-on: ubuntu-latest\n\n    name: static-psalm-analysis\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n        with:\n          persist-credentials: false\n\n      - name: Set up php\n        uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2.36.0\n        with:\n          php-version: 8.5\n          extensions: apcu\n          coverage: none\n          ini-file: development\n\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Install dependencies and run psalm\n        run: |\n          set -x\n          cd php\n          composer install\n          composer run psalm\n"
  },
  {
    "path": ".github/workflows/shellcheck.yml",
    "content": "name: Shellcheck\n\non:\n  pull_request:\n    paths:\n      - '**.sh'\n  push:\n    branches:\n      - main\n    paths:\n      - '**.sh'\n\njobs:\n  shellcheck:\n    name: Check Shell\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - name: Run Shellcheck\n      uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0\n      with:\n        check_together: 'yes'\n      env:\n        SHELLCHECK_OPTS: --shell bash\n"
  },
  {
    "path": ".github/workflows/talk.yml",
    "content": "name: talk-update\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  talk-update:\n    name: update talk\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - name: Run talk-container-update\n      run: |\n        # Recording\n        recording_version=\"$(\n          git ls-remote https://github.com/nextcloud/nextcloud-talk-recording v* \\\n            | cut -d/ -f3 \\\n            | sort -V \\\n            | grep -E \"^v[0-9\\.]+$\" \\\n            | tail -1\n        )\"\n        sed -i \"s|^ENV RECORDING_VERSION.*$|ENV RECORDING_VERSION=$recording_version|\" ./Containers/talk-recording/Dockerfile\n        curl -L \"https://raw.githubusercontent.com/nextcloud/nextcloud-talk-recording/$recording_version/server.conf.in\" -o Containers/talk-recording/recording.conf\n        \n        # Signaling\n        signaling_version=\"$(\n          git ls-remote https://github.com/strukturag/nextcloud-spreed-signaling v*.*.* \\\n            | cut -d/ -f3 \\\n            | sort -V \\\n            | grep -E \"^v[0-9]+\\.[0-9]+\\.[0-9]+$\" \\\n            | tail -1\n        )\"\n        curl -L \"https://raw.githubusercontent.com/strukturag/nextcloud-spreed-signaling/$signaling_version/server.conf.in\" -o Containers/talk/server.conf.in\n        \n        # Janus\n        janus_version=\"$(\n          git ls-remote https://github.com/meetecho/janus-gateway v1.*.* \\\n            | cut -d/ -f3 \\\n            | sort -V \\\n            | grep -E \"^v[0-9]+\\.[0-9]+\\.[0-9]+$\" \\\n            | tail -1\n        )\"\n        sed -i \"s|^ARG JANUS_VERSION=.*$|ARG JANUS_VERSION=$janus_version|\" ./Containers/talk/Dockerfile\n        \n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: talk-update automated change\n        signoff: true\n        title: talk container update\n        body: Automated talk container update\n        labels: dependencies, 3. to review\n        milestone: next\n        branch: talk-container-update\n"
  },
  {
    "path": ".github/workflows/twig-lint.yml",
    "content": "name: Twig Lint\n\non:\n  pull_request:\n    paths:\n      - '**.twig'\n  push:\n    branches:\n      - main\n    paths:\n      - '**.twig'\n\npermissions:\n  contents: read\n\nconcurrency:\n  group: lint-twig-${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\njobs:\n  twig-lint:\n    runs-on: ubuntu-latest\n    name: twig-lint\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n\n      - name: Set up php ${{ matrix.php-versions }}\n        uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2\n        with:\n          php-version: 8.5\n          extensions: apcu\n          coverage: none\n\n      - name: twig lint\n        run: |\n          cd php\n          composer install\n          composer run lint:twig\n"
  },
  {
    "path": ".github/workflows/update-copyright.yml",
    "content": "name: Update Copyright\n\non:\n  workflow_dispatch:\n\njobs:\n  update-copyright:\n    name: update copyright\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n"
  },
  {
    "path": ".github/workflows/update-helm.yml",
    "content": "name: Update Helm Chart\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  update-helm:\n    name: update helm chart\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - name: update helm chart\n        run: |\n          set -x\n          GHCR_TOKEN=\"$(curl https://ghcr.io/token?scope=repository:nextcloud-releases/nce-php-fpm-mgmt:pull | jq '.token' | sed 's|\"||g')\"\n          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)\"\n          export DOCKER_TAG\n          set +x\n          if [ -n \"$DOCKER_TAG\" ] && ! grep -q \"aio-nextcloud:$DOCKER_TAG\" ./nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml; then\n            sudo bash nextcloud-aio-helm-chart/update-helm.sh \"$DOCKER_TAG\"\n          fi\n      - name: Create Pull Request\n        uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n        with:\n          commit-message: Helm Chart updates\n          signoff: true\n          title: Helm Chart updates\n          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.\n          labels: dependencies, 3. to review\n          milestone: next\n          branch: aio-helm-update\n          token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/update-yaml.yml",
    "content": "name: Update Yaml files\r\n\r\non:\r\n  workflow_dispatch:\r\n  schedule:\r\n  - cron:  '00 12 * * *'\r\n\r\njobs:\r\n  update-yaml:\r\n    name: update yaml files\r\n    runs-on: ubuntu-latest\r\n    steps:\r\n      - name: Checkout code\r\n        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - name: update yaml files\r\n        run: |\r\n          sudo bash manual-install/update-yaml.sh\r\n      - name: Create Pull Request\r\n        uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\r\n        with:\r\n          commit-message: Yaml updates\r\n          signoff: true\r\n          title: Yaml updates\r\n          body: Automated yaml updates for the docker-compose files. Should only be merged shortly before the next latest release.\r\n          labels: dependencies, 3. to review\r\n          milestone: next\r\n          branch: aio-yaml-update\r\n          token: ${{ secrets.GITHUB_TOKEN }}\r\n"
  },
  {
    "path": ".github/workflows/watchtower-update.yml",
    "content": "name: watchtower-update\n\non:\n  workflow_dispatch:\n  schedule:\n  - cron:  '00 12 * * *'\n\njobs:\n  watchtower-update:\n    name: update watchtower\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - name: Run watchtower-container-update\n      run: |\n        # Watchtower\n        watchtower_version=\"$(\n          git ls-remote https://github.com/nicholas-fedor/watchtower v* \\\n            | cut -d/ -f3 \\\n            | sort -V \\\n            | grep -E \"^v[0-9\\.]+$\" \\\n            | tail -1\n        )\"\n        watchtower_commit_hash=\"$(git ls-remote https://github.com/nicholas-fedor/watchtower $watchtower_version | sed 's/refs.*//')\"\n        sed -i \"s|^ENV WATCHTOWER_COMMIT_HASH.*$|ENV WATCHTOWER_COMMIT_HASH=$watchtower_commit_hash|\" ./Containers/watchtower/Dockerfile\n        sed -i \"s|\\$WATCHTOWER_COMMIT_HASH.*$|\\$WATCHTOWER_COMMIT_HASH # $watchtower_version|\" ./Containers/watchtower/Dockerfile\n        \n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: watchtower-update automated change\n        signoff: true\n        title: watchtower container update\n        body: Automated watchtower container update\n        labels: dependencies, 3. to review\n        milestone: next\n        branch: watchtower-container-update\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n.idea/\n*.iml\n\n/php/data/*\n/php/session/*\n!/php/data/.gitkeep\n!/php/session/.gitkeep\n/php/vendor\n\n/manual-install/*.conf\n!/manual-install/sample.conf\n/manual-install/docker-compose.yml\n/manual-install/compose.yaml\n/manual-install/.env\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "<!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\nIn 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.\n\nOur 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.\n\nThe 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.\n\nYou can find our full code of conduct on our website: https://nextcloud.com/code-of-conduct/\n\nPlease, 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.\n"
  },
  {
    "path": "Containers/alpine/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM alpine:3.23.3\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a\n\nLABEL org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/apache/Caddyfile",
    "content": "{\n    auto_https disable_redirects\n\n    storage file_system {\n        root /mnt/data/caddy\n    }\n\n    servers {\n        # trusted_proxies placeholder\n    }\n\n    log {\n        level ERROR\n    }\n}\n\nhttps://{$ADDITIONAL_TRUSTED_DOMAIN}:443,\nhttp://{$APACHE_HOST}.nextcloud-aio:23973, # For Collabora callback and WOPI requests, see containers.json\n{$PROTOCOL}://{$NC_DOMAIN}:{$APACHE_PORT} {\n    header -Server\n    header -X-Powered-By\n\n    # Collabora\n    route /browser/* {\n        reverse_proxy {$COLLABORA_HOST}:9980\n    }\n    route /hosting/* {\n        reverse_proxy {$COLLABORA_HOST}:9980\n    }\n    route /cool/* {\n        reverse_proxy {$COLLABORA_HOST}:9980\n    }\n\n    # Notify Push\n    route /push/* {\n        uri strip_prefix /push\n        reverse_proxy {$NOTIFY_PUSH_HOST}:7867\n    }\n\n    # Onlyoffice\n    route /onlyoffice/* {\n        uri strip_prefix /onlyoffice\n        reverse_proxy {$ONLYOFFICE_HOST}:80 {\n            header_up X-Forwarded-Host {http.request.hostport}/onlyoffice\n            header_up X-Forwarded-Proto https\n        }\n    }\n\n    # Talk\n    route /standalone-signaling/* {\n        uri strip_prefix /standalone-signaling\n        reverse_proxy {$TALK_HOST}:8081\n    }\n\n    # Whiteboard\n    route /whiteboard/* {\n        uri strip_prefix /whiteboard\n        reverse_proxy {$WHITEBOARD_HOST}:3002\n    }\n\n    # HaRP (ExApps)\n    route /exapps/* {\n        reverse_proxy {$HARP_HOST}:8780\n    }\n\n    # Nextcloud\n    route {\n        header Strict-Transport-Security max-age=31536000;\n        reverse_proxy 127.0.0.1:8000\n    }\n    redir /.well-known/carddav /remote.php/dav/ 301\n    redir /.well-known/caldav /remote.php/dav/ 301\n\n    # TLS options\n    tls {\n        issuer acme {\n            disable_http_challenge\n        }\n    }\n}\n"
  },
  {
    "path": "Containers/apache/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM caddy:2.11.2-alpine AS caddy\n\n# From https://github.com/docker-library/httpd/blob/master/2.4/alpine/Dockerfile\nFROM httpd:2.4.66-alpine3.23\n\nCOPY --from=caddy /usr/bin/caddy /usr/bin/caddy\n\nCOPY --chown=33:33 Caddyfile /Caddyfile\nCOPY --chmod=664 nextcloud.conf /usr/local/apache2/conf/nextcloud.conf\nCOPY --chmod=664 supervisord.conf /supervisord.conf\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nVOLUME /mnt/data\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache shadow; \\\n    groupmod -g 33 www-data; \\\n    usermod -u 33 -g 33 www-data; \\\n    apk del --no-cache shadow; \\\n    \\\n    mkdir -p /mnt/data; \\\n    chown -R www-data:www-data /mnt/data; \\\n    chown -R 777 /tmp; \\\n    \\\n    apk add --no-cache \\\n        bash \\\n        supervisor \\\n        tzdata \\\n        ca-certificates \\\n        openssl \\\n        bind-tools \\\n        netcat-openbsd; \\\n    \\\n    sed -i \\\n            -e '/^Listen /d' \\\n            -e 's/^#\\(LoadModule .*mod_rewrite.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_headers.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_proxy.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_proxy_fcgi.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_setenvif.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_env.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_mime.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_dir.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_authz_core.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_alias.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_mpm_event.so\\)/\\1/' \\\n            -e 's/^#\\(LoadModule .*mod_brotli.so\\)/\\1/' \\\n            -e 's/\\(LoadModule .*mod_mpm_worker.so\\)/#\\1/' \\\n            -e 's/\\(LoadModule .*mod_mpm_prefork.so\\)/#\\1/' \\\n            -e 's/\\(ScriptAlias \\)/#\\1/' \\\n        /usr/local/apache2/conf/httpd.conf; \\\n    echo \"Include conf/nextcloud.conf\" | tee -a /usr/local/apache2/conf/httpd.conf; \\\n    echo \"ServerName localhost\" | tee -a /usr/local/apache2/conf/httpd.conf; \\\n# Sync this with max db connections and pm.max_children\n# We don't actually expect so many workers but don't want to limit it artificially because people will report issues otherwise.\n    sed -i 's|MaxRequestWorkers.*|MaxRequestWorkers 5000|' /usr/local/apache2/conf/extra/httpd-mpm.conf; \\\n    grep -q '<IfModule mpm_event_module>' /usr/local/apache2/conf/extra/httpd-mpm.conf; \\\n# ServerLimit needs to be set to MaxRequestWorkers divided by ThreadsPerChild which is set to 25 by default\n    sed -i '/<IfModule mpm_event_module>/a\\ \\ \\ \\ ServerLimit 200' /usr/local/apache2/conf/extra/httpd-mpm.conf; \\\n    \\\n    rm -rf /usr/local/apache2/conf/original /var/www; \\\n    mkdir -p /var/www; \\\n    chown -R www-data:www-data /var/www; \\\n    \\\n    mkdir /var/log/supervisord; \\\n    mkdir /var/run/supervisord; \\\n    chown www-data:www-data /var/run/supervisord; \\\n    chown www-data:www-data /var/log/supervisord; \\\n    chmod 777 /var/run/supervisord; \\\n    chmod 777 /var/log/supervisord; \\\n    \\\n    chown -R www-data:www-data /usr/local/apache2; \\\n    chmod +r -R /usr/local/apache2; \\\n    mkdir -p /usr/local/apache2/logs; \\\n    chmod 777 -R /home/www-data; \\\n    chmod 777 -R /usr/local/apache2/logs; \\\n    rm -rf /usr/local/apache2/cgi-bin/; \\\n    \\\n    echo \"root:$(openssl rand -base64 12)\" | chpasswd; \\\n    apk --no-cache del openssl\n\nUSER 33\n\nENTRYPOINT [\"/start.sh\"]\nCMD [\"/usr/bin/supervisord\", \"-c\", \"/supervisord.conf\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/apache/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z \"$NEXTCLOUD_HOST\" 9000 || exit 0\nnc -z 127.0.0.1 8000 || exit 1\nnc -z 127.0.0.1 \"$APACHE_PORT\" || exit 1\n"
  },
  {
    "path": "Containers/apache/nextcloud.conf",
    "content": "Listen 8000\n<VirtualHost *:8000>\n    ServerName localhost\n\n    # Add error log\n    CustomLog /proc/self/fd/1 proxy\n    LogFormat \"%{X-Forwarded-For}i %l %u %t \\\"%r\\\" %>s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" proxy\n    ErrorLog /proc/self/fd/2\n    ErrorLogFormat \"[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]\"\n    LogLevel warn\n\n    # PHP match\n    <FilesMatch \"\\.php$\">\n        SetHandler \"proxy:fcgi://${NEXTCLOUD_HOST}:9000\"\n    </FilesMatch>\n\n    <Proxy \"fcgi://${NEXTCLOUD_HOST}:9000\" flushpackets=on>\n    </Proxy>\n\n    # Enable Brotli compression for js, css and svg files - other plain files are compressed by Nextcloud by default\n    <IfModule mod_brotli.c>\n        AddOutputFilterByType BROTLI_COMPRESS text/javascript application/javascript application/x-javascript text/css image/svg+xml\n        BrotliCompressionQuality 0\n    </IfModule>\n\n    # Nextcloud dir\n    DocumentRoot /var/www/html/\n    <Directory /var/www/html/>\n        Options Indexes FollowSymLinks\n        Require all granted\n        AllowOverride All\n        Options FollowSymLinks MultiViews\n        Satisfy Any\n        <IfModule mod_dav.c>\n            Dav off\n        </IfModule>\n    </Directory>\n    # Deny access to .ht files\n    <Files \".ht*\">\n        Require all denied\n    </Files>\n\n    # See https://httpd.apache.org/docs/current/en/mod/core.html#limitrequestbody\n    LimitRequestBody ${APACHE_MAX_SIZE}\n\n    # See https://httpd.apache.org/docs/current/mod/core.html#timeout\n    Timeout ${APACHE_MAX_TIME}\n\n    # See https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxytimeout\n    ProxyTimeout ${APACHE_MAX_TIME}\n\n    # See https://httpd.apache.org/docs/trunk/mod/core.html#traceenable\n    TraceEnable Off\n</VirtualHost>\n"
  },
  {
    "path": "Containers/apache/start.sh",
    "content": "#!/bin/bash\n\nif [ -z \"$NC_DOMAIN\" ]; then\n    echo \"NC_DOMAIN and NEXTCLOUD_HOST need to be provided. Exiting!\"\n    exit 1\nfi\n\n# Need write access to /mnt/data\nif ! [ -w /mnt/data ]; then\n    echo \"Cannot write to /mnt/data\"\n    exit 1\nfi\n\n# Only start container if nextcloud is accessible\nwhile ! nc -z \"$NEXTCLOUD_HOST\" 9000; do\n    echo \"Waiting for Nextcloud to start...\"\n    sleep 5\ndone\n\n# Get ipv4-address of Apache\n# shellcheck disable=SC2153\nIPv4_ADDRESS=\"$(dig \"$APACHE_HOST\" A +short +search | head -1)\"\n# Bring it in CIDR notation\n# shellcheck disable=SC2001\nIPv4_ADDRESS=\"$(echo \"$IPv4_ADDRESS\" | sed 's|[0-9]\\+$|0/16|')\"\n\nif [ -z \"$APACHE_PORT\" ]; then\n    export APACHE_PORT=\"443\"\nfi\n\n# Change variables in case of reverse proxies\nif [ \"$APACHE_PORT\" != '443' ]; then\n    export PROTOCOL=\"http\"\n    export NC_DOMAIN=\"\"\nelse\n    export PROTOCOL=\"https\"\nfi\n\n# Change the auto_https in case of reverse proxies\nif [ \"$APACHE_PORT\" != '443' ]; then\n    CADDYFILE=\"$(sed 's|auto_https.*|auto_https off|' /Caddyfile)\"\nelse\n    CADDYFILE=\"$(sed 's|auto_https.*|auto_https disable_redirects|' /Caddyfile)\"\nfi\necho \"$CADDYFILE\" > /tmp/Caddyfile\n\n# Change the trusted_proxies in case of reverse proxies\nif [ \"$APACHE_PORT\" != '443' ]; then\n    # Here the 100.64.0.0/10 range gets added which is the CGNAT range used by Tailscale nodes\n    # See https://github.com/nextcloud/all-in-one/pull/6703 for reference\n    CADDYFILE=\"$(sed 's|# trusted_proxies placeholder|trusted_proxies static private_ranges 100.64.0.0/10|' /tmp/Caddyfile)\"\nelse\n    CADDYFILE=\"$(sed \"s|# trusted_proxies placeholder|trusted_proxies static $IPv4_ADDRESS|\" /tmp/Caddyfile)\"\nfi\necho \"$CADDYFILE\" > /tmp/Caddyfile\n\n# Remove additional domain if not given\nif [ -z \"$ADDITIONAL_TRUSTED_DOMAIN\" ]; then\n    CADDYFILE=\"$(sed '/ADDITIONAL_TRUSTED_DOMAIN/d' /tmp/Caddyfile)\"\nfi\necho \"$CADDYFILE\" > /tmp/Caddyfile\n\n# Fix the Caddyfile format\ncaddy fmt --overwrite /tmp/Caddyfile\n\n# Add caddy path\nmkdir -p /mnt/data/caddy/\n\n# Fix caddy startup\nif [ -d \"/mnt/data/caddy/locks\" ]; then\n    rm -rf /mnt/data/caddy/locks/*\nfi\n\n# Fix apache startup\nrm -f /usr/local/apache2/logs/httpd.pid\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/apache/supervisord.conf",
    "content": "[supervisord]\r\nnodaemon=true\r\nnodaemon=true\r\nlogfile=/var/log/supervisord/supervisord.log\r\npidfile=/var/run/supervisord/supervisord.pid\r\nchildlogdir=/var/log/supervisord/\r\nlogfile_maxbytes=50MB                           \r\nlogfile_backups=10                              \r\nloglevel=error\r\n\r\n[program:apache]\r\n# Stdout logging is disabled as otherwise the logs are spammed\r\nstdout_logfile=NONE\r\nstderr_logfile=/dev/stderr\r\nstderr_logfile_maxbytes=0\r\ncommand=apachectl -DFOREGROUND\r\n\r\n[program:caddy]\r\nstdout_logfile=/dev/stdout\r\nstdout_logfile_maxbytes=0\r\nstderr_logfile=/dev/stderr\r\nstderr_logfile_maxbytes=0\r\ncommand=/usr/bin/caddy run --config /tmp/Caddyfile\r\n"
  },
  {
    "path": "Containers/borgbackup/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM alpine:3.23.3\n\nRUN set -ex; \\\n    \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        util-linux-misc \\\n        bash \\\n        borgbackup \\\n        rsync \\\n        fuse \\\n        py3-llfuse \\\n        jq \\\n        openssh-client\n\nVOLUME /root\n\nCOPY --chmod=770 *.sh /\nCOPY borg_excludes /\n\nENTRYPOINT [\"/start.sh\"]\n# hadolint ignore=DL3002\nUSER root\n\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\nENV BORG_RETENTION_POLICY=\"--keep-within=7d --keep-weekly=4 --keep-monthly=6\"\n"
  },
  {
    "path": "Containers/borgbackup/backupscript.sh",
    "content": "#!/bin/bash\n\n# Functions\nget_start_time(){\n    START_TIME=$(date +%s)\n    CURRENT_DATE=$(date --date @\"$START_TIME\" +\"%Y%m%d_%H%M%S\")\n}\nget_expiration_time() {\n    END_TIME=$(date +%s)\n    END_DATE_READABLE=$(date --date @\"$END_TIME\" +\"%d.%m.%Y - %H:%M:%S\")\n    DURATION=$((END_TIME-START_TIME))\n    DURATION_SEC=$((DURATION % 60))\n    DURATION_MIN=$(((DURATION / 60) % 60))\n    DURATION_HOUR=$((DURATION / 3600))\n    DURATION_READABLE=$(printf \"%02d hours %02d minutes %02d seconds\" $DURATION_HOUR $DURATION_MIN $DURATION_SEC)\n}\n\n# Test if all volumes aren't empty\nVOLUME_DIRS=\"$(find /nextcloud_aio_volumes -mindepth 1 -maxdepth 1 -type d)\"\nmapfile -t VOLUME_DIRS <<< \"$VOLUME_DIRS\"\nfor directory in \"${VOLUME_DIRS[@]}\"; do\n    if ! mountpoint -q \"$directory\"; then\n        echo \"$directory is not a mountpoint which is not allowed.\"\n        exit 1\n    fi\ndone\n# Test if default volumes are there\nDEFAULT_VOLUMES=(nextcloud_aio_apache nextcloud_aio_nextcloud nextcloud_aio_database nextcloud_aio_database_dump nextcloud_aio_elasticsearch nextcloud_aio_nextcloud_data nextcloud_aio_mastercontainer)\nfor volume in \"${DEFAULT_VOLUMES[@]}\"; do\n    if ! mountpoint -q \"/nextcloud_aio_volumes/$volume\"; then\n        echo \"$volume is missing which is not intended.\"\n        exit 1\n    fi\ndone\n\n# Check if target is mountpoint\nif [ -z \"$BORG_REMOTE_REPO\" ] && ! mountpoint -q \"$MOUNT_DIR\"; then\n    echo \"$MOUNT_DIR is not a mountpoint which is not allowed.\"\n    exit 1\nfi\n\n# Check if repo is uninitialized\nif [ \"$BORG_MODE\" != backup ] && [ \"$BORG_MODE\" != test ] && ! borg info > /dev/null; then\n    if [ -n \"$BORG_REMOTE_REPO\" ]; then\n        echo \"The repository is uninitialized or cannot connect to remote. Cannot perform check or restore.\"\n    else\n        echo \"The repository is uninitialized. Cannot perform check or restore.\"\n    fi\n    exit 1\nfi\n\n# Do not continue if this file exists (needed for simple external blocking)\nif [ -z \"$BORG_REMOTE_REPO\" ] && [ -f \"$BORG_BACKUP_DIRECTORY/aio-lockfile\" ]; then\n    echo \"Not continuing because aio-lockfile exists – it seems like a script is externally running which is locking the backup archive.\"\n    echo \"If this should not be the case, you can fix this by deleting the 'aio-lockfile' file from the backup archive directory.\"\n    exit 1\nfi\n\n# Create lockfile\nif [ \"$BORG_MODE\" = backup ] || [ \"$BORG_MODE\" = restore ]; then\n    touch \"/nextcloud_aio_volumes/nextcloud_aio_database_dump/backup-is-running\"\nfi\n\nif [ -n \"$BORG_REMOTE_REPO\" ] && ! [ -f \"$BORGBACKUP_KEY\" ]; then\n    echo \"First run, creating borg ssh key\"\n    ssh-keygen  -f \"$BORGBACKUP_KEY\" -N \"\"\n    echo \"You should configure the remote to accept this public key\"\nfi\nif [ -n \"$BORG_REMOTE_REPO\" ] && [ -f \"$BORGBACKUP_KEY.pub\" ]; then\n    echo \"Your public ssh key for borgbackup is: $(cat \"$BORGBACKUP_KEY.pub\")\"\nfi\n\n# Do the backup\nif [ \"$BORG_MODE\" = backup ]; then\n\n    # Test if important files are present\n    if ! [ -f \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\" ]; then\n        echo \"configuration.json not present. Cannot perform the backup!\"\n        exit 1\n    elif ! grep -q '\"domain\"' \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\" \\\n    || ! grep -q '\"wasStartButtonClicked\"' \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\"; then\n        echo \"It seems like the configuration.json setup was not done correctly. Something is wrong! (Most likely the provided configuration.json is invalid)\"\n        exit 1\n    elif ! [ -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud/config/config.php\" ]; then\n        echo \"config.php is missing. Cannot perform backup!\"\n        exit 1\n    elif ! [ -f \"/nextcloud_aio_volumes/nextcloud_aio_database_dump/database-dump.sql\" ]; then\n        echo \"database-dump is missing. Cannot perform backup!\"\n        echo \"Please check the database container logs!\"\n        exit 1\n    elif ! [ -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.ocdata\" ] && ! [ -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.ncdata\" ]; then\n        echo \"The .ncdata or .ocdata file is missing in Nextcloud datadir which means it is invalid!\"\n        echo \"Is the drive where the datadir is located on still mounted?\"\n        exit 1\n    fi\n\n    # Test that default volumes are not empty\n    for volume in \"${DEFAULT_VOLUMES[@]}\"; do\n        if [ -z \"$(ls -A \"/nextcloud_aio_volumes/$volume\")\" ] && [ \"$volume\" != \"nextcloud_aio_elasticsearch\" ]; then\n            echo \"/nextcloud_aio_volumes/$volume is empty which should not happen!\"\n            exit 1\n        fi\n    done\n\n    if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_database_dump/export.failed\" ]; then\n        echo \"Cannot create a backup now.\"\n        echo \"Reason is that the database export failed the last time.\"\n        echo \"Most likely was the database container not correctly shut down via the AIO interface.\"\n        echo \"\"\n        echo \"You might want to try the database export again manually by running the three commands:\"\n        echo \"sudo docker start nextcloud-aio-database\"\n        echo \"sleep 10\"\n        echo \"sudo docker stop nextcloud-aio-database -t 1800\"\n        echo \"\"\n        echo \"Afterwards try to create a backup again and it should hopefully work.\"\n        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!\"\n        exit 1\n    fi\n\n    if [ -z \"$BORG_REMOTE_REPO\" ]; then\n        # Create backup folder\n        mkdir -p \"$BORG_BACKUP_DIRECTORY\"\n    fi\n\n    # Initialize the repository if can't get info from target\n    if ! borg info > /dev/null; then\n        # Don't initialize if already initialized\n        if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config\" ]; then\n            if [ -n \"$BORG_REMOTE_REPO\" ]; then\n                echo \"Borg could not get info from the remote repo.\"\n                echo \"This might be a failure to connect to the remote server. See the above borg info output for details.\"\n            else\n                echo \"Borg could not get info from the targeted directory.\"\n                echo \"This might happen if the targeted directory is located on an external drive and the drive not connected anymore. You should check this.\"\n            fi\n            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:\"\n            echo \"sudo docker exec nextcloud-aio-mastercontainer rm /mnt/docker-aio-config/data/borg.config\"\n            exit 1\n        fi\n\n        echo \"Initializing repository...\"\n        NEW_REPOSITORY=1\n        if ! borg init --debug --encryption=repokey-blake2; then\n            echo \"Could not initialize borg repository.\"\n            exit 1\n        fi\n\n        if [ -z \"$BORG_REMOTE_REPO\" ]; then\n            # borg config only works for local repos; it's up to the remote to ensure the disk isn't full\n            borg config :: additional_free_space 2G\n\n            # Fix too large Borg cache\n            # https://borgbackup.readthedocs.io/en/stable/faq.html#the-borg-cache-eats-way-too-much-disk-space-what-can-i-do\n            BORG_ID=\"$(borg config :: id)\"\n            rm -r \"/root/.cache/borg/$BORG_ID/chunks.archive.d\"\n            touch \"/root/.cache/borg/$BORG_ID/chunks.archive.d\"\n        fi\n\n        if ! borg info > /dev/null; then\n            echo \"Borg can't get info from the repo it created. Something is wrong.\"\n            exit 1\n        fi\n\n        rm -f \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config\"\n        if [ -n \"$BORG_REMOTE_REPO\" ]; then\n            # `borg config` does not support remote repos so instead create a dummy file and rely on the remote to avoid\n            # corruption of the config file (which contains the encryption key). We don't actually use the contents of\n            # this file anywhere, so a touch is all we need so we remember we already initialized the repo.\n            touch \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config\"\n        else\n            # Make a backup from the borg config file\n            if ! cp \"$BORG_BACKUP_DIRECTORY/config\" \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config\"; then\n                echo \"Could not copy config file to second place. Cannot perform backup.\"\n                exit 1\n            fi\n        fi\n\n        echo \"Repository successfully initialized.\"\n    fi\n\n    # Perform backup\n    echo \"Performing backup...\"\n\n    # Borg options\n    # auto,zstd compression seems to has the best ratio based on:\n    # https://forum.level1techs.com/t/optimal-compression-for-borg-backups/145870/6\n    BORG_OPTS=(-v --stats --compression \"auto,zstd\")\n    if [ \"$NEW_REPOSITORY\" = 1 ]; then\n        BORG_OPTS+=(--progress)\n    fi\n\n    # Exclude the nextcloud log and audit log for GDPR reasons\n    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\")\n    BORG_INCLUDE=()\n\n    # Exclude datadir if .noaiobackup file was found\n    # shellcheck disable=SC2144\n    if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.noaiobackup\" ]; then\n        BORG_EXCLUDE+=(--exclude \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/\")\n        BORG_INCLUDE+=(--pattern=\"+/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.noaiobackup\")\n        echo \"⚠️⚠️⚠️ '.noaiobackup' file was found in Nextcloud's data directory. Excluding the data directory from backup!\"\n    # Exclude preview folder if .noaiobackup file was found\n    elif [ -f /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/.noaiobackup ]; then\n        BORG_EXCLUDE+=(--exclude \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/\")\n        BORG_INCLUDE+=(--pattern=\"+/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/.noaiobackup\")\n        echo \"⚠️⚠️⚠️ '.noaiobackup' file was found in the preview directory. Excluding the preview directory from backup!\"\n    fi\n\n    # Make sure that there is always a borg.config file before creating a new backup\n    if ! [ -f \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config\" ]; then\n        echo \"Did not find borg.config file in the mastercontainer volume.\"\n        echo \"Cannot create a backup as this is wrong.\"\n        exit 1\n    fi\n\n    # Create the backup\n    echo \"Starting the backup...\"\n    get_start_time\n    if ! borg create \"${BORG_OPTS[@]}\" \"${BORG_INCLUDE[@]}\" \"${BORG_EXCLUDE[@]}\" \"::$CURRENT_DATE-nextcloud-aio\" \"/nextcloud_aio_volumes/\" --exclude-from /borg_excludes; then\n        echo \"Deleting the failed backup archive...\"\n        borg delete --stats \"::$CURRENT_DATE-nextcloud-aio\"\n        echo \"Backup failed!\"\n        echo \"You might want to check the backup integrity via the AIO interface.\"\n        if [ \"$NEW_REPOSITORY\" = 1 ]; then\n            echo \"Deleting borg.config file so that you can choose a different location for the backup.\"\n            rm \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config\"\n        fi\n        exit 1\n    fi\n\n    # Remove the update skip file because the backup was successful\n    rm -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update\"\n\n    # Prune options\n    read -ra BORG_PRUNE_OPTS <<< \"$BORG_RETENTION_POLICY\"\n    echo \"BORG_PRUNE_OPTS are ${BORG_PRUNE_OPTS[*]}\"\n\n    # Prune archives\n    echo \"Pruning the archives...\"\n    if ! borg prune --stats --glob-archives '*_*-nextcloud-aio' \"${BORG_PRUNE_OPTS[@]}\"; then\n        echo \"Failed to prune archives!\"\n        exit 1\n    fi\n\n    # Compact archives\n    echo \"Compacting the archives...\"\n    if ! borg compact; then\n        echo \"Failed to compact archives!\"\n        exit 1\n    fi\n\n    # Back up additional directories of the host\n    if [ \"$ADDITIONAL_DIRECTORIES_BACKUP\" = 'yes' ]; then\n        if [ -d \"/docker_volumes/\" ]; then\n            DOCKER_VOLUME_DIRS=\"$(find /docker_volumes -mindepth 1 -maxdepth 1 -type d)\"\n            mapfile -t DOCKER_VOLUME_DIRS <<< \"$DOCKER_VOLUME_DIRS\"\n            for directory in \"${DOCKER_VOLUME_DIRS[@]}\"; do\n                if [ -z \"$(ls -A \"$directory\")\" ]; then\n                    echo \"$directory is empty which is not allowed.\"\n                    exit 1\n                fi\n            done\n            echo \"Starting the backup for additional volumes...\"\n            if ! borg create \"${BORG_OPTS[@]}\" \"::$CURRENT_DATE-additional-docker-volumes\" \"/docker_volumes/\"; then\n                echo \"Deleting the failed backup archive...\"\n                borg delete --stats \"::$CURRENT_DATE-additional-docker-volumes\"\n                echo \"Backup of additional docker-volumes failed!\"\n                exit 1\n            fi\n            echo \"Pruning additional volumes...\"\n            if ! borg prune --stats --glob-archives '*_*-additional-docker-volumes' \"${BORG_PRUNE_OPTS[@]}\"; then\n                echo \"Failed to prune additional docker-volumes archives!\"\n                exit 1\n            fi\n            echo \"Compacting additional volumes...\"\n            if ! borg compact; then\n                echo \"Failed to compact additional docker-volume archives!\"\n                exit 1\n            fi\n        fi\n        if [ -d \"/host_mounts/\" ]; then\n            EXCLUDED_DIRECTORIES=(home/*/.cache root/.cache var/cache lost+found run var/run dev tmp sys proc)\n            # Exclude borg backup cache\n            EXCLUDED_DIRECTORIES+=(var/lib/docker/volumes/nextcloud_aio_backup_cache/_data)\n            # Exclude target directory\n            if [ -n \"$BORGBACKUP_HOST_LOCATION\" ] && [ \"$BORGBACKUP_HOST_LOCATION\" != \"nextcloud_aio_backupdir\" ]; then\n                EXCLUDED_DIRECTORIES+=(\"$BORGBACKUP_HOST_LOCATION\")\n            fi\n            for directory in \"${EXCLUDED_DIRECTORIES[@]}\"\n            do\n                EXCLUDE_DIRS+=(--exclude \"/host_mounts/$directory/\")\n            done\n            echo \"Starting the backup for additional host mounts...\"\n            if ! borg create \"${BORG_OPTS[@]}\" \"${EXCLUDE_DIRS[@]}\" \"::$CURRENT_DATE-additional-host-mounts\" \"/host_mounts/\"; then\n                echo \"Deleting the failed backup archive...\"\n                borg delete --stats \"::$CURRENT_DATE-additional-host-mounts\"\n                echo \"Backup of additional host-mounts failed!\"\n                exit 1\n            fi\n            echo \"Pruning additional host mounts...\"\n            if ! borg prune --stats --glob-archives '*_*-additional-host-mounts' \"${BORG_PRUNE_OPTS[@]}\"; then\n                echo \"Failed to prune additional host-mount archives!\"\n                exit 1\n            fi\n            echo \"Compacting additional host mounts...\"\n            if ! borg compact; then\n                echo \"Failed to compact additional host-mount archives!\"\n                exit 1\n            fi\n        fi\n    fi\n\n    # Inform user\n    get_expiration_time\n    echo \"Backup finished successfully on $END_DATE_READABLE ($DURATION_READABLE).\"\n    if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/update.failed\" ]; then\n        echo \"However a Nextcloud update failed. So reporting that the backup failed which will skip any update attempt the next time.\"\n        echo \"Please restore a backup from before the failed Nextcloud update attempt.\"\n        exit 1\n    fi\n    exit 0\nfi\n\n# Do the restore\nif [ \"$BORG_MODE\" = restore ]; then\n    get_start_time\n\n    # Pick archive to restore\n    if [ -n \"$SELECTED_RESTORE_TIME\" ]; then\n        SELECTED_ARCHIVE=\"$(borg list | grep \"nextcloud-aio\" | grep \"$SELECTED_RESTORE_TIME\" | awk -F \" \" '{print $1}' | head -1)\"\n    else\n        SELECTED_ARCHIVE=\"$(borg list | grep \"nextcloud-aio\" | awk -F \" \" '{print $1}' | sort -r | head -1)\"\n    fi\n    echo \"Restoring '$SELECTED_ARCHIVE'...\"\n\n    ADDITIONAL_RSYNC_EXCLUDES=()\n    ADDITIONAL_BORG_EXCLUDES=()\n    ADDITIONAL_FIND_EXCLUDES=()\n    # Exclude datadir if .noaiobackup file was found\n    # shellcheck disable=SC2144\n    if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/.noaiobackup\" ]; then\n        # Keep these 3 in sync. Beware, the pattern syntax and the paths differ\n        ADDITIONAL_RSYNC_EXCLUDES=(--exclude \"nextcloud_aio_nextcloud_data/**\")\n        ADDITIONAL_BORG_EXCLUDES=(--exclude \"sh:nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/**\")\n        ADDITIONAL_FIND_EXCLUDES=(-o -regex 'nextcloud_aio_volumes/nextcloud_aio_nextcloud_data\\(/.*\\)?')\n        echo \"⚠️⚠️⚠️ '.noaiobackup' file was found in Nextcloud's data directory. Excluding the data directory from restore!\"\n        echo \"You might run into problems due to this afterwards as potentially this makes the directory go out of sync with the database.\"\n        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.\"\n        echo \"See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands\"\n    # Exclude previews from restore if selected to speed up process or exclude preview folder if .noaiobackup file was found\n    elif [ -n \"$RESTORE_EXCLUDE_PREVIEWS\" ] || [ -f /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/.noaiobackup ]; then\n        # Keep these 3 in sync. Beware, the pattern syntax and the paths differ\n        ADDITIONAL_RSYNC_EXCLUDES=(--exclude \"nextcloud_aio_nextcloud_data/appdata_*/preview/**\")\n        ADDITIONAL_BORG_EXCLUDES=(--exclude \"sh:nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_*/preview/**\")\n        ADDITIONAL_FIND_EXCLUDES=(-o -regex 'nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/appdata_[^/]*/preview\\(/.*\\)?')\n        echo \"⚠️⚠️⚠️ Excluding previews from restore!\"\n        echo \"You might run into problems due to this afterwards as potentially this makes the directory go out of sync with the database.\"\n        echo \"You might be able to fix this by running 'occ files:scan-app-data preview' after the restore.\"\n        echo \"See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands\"\n    fi\n\n    # Save Additional Backup dirs\n    if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories\" ]; then\n        ADDITIONAL_BACKUP_DIRECTORIES=\"$(cat /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories)\"\n    fi\n\n    # Save daily backup time\n    if [ -f \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time\" ]; then\n        DAILY_BACKUPTIME=\"$(cat /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time)\"\n    fi\n\n    # Save current aio password\n    AIO_PASSWORD=\"$(jq '.password' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n\n    # Save current backup location vars\n    BORG_LOCATION=\"$(jq '.borg_backup_host_location' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    REMOTE_REPO=\"$(jq '.borg_remote_repo' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n\n    # Save current nextcloud datadir\n    if grep -q '\"nextcloud_datadir\":' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json; then\n        NEXTCLOUD_DATADIR=\"$(jq '.nextcloud_datadir' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    else\n        NEXTCLOUD_DATADIR='\"\"'\n    fi\n\n    if [ -z \"$BORG_REMOTE_REPO\" ]; then\n        mkdir -p /tmp/borg\n        if ! borg mount \"::$SELECTED_ARCHIVE\" /tmp/borg; then\n            echo \"Could not mount the backup!\"\n            exit 1\n        fi\n\n        # Restore everything except the configuration file\n        #\n        # These exclude patterns need to be kept in sync with the borg_excludes file and the find excludes in this file,\n        # which use a different syntax (patterns appear in 3 places in total)\n        if ! rsync --stats --archive --human-readable -vv --delete \\\n        --exclude \"nextcloud_aio_apache/caddy/**\" \\\n        --exclude \"nextcloud_aio_mastercontainer/caddy/**\" \\\n        --exclude \"nextcloud_aio_nextcloud/data/nextcloud.log*\" \\\n        --exclude \"nextcloud_aio_nextcloud/data/audit.log\" \\\n        --exclude \"nextcloud_aio_mastercontainer/certs/**\" \\\n        --exclude \"nextcloud_aio_mastercontainer/data/configuration.json\" \\\n        --exclude \"nextcloud_aio_mastercontainer/data/daily_backup_running\" \\\n        --exclude \"nextcloud_aio_mastercontainer/data/session_date_file\" \\\n        --exclude \"nextcloud_aio_mastercontainer/session/**\" \\\n        --exclude \"nextcloud_aio_nextcloud_data/lost+found\" \\\n        \"${ADDITIONAL_RSYNC_EXCLUDES[@]}\" \\\n        /tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes/; then\n            RESTORE_FAILED=1\n            echo \"Something failed while restoring from backup.\"\n        fi\n\n        # Restore the configuration file\n        if ! rsync --archive --human-readable -vv \\\n                /tmp/borg/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json \\\n                /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json; then\n            RESTORE_FAILED=1\n            echo \"Something failed while restoring the configuration.json.\"\n        fi\n\n        if ! umount /tmp/borg; then\n            echo \"Failed to unmount the borg archive but should still be able to restore successfully\"\n        fi\n    else\n        # Restore nearly everything\n        #\n        # borg mount is really slow for remote repos (did not check whether it's slow for local repos too),\n        # using extract to /tmp would require temporarily storing a second copy of the data.\n        # So instead extract directly on top of the destination with exclude patterns for the config, but\n        # then we do still need to delete local files which are not present in the archive.\n        #\n        # Older backups may still contain files we've since excluded, so we have to exclude on extract as well.\n        cd /  # borg extract has no destination arg and extracts to CWD\n        if ! borg extract \"::$SELECTED_ARCHIVE\" --progress --exclude-from /borg_excludes \"${ADDITIONAL_BORG_EXCLUDES[@]}\" --pattern '+nextcloud_aio_volumes/**'\n        then\n            RESTORE_FAILED=1\n            echo \"Failed to extract backup archive.\"\n        else\n            # Delete files/dirs present locally, but not in the backup archive, excluding conf files\n            # https://unix.stackexchange.com/a/759341\n            # This comm does not support -z, but I doubt any file names would have \\n in them\n            #\n            # These find patterns need to be kept in sync with the borg_excludes file and the rsync excludes in this\n            # file, which use a different syntax (patterns appear in 3 places in total)\n            echo \"Deleting local files which do not exist in the backup\"\n            if ! find nextcloud_aio_volumes \\\n                    -not \\( \\\n                        -path nextcloud_aio_volumes/nextcloud_aio_apache/caddy \\\n                        -o -path \"nextcloud_aio_volumes/nextcloud_aio_apache/caddy/*\" \\\n                        -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy \\\n                        -o -path \"nextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy/*\" \\\n                        -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/certs \\\n                        -o -path \"nextcloud_aio_volumes/nextcloud_aio_mastercontainer/certs/*\" \\\n                        -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/session \\\n                        -o -path \"nextcloud_aio_volumes/nextcloud_aio_mastercontainer/session/*\" \\\n                        -o -path \"nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log*\" \\\n                        -o -path nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log \\\n                        -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_running \\\n                        -o -path nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/session_date_file \\\n                        -o -path \"nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/id_borg*\" \\\n                        -o -path \"nextcloud_aio_nextcloud_data/lost+found\" \\\n                        \"${ADDITIONAL_FIND_EXCLUDES[@]}\" \\\n                    \\) \\\n                    | LC_ALL=C sort \\\n                    | LC_ALL=C comm -23 - \\\n                        <(borg list \"::$SELECTED_ARCHIVE\" --short --exclude-from /borg_excludes  --pattern '+nextcloud_aio_volumes/**' | LC_ALL=C sort) \\\n                    > /tmp/local_files_not_in_backup\n            then\n                RESTORE_FAILED=1\n                echo \"Failed to delete local files not in backup archive.\"\n            else\n                # More robust than e.g. xargs as I got a ~\"args line too long\" error while testing that, but it's slower\n                # https://stackoverflow.com/a/21848934\n                while IFS= read -r file\n                do rm -vrf -- \"$file\" || DELETE_FAILED=1\n                done < /tmp/local_files_not_in_backup\n\n                if [ \"$DELETE_FAILED\" = 1 ]; then\n                    RESTORE_FAILED=1\n                    echo \"Failed to delete (some) local files not in backup archive.\"\n                fi\n            fi\n        fi\n    fi\n\n    # Set backup-mode to restore since it was a restore\n    CONTENTS=\"$(jq '.\"backup-mode\" = \"restore\"' /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    echo -E \"${CONTENTS}\" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\n\n    # Reset the backup location vars to the currently used one\n    CONTENTS=\"$(jq \".borg_backup_host_location = $BORG_LOCATION\" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    echo -E \"${CONTENTS}\" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\n    CONTENTS=\"$(jq \".borg_remote_repo = $REMOTE_REPO\" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    echo -E \"${CONTENTS}\" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\n\n    # Reset the AIO password to the currently used one\n    CONTENTS=\"$(jq \".password = $AIO_PASSWORD\" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    echo -E \"${CONTENTS}\" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\n\n    # Reset the datadir to the one that was used for the restore\n    CONTENTS=\"$(jq \".nextcloud_datadir = $NEXTCLOUD_DATADIR\" /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json)\"\n    echo -E \"${CONTENTS}\" > /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\n\n    # Reset the additional backup directories\n    if [ -n \"$ADDITIONAL_BACKUP_DIRECTORIES\" ]; then\n        echo \"$ADDITIONAL_BACKUP_DIRECTORIES\" > \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories\"\n        chown 33:0 \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories\"\n        chmod 770 \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories\"\n    fi\n\n    # Reset the additional backup directories\n    if [ -n \"$DAILY_BACKUPTIME\" ]; then\n        echo \"$DAILY_BACKUPTIME\" > \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time\"\n        chown 33:0 \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time\"\n        chmod 770 \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time\"\n    fi\n\n    if [ \"$RESTORE_FAILED\" = 1 ]; then\n        exit 1\n    elif ! grep -q '\"domain\"' \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\" \\\n    || ! grep -q '\"wasStartButtonClicked\"' \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/configuration.json\"; then\n        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)!\"\n        exit 1\n    fi\n\n    # Inform user\n    get_expiration_time\n    echo \"Restore finished successfully on $END_DATE_READABLE ($DURATION_READABLE).\"\n\n    # Add file to Nextcloud container so that it skips any update the next time\n    touch \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update\"\n    chmod 777 \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update\"\n\n    # Add file to Nextcloud container so that it performs a fingerprint update the next time\n    touch \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/fingerprint.update\"\n    chmod 777 \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/fingerprint.update\"\n\n    # Add file to Netcloud container to trigger a preview scan the next time it starts\n    if [ -n \"$RESTORE_EXCLUDE_PREVIEWS\" ]; then\n        touch \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/trigger-preview.scan\"\n        chmod 777 \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/trigger-preview.scan\"\n    fi\n\n    # Delete redis cache\n    rm -f \"/mnt/redis/dump.rdb\"\nfi\n\n# Do the Backup check\nif [ \"$BORG_MODE\" = check ]; then\n    get_start_time\n    echo \"Checking the backup integrity...\"\n\n    # Perform the check\n    if ! borg check -v --verify-data; then\n        echo \"Some errors were found while checking the backup integrity!\"\n        echo \"Check the AIO interface for advice on how to proceed now!\"\n        exit 1\n    fi\n\n    # Inform user\n    get_expiration_time\n    echo \"Check finished successfully on $END_DATE_READABLE ($DURATION_READABLE).\"\n    exit 0\nfi\n\n# Do the Backup check-repair\nif [ \"$BORG_MODE\" = \"check-repair\" ]; then\n    get_start_time\n    echo \"Checking the backup integrity and repairing it...\"\n\n    # Perform the check-repair\n    if ! echo YES | borg check -v --repair; then\n        echo \"Some errors were found while checking and repairing the backup integrity!\"\n        exit 1\n    fi\n\n    # Inform user\n    get_expiration_time\n    echo \"Check finished successfully on $END_DATE_READABLE ($DURATION_READABLE).\"\n    exit 0\nfi\n\n# Do the backup test\nif [ \"$BORG_MODE\" = test ]; then\n    if [ -n \"$BORG_REMOTE_REPO\" ]; then\n        if ! borg info > /dev/null; then\n            echo \"Borg could not get info from the remote repo.\"\n            echo \"See the above borg info output for details.\"\n            exit 1\n        fi\n    else\n        if ! [ -d \"$BORG_BACKUP_DIRECTORY\" ]; then\n            echo \"No 'borg' directory in the given backup directory found!\"\n            echo \"Only the files/folders below have been found in the given directory.\"\n            ls -a \"$MOUNT_DIR\"\n            echo \"Please adjust the directory so that the borg archive is positioned in a folder named 'borg' inside the given directory!\"\n            exit 1\n        elif ! [ -f \"$BORG_BACKUP_DIRECTORY/config\" ]; then\n            echo \"A 'borg' directory was found but could not find the borg archive.\"\n            echo \"Only the files/folders below have been found in the borg directory.\"\n            ls -a \"$BORG_BACKUP_DIRECTORY\"\n            echo \"The archive and most importantly the config file must be positioned directly in the 'borg' subfolder.\"\n            exit 1\n        fi\n    fi\n\n    if ! borg list >/dev/null; then\n        echo \"The entered path seems to be valid but could not open the backup archive.\"\n        echo \"Most likely the entered password was wrong so please adjust it accordingly!\"\n        exit 1\n    else\n        if ! borg list | grep \"nextcloud-aio\"; then\n            echo \"The backup archive does not contain a valid Nextcloud AIO backup.\"\n            echo \"Most likely was the archive not created via Nextcloud AIO.\"\n            exit 1\n        else\n            echo \"Everything looks fine so feel free to continue!\"\n            exit 0\n        fi\n    fi\nfi\n\nif [ \"$BORG_MODE\" = list ]; then\n    echo \"Updating backup list...\"\n    if ! borg info > /dev/null; then\n        echo \"Could not update the backup list.\"\n        exit 1\n    fi\n    # The update gets done automatically in the wrapper start.sh script.\nfi\n"
  },
  {
    "path": "Containers/borgbackup/borg_excludes",
    "content": "# These patterns need to be kept in sync with rsync and find excludes in backupscript.sh,\n# which use a different syntax (patterns appear in 3 places in total)\nnextcloud_aio_volumes/nextcloud_aio_apache/caddy/\nnextcloud_aio_volumes/nextcloud_aio_mastercontainer/caddy/\nnextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log*\nnextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log\nnextcloud_aio_volumes/nextcloud_aio_mastercontainer/certs/\nnextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_running\nnextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/session_date_file\nnextcloud_aio_volumes/nextcloud_aio_mastercontainer/session/\nnextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/id_borg*"
  },
  {
    "path": "Containers/borgbackup/start.sh",
    "content": "#!/bin/bash\n\n# Variables\nexport MOUNT_DIR=\"/mnt/borgbackup\"\nexport BORG_BACKUP_DIRECTORY=\"$MOUNT_DIR/borg\"  # necessary even when remote to store the aio-lockfile\n\n# Validate BORG_PASSWORD\nif [ -z \"$BORG_PASSWORD\" ] && [ -z \"$BACKUP_RESTORE_PASSWORD\" ]; then\n    echo \"Neither BORG_PASSWORD nor BACKUP_RESTORE_PASSWORD are set.\"\n    exit 1\nfi\n\n# Export defaults\nif [ -n \"$BACKUP_RESTORE_PASSWORD\" ]; then\n    export BORG_PASSPHRASE=\"$BACKUP_RESTORE_PASSWORD\"\nelse\n    export BORG_PASSPHRASE=\"$BORG_PASSWORD\"\nfi\nexport BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes\nexport BORG_RELOCATED_REPO_ACCESS_IS_OK=yes\nif [ -n \"$BORG_REMOTE_REPO\" ]; then\n    export BORG_REPO=\"$BORG_REMOTE_REPO\"\n\n    # Location to create the borg ssh pub/priv key\n    export BORGBACKUP_KEY=\"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/id_borg\"\n\n    # Accept any host key the first time connecting to the remote. Strictly speaking should be provided by user but you'd\n    # have to be very unlucky to get MitM'ed on your first connection.\n    export BORG_RSH=\"ssh -o StrictHostKeyChecking=accept-new -i $BORGBACKUP_KEY\"\nelse\n    export BORG_REPO=\"$BORG_BACKUP_DIRECTORY\"\nfi\n\n# Validate BORG_MODE\nif [ \"$BORG_MODE\" != backup ] && [ \"$BORG_MODE\" != restore ] && [ \"$BORG_MODE\" != check ] && [ \"$BORG_MODE\" != \"check-repair\" ] && [ \"$BORG_MODE\" != \"test\" ] && [ \"$BORG_MODE\" != \"list\" ]; then\n    echo \"No correct BORG_MODE mode applied. Valid are 'backup', 'check', 'restore', 'test' and 'list'.\"\n    exit 1\nfi\n\nexport BORG_MODE\n\n# Run the backup script\nif ! bash /backupscript.sh; then\n    FAILED=1\nfi\n\n# Remove lockfile\nrm -f \"/nextcloud_aio_volumes/nextcloud_aio_database_dump/backup-is-running\"\n\n# Get a list of all available borg archives\nif borg list &>/dev/null; then\n    borg list | grep \"nextcloud-aio\" | awk -F \" \" '{print $1\",\"$3,$4}' > \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list\"\nelse\n    echo \"\" > \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list\"\nfi\nchmod +r \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list\"\n\nif [ -n \"$FAILED\" ]; then\n    if [ \"$BORG_MODE\" = backup ]; then\n        # Add file to Nextcloud container so that it skips any update the next time\n        touch \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update\"\n        chmod 777 \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update\"\n    fi\n    exit 1\nfi\n\nexec \"$@\""
  },
  {
    "path": "Containers/clamav/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM alpine:3.23.3\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache tzdata clamav clamav-milter supervisor bash; \\\n    mkdir -p /tmp /var/lib/clamav /run/clamav /var/log/supervisord /var/run/supervisord; \\\n    chmod 777 -R /tmp /run/clamav /var/log/clamav /var/log/supervisord /var/run/supervisord; \\\n    chown -R 100:100 /var/lib/clamav; \\\n    sed -i \"s|#\\?MaxDirectoryRecursion.*|MaxDirectoryRecursion 30|g\" /etc/clamav/clamd.conf; \\\n    sed -i \"s|#\\?MaxScanSize.*|MaxScanSize 2000M|g\" /etc/clamav/clamd.conf; \\\n    sed -i \"s|#\\?MaxFileSize.*|MaxFileSize 2000M|g\" /etc/clamav/clamd.conf; \\\n    sed -i \"s|#\\?PCREMaxFileSize.*|PCREMaxFileSize 2000M|g\" /etc/clamav/clamd.conf; \\\n# StreamMaxLength must be synced with av_stream_max_length inside the Nextcloud files_antivirus plugin\n    sed -i \"s|#\\?StreamMaxLength.*|StreamMaxLength 2000M|g\" /etc/clamav/clamd.conf; \\\n    sed -i \"s|#\\?TCPSocket|TCPSocket|g\" /etc/clamav/clamd.conf; \\\n    sed -i \"s|^LocalSocket .*|LocalSocket /tmp/clamd.sock|g\" /etc/clamav/clamd.conf; \\\n    sed -i \"s|Example| |g\" /etc/clamav/clamav-milter.conf; \\\n    sed -i \"s|#\\?MilterSocket inet:7357|MilterSocket inet:7357|g\" /etc/clamav/clamav-milter.conf; \\\n    sed -i \"s|#\\?ClamdSocket unix:/run/clamav/clamd.sock|ClamdSocket unix:/tmp/clamd.sock|g\" /etc/clamav/clamav-milter.conf; \\\n    sed -i \"s|#\\?OnInfected Quarantine|OnInfected Reject|g\" /etc/clamav/clamav-milter.conf; \\\n    sed -i \"s|#\\?AddHeader Replace|AddHeader Add|g\" /etc/clamav/clamav-milter.conf; \\\n    sed -i \"s|#\\?Foreground yes|Foreground yes|g\" /etc/clamav/clamav-milter.conf\n\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\nCOPY --chmod=664 supervisord.conf /supervisord.conf\n\nUSER 100\nRUN set -ex; \\\n    freshclam --foreground --stdout\nVOLUME /var/lib/clamav\nENTRYPOINT [\"/start.sh\"]\nCMD [\"/usr/bin/supervisord\", \"-c\", \"/supervisord.conf\"]\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\nHEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh\n"
  },
  {
    "path": "Containers/clamav/healthcheck.sh",
    "content": "#!/bin/bash\n\nif [ \"$(echo \"PING\" | nc 127.0.0.1 3310)\" != \"PONG\" ]; then\n\techo \"ERROR: Unable to contact server\"\n\texit 1\nfi\n\necho \"Clamd is up\"\nexit 0\n"
  },
  {
    "path": "Containers/clamav/start.sh",
    "content": "#!/bin/bash\n\n# Print out clamav version for compliance reasons\nclamscan --version\n\necho \"Clamav started\"\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/clamav/supervisord.conf",
    "content": "[supervisord]\nnodaemon=true\nnodaemon=true\nlogfile=/var/log/supervisord/supervisord.log\npidfile=/var/run/supervisord/supervisord.pid\nchildlogdir=/var/log/supervisord/\nlogfile_maxbytes=50MB                           \nlogfile_backups=10                              \nloglevel=error\n\n[program:freshclam]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=freshclam --foreground --stdout --daemon --daemon-notify=/etc/clamav/clamd.conf\n\n[program:clamd]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=clamd --foreground --config-file=/etc/clamav/clamd.conf\n\n[program:milter]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=clamav-milter --config-file=/etc/clamav/clamav-milter.conf"
  },
  {
    "path": "Containers/collabora/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# From a file located probably somewhere here: https://github.com/CollaboraOnline/online/blob/master/docker/from-packages/Dockerfile\nFROM collabora/code:25.04.9.3.1\n\nUSER root\nARG DEBIAN_FRONTEND=noninteractive\n\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nUSER 1001\n\nHEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/collabora/healthcheck.sh",
    "content": "#!/bin/bash\n\n# Unfortunately, no curl and no nc is installed in the container \n# and packages can also not be added as the package list is broken.\n# So always exiting 0 for now.\n# nc http://127.0.0.1:9980 || exit 1\nexit 0\n"
  },
  {
    "path": "Containers/collabora-online/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# From https://gitlab.collabora.com/collabora-online/docker\n# hadolint ignore=DL3007\nFROM registry.gitlab.collabora.com/collabora-online/docker:latest\n\nUSER root\nARG DEBIAN_FRONTEND=noninteractive\n\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nUSER 1001\n\nHEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/collabora-online/healthcheck.sh",
    "content": "#!/bin/bash\n\n# Unfortunately, no curl and no nc is installed in the container \n# and packages can also not be added as the package list is broken.\n# So always exiting 0 for now.\n# nc http://127.0.0.1:9980 || exit 1\nexit 0\n"
  },
  {
    "path": "Containers/docker-socket-proxy/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM haproxy:3.3.6-alpine\n\n# hadolint ignore=DL3002\nUSER root\nENV NEXTCLOUD_HOST=nextcloud-aio-nextcloud\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        ca-certificates \\\n        tzdata \\\n        bash \\\n        bind-tools; \\\n    chmod -R 777 /tmp\n\nCOPY --chmod=775 *.sh /\nCOPY --chmod=664 haproxy.cfg /haproxy.cfg\n\nENTRYPOINT [\"/start.sh\"]\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/docker-socket-proxy/haproxy.cfg",
    "content": "# Inspiration: https://github.com/Tecnativa/docker-socket-proxy/blob/master/haproxy.cfg\n\nglobal\n    maxconn 10\n\ndefaults\n    timeout connect 30s\n    timeout client 30s\n    timeout server 1800s\n\nfrontend http\n    mode http\n    bind :::2375 v4v6\n    http-request deny unless { src 127.0.0.1 } || { src ::1 } || { src NC_IPV4_PLACEHOLDER } || { src NC_IPV6_PLACEHOLDER }\n    # docker system _ping\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/_ping$ } METH_GET\n    # docker inspect image: GET images/%s/json\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/images/.*/json } METH_GET\n    # container inspect: GET containers/%s/json\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/json } METH_GET\n    # container inspect: GET containers/%s/logs\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/logs } METH_GET\n    # container start/stop: POST containers/%s/start containers/%s/stop\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/((start)|(stop)) } METH_POST\n    # container rm: DELETE containers/%s\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+ } METH_DELETE\n    # container update/exec: POST containers/%s/update containers/%s/exec\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/((update)|(exec)) } METH_POST\n    # container put: PUT containers/%s/archive\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/containers/nc_app_[a-zA-Z0-9_.-]+/archive } METH_PUT\n    # run exec instance: POST exec/%s\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/exec/[a-zA-Z0-9_.-]+/start } METH_POST\n\n    # container create: POST containers/create?name=%s\n    # ACL to restrict container name to nc_app_[a-zA-Z0-9_.-]+\n    acl nc_app_container_name url_param(name) -m reg -i \"^nc_app_[a-zA-Z0-9_.-]+\"\n\n    # ACL to restrict the number of Mounts to 1\n    acl one_mount_volume req.body -m reg -i \"\\\"Mounts\\\"\\s*:\\s*\\[\\s*(?:(?!\\\"Mounts\\\"\\s*:\\s*\\[)[^}]*)}[^}]*\\]\"\n    # ACL to deny if there are any binds\n    acl binds_present req.body -m reg -i \"\\\"HostConfig\\\"\\s*:.*\\\"Binds\\\"\\s*:\"\n    # ACL to restrict the type of Mounts to volume\n    acl type_not_volume req.body -m reg -i \"\\\"Mounts\\\"\\s*:\\s*\\[[^\\]]*(\\\"Type\\\"\\s*:\\s*\\\"(?!volume\\b)\\w+\\\"[^\\]]*)+\\]\"\n    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\n\n    # ACL to restrict container creation, that it has HostConfig.Privileged(by searching for \"Privileged\" word in all payload)\n    acl no_privileged_flag req.body -m reg -i \"\\\"Privileged\\\"\"\n    # ACL to allow mount volume with strict pattern for name: nc_app_[a-zA-Z0-9_.-]+_data\n    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\\\"\"\n    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\n    # end of container create\n\n    # volume create: POST volumes/create\n    # restrict name\n    acl nc_app_volume_data req.body -m reg -i \"\\\"Name\\\"\\s*:\\s*\\\"nc_app_[a-zA-Z0-9_.-]+_data\\\"\"\n    # do not allow to use \"device\" word e.g., \"--opt device=:/path/to/dir\"\n    acl volume_no_device req.body -m reg -i \"\\\"device\\\"\"\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/volumes/create } nc_app_volume_data !volume_no_device METH_POST\n    # volume rm: DELETE volumes/%s\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/volumes/nc_app_[a-zA-Z0-9_.-]+_data } METH_DELETE\n    # image pull: POST images/create?fromImage=%s\n    http-request allow if { path,url_dec -m reg -i ^(/v[\\d\\.]+)?/images/create } METH_POST\n    http-request deny\n    default_backend dockerbackend\n\nbackend dockerbackend\n    mode http\n    server dockersocket /var/run/docker.sock\n"
  },
  {
    "path": "Containers/docker-socket-proxy/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z \"$NEXTCLOUD_HOST\" 9001 || exit 0\nnc -z 127.0.0.1 2375 || exit 1\n"
  },
  {
    "path": "Containers/docker-socket-proxy/start.sh",
    "content": "#!/bin/sh\n\n# Only start container if nextcloud is accessible\nwhile ! nc -z \"$NEXTCLOUD_HOST\" 9001; do\n    echo \"Waiting for Nextcloud to start...\"\n    sleep 5\ndone\n\nset -x\nIPv4_ADDRESS_NC=\"$(dig nextcloud-aio-nextcloud IN A +short +search | grep '^[0-9.]\\+$' | sort | head -n1)\"\nHAPROXYFILE=\"$(sed \"s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|\" /haproxy.cfg)\" \necho \"$HAPROXYFILE\" > /tmp/haproxy.cfg\n\nIPv6_ADDRESS_NC=\"$(dig nextcloud-aio-nextcloud AAAA +short +search | grep '^[0-9a-f:]\\+$' | sort | head -n1)\"\nif [ -n \"$IPv6_ADDRESS_NC\" ]; then\n    HAPROXYFILE=\"$(sed \"s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|\" /tmp/haproxy.cfg)\"\nelse\n    HAPROXYFILE=\"$(sed \"s# || { src NC_IPV6_PLACEHOLDER }##g\" /tmp/haproxy.cfg)\"\nfi\necho \"$HAPROXYFILE\" > /tmp/haproxy.cfg\nset +x\n\nhaproxy -f /tmp/haproxy.cfg -db\n"
  },
  {
    "path": "Containers/domaincheck/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM alpine:3.23.3\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache bash lighttpd netcat-openbsd; \\\n    adduser -S www-data -G www-data; \\\n    rm -rf /etc/lighttpd/lighttpd.conf; \\\n    chmod 777 -R /etc/lighttpd; \\\n    mkdir -p /var/www/domaincheck; \\\n    chown www-data:www-data -R /var/www; \\\n    chmod 777 -R /var/www/domaincheck\nCOPY --chown=www-data:www-data lighttpd.conf /lighttpd.conf\n\nCOPY --chmod=775 start.sh /start.sh\n\nUSER www-data\nENTRYPOINT [\"/start.sh\"]\n\nHEALTHCHECK CMD nc -z 127.0.0.1 $APACHE_PORT || exit 1\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/domaincheck/lighttpd.conf",
    "content": "server.document-root = \"/var/www/domaincheck/\" \n\nserver.port = env.APACHE_PORT\n\nserver.username = \"www-data\" \nserver.groupname = \"www-data\" \n\nmimetype.assign = (\n  \".html\" => \"text/html\", \n  \".txt\" => \"text/plain\",\n  \".jpg\" => \"image/jpeg\",\n  \".png\" => \"image/png\" \n)\n\nstatic-file.exclude-extensions = ( \".fcgi\", \".php\", \".rb\", \"~\", \".inc\" )\nindex-file.names = ( \"index.html\" )\n\n$SERVER[\"socket\"] == \"ipv6-placeholder\" {\n\tserver.document-root = \"/var/www/domaincheck/\" \n}\n"
  },
  {
    "path": "Containers/domaincheck/start.sh",
    "content": "#!/bin/bash\n\nif [ -z \"$INSTANCE_ID\" ]; then\n    echo \"You need to provide an instance id.\"\n    exit 1\nfi\n\necho \"$INSTANCE_ID\" > /var/www/domaincheck/index.html\n\nif [ -z \"$APACHE_PORT\" ]; then\n    export APACHE_PORT=\"443\"\nfi\n\nCONF_FILE=\"$(sed \"s|ipv6-placeholder|\\[::\\]:$APACHE_PORT|\" /lighttpd.conf)\"\necho \"$CONF_FILE\" > /etc/lighttpd/lighttpd.conf\n\n# Check config file\nlighttpd -tt -f /etc/lighttpd/lighttpd.conf\n\n# Run server\nlighttpd -D -f /etc/lighttpd/lighttpd.conf\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/fulltextsearch/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\r\n# Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile\r\nFROM elasticsearch:8.19.13\r\n\r\nUSER root\r\n\r\nARG DEBIAN_FRONTEND=noninteractive\r\n\r\n# hadolint ignore=DL3008\r\nRUN set -ex; \\\r\n    \\\r\n    apt-get update; \\\r\n    apt-get upgrade -y; \\\r\n    apt-get install -y --no-install-recommends \\\r\n        tzdata \\\r\n    ; \\\r\n    rm -rf /var/lib/apt/lists/*;\r\n\r\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\r\n\r\nUSER 1000:0\r\n\r\nHEALTHCHECK --interval=10s --timeout=5s --start-period=1m --retries=5 CMD /healthcheck.sh\r\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\r\n    wud.watch=\"false\" \\\r\n    org.label-schema.vendor=\"Nextcloud\"\r\nENV ES_JAVA_OPTS=\"-Xms512M -Xmx512M\"\r\n"
  },
  {
    "path": "Containers/fulltextsearch/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z 127.0.0.1 9200 || exit 1\n"
  },
  {
    "path": "Containers/imaginary/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\r\nFROM golang:1.26.1-alpine3.23 AS go\r\n\r\nENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee\n\r\nRUN set -ex; \\\r\n    apk upgrade --no-cache -a; \\\r\n    apk add --no-cache \\\r\n        vips-dev \\\r\n        vips-magick \\\r\n        vips-heif \\\r\n        vips-jxl \\\r\n        vips-poppler \\\r\n        build-base; \\\r\n    go install github.com/h2non/imaginary@\"$IMAGINARY_HASH\";\r\n\r\nFROM alpine:3.23.3\r\nRUN set -ex; \\\r\n    apk upgrade --no-cache -a; \\\r\n    apk add --no-cache \\\r\n        tzdata \\\r\n        ca-certificates \\\r\n        netcat-openbsd \\\r\n        vips \\\r\n        vips-magick \\\r\n        vips-heif \\\r\n        vips-jxl \\\r\n        vips-poppler \\\r\n        ttf-dejavu \\\r\n        bash\r\n\r\nCOPY --from=go /go/bin/imaginary /usr/local/bin/imaginary\r\nCOPY --chmod=775 start.sh /start.sh\r\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\r\n\r\nENV PORT=9000\r\n\r\nUSER 65534\r\n\r\n# https://github.com/h2non/imaginary#memory-issues\r\nENV MALLOC_ARENA_MAX=2\r\nENTRYPOINT [\"/start.sh\"]\r\n\r\nHEALTHCHECK CMD /healthcheck.sh\r\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\r\n    wud.watch=\"false\" \\\r\n    org.label-schema.vendor=\"Nextcloud\"\r\n"
  },
  {
    "path": "Containers/imaginary/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z 127.0.0.1 \"$PORT\" || exit 1\n"
  },
  {
    "path": "Containers/imaginary/start.sh",
    "content": "#!/bin/bash\n\necho \"Imaginary has started\"\nif [ -z \"$IMAGINARY_SECRET\" ]; then\n    imaginary -return-size -max-allowed-resolution 222.2 \"$@\"\nelse\n    imaginary -return-size -max-allowed-resolution 222.2 -key \"$IMAGINARY_SECRET\" \"$@\"\nfi\n"
  },
  {
    "path": "Containers/mastercontainer/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# Docker CLI is a requirement\nFROM docker:29.3.0-cli AS docker\n\nARG CADDY_REMOTE_HOST_HASH=b21775afa730ffb52a24ddff310c8a6d1fd37276\n\n# Caddy is a requirement\nFROM caddy:2.11.2-builder-alpine AS caddy\nRUN set -ex; \\\n    xcaddy build --with github.com/muety/caddy-remote-host@\"$CADDY_REMOTE_HOST_HASH\"; \\\n    /usr/bin/caddy list-modules\n\n# From https://github.com/docker-library/php/blob/master/8.5/alpine3.23/fpm/Dockerfile\nFROM php:8.5.4-fpm-alpine3.23\n\nEXPOSE 80\nEXPOSE 8080\nEXPOSE 8443\n\n# Overwrite home variable for subservices\nENV HOME=/var/www\n\nCOPY --from=caddy /usr/bin/caddy /usr/bin/caddy\nCOPY --from=docker /usr/local/bin/docker /usr/local/bin/docker\n\nCOPY community-containers /var/www/docker-aio/community-containers\nCOPY php /var/www/docker-aio/php\nCOPY --chmod=775 Containers/mastercontainer/*.sh /\nCOPY --chmod=664 Containers/mastercontainer/*.Caddyfile /\nCOPY --chmod=664 Containers/mastercontainer/supervisord.conf /supervisord.conf\n\nWORKDIR /var/www/docker-aio\n\n# hadolint ignore=SC2086,DL3047,DL3003,DL3004\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache shadow; \\\n    groupmod -g 33 www-data; \\\n    usermod -u 33 -g 33 www-data; \\\n    \\\n    apk add --no-cache \\\n        util-linux-misc \\\n        ca-certificates \\\n        bash \\\n        supervisor \\\n        sudo \\\n        netcat-openbsd \\\n        curl \\\n        grep; \\\n    \\\n    apk add --no-cache --virtual .build-deps \\\n        autoconf \\\n        build-base; \\\n    pecl install APCu-5.1.28; \\\n    docker-php-ext-enable apcu; \\\n    rm -r /tmp/pear; \\\n    runDeps=\"$( \\\n        scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \\\n            | tr ',' '\\n' \\\n            | sort -u \\\n            | awk 'system(\"[ -e /usr/local/lib/\" $1 \" ]\") == 0 { next } { print \"so:\" $1 }' \\\n    )\"; \\\n    apk add --no-cache --virtual .nextcloud-aio-rundeps $runDeps; \\\n    apk del .build-deps; \\\n    grep -q '^pm = dynamic' /usr/local/etc/php-fpm.d/www.conf; \\\n    sed -i 's/^pm = dynamic/pm = ondemand/' /usr/local/etc/php-fpm.d/www.conf; \\\n    sed -i 's/^pm.max_children =.*/pm.max_children = 80/' /usr/local/etc/php-fpm.d/www.conf; \\\n    sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf; \\\n    grep -q '^listen =' /usr/local/etc/php-fpm.d/docker.conf; \\\n    sed -i 's|listen =.*|listen = /run/php.sock|' /usr/local/etc/php-fpm.d/docker.conf; \\\n    echo \"listen.owner = www-data\" | tee -a /usr/local/etc/php-fpm.d/docker.conf; \\\n    \\\n    apk add --no-cache git; \\\n    curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer; \\\n    chmod +x /usr/local/bin/composer; \\\n    cd /var/www/docker-aio; \\\n    rm -r ./php/tests; \\\n    chown www-data:www-data -R /var/www/docker-aio; \\\n    cd php; \\\n    sudo -E -u www-data composer install --no-dev; \\\n    sudo -E -u www-data composer clear-cache; \\\n    cd ..; \\\n    rm -f /usr/local/bin/composer; \\\n    chmod -R 770 /var/www/docker-aio; \\\n    chown -R www-data:www-data /var/www; \\\n    rm -r php/data; \\\n    rm -r php/session; \\\n    \\\n    mkdir /var/log/supervisord; \\\n    mkdir /var/run/supervisord;\n\n# hadolint ignore=DL3048\nLABEL org.label-schema.vendor=\"Nextcloud\" \\\n    wud.watch=\"false\" \\\n    com.docker.compose.project=\"nextcloud-aio\"\n\n# hadolint ignore=DL3002\nUSER root\n\nENTRYPOINT [\"/start.sh\"]\n\nHEALTHCHECK CMD /healthcheck.sh\n"
  },
  {
    "path": "Containers/mastercontainer/README.md",
    "content": "# Nextcloud All-in-One `mastercontainer`\n\nThis folder contains the OCI/Docker container definition, along with associated resources and\nconfiguration files, for building the `mastercontainer` as part of the Nextcloud All-in-One\nproject. This container hosts [the Nextcloud AIO interface](\nhttps://github.com/nextcloud/all-in-one/tree/main/php)[^app], and a dedicated PHP environment\nfor it (which is completely independent of the Nextcloud Server).\n\n## Overview\n\nThe mastercontainer acts as the central orchestration service for the deployment and management\nof all other containers in the Nextcloud All-in-One stack. It hosts:\n\n- A dedicated PHP SAPI/backend (php-fpm) for AIO itself (not Nextcloud Server)\n- A Caddy server enabling self-signed HTTPS access to the AIO frontend on port 8080/tcp.\n- A Caddy server enabling trusted HTTPS access to the AIO frontend on port 8443/tcp.\n  - Caddy will automatically issue a Let's Encrypt issued certificate if port 80 and 8443\n    is open/forwarded and a domain pointer is in place; then, simply open the Nextcloud AIO interface using the\n    domain (`https://your-domain-that-points-to-this-server.tld:8443`). The Let's Encrypt certificate request will\n    use an [ACME HTTP-01](https://letsencrypt.org/docs/challenge-types/#http-01-challenge) challenge.\n- Miscellaneous support services specific to AIO (backup management, health checks, etc.)\n\n## Key Responsibilities\n\n- Orchestrates the deployment and lifecycle of all Nextcloud service containers\n- Handles initial setup and container configuration\n- Coordinates image updates\n- Monitors general system health\n\nIt triggers the initial installation and ensures the smooth operation of the Nextcloud\nAll-in-One stack.\n\n## Contents\n\n- **Dockerfile**: Instructions for building the mastercontainer image.\n- **Entrypoint script**: The `start.sh` script is used for container initialization and runtime\n  configuration before starting supervisord.\n- [**Nextcloud All-in-One Controller App**](https://github.com/nextcloud/all-in-one/tree/main/php): The\n  core AIO orchestrator that handles configuration and settings for the containers.\n- **Supervisor**: The `supervisord.conf` file defines the long-running services hosted within\n  the container (php-fpm, cron, etc.)\n\n## Usage\n\nThis container should be used as the trigger image when deploying the Nextcloud All-in-One\nstack in a Docker or other OCI-compliant container environment. For detailed deployment\ninstructions, refer to the [project documentation](\nhttps://github.com/nextcloud/all-in-one).\n\n## Related Resources\n\n- [Main Repository](https://github.com/nextcloud/all-in-one)\n- [Documentation](https://github.com/nextcloud/all-in-one#readme)\n\n## Contributing\n\nContributions are welcome! Please follow the Nextcloud project's guidelines and submit pull\nrequests or issues via the main repository.\n\n## License\n\nThis folder and its contents are licensed under the\n[GNU AGPLv3](https://www.gnu.org/licenses/agpl-3.0.html), in line with the rest of Nextcloud\nAll-in-One.\n\n[^app]: The Nextcloud All-in-One interface allows users to install, configure, and\nmanage their Nextcloud instance and related containers via a secure web interface and API.\nIt automates and simplifies complex tasks such as container orchestration, backups, updates,\nand service management for users deploying Nextcloud in Docker environments.\n"
  },
  {
    "path": "Containers/mastercontainer/acme.Caddyfile",
    "content": "{\n\tadmin off\n\n\t# auto_https will create redirects for https://{host}:8443 instead of https://{host}\n\t# https redirects are added manually in the http://:80 block\n\tauto_https disable_redirects\n\n\tstorage file_system {\n\t\troot /mnt/docker-aio-config/caddy/\n\t}\n\n\tlog {\n\t\tlevel ERROR\n\t\t# We need to exclude the remote-host plugin from logging as it would spam the logs\n\t\t# See https://github.com/nextcloud/all-in-one/pull/7006#issuecomment-4003238239 \n\t\texclude http.matchers.remote_host\n\t}\n\n\tservers {\n\t\t# Only h1 is allowed as we prevent `ERR_NETWORK_CHANGED` from happening\n\t\tprotocols h1\n\t}\n\n\ton_demand_tls {\n\t\task http://127.0.0.1:9876/\n\t}\n\n\tskip_install_trust\n}\n\nhttp://:80 {\n\tredir https://{host}{uri} permanent\n}\n\nhttps://:8443 {\n\t@denied {\n\t\tpath /api/auth/login /api/auth/getlogin\n\t\tremote_host nextcloud-aio-nextcloud\n\t}\n\tabort @denied\n\n\troot * /var/www/docker-aio/php/public\n\tphp_fastcgi unix//run/php.sock\n\tfile_server\n\n\ttls {\n\t\ton_demand\n\t\tissuer acme {\n\t\t\tdisable_tlsalpn_challenge\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Containers/mastercontainer/backup-time-file-watcher.sh",
    "content": "#!/bin/bash\n\nrestart_process() {\n    echo \"Restarting cron.sh because daily backup time was set, changed or unset.\"\n    pkill cron.sh\n}\n\nfile_present() {\n    if [ -f \"/mnt/docker-aio-config/data/daily_backup_time\" ]; then\n        if [ \"$FILE_PRESENT\" = 0 ]; then\n            restart_process\n        else\n            if [ -n \"$BACKUP_TIME\" ] && [ \"$(head -1 \"/mnt/docker-aio-config/data/daily_backup_time\")\" != \"$BACKUP_TIME\" ]; then\n                restart_process\n            fi\n        fi\n        FILE_PRESENT=1\n        BACKUP_TIME=\"$(head -1 \"/mnt/docker-aio-config/data/daily_backup_time\")\"\n    else\n        if [ \"$FILE_PRESENT\" = 1 ]; then\n            restart_process\n        fi\n        FILE_PRESENT=0\n    fi\n}\n\nwhile true; do\n    file_present\n    sleep 2\ndone\n"
  },
  {
    "path": "Containers/mastercontainer/cron.sh",
    "content": "#!/bin/bash\n\nwhile true; do\n    if [ -f \"/mnt/docker-aio-config/data/daily_backup_time\" ]; then\n        set -x\n        BACKUP_TIME=\"$(head -1 \"/mnt/docker-aio-config/data/daily_backup_time\")\"\n        export BACKUP_TIME\n        export DAILY_BACKUP=1\n        if [ \"$(sed -n '2p' \"/mnt/docker-aio-config/data/daily_backup_time\")\" != 'automaticUpdatesAreNotEnabled' ]; then\n            export AUTOMATIC_UPDATES=1\n        else\n            export AUTOMATIC_UPDATES=0\n            export START_CONTAINERS=1\n        fi\n        if [ \"$(sed -n '3p' \"/mnt/docker-aio-config/data/daily_backup_time\")\" != 'successNotificationsAreNotEnabled' ]; then\n            export SEND_SUCCESS_NOTIFICATIONS=1\n        else\n            export SEND_SUCCESS_NOTIFICATIONS=0\n        fi\n        set +x\n        if [ -f \"/mnt/docker-aio-config/data/daily_backup_running\" ]; then\n            export LOCK_FILE_PRESENT=1\n        else\n            export LOCK_FILE_PRESENT=0\n        fi\n    else\n        export BACKUP_TIME=\"04:00\"\n        export DAILY_BACKUP=0\n        export LOCK_FILE_PRESENT=0\n    fi\n\n    # Allow to continue directly if e.g. the mastercontainer was updated. Otherwise wait for the next execution\n    if [ \"$LOCK_FILE_PRESENT\" = 0 ]; then\n        while [ \"$(date +%H:%M)\" != \"$BACKUP_TIME\" ]; do \n            sleep 30\n        done\n    fi\n\n    if [ \"$DAILY_BACKUP\" = 1 ]; then\n        bash /daily-backup.sh\n    fi\n\n    # Make sure to delete the lock file always\n    rm -f \"/mnt/docker-aio-config/data/daily_backup_running\"\n\n    # Check for updates and send notification if yes on saturdays\n    if [ \"$(date +%u)\" = 6 ]; then\n        sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/UpdateNotification.php\n    fi\n\n    # Check if AIO is outdated\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/OutdatedNotification.php\n\n    # Remove sessions older than 24h\n    find \"/mnt/docker-aio-config/session/\" -mindepth 1 -mmin +1440 -delete\n\n    # Remove nextcloud-aio-domaincheck container\n    if sudo -E -u www-data docker ps --format \"{{.Names}}\" --filter \"status=exited\" | grep -q \"^nextcloud-aio-domaincheck$\"; then\n        sudo -E -u www-data docker container remove nextcloud-aio-domaincheck\n    fi\n\n    # Remove dangling images\n    sudo -E -u www-data docker image prune --filter \"label=org.label-schema.vendor=Nextcloud\" --force\n\n    # Check for available free space\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/CheckFreeDiskSpace.php\n\n    # Remove mastercontainer from default bridge network\n    if sudo -E -u www-data docker inspect nextcloud-aio-mastercontainer  --format \"{{.NetworkSettings.Networks}}\" | grep -q \"bridge\"; then\n        sudo -E -u www-data docker network disconnect bridge nextcloud-aio-mastercontainer\n    fi\n\n    # Wait 60s so that the whole loop will not be executed again\n    sleep 60\ndone\n"
  },
  {
    "path": "Containers/mastercontainer/daily-backup.sh",
    "content": "#!/bin/bash\n\necho \"Daily backup script has started\"\n\n# Check if initial configuration has been done, otherwise this script should do nothing.\nCONFIG_FILE=/mnt/docker-aio-config/data/configuration.json\nif ! [ -f \"$CONFIG_FILE\" ] || (! grep -q \"wasStartButtonClicked.*1\" \"$CONFIG_FILE\" && ! grep -q \"wasStartButtonClicked.*true\" \"$CONFIG_FILE\"); then\n    echo \"Initial configuration via AIO interface not done yet. Exiting...\"\n    exit 0\nfi\n\n# Daily backup and backup check cannot be run at the same time\nif [ \"$DAILY_BACKUP\" = 1 ] && [ \"$CHECK_BACKUP\" = 1 ]; then\n    echo \"Daily backup and backup check cannot be run at the same time. Exiting...\"\n    exit 1\nfi\n\n# Delete all active sessions and create a lock file\n# But don't kick out the user if the mastercontainer was just updated since we block the interface either way with the lock file\nif [ \"$LOCK_FILE_PRESENT\" = 0 ] || ! [ -f \"/mnt/docker-aio-config/data/daily_backup_running\" ]; then\n    find \"/mnt/docker-aio-config/session/\" -mindepth 1 -delete\nfi\nsudo -E -u www-data touch \"/mnt/docker-aio-config/data/daily_backup_running\"\n\n# Check if apache is running/stopped, watchtower is stopped and backupcontainer is stopped\nLOCAL_APACHE_PORT=\"$(docker inspect nextcloud-aio-apache --format \"{{.Config.Env}}\" | grep -o 'APACHE_PORT=[0-9]\\+' | grep -o '[0-9]\\+' | head -1)\"\nif [ -z \"$LOCAL_APACHE_PORT\" ]; then\n    echo \"APACHE_PORT is not set which is not expected...\"\nelse\n    # Connect mastercontainer to nextcloud-aio network to make sure that nextcloud-aio-apache is reachable\n    # Prevent issues like https://github.com/nextcloud/all-in-one/discussions/5222\n    docker network connect nextcloud-aio nextcloud-aio-mastercontainer &>/dev/null\n\n    # Wait for apache to start\n    while docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-apache$\" && ! nc -z nextcloud-aio-apache \"$LOCAL_APACHE_PORT\"; do\n        echo \"Waiting for apache to become available\"\n        sleep 30\n    done\nfi\nwhile docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-watchtower$\"; do\n    echo \"Waiting for watchtower to stop\"\n    sleep 30\ndone\nwhile docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-borgbackup$\"; do\n    echo \"Waiting for borgbackup to stop\"\n    sleep 30\ndone\n\n# Update the mastercontainer\nif [ \"$AUTOMATIC_UPDATES\" = 1 ]; then\n    echo \"Starting mastercontainer update...\" \n    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.)\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/UpdateMastercontainer.php\nfi\n\n# Wait for watchtower to stop\nif [ \"$AUTOMATIC_UPDATES\" = 1 ]; then\n    if ! docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-watchtower$\"; then\n        echo \"Something seems to be wrong: Watchtower should be started at this step.\"\n    fi\n    while docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-watchtower$\"; do\n        echo \"Waiting for watchtower to stop\"\n        sleep 30\n    done\nfi\n\n# Update container images to reduce downtime later on\nif [ \"$AUTOMATIC_UPDATES\" = 1 ]; then\n    echo \"Updating container images...\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/PullContainerImages.php\nfi\n\n# Stop containers if required\n# shellcheck disable=SC2235\nif [ \"$CHECK_BACKUP\" != 1 ] && ([ \"$DAILY_BACKUP\" != 1 ] || [ \"$STOP_CONTAINERS\" = 1 ]); then\n    echo \"Stopping containers...\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/StopContainers.php\nfi\n\n# Execute the backup itself and some related tasks (also stops the containers)\nif [ \"$DAILY_BACKUP\" = 1 ]; then\n    echo \"Creating daily backup...\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/CreateBackup.php\n    if ! docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-borgbackup$\"; then\n        echo \"Something seems to be wrong: the borg container should be started at this step.\"\n    fi\n    while docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-borgbackup$\"; do\n        echo \"Waiting for backup container to stop\"\n        sleep 30\n    done\nfi\n\n# Execute backup check\nif [ \"$CHECK_BACKUP\" = 1 ]; then\n    echo \"Starting backup check...\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/CheckBackup.php\nfi\n\n# Start and/or update containers\nif [ \"$AUTOMATIC_UPDATES\" = 1 ]; then\n    echo \"Starting and updating containers...\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/StartAndUpdateContainers.php\nelse\n    if [ \"$START_CONTAINERS\" = 1 ]; then\n        echo \"Starting containers without updating them...\"\n        sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/StartContainers.php\n    fi\nfi\n\n# Delete the lock file\nrm -f \"/mnt/docker-aio-config/data/daily_backup_running\"\n\n# Send backup notification\n# shellcheck disable=SC2235\nif [ \"$DAILY_BACKUP\" = 1 ] && ([ \"$AUTOMATIC_UPDATES\" = 1 ] || [ \"$START_CONTAINERS\" = 1 ]); then\n    # Wait for the nextcloud container to start and send if the backup was successful\n    if ! docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-nextcloud$\"; then\n        echo \"Something seems to be wrong: Nextcloud should be started at this step.\"\n    else\n        while docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-nextcloud$\" && ! nc -z nextcloud-aio-nextcloud 9000; do\n            echo \"Waiting for the Nextcloud container to start\"\n            sleep 30\n            if [ \"$(docker inspect nextcloud-aio-nextcloud --format \"{{.State.Restarting}}\")\" = \"true\" ]; then\n                echo \"Nextcloud container restarting. Skipping this check!\"\n                break\n            fi\n        done\n    fi\n    echo \"Sending backup notification...\"\n    sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/BackupNotification.php\nfi\n\necho \"Daily backup script has finished\"\n"
  },
  {
    "path": "Containers/mastercontainer/healthcheck.sh",
    "content": "#!/bin/bash\n\nif [ -f \"/mnt/docker-aio-config/data/configuration.json\" ]; then\n    nc -z 127.0.0.1 80 || exit 1\n    nc -z 127.0.0.1 8080 || exit 1\n    nc -z 127.0.0.1 8443 || exit 1\n    test -S /run/php.sock || exit 1\n    nc -z 127.0.0.1 9876 || exit 1\nfi\n"
  },
  {
    "path": "Containers/mastercontainer/internal.Caddyfile",
    "content": "{\n\tadmin off\n\n\tstorage file_system {\n\t\troot /mnt/docker-aio-config/caddy/\n\t}\n\n\tlog {\n\t\tlevel ERROR\n\t\t# We need to exclude the remote-host plugin from logging as it would spam the logs\n\t\t# See https://github.com/nextcloud/all-in-one/pull/7006#issuecomment-4003238239 \n\t\texclude http.matchers.remote_host\n\t}\n\n\tservers {\n\t\t# Only h1 is allowed as we prevent `ERR_NETWORK_CHANGED` from happening\n\t\tprotocols h1\n\t}\n\n\tskip_install_trust\n}\n\nhttps://:8080 {\n\t@denied {\n\t\tpath /api/auth/login /api/auth/getlogin\n\t\tremote_host nextcloud-aio-nextcloud\n\t}\n\tabort @denied\n\n\troot * /var/www/docker-aio/php/public\n\tphp_fastcgi unix//run/php.sock\n\tfile_server\n\n\ttls {\n\t\ton_demand\n\t\tissuer internal\n\t}\n}\n"
  },
  {
    "path": "Containers/mastercontainer/session-deduplicator.sh",
    "content": "#!/bin/bash\n\ndeduplicate_sessions() {\n    echo \"Deleting duplicate sessions\"\n    find \"/mnt/docker-aio-config/session/\" -mindepth 1 -exec grep -qv \"$NEW_SESSION_TIME\" {} \\; -delete\n}\n\ncompare_times() {\n    if [ -f \"/mnt/docker-aio-config/data/session_date_file\" ]; then\n        unset NEW_SESSION_TIME\n        NEW_SESSION_TIME=\"$(cat \"/mnt/docker-aio-config/data/session_date_file\")\"\n        if [ -n \"$NEW_SESSION_TIME\" ] && [ -n \"$OLD_SESSION_TIME\" ] && [ \"$NEW_SESSION_TIME\" != \"$OLD_SESSION_TIME\" ]; then\n            deduplicate_sessions\n        fi\n        OLD_SESSION_TIME=\"$NEW_SESSION_TIME\"\n    fi\n}\n\nwhile true; do\n    compare_times\n    sleep 2\ndone\n"
  },
  {
    "path": "Containers/mastercontainer/start.sh",
    "content": "#!/bin/bash\n\n# Function to show text in green\nprint_green() {\n    local TEXT=\"$1\"\n    printf \"%b%s%b\\n\" \"\\e[0;92m\" \"$TEXT\" \"\\e[0m\"\n}\n\n# Function to show text in red\nprint_red() {\n    local TEXT=\"$1\"\n    printf \"%b%s%b\\n\" \"\\e[0;31m\" \"$TEXT\" \"\\e[0m\"\n}\n\n# Function to check if number was provided\ncheck_if_number() {\ncase \"${1}\" in\n    ''|*[!0-9]*) return 1 ;;\n    *) return 0 ;;\nesac\n}\n\n# Check if running as root user\nif [ \"$EUID\" != \"0\" ]; then\n    print_red \"Container does not run as root user. This is not supported.\"\n    exit 1\nfi\n\n# Check that the CMD is not overwritten nor set\nif [ \"$*\" != \"\" ]; then\n    print_red \"Docker run command for AIO is incorrect as a CMD option was given which is not expected.\"\n    exit 1\nfi\n\n# Check if socket is available and readable\nif ! [ -e \"/var/run/docker.sock\" ]; then\n    print_red \"Docker socket is not available. Cannot continue.\"\n    echo \"Please make sure to mount the docker socket into /var/run/docker.sock inside the container!\"\n    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.\"\n    echo \"And https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml\"\n    exit 1\nelif ! mountpoint -q \"/mnt/docker-aio-config\"; then\n    print_red \"/mnt/docker-aio-config is not a mountpoint. Cannot proceed!\"\n    echo \"Please make sure to mount the nextcloud_aio_mastercontainer docker volume into /mnt/docker-aio-config inside the container!\"\n    echo \"If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale\"\n    exit 1\nelif mountpoint -q /var/www/docker-aio/php/containers.json; then\n    print_red \"/var/www/docker-aio/php/containers.json is a mountpoint. Cannot proceed!\"\n    echo \"This is a not-supported customization of the mastercontainer!\"\n    echo \"Please remove this bind-mount from the mastercontainer.\"\n    echo \"If you need to customize things, feel free to use https://github.com/nextcloud/all-in-one/tree/main/manual-install\"\n    echo \"See https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml\"\n    exit 1\nelif ! sudo -E -u www-data test -r /var/run/docker.sock; then\n    echo \"Trying to fix docker.sock permissions internally...\"\n    DOCKER_GROUP=$(stat -c '%G' /var/run/docker.sock)\n    DOCKER_GROUP_ID=$(stat -c '%g' /var/run/docker.sock)\n    # Check if a group with the same group name of /var/run/docker.socket already exists in the container\n    if grep -q \"^$DOCKER_GROUP:\" /etc/group; then\n        # If yes, add www-data to that group\n        echo \"Adding internal www-data to group $DOCKER_GROUP\"\n        usermod -aG \"$DOCKER_GROUP\" www-data\n    else\n        # Delete the docker group for cases when the docker socket permissions changed between restarts\n        groupdel docker &>/dev/null\n\n        # If the group doesn't exist, create it\n        echo \"Creating docker group internally with id $DOCKER_GROUP_ID\"\n        groupadd -g \"$DOCKER_GROUP_ID\" docker\n        usermod -aG docker www-data\n    fi\n    if ! sudo -E -u www-data test -r /var/run/docker.sock; then\n        print_red \"Docker socket is not readable by the www-data user. Cannot continue.\"\n        exit 1\n    fi\nfi\n\n# Get default docker api version\nAPI_VERSION_FILE=\"$(find ./ -name DockerActionManager.php | head -1)\"\nAPI_VERSION=\"$(grep -oP 'const string API_VERSION.*\\;' \"$API_VERSION_FILE\" | grep -oP '[0-9]+.[0-9]+' | head -1)\"\nif [ -z \"$API_VERSION\" ]; then\n    print_red \"Could not get API_VERSION. Something is wrong!\"\n    exit 1\nfi\n\n# Check if DOCKER_API_VERSION is set globally\nif [ -n \"$DOCKER_API_VERSION\" ]; then\n    if ! echo \"$DOCKER_API_VERSION\" | grep -q '^[0-9].[0-9]\\+$'; then\n        print_red \"You've set DOCKER_API_VERSION but not to an allowed value.\nThe string must be a version number like e.g. '1.44'.\nIt is set to '$DOCKER_API_VERSION'.\"\n        exit 1\n    fi\n    print_red \"DOCKER_API_VERSION was found to be set to '$DOCKER_API_VERSION'.\"\n    print_red \"Please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO.\"\n    print_red \"So you run on your own risk and things might break without warning.\"\nelse\n    # Export docker api version to use it everywhere\n    export DOCKER_API_VERSION=\"$API_VERSION\"\nfi\n\n# Set a fallback docker api version. Needed for api version check. \n# The check will not work otherwise on old docker versions\nFALLBACK_DOCKER_API_VERSION=\"1.41\"\n\n# Check if docker info can be used\nif ! sudo -E -u www-data docker info &>/dev/null; then\n    if ! sudo -E -u www-data DOCKER_API_VERSION=\"$FALLBACK_DOCKER_API_VERSION\" docker info &>/dev/null; then\n        print_red \"Cannot connect to the docker socket. Cannot proceed.\"\n        echo \"Did you maybe remove group read permissions for the docker socket? AIO needs them in order to access the docker socket.\"\n        echo \"If SELinux is enabled on your host, see https://github.com/nextcloud/all-in-one#are-there-known-problems-when-selinux-is-enabled\"\n        echo \"If you are on TrueNas SCALE, see https://github.com/nextcloud/all-in-one#can-i-run-aio-on-truenas-scale\"\n        echo \"On macOS, see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-macos\"\n        echo \"Another possibility might be that Docker api v$API_VERSION is not supported by your docker daemon.\"\n        echo \"In that case, you should report this to https://github.com/nextcloud/all-in-one/issues\"\n        echo \"\"\n        exit 1\n    fi\nfi\n\n# Docker api version check\n# shellcheck disable=SC2001\nAPI_VERSION_NUMB=\"$(echo \"$DOCKER_API_VERSION\" | sed 's/\\.//')\"\nLOCAL_API_VERSION_NUMB=\"$(sudo -E -u www-data docker version | grep -i \"api version\" | grep -oP '[0-9]+.[0-9]+' | head -1 | sed 's/\\.//')\"\nif [ -z \"$LOCAL_API_VERSION_NUMB\" ]; then\n    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/\\.//')\"\nfi\nif [ -n \"$LOCAL_API_VERSION_NUMB\" ] && [ -n \"$API_VERSION_NUMB\" ]; then\n    if ! [ \"$LOCAL_API_VERSION_NUMB\" -ge \"$API_VERSION_NUMB\" ]; then\n        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!\"\n        echo \"Alternatively, set the DOCKER_API_VERSION environmental variable to a compatible version.\"\n        echo \"However please note that only v$API_VERSION is officially supported and tested by the maintainers of Nextcloud AIO.\"\n        echo \"See https://github.com/nextcloud/all-in-one#how-to-adjust-the-internally-used-docker-api-version\"\n        exit 1\n    fi\nelse\n    echo \"LOCAL_API_VERSION_NUMB or API_VERSION_NUMB are not set correctly. Cannot check if the API version is supported.\"\n    sleep 10\nfi\n\n# Check Storage drivers\nSTORAGE_DRIVER=\"$(sudo -E -u www-data docker info | grep \"Storage Driver\")\"\n# Check if vfs is used: https://github.com/nextcloud/all-in-one/discussions/1467\nif echo \"$STORAGE_DRIVER\" | grep -q vfs; then\n    echo \"$STORAGE_DRIVER\"\n    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!\"\nelif echo \"$STORAGE_DRIVER\" | grep -q fuse-overlayfs; then\n    echo \"$STORAGE_DRIVER\"\n    print_red \"Warning: It seems like the storage driver fuse-overlayfs is used. Please check if you can switch to overlay2 instead.\"\nfi\n\n# Check if snap install\nif sudo -E -u www-data docker info | grep \"Docker Root Dir\" | grep \"/var/snap/docker/\"; then\n    print_red \"Warning: It looks like your installation uses docker installed via snap.\"\n    print_red \"This comes with some limitations and is disrecommended by the docker maintainers.\"\n    print_red \"See for example https://github.com/nextcloud/all-in-one/discussions/4890#discussioncomment-10386752\"\nfi\n\n# Check if startup command was executed correctly\nif ! sudo -E -u www-data docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-mastercontainer$\"; then\n    print_red \"It seems like you did not give the mastercontainer the correct name? (The 'nextcloud-aio-mastercontainer' container was not found.)\nUsing a different name is not supported since mastercontainer updates will not work in that case!\nIf 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\"\n    exit 1\nelif sudo -E -u www-data docker inspect nextcloud-aio-mastercontainer --format \"{{.Config.Image}}\" | grep -q '@'; then\n    print_red \"It seems like you used a hash for the mastercontainer image tag. This is not supported!\"\n    exit 1\nelif ! sudo -E -u www-data docker volume ls --format \"{{.Name}}\" | grep -q \"^nextcloud_aio_mastercontainer$\"; then\n    print_red \"It seems like you did not give the mastercontainer volume the correct name? (The 'nextcloud_aio_mastercontainer' volume was not found.)\nUsing a different name is not supported since the built-in backup solution will not work in that case!\"\n    exit 1\nelif ! sudo -E -u www-data docker inspect nextcloud-aio-mastercontainer | grep -q \"nextcloud_aio_mastercontainer\"; then\n    print_red \"It seems like you did not attach the 'nextcloud_aio_mastercontainer' volume to the mastercontainer?\nThis is not supported since the built-in backup solution will not work in that case!\"\n    exit 1\nfi\n\n# Check for other options\nif [ -n \"$NEXTCLOUD_DATADIR\" ]; then\n    if [ \"$NEXTCLOUD_DATADIR\" = \"nextcloud_aio_nextcloud_datadir\" ]; then\n        sleep 1\n    elif ! echo \"$NEXTCLOUD_DATADIR\" | grep -q \"^/\" || [ \"$NEXTCLOUD_DATADIR\" = \"/\" ]; then\n        print_red \"You've set NEXTCLOUD_DATADIR but not to an allowed value.\nThe string must start with '/' and must not be equal to '/'. Also allowed is 'nextcloud_aio_nextcloud_datadir'.\nIt is set to '$NEXTCLOUD_DATADIR'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_MOUNT\" ]; then\n    if ! echo \"$NEXTCLOUD_MOUNT\" | grep -q \"^/\" || [ \"$NEXTCLOUD_MOUNT\" = \"/\" ]; then\n        print_red \"You've set NEXTCLOUD_MOUNT but not to an allowed value.\nThe string must start with '/' and must not be equal to '/'.\nIt is set to '$NEXTCLOUD_MOUNT'.\"\n        exit 1\n    elif [ \"$NEXTCLOUD_MOUNT\" = \"/mnt/ncdata\" ] || echo \"$NEXTCLOUD_MOUNT\" | grep -q \"^/mnt/ncdata/\"; then\n        print_red \"'/mnt/ncdata' and '/mnt/ncdata/' are not allowed as values for NEXTCLOUD_MOUNT.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_DATADIR\" ] && [ -n \"$NEXTCLOUD_MOUNT\" ]; then\n    if [ \"$NEXTCLOUD_DATADIR\" = \"$NEXTCLOUD_MOUNT\" ]; then\n        print_red \"NEXTCLOUD_DATADIR and NEXTCLOUD_MOUNT are not allowed to be equal.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_UPLOAD_LIMIT\" ]; then\n    if ! echo \"$NEXTCLOUD_UPLOAD_LIMIT\" | grep -q '^[0-9]\\+G$'; then\n        print_red \"You've set NEXTCLOUD_UPLOAD_LIMIT but not to an allowed value.\nThe string must start with a number and end with 'G'.\nIt is set to '$NEXTCLOUD_UPLOAD_LIMIT'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_MAX_TIME\" ]; then\n    if ! echo \"$NEXTCLOUD_MAX_TIME\" | grep -q '^[0-9]\\+$'; then\n        print_red \"You've set NEXTCLOUD_MAX_TIME but not to an allowed value.\nThe string must be a number. E.g. '3600'.\nIt is set to '$NEXTCLOUD_MAX_TIME'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_MEMORY_LIMIT\" ]; then\n    if ! echo \"$NEXTCLOUD_MEMORY_LIMIT\" | grep -q '^[0-9]\\+M$'; then\n        print_red \"You've set NEXTCLOUD_MEMORY_LIMIT but not to an allowed value.\nThe string must start with a number and end with 'M'.\nIt is set to '$NEXTCLOUD_MEMORY_LIMIT'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$APACHE_PORT\" ]; then\n    if ! check_if_number \"$APACHE_PORT\"; then\n        print_red \"You provided an Apache port but did not only use numbers.\nIt is set to '$APACHE_PORT'.\"\n        exit 1\n    elif ! [ \"$APACHE_PORT\" -le 65535 ] || ! [ \"$APACHE_PORT\" -ge 1 ]; then\n        print_red \"The provided Apache port is invalid. It must be between 1 and 65535\"\n        exit 1\n    fi\nfi\nif [ -n \"$APACHE_IP_BINDING\" ]; then\n    if ! echo \"$APACHE_IP_BINDING\" | grep -q '^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$\\|^[0-9a-f:]\\+$\\|^@INTERNAL$'; then\n        print_red \"You provided an ip-address for the apache container's ip-binding but it was not a valid ip-address.\nIt is set to '$APACHE_IP_BINDING'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$APACHE_ADDITIONAL_NETWORK\" ]; then\n    if ! echo \"$APACHE_ADDITIONAL_NETWORK\" | grep -q \"^[a-zA-Z0-9._-]\\+$\"; then\n        print_red \"You've set APACHE_ADDITIONAL_NETWORK but not to an allowed value.\nIt needs to be a string with letters, numbers, hyphens and underscores.\nIt is set to '$APACHE_ADDITIONAL_NETWORK'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$TALK_PORT\" ]; then\n    if ! check_if_number \"$TALK_PORT\"; then\n        print_red \"You provided an Talk port but did not only use numbers.\nIt is set to '$TALK_PORT'.\"\n        exit 1\n    elif ! [ \"$TALK_PORT\" -le 65535 ] || ! [ \"$TALK_PORT\" -ge 1 ]; then\n        print_red \"The provided Talk port is invalid. It must be between 1 and 65535\"\n        exit 1\n    fi\nfi\nif [ -n \"$APACHE_PORT\" ] && [ -n \"$TALK_PORT\" ]; then\n    if [ \"$APACHE_PORT\" = \"$TALK_PORT\" ]; then\n        print_red \"APACHE_PORT and TALK_PORT are not allowed to be equal.\"\n        exit 1\n    fi\nfi\nif [ -n \"$WATCHTOWER_DOCKER_SOCKET_PATH\" ]; then\n    if ! echo \"$WATCHTOWER_DOCKER_SOCKET_PATH\" | grep -q \"^/\" || echo \"$WATCHTOWER_DOCKER_SOCKET_PATH\" | grep -q \"/$\"; then\n        print_red \"You've set WATCHTOWER_DOCKER_SOCKET_PATH but not to an allowed value.\nThe string must start with '/' and must not end with '/'.\nIt is set to '$WATCHTOWER_DOCKER_SOCKET_PATH'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_TRUSTED_CACERTS_DIR\" ]; then\n    if ! echo \"$NEXTCLOUD_TRUSTED_CACERTS_DIR\" | grep -q \"^/\" || echo \"$NEXTCLOUD_TRUSTED_CACERTS_DIR\" | grep -q \"/$\"; then\n        print_red \"You've set NEXTCLOUD_TRUSTED_CACERTS_DIR but not to an allowed value.\nIt should be an absolute path to a directory that starts with '/' but not end with '/'.\nIt is set to '$NEXTCLOUD_TRUSTED_CACERTS_DIR '.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_STARTUP_APPS\" ]; then\n    if ! echo \"$NEXTCLOUD_STARTUP_APPS\" | grep -q \"^[a-z0-9 _-]\\+$\"; then\n        print_red \"You've set NEXTCLOUD_STARTUP_APPS but not to an allowed value.\nIt needs to be a string. Allowed are small letters a-z, 0-9, spaces, hyphens and '_'.\nIt is set to '$NEXTCLOUD_STARTUP_APPS'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_ADDITIONAL_APKS\" ]; then\n    if ! echo \"$NEXTCLOUD_ADDITIONAL_APKS\" | grep -q \"^[a-z0-9 ._-]\\+$\"; then\n        print_red \"You've set NEXTCLOUD_ADDITIONAL_APKS but not to an allowed value.\nIt needs to be a string. Allowed are small letters a-z, digits 0-9, spaces, hyphens, dots and '_'.\nIt is set to '$NEXTCLOUD_ADDITIONAL_APKS'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS\" ]; then\n    if ! echo \"$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS\" | grep -q \"^[a-z0-9 ._-]\\+$\"; then\n        print_red \"You've set NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS but not to an allowed value.\nIt needs to be a string. Allowed are small letters a-z, digits 0-9, spaces, hyphens, dots and '_'.\nIt is set to '$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS'.\"\n        exit 1\n    fi\nfi\nif [ -n \"$AIO_COMMUNITY_CONTAINERS\" ]; then\n    print_red \"You've set AIO_COMMUNITY_CONTAINERS but the option was removed.\nThe community containers get managed via the AIO interface now.\"\nfi\n\n# Check if ghcr.io is reachable\n# Solves issues like https://github.com/nextcloud/all-in-one/discussions/5268\nif ! curl --no-progress-meter https://ghcr.io/v2/ >/dev/null; then\n    print_red \"Could not reach https://ghcr.io.\"\n    echo \"Most likely is something blocking access to it.\"\n    echo \"You should be able to fix this by following https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html\"\n    echo \"Another solution is using https://github.com/nextcloud/all-in-one/tree/main/manual-install\"\n    echo \"See https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml\"\n    exit 1\nfi\n\n# Check that no changes have been made to timezone settings since AIO only supports running in Etc/UTC timezone\nif [ -n \"$TZ\" ]; then\n    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!\"\n    echo \"The correct timezone can be set in the AIO interface later on!\"\n    # Disable exit since it seems to be by default set on unraid and we dont want to break these instances\n    # exit 1\nfi\n# Check that http proxy or no_proxy variable is not set which AIO does not support\nif [ -n \"$HTTP_PROXY\" ] || [ -n \"$http_proxy\" ] || [ -n \"$HTTPS_PROXY\" ] || [ -n \"$https_proxy\" ] || [ -n \"$NO_PROXY\" ] || [ -n \"$no_proxy\" ]; then\n    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.\"\n    echo \"If you need this, then you should use https://github.com/nextcloud/all-in-one/tree/main/manual-install\"\n    echo \"See https://github.com/nextcloud/all-in-one/blob/main/manual-install/latest.yml\"\n    exit 1\nfi\nif mountpoint -q /etc/localtime; then\n    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!\"\n    echo \"The correct timezone can be set in the AIO interface later on!\"\n    exit 1\nfi\nif mountpoint -q /etc/timezone; then\n    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!\"\n    echo \"The correct timezone can be set in the AIO interface later on!\"\n    exit 1\nfi\n\n# Check if unsupported env are set (but don't exit as it would break many instances)\nif [ -n \"$APACHE_DISABLE_REWRITE_IP\" ]; then\n    print_red \"The environmental variable APACHE_DISABLE_REWRITE_IP has been set which is not supported by AIO. Please remove it!\"\nfi\nif [ -n \"$NEXTCLOUD_TRUSTED_DOMAINS\" ]; then\n    print_red \"The environmental variable NEXTCLOUD_TRUSTED_DOMAINS has been set which is not supported by AIO. Please remove it!\"\nfi\nif [ -n \"$TRUSTED_PROXIES\" ]; then\n    print_red \"The environmental variable TRUSTED_PROXIES has been set which is not supported by AIO. Please remove it!\"\nfi\n\n# Add important folders\nmkdir -p /mnt/docker-aio-config/data/\nmkdir -p /mnt/docker-aio-config/session/\nmkdir -p /mnt/docker-aio-config/caddy/\n\n# Adjust permissions for all instances\nchmod 770 -R /mnt/docker-aio-config\nchmod 777 /mnt/docker-aio-config\nchown www-data:www-data -R /mnt/docker-aio-config/data/\nchown www-data:www-data -R /mnt/docker-aio-config/session/\nchown www-data:www-data -R /mnt/docker-aio-config/caddy/\n\nprint_green \"Initial startup of Nextcloud All-in-One complete!\nYou should be able to open the Nextcloud AIO Interface now on port 8080 of this server!\nE.g. https://internal.ip.of.this.server:8080\n⚠️ Important: do always use an ip-address if you access this port and not a domain as HSTS might block access to it later!\n\nIf 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:\nhttps://your-domain-that-points-to-this-server.tld:8443\"\n\n# Set the timezone to Etc/UTC\nexport TZ=Etc/UTC\n\n# Remove unused certs\nrm -vrf /mnt/docker-aio-config/certs\n\n# Remove the php socket as safeguard\nrm -vf /run/php.sock\n\n# Fix caddy startup\nif [ -d \"/mnt/docker-aio-config/caddy/locks\" ]; then\n    rm -rf /mnt/docker-aio-config/caddy/locks/*\nfi\n\n# Fix the Caddyfile format\ncaddy fmt --overwrite /acme.Caddyfile\ncaddy fmt --overwrite /internal.Caddyfile\n\n# Fix caddy log \nchmod 777 /root\n\n# Start supervisord\nexec /usr/bin/supervisord -c /supervisord.conf\n"
  },
  {
    "path": "Containers/mastercontainer/supervisord.conf",
    "content": "[supervisord]\nnodaemon=true\nlogfile=/var/log/supervisord/supervisord.log\npidfile=/var/run/supervisord/supervisord.pid\nchildlogdir=/var/log/supervisord/\nlogfile_maxbytes=50MB                           \nlogfile_backups=10                 \nloglevel=error\nuser=root\n\n[program:php-fpm]\n# Stdout logging is disabled as otherwise the logs are spammed\nstdout_logfile=NONE\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=php-fpm\nuser=root\n\n[program:caddy-internal]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/usr/bin/caddy run --config /internal.Caddyfile\nuser=www-data\n\n[program:caddy-acme]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/usr/bin/caddy run --config /acme.Caddyfile\nuser=www-data\n\n[program:cron]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/cron.sh\nuser=root\n\n[program:backup-time-file-watcher]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/backup-time-file-watcher.sh\nuser=root\n\n[program:session-deduplicator]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/session-deduplicator.sh\nuser=root\n\n[program:domain-validator]\n# Logging is disabled as otherwise all attempts will be logged which spams the logs\nstdout_logfile=NONE\nstderr_logfile=NONE\ncommand=php -S 127.0.0.1:9876 /var/www/docker-aio/php/domain-validator.php\nuser=www-data\n"
  },
  {
    "path": "Containers/nextcloud/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM php:8.3.30-fpm-alpine3.23\n\nENV PHP_MEMORY_LIMIT=512M\nENV PHP_UPLOAD_LIMIT=16G\nENV PHP_MAX_TIME=3600\nENV SOURCE_LOCATION=/usr/src/nextcloud\nENV REDIS_DB_INDEX=0\n\n# AIO settings start # Do not remove or change this line!\nENV NEXTCLOUD_VERSION=32.0.6\nENV AIO_TOKEN=123456\nENV AIO_URL=localhost\n# AIO settings end # Do not remove or change this line!\n\nCOPY --chmod=775 Containers/nextcloud/*.sh /\nCOPY --chmod=774 Containers/nextcloud/upgrade.exclude /upgrade.exclude\nCOPY Containers/nextcloud/config/*.php /\nCOPY Containers/nextcloud/supervisord.conf /supervisord.conf\n\n# AIO cloning start # Do not remove or change this line!\nCOPY app /usr/src/nextcloud/apps/nextcloud-aio\nCOPY Containers/nextcloud/root.motd /root.motd\n# AIO cloning end # Do not remove or change this line!\n\nVOLUME /mnt/ncdata\nVOLUME /var/www/html\n\n# Custom: change id of www-data user as it needs to be the same like on old installations\n# hadolint ignore=SC2086,DL3003\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache shadow; \\\n    deluser www-data; \\\n    addgroup -g 33 -S www-data; \\\n    adduser -u 33 -D -S -G www-data www-data; \\\n    \\\n# entrypoint.sh and cron.sh dependencies\n    apk add --no-cache \\\n        rsync \\\n    ; \\\n# install the PHP extensions we need\n# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html\n    apk add --no-cache --virtual .build-deps \\\n        $PHPIZE_DEPS \\\n        autoconf \\\n        freetype-dev \\\n        gmp-dev \\\n        icu-dev \\\n        imagemagick-dev \\\n        imagemagick-svg \\\n        imagemagick-heic \\\n        imagemagick-tiff \\\n        libevent-dev \\\n        libjpeg-turbo-dev \\\n        libmcrypt-dev \\\n        libmemcached-dev \\\n        libpng-dev \\\n        libwebp-dev \\\n        libxml2-dev \\\n        libzip-dev \\\n        openldap-dev \\\n        pcre-dev \\\n        postgresql-dev \\\n    ; \\\n    \\\n    docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \\\n    docker-php-ext-configure ftp --with-openssl-dir=/usr; \\\n    docker-php-ext-configure ldap; \\\n    docker-php-ext-install -j \"$(nproc)\" \\\n        bcmath \\\n        exif \\\n        gd \\\n        gmp \\\n        intl \\\n        ldap \\\n        opcache \\\n        pcntl \\\n        pdo_pgsql \\\n        sysvsem \\\n        zip \\\n    ; \\\n    \\\n# pecl will claim success even if one install fails, so we need to perform each install separately\n    pecl install -o igbinary-3.2.16; \\\n    pecl install APCu-5.1.28; \\\n    pecl install -D 'enable-memcached-igbinary=\"yes\"' memcached-3.4.0; \\\n    pecl install -oD 'enable-redis-igbinary=\"yes\" enable-redis-zstd=\"yes\" enable-redis-lz4=\"yes\"' redis-6.3.0; \\\n   pecl install -o imagick-3.8.1; \\\n    \\\n    docker-php-ext-enable \\\n        igbinary \\\n        apcu \\\n        memcached \\\n        redis \\\n        imagick \\\n    ; \\\n    rm -r /tmp/pear; \\\n    \\\n    runDeps=\"$( \\\n        scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \\\n            | tr ',' '\\n' \\\n            | sort -u \\\n            | awk 'system(\"[ -e /usr/local/lib/\" $1 \" ]\") == 0 { next } { print \"so:\" $1 }' \\\n    )\"; \\\n    apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps; \\\n    apk del .build-deps; \\\n    \\\n    { \\\n        echo 'apc.serializer=igbinary'; \\\n        echo 'session.serialize_handler=igbinary'; \\\n    } >> /usr/local/etc/php/conf.d/docker-php-ext-igbinary.ini; \\\n    \\\n# set recommended PHP.ini settings\n# see https://docs.nextcloud.com/server/stable/admin_manual/installation/server_tuning.html#enable-php-opcache and below\n    { \\\n        echo 'opcache.max_accelerated_files=10000'; \\\n        echo 'opcache.memory_consumption=256'; \\\n        echo 'opcache.interned_strings_buffer=64'; \\\n        echo 'opcache.save_comments=1'; \\\n        echo 'opcache.revalidate_freq=60'; \\\n        echo 'opcache.jit=1255'; \\\n        echo 'opcache.jit_buffer_size=8M'; \\\n    } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \\\n    \\\n    { \\\n        echo 'apc.enable_cli=1'; \\\n        echo 'apc.shm_size=64M'; \\\n    } >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \\\n    \\\n    { \\\n        echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \\\n        echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \\\n        echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \\\n        echo 'max_execution_time=${PHP_MAX_TIME}'; \\\n        echo 'max_input_time=-1'; \\\n        echo 'default_socket_timeout=${PHP_MAX_TIME}'; \\\n    } > /usr/local/etc/php/conf.d/nextcloud.ini; \\\n    \\\n    { \\\n        echo 'session.save_handler = redis'; \\\n        echo 'session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT}?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}\"'; \\\n        echo 'redis.session.locking_enabled = 1'; \\\n        echo 'redis.session.lock_retries = -1'; \\\n        echo 'redis.session.lock_wait_time = 10000'; \\\n        echo 'session.gc_maxlifetime = 86400'; \\\n    } > /usr/local/etc/php/conf.d/redis-session.ini; \\\n    \\\n    mkdir -p /var/www/data; \\\n    chown -R www-data:root /var/www; \\\n    chmod -R g=u /var/www; \\\n    \\\n# Download Nextcloud archive start # Do not remove or change this line!\n    apk add --no-cache --virtual .fetch-deps \\\n        bzip2 \\\n        gnupg \\\n    ; \\\n    \\\n    curl -fsSL -o nextcloud.tar.bz2 \\\n        \"https://github.com/nextcloud-releases/server/releases/download/v${NEXTCLOUD_VERSION}/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2\"; \\\n    curl -fsSL -o nextcloud.tar.bz2.asc \\\n        \"https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc\"; \\\n    export GNUPGHOME=\"$(mktemp -d)\"; \\\n# gpg key from https://nextcloud.com/nextcloud.asc\n    gpg --batch --keyserver keyserver.ubuntu.com  --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \\\n    gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \\\n    tar -xjf nextcloud.tar.bz2 -C /usr/src/; \\\n    gpgconf --kill all; \\\n    rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \\\n    mkdir -p /usr/src/nextcloud/data; \\\n    mkdir -p /usr/src/nextcloud/custom_apps; \\\n    chmod +x /usr/src/nextcloud/occ; \\\n    mkdir -p /usr/src/nextcloud/config; \\\n    apk del .fetch-deps; \\\n# Download Nextcloud archive end # Do not remove or change this line!\n    mv /*.php /usr/src/nextcloud/config/; \\\n    \\\n# Template from https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/fpm-alpine/Dockerfile\n    apk add --no-cache \\\n        ffmpeg \\\n        procps \\\n        samba-client \\\n        supervisor \\\n#       libreoffice \\\n    ; \\\n    \\\n    apk add --no-cache --virtual .build-deps \\\n        $PHPIZE_DEPS \\\n        imap-dev \\\n        krb5-dev \\\n        openssl-dev \\\n        samba-dev \\\n        bzip2-dev \\\n        libpq-dev \\\n    ; \\\n    \\\n    docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \\\n    docker-php-ext-install \\\n        bz2 \\\n        imap \\\n        pgsql \\\n        ftp \\\n    ; \\\n    pecl install smbclient; \\\n    docker-php-ext-enable smbclient; \\\n    \\\n    runDeps=\"$( \\\n        scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \\\n            | tr ',' '\\n' \\\n            | sort -u \\\n            | awk 'system(\"[ -e /usr/local/lib/\" $1 \" ]\") == 0 { next } { print \"so:\" $1 }' \\\n    )\"; \\\n    apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps; \\\n    apk del .build-deps; \\\n    \\\n    mkdir -p \\\n    /var/log/supervisord \\\n    /var/run/supervisord \\\n    ; \\\n    chmod 777 -R /var/log/supervisord; \\\n    chmod 777 -R /var/run/supervisord; \\\n    \\\n    apk add --no-cache \\\n        bash \\\n        netcat-openbsd \\\n        openssl \\\n        gnupg \\\n        git \\\n        postgresql-client \\\n        tzdata \\\n        sudo \\\n        grep \\\n        nodejs \\\n        bind-tools \\\n        imagemagick \\\n        imagemagick-svg \\\n        imagemagick-heic \\\n        imagemagick-tiff \\\n        coreutils; \\\n    \\\n    grep -q '^pm = dynamic' /usr/local/etc/php-fpm.d/www.conf; \\\n    sed -i 's/^pm = dynamic/pm = ondemand/' /usr/local/etc/php-fpm.d/www.conf; \\\n# Sync this with max db connections and MaxRequestWorkers\n# We don't actually expect so many children but don't want to limit it artificially because people will report issues otherwise.\n# Also children will usually be terminated again after the process is done due to the ondemand setting\n    sed -i 's/^pm.max_children =.*/pm.max_children = 5000/' /usr/local/etc/php-fpm.d/www.conf; \\\n    sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf; \\\n    \\\n    echo \"[ -n \\\"\\$TERM\\\" ] && [ -f /root.motd ] && cat /root.motd\" >> /root/.bashrc; \\\n    \\\n    chown www-data:root -R /usr/src && \\\n    chmod 777 -R /usr/local/etc/php/conf.d && \\\n    chmod 777 -R /usr/local/etc/php-fpm.d && \\\n    chmod -R 777 /tmp; \\\n    chmod -R 777 /etc/openldap; \\\n    \\\n    mkdir -p /nc-updater; \\\n    chmod -R 777 /nc-updater\n\n# hadolint ignore=DL3002\nUSER root\nENTRYPOINT [\"/start.sh\"]\nCMD [\"/usr/bin/supervisord\", \"-c\", \"/supervisord.conf\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/nextcloud/README.md",
    "content": "# Nextcloud All-in-One ``nextcloud`` Container\n\nThis 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.\n\n## Overview\n\nThe 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:\n\n- The PHP SAPI/backend (php-fpm)\n- Nextcloud background jobs and scheduled tasks, which are handled via cron\n- Miscellaneous minor support services specific to AIO's Nextcloud deployment (health and exec)\n\n## Contents\n\n- **Dockerfile**: Instructions for building the Nextcloud container image.\n- **Entrypoint script**: The `start.sh` script is used for container initialization and runtime configuration before starting supervisord.\n- **Nextcloud configuration files**: Specific to running in a containerized setting and/or within AIO.\n- **Supervisor**: The `supervisord.conf` file defines the long-running services hosted within the container (php-fpm, cron, etc.).\n\n## Usage\n\nThis 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).\n\n## Documentation\n\n- [Nextcloud All-in-One Documentation](https://github.com/nextcloud/all-in-one#readme)\n- [Nextcloud Documentation](https://docs.nextcloud.com/)\n\n## Contributing\n\nContributions are welcome! Please follow the Nextcloud project's guidelines and submit pull requests or issues via the main repository.\n\n## License\n\nThis 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.\n"
  },
  {
    "path": "Containers/nextcloud/config/aio.config.php",
    "content": "<?php\n$CONFIG = array (\n  'one-click-instance' => true,\n  'one-click-instance.user-limit' => 100,\n);\n"
  },
  {
    "path": "Containers/nextcloud/config/apcu.config.php",
    "content": "<?php\n$CONFIG = array (\n  'memcache.local' => '\\OC\\Memcache\\APCu',\n);\n"
  },
  {
    "path": "Containers/nextcloud/config/apps.config.php",
    "content": "<?php\n$CONFIG = array (\n  'apps_paths' => array (\n      0 => array (\n              'path'     => '/var/www/html/apps',\n              'url'      => '/apps',\n              'writable' => false,\n      ),\n      1 => array (\n              'path'     => '/var/www/html/custom_apps',\n              'url'      => '/custom_apps',\n              'writable' => true,\n      ),\n  ),\n);\nif (getenv('APPS_ALLOWLIST')) {\n    $CONFIG['appsallowlist'] = explode(\" \", getenv('APPS_ALLOWLIST'));\n}\nif (getenv('NEXTCLOUD_APP_STORE_URL')) {\n    $CONFIG['appstoreurl'] = getenv('NEXTCLOUD_APP_STORE_URL');\n}\n"
  },
  {
    "path": "Containers/nextcloud/config/certificates-bundle.config.php",
    "content": "<?php\n// Check if NEXTCLOUD_TRUSTED_CERTIFICATES_ are configured\nif (str_contains(implode(' ', array_keys(getenv())), 'NEXTCLOUD_TRUSTED_CERTIFICATES_')) {\n  $CONFIG['default_certificates_bundle_path'] = '/var/www/html/data/certificates/ca-bundle.crt';\n}\n"
  },
  {
    "path": "Containers/nextcloud/config/postgres.config.php",
    "content": "<?php\nif (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_POSTGRES')) {\n  $CONFIG = array(\n    'pgsql_ssl' => array(\n      'mode' => 'verify-ca',\n      'rootcert' => '/var/www/html/data/certificates/ca-bundle.crt',\n    ),\n  );\n}\nif (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MYSQL')) {\n  $CONFIG = array(\n    'dbdriveroptions' => array(\n      PDO::MYSQL_ATTR_SSL_CA => '/var/www/html/data/certificates/ca-bundle.crt',\n    ),\n  );\n}\n\n"
  },
  {
    "path": "Containers/nextcloud/config/proxy.config.php",
    "content": "<?php\nif (getenv('HTTP_PROXY')) {\n    $CONFIG['proxy'] = getenv('HTTP_PROXY');\n}\nif (getenv('HTTPS_PROXY')) {\n    $CONFIG['proxy'] = getenv('HTTPS_PROXY');\n}\nif (getenv('PROXY_USER_PASSWORD')) {\n    $CONFIG['proxyuserpwd'] = getenv('PROXY_USER_PASSWORD');\n}\nif (getenv('NO_PROXY')) {\n    $CONFIG['proxyexclude'] = explode(',', getenv('NO_PROXY'));\n}\n"
  },
  {
    "path": "Containers/nextcloud/config/redis.config.php",
    "content": "<?php\nif (getenv('REDIS_MODE') !== 'rediscluster') {\n  $CONFIG = array(\n    'memcache.distributed' => '\\OC\\Memcache\\Redis',\n    'memcache.locking' => '\\OC\\Memcache\\Redis',\n  );\n\n  if (getenv('REDIS_HOST')) {\n    $CONFIG['redis']['host'] = (string) getenv('REDIS_HOST');\n  }\n\n  if (getenv('REDIS_HOST_PASSWORD')) {\n    $CONFIG['redis']['password'] = (string) getenv('REDIS_HOST_PASSWORD');\n  }\n\n  if (getenv('REDIS_PORT')) {\n    $CONFIG['redis']['port'] = (int) getenv('REDIS_PORT');\n  }\n\n  if (getenv('REDIS_DB_INDEX')) {\n    $CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX');\n  }\n\n  if (getenv('REDIS_USER_AUTH')) {\n    $CONFIG['redis']['user'] = str_replace(\"&auth[]=\", \"\", getenv('REDIS_USER_AUTH'));\n  }\n\n  if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_REDIS')) {\n    $CONFIG['redis']['ssl_context']['cafile'] = '/var/www/html/data/certificates/ca-bundle.crt';\n  }\n} else {\n  $CONFIG = array(\n    'memcache.distributed' => '\\OC\\Memcache\\Redis',\n    'memcache.locking' => '\\OC\\Memcache\\Redis',\n    'redis.cluster' => array(\n      'timeout' => 0.0,\n      'read_timeout' => 0.0,\n      'failover_mode' => \\RedisCluster::FAILOVER_ERROR,\n      'seeds' => array_values(array_filter(array(\n        (getenv('REDIS_HOST') && getenv('REDIS_PORT')) ? (getenv('REDIS_HOST') . ':' . (string)getenv('REDIS_PORT')) : null,\n        (getenv('REDIS_HOST_2') && getenv('REDIS_PORT_2')) ? (getenv('REDIS_HOST_2') . ':' . (string)getenv('REDIS_PORT_2')) : null,\n        (getenv('REDIS_HOST_3') && getenv('REDIS_PORT_3')) ? (getenv('REDIS_HOST_3') . ':' . (string)getenv('REDIS_PORT_3')) : null,\n        (getenv('REDIS_HOST_4') && getenv('REDIS_PORT_4')) ? (getenv('REDIS_HOST_4') . ':' . (string)getenv('REDIS_PORT_4')) : null,\n        (getenv('REDIS_HOST_5') && getenv('REDIS_PORT_5')) ? (getenv('REDIS_HOST_5') . ':' . (string)getenv('REDIS_PORT_5')) : null,\n        (getenv('REDIS_HOST_6') && getenv('REDIS_PORT_6')) ? (getenv('REDIS_HOST_6') . ':' . (string)getenv('REDIS_PORT_6')) : null,\n        (getenv('REDIS_HOST_7') && getenv('REDIS_PORT_7')) ? (getenv('REDIS_HOST_7') . ':' . (string)getenv('REDIS_PORT_7')) : null,\n        (getenv('REDIS_HOST_8') && getenv('REDIS_PORT_8')) ? (getenv('REDIS_HOST_8') . ':' . (string)getenv('REDIS_PORT_8')) : null,\n        (getenv('REDIS_HOST_9') && getenv('REDIS_PORT_9')) ? (getenv('REDIS_HOST_9') . ':' . (string)getenv('REDIS_PORT_9')) : null,\n      ))),\n    ),\n  );\n\n  if (getenv('REDIS_HOST_PASSWORD')) {\n    $CONFIG['redis.cluster']['password'] = (string) getenv('REDIS_HOST_PASSWORD');\n  }\n\n  if (getenv('REDIS_USER_AUTH')) {\n    $CONFIG['redis.cluster']['user'] = str_replace(\"&auth[]=\", \"\", getenv('REDIS_USER_AUTH'));\n  }\n\n  if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_REDIS')) {\n    $CONFIG['redis.cluster']['ssl_context']['cafile'] = '/var/www/html/data/certificates/ca-bundle.crt';\n  }\n}\n"
  },
  {
    "path": "Containers/nextcloud/config/reverse-proxy.config.php",
    "content": "<?php\n$overwriteHost = getenv('OVERWRITEHOST');\nif ($overwriteHost) {\n  $CONFIG['overwritehost'] = $overwriteHost;\n}\n\n$overwriteProtocol = getenv('OVERWRITEPROTOCOL');\nif ($overwriteProtocol) {\n  $CONFIG['overwriteprotocol'] = $overwriteProtocol;\n}\n\n$overwriteWebRoot = getenv('OVERWRITEWEBROOT');\nif ($overwriteWebRoot) {\n  $CONFIG['overwritewebroot'] = $overwriteWebRoot;\n}\n\n$overwriteCondAddr = getenv('OVERWRITECONDADDR');\nif ($overwriteCondAddr) {\n  $CONFIG['overwritecondaddr'] = $overwriteCondAddr;\n}\n"
  },
  {
    "path": "Containers/nextcloud/config/s3.config.php",
    "content": "<?php\r\nif (getenv('OBJECTSTORE_S3_BUCKET')) {\r\n  $use_ssl = getenv('OBJECTSTORE_S3_SSL');\r\n  $use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');\r\n  $use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');\r\n  $autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');\r\n  $multibucket = getenv('OBJECTSTORE_S3_MULTIBUCKET');\r\n  $CONFIG = array(\r\n    'objectstore' => array(\r\n      'class' => '\\OC\\Files\\ObjectStore\\S3',\r\n      'arguments' => array(\r\n        'multibucket' => $multibucket === 'true',\r\n        'num_buckets' => (int)getenv('OBJECTSTORE_S3_NUM_BUCKETS') ?: 64,\r\n        'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),\r\n        'key' => getenv('OBJECTSTORE_S3_KEY') ?: '',\r\n        'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '',\r\n        'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',\r\n        'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',\r\n        'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',\r\n        'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',\r\n        'objectPrefix' => getenv(\"OBJECTSTORE_S3_OBJECT_PREFIX\") ? getenv(\"OBJECTSTORE_S3_OBJECT_PREFIX\") : \"urn:oid:\",\r\n        'autocreate' => strtolower($autocreate) !== 'false',\r\n        'use_ssl' => strtolower($use_ssl) !== 'false',\r\n        // required for some non Amazon S3 implementations\r\n        'use_path_style' => strtolower($use_path) === 'true',\r\n        // required for older protocol versions\r\n        'legacy_auth' => strtolower($use_legacyauth) === 'true',\r\n        'use_nextcloud_bundle' => 1,\r\n      )\r\n    )\r\n  );\r\n\r\n  $sse_c_key = getenv('OBJECTSTORE_S3_SSE_C_KEY');\r\n  if ($sse_c_key) {\r\n    $CONFIG['objectstore']['arguments']['sse_c_key'] = $sse_c_key;\r\n  }\r\n\r\n  $requestChecksumValidation = getenv('OBJECTSTORE_S3_REQUEST_CHECKSUM_VALIDATION');\r\n  if ($requestChecksumValidation) {\r\n    $CONFIG['objectstore']['arguments']['request_checksum_calculation'] = $requestChecksumValidation;\r\n  }\r\n\r\n  $responseChecksumValidation = getenv('OBJECTSTORE_S3_RESPONSE_CHECKSUM_VALIDATION');\r\n  if ($responseChecksumValidation) {\r\n    $CONFIG['objectstore']['arguments']['response_checksum_validation'] = $responseChecksumValidation;\r\n  }\r\n}\r\n"
  },
  {
    "path": "Containers/nextcloud/config/smtp.config.php",
    "content": "<?php\nif (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {\n  $CONFIG = array (\n    'mail_smtpmode' => 'smtp',\n    'mail_smtphost' => getenv('SMTP_HOST'),\n    'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),\n    'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',\n    'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'),\n    'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',\n    'mail_smtpname' => getenv('SMTP_NAME') ?: '',\n    'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),\n    'mail_domain' => getenv('MAIL_DOMAIN'),\n  );\n\n  if (getenv('SMTP_PASSWORD')) {\n      $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD');\n  } else {\n      $CONFIG['mail_smtppassword'] = '';\n  }\n}\n\nif (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_MAILER')) {\n  $CONFIG = array(\n    'mail_smtpstreamoptions' => array(\n      'ssl' => array(\n        'verify_peer_name' => false,\n        'cafile' => '/var/www/html/data/certificates/ca-bundle.crt',\n      )\n    )\n  );\n}\n"
  },
  {
    "path": "Containers/nextcloud/config/swift.config.php",
    "content": "<?php\r\nif (getenv('OBJECTSTORE_SWIFT_URL')) {\r\n    $autocreate = getenv('OBJECTSTORE_SWIFT_AUTOCREATE');\r\n  $CONFIG = array(\r\n    'objectstore' => [\r\n      'class' => 'OC\\\\Files\\\\ObjectStore\\\\Swift',\r\n      'arguments' => [\r\n        'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false',\r\n        'user' => [\r\n          'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'),\r\n          'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'),\r\n          'domain' => [\r\n            'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default',\r\n          ],\r\n        ],\r\n        'scope' => [\r\n          'project' => [\r\n            'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'),\r\n            'domain' => [\r\n              'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default',\r\n            ],\r\n          ],\r\n        ],\r\n        'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift',\r\n        'region' => getenv('OBJECTSTORE_SWIFT_REGION'),\r\n        'url' => getenv('OBJECTSTORE_SWIFT_URL'),\r\n        'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'),\r\n      ]\r\n    ]\r\n  );\r\n}\r\n"
  },
  {
    "path": "Containers/nextcloud/cron.sh",
    "content": "#!/bin/bash\nwait_for_cron() {\n    set -x\n    while [ -n \"$(pgrep -f /var/www/html/cron.php)\" ]; do\n        echo \"Waiting for cron to stop...\"\n        sleep 5\n    done\n    echo \"Cronjob successfully exited.\"\n    exit\n}\n\ntrap wait_for_cron SIGINT SIGTERM\n\nwhile true; do\n    php -f /var/www/html/cron.php &\n    sleep 5m &\n    wait $!\ndone\n"
  },
  {
    "path": "Containers/nextcloud/entrypoint.sh",
    "content": "#!/bin/bash\n\n# version_greater A B returns whether A > B\nversion_greater() {\n    [ \"$(printf '%s\\n' \"$@\" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)\" != \"$1\" ]\n}\n\n# return true if specified directory is empty\ndirectory_empty() {\n    [ -z \"$(ls -A \"$1/\")\" ]\n}\n\nrun_upgrade_if_needed_due_to_app_update() {\n    if php /var/www/html/occ status | grep maintenance | grep -q true; then\n        php /var/www/html/occ maintenance:mode --off\n    fi\n    if php /var/www/html/occ status | grep needsDbUpgrade | grep -q true; then\n        php /var/www/html/occ upgrade\n        php /var/www/html/occ app:enable nextcloud-aio --force\n    fi\n}\n\n# Create cert bundle\nif env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then\n\n    # Enable debug mode\n    set -x\n\n    # Default vars\n    CERTIFICATES_ROOT_DIR=\"/var/www/html/data/certificates\"\n    CERTIFICATE_BUNDLE=\"/var/www/html/data/certificates/ca-bundle.crt\"\n    \n    # Remove old root certs and recreate them with current ones\n    rm -rf \"$CERTIFICATES_ROOT_DIR\"\n    mkdir -p \"$CERTIFICATES_ROOT_DIR\"\n\n    # Retrieve default root cert bundle\n    if ! [ -f \"$SOURCE_LOCATION/resources/config/ca-bundle.crt\" ]; then\n        echo \"Root ca-bundle not found. Only concattening configured NEXTCLOUD_TRUSTED_CERTIFICATES files!\"\n        # Recreate cert file\n        touch \"$CERTIFICATE_BUNDLE\"\n    else\n        # Write default bundle to the target ca file\n        cat \"$SOURCE_LOCATION/resources/config/ca-bundle.crt\" > \"$CERTIFICATE_BUNDLE\"\n    fi\n\n    # Iterate through certs\n    TRUSTED_CERTIFICATES=\"$(env | grep NEXTCLOUD_TRUSTED_CERTIFICATES_ | grep -oP '^[A-Z_a-z0-9]+')\"\n    mapfile -t TRUSTED_CERTIFICATES <<< \"$TRUSTED_CERTIFICATES\"\n    for certificate in \"${TRUSTED_CERTIFICATES[@]}\"; do\n\n        # Create new line\n        echo \"\" >> \"$CERTIFICATE_BUNDLE\"\n\n        # Check if variable is an actual cert\n        if echo \"${!certificate}\" | grep -q \"BEGIN CERTIFICATE\" && echo \"${!certificate}\" | grep -q \"END CERTIFICATE\"; then\n            # Write out cert to bundle\n            echo \"${!certificate}\" >> \"$CERTIFICATE_BUNDLE\"\n        fi\n\n        # Create file in cert dir for extra logic in other places\n        if ! [ -f \"$CERTIFICATES_ROOT_DIR/$CERTIFICATE_NAME\" ]; then\n            touch \"$CERTIFICATES_ROOT_DIR/$CERTIFICATE_NAME\"\n        fi\n\n    done\n\n    # Backwards compatibility with older instances\n    if [ -f \"/var/www/html/config/postgres.config.php\" ]; then\n        sed -i \"s|/var/www/html/data/certificates/POSTGRES|/var/www/html/data/certificates/ca-bundle.crt|\" /var/www/html/config/postgres.config.php\n        sed -i \"s|/var/www/html/data/certificates/MYSQL|/var/www/html/data/certificates/ca-bundle.crt|\" /var/www/html/config/postgres.config.php\n    fi\n\n    # Print out bundle one last time\n    cat \"$CERTIFICATE_BUNDLE\"\n\n    # Disable debug mode\n    set +x\nfi\n\n# Adjust DATABASE_TYPE to by Nextcloud supported value\nif [ \"$DATABASE_TYPE\" = postgres ]; then\n    export DATABASE_TYPE=pgsql\nfi\n\n# Only start container if Redis is accessible\n# shellcheck disable=SC2153\nwhile ! nc -z \"$REDIS_HOST\" \"$REDIS_PORT\"; do\n    echo \"Waiting for Redis to start...\"\n    sleep 5\ndone\n\n# Check permissions in ncdata\ntest_file=\"$NEXTCLOUD_DATA_DIR/this-is-a-test-file\"\ntouch \"$test_file\"\nif ! [ -f \"$test_file\" ]; then\n    echo \"The www-data user does not appear to have access rights to the data directory.\"\n    echo \"It is possible that the files are on a filesystem that does not support standard Linux permissions,\"\n    echo \"or the permissions simply need to be adjusted. Please change the permissions as described below.\"\n    echo \"Current permissions are:\"\n    stat -c \"%u:%g %a\" \"$NEXTCLOUD_DATA_DIR\"\n    echo \"(userID:groupID permissions)\"\n    echo \"They should be:\"\n    echo \"33:0 750\"\n    echo \"(userID:groupID permissions)\"\n    echo \"Also, ensure that all parent directories on the host of your chosen data directory are publicly readable.\"\n    echo \"For example: sudo chmod +r /mnt  (adjust this command as needed).\"\n    echo \"If you want to use a FUSE mount as the data directory, add 'allow_other' as an additional mount option.\"\n    echo \"For SMB/CIFS mounts as the data directory, see:\"\n    echo \"  https://github.com/nextcloud/all-in-one#can-i-use-a-cifssmb-share-as-nextclouds-datadir\"\n    exit 1\nfi\nrm -f \"$test_file\"\n\nif [ -f /var/www/html/version.php ]; then\n    # shellcheck disable=SC2016\n    installed_version=\"$(php -r 'require \"/var/www/html/version.php\"; echo implode(\".\", $OC_Version);')\"\nelse\n    installed_version=\"0.0.0.0\"\nfi\nif [ -f \"$SOURCE_LOCATION/version.php\" ]; then\n    # shellcheck disable=SC2016\n    image_version=\"$(php -r \"require '$SOURCE_LOCATION/version.php'; echo implode('.', \\$OC_Version);\")\"\nelse\n    image_version=\"$installed_version\"\nfi\n\n# unset admin password\nif [ \"$installed_version\" != \"0.0.0.0\" ]; then\n    unset ADMIN_PASSWORD\nfi\n\n# Don't start the container if Nextcloud is not compatible with the PHP version\nif [ -f \"/var/www/html/lib/versioncheck.php\" ] && ! php /var/www/html/lib/versioncheck.php; then\n    echo \"Your installed Nextcloud version is not compatible with the PHP version provided by this image.\"\n    echo \"This typically occurs when you restore an older Nextcloud backup that does not support the\"\n    echo \"PHP version included in this image.\"\n    echo \"Please restore a more recent backup that includes a compatible Nextcloud version.\"\n    echo \"If you do not have a more recent backup, refer to the manual upgrade documentation:\"\n    echo \"  https://github.com/nextcloud/all-in-one/blob/main/manual-upgrade.md\"\n    exit 1\nfi\n\n# Do not start the container if the last update failed\nif [ -f \"$NEXTCLOUD_DATA_DIR/update.failed\" ]; then\n    echo \"The last Nextcloud update failed.\"\n    echo \"Please restore from a backup and try again.\"\n    echo \"If you do not have a backup, you can delete the update.failed file in the data directory\"\n    echo \"to allow the container to start again.\"\n    exit 1\nfi\n\n# Do not start the container if the install failed\nif [ -f \"$NEXTCLOUD_DATA_DIR/install.failed\" ]; then\n    echo \"The initial Nextcloud installation failed.\"\n    echo \"For more information about what went wrong, check the logs above.\"\n    echo \"Please reset AIO properly and try again.\"\n    echo \"See:\"\n    echo \"  https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance\"\n    exit 1\nfi\n\n# Skip any update if Nextcloud was just restored\nif ! [ -f \"$NEXTCLOUD_DATA_DIR/skip.update\" ]; then\n    if version_greater \"$image_version\" \"$installed_version\"; then\n        # Check if it skips a major version\n        INSTALLED_MAJOR=\"${installed_version%%.*}\"\n        IMAGE_MAJOR=\"${image_version%%.*}\"\n        \n        if [ \"$installed_version\" != \"0.0.0.0\" ]; then\n            # Write output to logfile.\n            exec > >(tee -i \"/var/www/html/data/update.log\")\n            exec 2>&1\n        fi\n\n        if [ \"$installed_version\" != \"0.0.0.0\" ] && [ \"$((IMAGE_MAJOR - INSTALLED_MAJOR))\" -gt 1 ]; then\n# Do not skip major versions placeholder # Do not remove or change this line!\n# Do not skip major versions start # Do not remove or change this line!\n            set -ex\n            NEXT_MAJOR=\"$((INSTALLED_MAJOR + 1))\"\n            curl -fsSL -o nextcloud.tar.bz2 \"https://download.nextcloud.com/server/releases/latest-${NEXT_MAJOR}.tar.bz2\"\n            curl -fsSL -o nextcloud.tar.bz2.asc \"https://download.nextcloud.com/server/releases/latest-${NEXT_MAJOR}.tar.bz2.asc\"\n            GNUPGHOME=\"$(mktemp -d)\"\n            export GNUPGHOME\n            if ! gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; then\n                if ! gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 28806A878AE423A28372792ED75899B9A724937A; then\n                    curl -sSL https://nextcloud.com/nextcloud.asc | gpg --import\n                fi\n            fi\n            gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2\n            mkdir -p /usr/src/tmp\n            tar -xjf nextcloud.tar.bz2 -C /usr/src/tmp/\n            gpgconf --kill all\n            rm nextcloud.tar.bz2.asc nextcloud.tar.bz2\n            mkdir -p /usr/src/tmp/nextcloud/data\n            mkdir -p /usr/src/tmp/nextcloud/custom_apps\n            chmod +x /usr/src/tmp/nextcloud/occ\n            cp -r \"$SOURCE_LOCATION\"/config/* /usr/src/tmp/nextcloud/config/\n            mkdir -p /usr/src/tmp/nextcloud/apps/nextcloud-aio\n            cp -r \"$SOURCE_LOCATION\"/apps/nextcloud-aio/* /usr/src/tmp/nextcloud/apps/nextcloud-aio/\n            mv \"$SOURCE_LOCATION\" /usr/src/temp-nextcloud\n            mv /usr/src/tmp/nextcloud \"$SOURCE_LOCATION\"\n            rm -r /usr/src/tmp\n            rm -r /usr/src/temp-nextcloud\n            # shellcheck disable=SC2016\n            image_version=\"$(php -r \"require '$SOURCE_LOCATION/version.php'; echo implode('.', \\$OC_Version);\")\"\n            IMAGE_MAJOR=\"${image_version%%.*}\"\n            set +ex\n# Do not skip major versions end # Do not remove or change this line!\n        fi\n\n        if [ \"$installed_version\" != \"0.0.0.0\" ]; then\n# Check connection to appstore start # Do not remove or change this line!\n            while true; do\n                echo -e \"Checking connection to the app store...\"\n                APPSTORE_URL=\"https://apps.nextcloud.com/api/v1\"\n                if grep -q appstoreurl /var/www/html/config/config.php; then\n                    set -x\n                    APPSTORE_URL=\"$(grep appstoreurl /var/www/html/config/config.php | grep -oP 'https://.*v[0-9]+')\"\n                    set +x\n                fi\n                # 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\n                CURL_STATUS=\"$(curl -LI \"$APPSTORE_URL\"/apps.json -o /dev/null -w '%{http_code}\\n' -s)\"\n                if [[ \"$CURL_STATUS\" = \"200\" ]]\n                then\n                    echo \"App store is reachable.\"\n                    break\n                else\n                    echo \"Curl did not return a 200 status. Is the app store reachable?\"\n                    sleep 5\n                fi\n            done\n# Check connection to appstore end # Do not remove or change this line!\n\n            run_upgrade_if_needed_due_to_app_update\n\n            php /var/www/html/occ maintenance:mode --off\n\n            echo \"Getting and backing up the status of apps for later; this might take a while...\"\n            NC_APPS=\"$(find /var/www/html/custom_apps/ -type d -maxdepth 1 -mindepth 1 | sed 's|/var/www/html/custom_apps/||g')\"\n            if [ -z \"$NC_APPS\" ]; then\n                echo \"No apps detected. Aborting export of app status...\"\n                APPSTORAGE=\"no-export-done\"\n            else\n                mapfile -t NC_APPS_ARRAY <<< \"$NC_APPS\"\n                declare -Ag APPSTORAGE\n                echo \"Disabling apps before the update to make the update procedure safer. This can take a while...\"\n                for app in \"${NC_APPS_ARRAY[@]}\"; do\n                    if APPSTORAGE[$app]=\"$(php /var/www/html/occ config:app:get \"$app\" enabled)\"; then\n                        php /var/www/html/occ app:disable \"$app\"\n                    else\n                        APPSTORAGE[$app]=\"\"\n                        echo \"Not disabling $app because the occ command to get its enabled state failed.\"\n                    fi\n                done\n            fi\n\n            if [ \"$((IMAGE_MAJOR - INSTALLED_MAJOR))\" -eq 1 ]; then\n                php /var/www/html/occ config:system:delete app_install_overwrite\n            fi\n\n            php /var/www/html/occ app:update --all\n\n            run_upgrade_if_needed_due_to_app_update\n        fi\n\n        echo \"Initializing Nextcloud $image_version ...\"\n\n        # Copy over initial data from Nextcloud archive\n        rsync -rlD --delete \\\n            --exclude-from=/upgrade.exclude \\\n            \"$SOURCE_LOCATION/\" \\\n            /var/www/html/\n\n        # Copy custom_apps from Nextcloud archive\n        if ! directory_empty \"$SOURCE_LOCATION/custom_apps\"; then\n            set -x\n            for app in \"$SOURCE_LOCATION/custom_apps\"/*; do\n                app_id=\"$(basename \"$app\")\"\n                mkdir -p \"/var/www/html/custom_apps/$app_id\"\n                rsync -rlD --delete \\\n                    --include \"/$app_id/\" \\\n                    --exclude '/*' \\\n                    \"$SOURCE_LOCATION/custom_apps/\" \\\n                    /var/www/html/custom_apps/\n            done\n            set +x\n        fi\n\n        # Copy these from Nextcloud archive if they don't exist yet (i.e. new install)\n        for dir in config data custom_apps themes; do\n            if [ ! -d \"/var/www/html/$dir\" ] || directory_empty \"/var/www/html/$dir\"; then\n                rsync -rlD \\\n                    --include \"/$dir/\" \\\n                    --exclude '/*' \\\n                    \"$SOURCE_LOCATION/\" \\\n                    /var/www/html/\n            fi\n        done\n\n        rsync -rlD --delete \\\n            --include '/config/' \\\n            --exclude '/*' \\\n            --exclude '/config/CAN_INSTALL' \\\n            --exclude '/config/config.sample.php' \\\n            --exclude '/config/config.php' \\\n            \"$SOURCE_LOCATION/\" \\\n            /var/www/html/\n\n        rsync -rlD \\\n            --include '/version.php' \\\n            --exclude '/*' \\\n            \"$SOURCE_LOCATION/\" \\\n            /var/www/html/\n\n        echo \"Initializing finished\"\n\n        ################\n        # Fresh Install\n        ################\n        \n        if [ \"$installed_version\" = \"0.0.0.0\" ]; then\n            echo \"New Nextcloud instance.\"\n\n            # Write output to logfile.\n            mkdir -p /var/www/html/data\n            exec > >(tee -i \"/var/www/html/data/install.log\")\n            exec 2>&1\n\n            INSTALL_OPTIONS=(-n --admin-user \"$ADMIN_USER\" --admin-pass \"$ADMIN_PASSWORD\")\n            if [ -n \"${NEXTCLOUD_DATA_DIR}\" ]; then\n                INSTALL_OPTIONS+=(--data-dir \"$NEXTCLOUD_DATA_DIR\")\n            fi\n\n        # Skip the default permission check (we do our own)\n        cat > /var/www/html/config/datadir.permission.config.php <<'EOF'\n<?php\n    $CONFIG = array (\n        'check_data_directory_permissions' => false\n    );\nEOF\n\n            echo \"Installing with $DATABASE_TYPE database\"\n            # Set a default value for POSTGRES_PORT\n            if [ -z \"$POSTGRES_PORT\" ]; then\n                POSTGRES_PORT=5432\n            fi\n\n            # Add database options to INSTALL_OPTIONS\n            # shellcheck disable=SC2153\n            INSTALL_OPTIONS+=(\n                --database \"$DATABASE_TYPE\"\n                --database-name \"$POSTGRES_DB\"\n                --database-user \"$POSTGRES_USER\"\n                --database-pass \"$POSTGRES_PASSWORD\"\n                --database-host \"$POSTGRES_HOST\"\n                --database-port \"$POSTGRES_PORT\"\n            )\n            \n            echo \"Starting Nextcloud installation...\"\n            if ! php /var/www/html/occ maintenance:install \"${INSTALL_OPTIONS[@]}\"; then\n                echo \"Installation of Nextcloud failed!\"\n                touch \"$NEXTCLOUD_DATA_DIR/install.failed\"\n                exit 1\n            fi\n\n            # Try to force generation of appdata dir:\n            php /var/www/html/occ maintenance:repair\n\n            if [ -z \"$OBJECTSTORE_S3_BUCKET\" ] && [ -z \"$OBJECTSTORE_SWIFT_URL\" ]; then\n                max_retries=10\n                try=0\n                while [ -z \"$(find \"$NEXTCLOUD_DATA_DIR/\" -maxdepth 1 -mindepth 1 -type d -name \"appdata_*\")\" ] && [ \"$try\" -lt \"$max_retries\" ]; do\n                    echo \"Waiting for appdata to become available...\"\n                    try=$((try+1))\n                    sleep 10s\n                done\n\n                if [ \"$try\" -ge \"$max_retries\" ]; then\n                    echo \"Installation of Nextcloud failed!\"\n                    echo \"Installation errors: $(cat /var/www/html/data/nextcloud.log)\"\n                    touch \"$NEXTCLOUD_DATA_DIR/install.failed\"\n                    exit 1\n                fi\n            fi\n\n            # This autoconfig is not needed anymore and should be able to be overwritten by the user\n            rm /var/www/html/config/datadir.permission.config.php\n\n            # unset admin password\n            unset ADMIN_PASSWORD\n\n            # Enable the updatenotification app but disable its UI and server update notifications\n            php /var/www/html/occ config:system:set updatechecker --type=bool --value=false\n            php /var/www/html/occ config:app:set updatenotification notify_groups --value=\"[]\"\n\n# AIO update to latest start # Do not remove or change this line!\n            if [ \"$INSTALL_LATEST_MAJOR\" = yes ]; then\n                php /var/www/html/occ config:system:set updatedirectory --value=\"/nc-updater\"\n                INSTALLED_AT=\"$(php /var/www/html/occ config:app:get core installedat)\"\n                if [ -n \"${INSTALLED_AT}\" ]; then\n                    # Set the installdat to 00 which will allow to skip staging and install the next major directly\n                    # shellcheck disable=SC2001\n                    INSTALLED_AT=\"$(echo \"${INSTALLED_AT}\" | sed \"s|[0-9][0-9]$|00|\")\"\n                    php /var/www/html/occ config:app:set core installedat --value=\"${INSTALLED_AT}\" \n                fi\n                php /var/www/html/updater/updater.phar --no-interaction --no-backup\n                if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then\n                    echo \"Installation of Nextcloud failed!\"\n                    touch \"$NEXTCLOUD_DATA_DIR/install.failed\"\n                    exit 1\n                fi\n                # shellcheck disable=SC2016\n                installed_version=\"$(php -r 'require \"/var/www/html/version.php\"; echo implode(\".\", $OC_Version);')\"\n                INSTALLED_MAJOR=\"${installed_version%%.*}\"\n                IMAGE_MAJOR=\"${image_version%%.*}\"\n                # If a valid upgrade path, trigger the Nextcloud built-in Updater\n                if ! [ \"$INSTALLED_MAJOR\" -gt \"$IMAGE_MAJOR\" ]; then\n                    php /var/www/html/updater/updater.phar --no-interaction --no-backup\n                    if ! php /var/www/html/occ -V || php /var/www/html/occ status | grep maintenance | grep -q 'true'; then\n                        echo \"Installation of Nextcloud failed!\"\n                        # TODO: Add a hint here about what to do / where to look / updater.log? \n                        touch \"$NEXTCLOUD_DATA_DIR/install.failed\"\n                        exit 1\n                    fi\n                    # shellcheck disable=SC2016\n                    installed_version=\"$(php -r 'require \"/var/www/html/version.php\"; echo implode(\".\", $OC_Version);')\"\n                fi\n                php /var/www/html/occ config:system:set updatechecker --type=bool --value=true\n                php /var/www/html/occ app:enable nextcloud-aio --force\n                php /var/www/html/occ db:add-missing-columns\n                php /var/www/html/occ db:add-missing-primary-keys\n                yes | php /var/www/html/occ db:convert-filecache-bigint\n            fi\n# AIO update to latest end # Do not remove or change this line!\n\n            # Apply log settings\n            echo \"Applying default settings...\"\n            mkdir -p /var/www/html/data\n            php /var/www/html/occ config:system:set loglevel --value=\"2\" --type=integer\n            php /var/www/html/occ config:system:set log_type --value=\"file\"\n            php /var/www/html/occ config:system:set logfile --value=\"/var/www/html/data/nextcloud.log\"\n            php /var/www/html/occ config:system:set log_rotate_size --value=\"10485760\" --type=integer\n            php /var/www/html/occ app:enable admin_audit\n            php /var/www/html/occ config:app:set admin_audit logfile --value=\"/var/www/html/data/audit.log\"\n            php /var/www/html/occ config:system:set log.condition apps 0 --value=\"admin_audit\"\n\n            # Apply preview settings\n            echo \"Applying preview settings...\"\n            php /var/www/html/occ config:system:set preview_max_x --value=\"2048\" --type=integer\n            php /var/www/html/occ config:system:set preview_max_y --value=\"2048\" --type=integer\n            php /var/www/html/occ config:system:set jpeg_quality --value=\"60\" --type=integer\n            php /var/www/html/occ config:app:set preview jpeg_quality --value=\"60\"\n            php /var/www/html/occ config:system:delete enabledPreviewProviders\n            php /var/www/html/occ config:system:set enabledPreviewProviders 1 --value=\"OC\\\\Preview\\\\Image\"\n            php /var/www/html/occ config:system:set enabledPreviewProviders 2 --value=\"OC\\\\Preview\\\\MarkDown\"\n            php /var/www/html/occ config:system:set enabledPreviewProviders 3 --value=\"OC\\\\Preview\\\\MP3\"\n            php /var/www/html/occ config:system:set enabledPreviewProviders 4 --value=\"OC\\\\Preview\\\\TXT\"\n            php /var/www/html/occ config:system:set enabledPreviewProviders 5 --value=\"OC\\\\Preview\\\\OpenDocument\"\n            php /var/www/html/occ config:system:set enabledPreviewProviders 6 --value=\"OC\\\\Preview\\\\Movie\"\n            php /var/www/html/occ config:system:set enabledPreviewProviders 7 --value=\"OC\\\\Preview\\\\Krita\"\n            php /var/www/html/occ config:system:set enable_previews --value=true --type=boolean\n\n            # Apply other settings\n            echo \"Applying other settings...\"\n            # Add missing indices after new installation because they seem to be missing on new installation\n            php /var/www/html/occ db:add-missing-indices\n            php /var/www/html/occ config:system:set upgrade.disable-web --type=bool --value=true\n            php /var/www/html/occ config:system:set mail_smtpmode --value=\"smtp\"\n            php /var/www/html/occ config:system:set trashbin_retention_obligation --value=\"auto, 30\"\n            php /var/www/html/occ config:system:set versions_retention_obligation --value=\"auto, 30\"\n            php /var/www/html/occ config:system:set activity_expire_days --value=\"30\" --type=integer\n            php /var/www/html/occ config:system:set simpleSignUpLink.shown --type=bool --value=false\n            php /var/www/html/occ config:system:set share_folder --value=\"/Shared\"\n\n            # Install some apps by default\n            if [ -n \"$STARTUP_APPS\" ]; then\n                read -ra STARTUP_APPS_ARRAY <<< \"$STARTUP_APPS\"\n                for app in \"${STARTUP_APPS_ARRAY[@]}\"; do\n                    if ! echo \"$app\" | grep -q '^-'; then \n                        if [ -z \"$(find /var/www/html/apps /var/www/html/custom_apps -type d -maxdepth 1 -mindepth 1 -name \"$app\" )\" ]; then\n                            # If not shipped, install and enable the app\n                            php /var/www/html/occ app:install \"$app\"\n                        else\n                            # If shipped, enable the app\n                            php /var/www/html/occ app:enable \"$app\"\n                        fi\n                    else\n                        app=\"${app#-}\"\n                        # Disable the app if '-' was provided in front of the appid\n                        php /var/www/html/occ app:disable \"$app\"\n                    fi\n                done\n            fi\n\n        #upgrade\n        else\n            touch \"$NEXTCLOUD_DATA_DIR/update.failed\"\n            echo \"Upgrading Nextcloud from $installed_version to $image_version...\"\n            php /var/www/html/occ config:system:delete integrity.check.disabled\n            if ! php /var/www/html/occ upgrade || ! php /var/www/html/occ -V; then\n                echo \"Upgrade failed. Please restore from backup.\"\n                bash /notify.sh \"Nextcloud update to $image_version failed!\" \"Please restore from backup.\"\n                exit 1\n            fi\n\n            # shellcheck disable=SC2016\n            installed_version=\"$(php -r 'require \"/var/www/html/version.php\"; echo implode(\".\", $OC_Version);')\"\n\n            rm \"$NEXTCLOUD_DATA_DIR/update.failed\"\n            bash /notify.sh \"Nextcloud update to $image_version successful!\" \"You may inspect the Nextcloud container logs for more information.\"\n\n            php /var/www/html/occ app:update --all\n\n            run_upgrade_if_needed_due_to_app_update\n\n            # Restore app status\n            if [ \"${APPSTORAGE[0]}\" != \"no-export-done\" ]; then\n                echo \"Restoring app statuses. This may take a while...\"\n                for app in \"${!APPSTORAGE[@]}\"; do\n                    if [ -n \"${APPSTORAGE[$app]}\" ]; then\n                        if [ \"${APPSTORAGE[$app]}\" != \"no\" ]; then\n                            echo \"Enabling $app...\"\n                            if ! php /var/www/html/occ app:enable \"$app\" >/dev/null; then\n                                php /var/www/html/occ app:disable \"$app\" >/dev/null\n                                if ! php /var/www/html/occ -V &>/dev/null; then\n                                    rm -r \"/var/www/html/custom_apps/$app\"\n                                    php /var/www/html/occ maintenance:mode --off\n                                fi\n                                run_upgrade_if_needed_due_to_app_update\n                                echo \"The $app app could not be re-enabled, probably because it is not compatible with the new Nextcloud version.\"\n                                if [ \"$app\" = apporder ]; then\n                                    CUSTOM_HINT=\"The apporder app was deprecated. A possible replacement is the side_menu app, aka 'Custom menu'.\"\n                                else\n                                    CUSTOM_HINT=\"Most likely, it is not compatible with the new Nextcloud version.\"\n                                fi\n                                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.\"\n                                continue\n                            fi\n                            # Only restore the group settings, if the app was enabled (and is thus compatible with the new NC version)\n                            if [ \"${APPSTORAGE[$app]}\" != \"yes\" ]; then\n                                php /var/www/html/occ config:app:set \"$app\" enabled --value=\"${APPSTORAGE[$app]}\"\n                            fi\n                        fi\n                    fi\n                done\n            fi\n\n            php /var/www/html/occ app:update --all\n\n            run_upgrade_if_needed_due_to_app_update\n\n            # Enable the updatenotification app but disable its UI and server update notifications\n            php /var/www/html/occ config:system:set updatechecker --type=bool --value=false\n            php /var/www/html/occ app:enable updatenotification\n            php /var/www/html/occ config:app:set updatenotification notify_groups --value=\"[]\"\n\n            # Apply optimization\n            echo \"Performing some optimizations...\"\n            if [ \"$NEXTCLOUD_SKIP_DATABASE_OPTIMIZATION\" != yes ]; then\n                php /var/www/html/occ maintenance:repair --include-expensive\n                php /var/www/html/occ db:add-missing-indices\n                php /var/www/html/occ db:add-missing-columns\n                php /var/www/html/occ db:add-missing-primary-keys\n                yes | php /var/www/html/occ db:convert-filecache-bigint\n            else\n                php /var/www/html/occ maintenance:repair\n            fi\n        fi\n    fi\n\n    # Performing update of all apps if daily backups are enabled, running and successful and if it is saturday\n    if [ \"$UPDATE_NEXTCLOUD_APPS\" = 'yes' ] && [ \"$(date +%u)\" = 6 ]; then\n        UPDATED_APPS=\"$(php /var/www/html/occ app:update --all)\"\n        run_upgrade_if_needed_due_to_app_update\n        if [ -n \"$UPDATED_APPS\" ]; then\n             bash /notify.sh \"Your apps just got updated!\" \"$UPDATED_APPS\"\n        fi\n    fi\nelse\n    SKIP_UPDATE=1\nfi\n\nrun_upgrade_if_needed_due_to_app_update\n\nif [ -z \"$OBJECTSTORE_S3_BUCKET\" ] && [ -z \"$OBJECTSTORE_SWIFT_URL\" ]; then\n    # Check if appdata is present\n    # If not, something broke (e.g. changing ncdatadir after aio was first started)\n    if [ -z \"$(find \"$NEXTCLOUD_DATA_DIR/\" -maxdepth 1 -mindepth 1 -type d -name \"appdata_*\")\" ]; then\n        echo \"Appdata is not present. Did you change the datadir after the initial Nextcloud installation? This is not supported!\"\n        echo \"See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir\"\n        echo \"If you moved the datadir to an external drive, make sure that the drive is still mounted.\"\n        echo \"The following was found in the datadir:\"\n        ls -la \"$NEXTCLOUD_DATA_DIR/\"\n        exit 1\n    fi\n\n    # Delete formerly configured tempdirectory as the default is usually faster (if the datadir is on a HDD or network FS)\n    if [ \"$(php /var/www/html/occ config:system:get tempdirectory)\" = \"$NEXTCLOUD_DATA_DIR/tmp/\" ]; then\n        php /var/www/html/occ config:system:delete tempdirectory\n        if [ -d \"$NEXTCLOUD_DATA_DIR/tmp/\" ]; then\n            rm -r \"$NEXTCLOUD_DATA_DIR/tmp/\"\n        fi\n    fi\n\nfi\n\n# Perform fingerprint update if instance was restored\nif [ -f \"$NEXTCLOUD_DATA_DIR/fingerprint.update\" ]; then\n    php /var/www/html/occ maintenance:data-fingerprint\n    rm \"$NEXTCLOUD_DATA_DIR/fingerprint.update\"\nfi\n\n# Perform preview scan if previews were excluded from restore\nif [ -f \"$NEXTCLOUD_DATA_DIR/trigger-preview.scan\" ]; then\n    php /var/www/html/occ files:scan-app-data preview -vvv\n    rm \"$NEXTCLOUD_DATA_DIR/trigger-preview.scan\"\nfi\n\n# AIO one-click settings start # Do not remove or change this line!\n# Apply one-click-instance settings\necho \"Applying one-click-instance settings...\"\nphp /var/www/html/occ config:system:set one-click-instance --value=true --type=bool\nphp /var/www/html/occ config:system:set one-click-instance.user-limit --value=100 --type=int\nphp /var/www/html/occ config:system:set one-click-instance.link --value=\"https://nextcloud.com/all-in-one/\"\n# AIO one-click settings end # Do not remove or change this line!\nphp /var/www/html/occ app:enable support\nif [ -n \"$SUBSCRIPTION_KEY\" ] && [ -z \"$(php /var/www/html/occ config:app:get support potential_subscription_key)\" ]; then\n    php /var/www/html/occ config:app:set support potential_subscription_key --value=\"$SUBSCRIPTION_KEY\"\n    php /var/www/html/occ config:app:delete support last_check\nfi\nif [ -n \"$NEXTCLOUD_DEFAULT_QUOTA\" ]; then\n    if [ \"$NEXTCLOUD_DEFAULT_QUOTA\" = \"unlimited\" ]; then\n        php /var/www/html/occ config:app:delete files default_quota\n    else\n        php /var/www/html/occ config:app:set files default_quota --value=\"$NEXTCLOUD_DEFAULT_QUOTA\"\n    fi\nfi\n\n# Adjusting log files to be stored on a volume\necho \"Adjusting log files...\"\nphp /var/www/html/occ config:system:set upgrade.cli-upgrade-link --value=\"https://github.com/nextcloud/all-in-one/discussions/2726\"\nphp /var/www/html/occ config:system:set logfile --value=\"/var/www/html/data/nextcloud.log\"\nphp /var/www/html/occ config:app:set admin_audit logfile --value=\"/var/www/html/data/audit.log\"\nphp /var/www/html/occ config:system:set updatedirectory --value=\"/nc-updater\"\nif [ -n \"$NEXTCLOUD_SKELETON_DIRECTORY\" ]; then\n    if [ \"$NEXTCLOUD_SKELETON_DIRECTORY\" = \"empty\" ]; then\n        php /var/www/html/occ config:system:set skeletondirectory --value=\"\"\n    else\n        php /var/www/html/occ config:system:set skeletondirectory --value=\"$NEXTCLOUD_SKELETON_DIRECTORY\"\n    fi\nfi\nif [ -n \"$SERVERINFO_TOKEN\" ] && [ -z \"$(php /var/www/html/occ config:app:get serverinfo token)\" ]; then\n    php /var/www/html/occ config:app:set serverinfo token --value=\"$SERVERINFO_TOKEN\"\nfi\n# Set maintenance window so that no warning is shown in the admin overview\nif [ -z \"$NEXTCLOUD_MAINTENANCE_WINDOW\" ]; then\n    NEXTCLOUD_MAINTENANCE_WINDOW=100\nfi\nphp /var/www/html/occ config:system:set maintenance_window_start --type=int --value=\"$NEXTCLOUD_MAINTENANCE_WINDOW\"\n\n# Apply network settings\necho \"Applying network settings...\"\nphp /var/www/html/occ config:system:set allow_local_remote_servers --type=bool --value=true\nphp /var/www/html/occ config:system:set davstorage.request_timeout --value=\"$PHP_MAX_TIME\" --type=int\nphp /var/www/html/occ config:system:set trusted_domains 1 --value=\"$NC_DOMAIN\"\nphp /var/www/html/occ config:system:set overwrite.cli.url --value=\"https://$NC_DOMAIN/\"\nphp /var/www/html/occ config:system:set documentation_url.server_logs --value=\"https://github.com/nextcloud/all-in-one/discussions/5425\"\nphp /var/www/html/occ config:system:set htaccess.RewriteBase --value=\"/\"\nphp /var/www/html/occ maintenance:update:htaccess\n\n# Handle db persistent settings\nif [ \"$NEXTCLOUD_PERSIST_DATABASE_CONNECTIONS\" = \"yes\" ]; then\n    php /var/www/html/occ config:system:set dbpersistent --value=true --type=bool\nelse\n    php /var/www/html/occ config:system:set dbpersistent --value=false --type=bool\nfi\n\nif [ \"$DISABLE_BRUTEFORCE_PROTECTION\" = yes ]; then\n    php /var/www/html/occ config:system:set auth.bruteforce.protection.enabled --type=bool --value=false\n    php /var/www/html/occ config:system:set ratelimit.protection.enabled --type=bool --value=false\nelse\n    php /var/www/html/occ config:system:set auth.bruteforce.protection.enabled --type=bool --value=true\n    php /var/www/html/occ config:system:set ratelimit.protection.enabled --type=bool --value=true\nfi\n\n# Disallow creating local external storages when nothing was mounted\nif [ -z \"$NEXTCLOUD_MOUNT\" ]; then\n    php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=false\nelse\n    php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=true\nfi\n\n# AIO app start # Do not remove or change this line!\n# AIO app\nif [ \"$THIS_IS_AIO\" = \"true\" ]; then\n    if [ \"$(php /var/www/html/occ config:app:get nextcloud-aio enabled)\" != \"yes\" ]; then\n        php /var/www/html/occ app:enable nextcloud-aio\n    fi\nelse\n    if [ \"$(php /var/www/html/occ config:app:get nextcloud-aio enabled)\" != \"no\" ]; then\n        php /var/www/html/occ app:disable nextcloud-aio\n    fi\nfi\n# AIO app end # Do not remove or change this line!\n\n# Notify push\nif ! [ -d \"/var/www/html/custom_apps/notify_push\" ]; then\n    php /var/www/html/occ app:install notify_push\nelif [ \"$(php /var/www/html/occ config:app:get notify_push enabled)\" != \"yes\" ]; then\n    php /var/www/html/occ app:enable notify_push\nelif [ \"$SKIP_UPDATE\" != 1 ]; then\n    php /var/www/html/occ app:update notify_push\nfi\nchmod 775 -R /var/www/html/custom_apps/notify_push/bin/\nphp /var/www/html/occ config:system:set trusted_proxies 0 --value=\"127.0.0.1\"\nphp /var/www/html/occ config:system:set trusted_proxies 1 --value=\"::1\"\nif [ -n \"$ADDITIONAL_TRUSTED_PROXY\" ]; then\n    php /var/www/html/occ config:system:set trusted_proxies 2 --value=\"$ADDITIONAL_TRUSTED_PROXY\"\nfi\n\n# Get ipv4-address of Nextcloud\nif [ -z \"$NEXTCLOUD_HOST\" ]; then\n    export NEXTCLOUD_HOST=\"nextcloud-aio-nextcloud\"\nfi\nIPv4_ADDRESS=\"$(dig \"$NEXTCLOUD_HOST\" A +short +search | head -1)\" \n# Bring it in CIDR notation \n# shellcheck disable=SC2001\nIPv4_ADDRESS=\"$(echo \"$IPv4_ADDRESS\" | sed 's|[0-9]\\+$|0/16|')\" \nif [ -n \"$IPv4_ADDRESS\" ]; then\n    php /var/www/html/occ config:system:set trusted_proxies 10 --value=\"$IPv4_ADDRESS\"\nfi\n\nif [ -n \"$ADDITIONAL_TRUSTED_DOMAIN\" ]; then\n    php /var/www/html/occ config:system:set trusted_domains 2 --value=\"$ADDITIONAL_TRUSTED_DOMAIN\"\nfi\nphp /var/www/html/occ config:app:set notify_push base_endpoint --value=\"https://$NC_DOMAIN/push\"\n\n# Collabora\nif [ \"$COLLABORA_ENABLED\" = 'yes' ]; then\n    set -x\n    if echo \"$COLLABORA_HOST\" | grep -q \"nextcloud-.*-collabora\"; then\n        COLLABORA_HOST=\"$NC_DOMAIN\"\n    fi\n    set +x\n    # Remove richdcoumentscode if it should be incorrectly installed\n    if [ -d \"/var/www/html/custom_apps/richdocumentscode\" ]; then\n        php /var/www/html/occ app:remove richdocumentscode\n    fi\n    if ! [ -d \"/var/www/html/custom_apps/richdocuments\" ]; then\n        php /var/www/html/occ app:install richdocuments\n    elif [ \"$(php /var/www/html/occ config:app:get richdocuments enabled)\" != \"yes\" ]; then\n        php /var/www/html/occ app:enable richdocuments\n    elif [ \"$SKIP_UPDATE\" != 1 ]; then\n        php /var/www/html/occ app:update richdocuments\n    fi\n    php /var/www/html/occ config:app:set richdocuments wopi_url --value=\"https://$COLLABORA_HOST/\"\n    # Make collabora more save\n    COLLABORA_IPv4_ADDRESS=\"$(dig \"$COLLABORA_HOST\" A +short +search | grep '^[0-9.]\\+$' | sort | head -n1)\"\n    COLLABORA_IPv6_ADDRESS=\"$(dig \"$COLLABORA_HOST\" AAAA +short +search | grep '^[0-9a-f:]\\+$' | sort | head -n1)\"\n    COLLABORA_ALLOW_LIST=\"$(php /var/www/html/occ config:app:get richdocuments wopi_allowlist)\"\n    if [ -n \"$COLLABORA_IPv4_ADDRESS\" ]; then\n        if ! echo \"$COLLABORA_ALLOW_LIST\" | grep -q \"$COLLABORA_IPv4_ADDRESS\"; then\n            if [ -z \"$COLLABORA_ALLOW_LIST\" ]; then\n                COLLABORA_ALLOW_LIST=\"$COLLABORA_IPv4_ADDRESS\"\n            else\n                COLLABORA_ALLOW_LIST+=\",$COLLABORA_IPv4_ADDRESS\"\n            fi\n        fi\n    else\n        echo \"Warning: No IPv4 address found for $COLLABORA_HOST.\"\n    fi\n    if [ -n \"$COLLABORA_IPv6_ADDRESS\" ]; then\n        if ! echo \"$COLLABORA_ALLOW_LIST\" | grep -q \"$COLLABORA_IPv6_ADDRESS\"; then\n            if [ -z \"$COLLABORA_ALLOW_LIST\" ]; then\n                COLLABORA_ALLOW_LIST=\"$COLLABORA_IPv6_ADDRESS\"\n            else\n                COLLABORA_ALLOW_LIST+=\",$COLLABORA_IPv6_ADDRESS\"\n            fi\n        fi\n    else\n        echo \"No IPv6 address found for $COLLABORA_HOST.\"\n    fi\n    if [ -n \"$COLLABORA_ALLOW_LIST\" ]; then\n        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'\n        if ! echo \"$COLLABORA_ALLOW_LIST\" | grep -q \"$PRIVATE_IP_RANGES\"; then\n            COLLABORA_ALLOW_LIST+=\",$PRIVATE_IP_RANGES\"\n        fi\n        if [ -n \"$ADDITIONAL_TRUSTED_PROXY\" ]; then\n            if ! echo \"$COLLABORA_ALLOW_LIST\" | grep -q \"$ADDITIONAL_TRUSTED_PROXY\"; then\n                COLLABORA_ALLOW_LIST+=\",$ADDITIONAL_TRUSTED_PROXY\"\n            fi\n        fi\n        php /var/www/html/occ config:app:set richdocuments wopi_allowlist --value=\"$COLLABORA_ALLOW_LIST\"\n    else\n        echo \"Warning: wopi_allowlist is empty; this should not be the case!\"\n    fi\nelse\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ] && [ -d \"/var/www/html/custom_apps/richdocuments\" ]; then\n        php /var/www/html/occ app:remove richdocuments\n    fi\nfi\n\n# OnlyOffice\nif [ \"$ONLYOFFICE_ENABLED\" = 'yes' ]; then\n    # Determine OnlyOffice port based on host pattern\n    if echo \"$ONLYOFFICE_HOST\" | grep -q \"nextcloud-.*-onlyoffice\"; then\n        ONLYOFFICE_PORT=80\n    else\n        ONLYOFFICE_PORT=443\n    fi\n\n    count=0\n    while ! nc -z \"$ONLYOFFICE_HOST\" \"$ONLYOFFICE_PORT\" && [ \"$count\" -lt 90 ]; do\n        echo \"Waiting for OnlyOffice to become available...\"\n        count=$((count+5))\n        sleep 5\n    done\n    if [ \"$count\" -ge 90 ]; then\n        bash /notify.sh \"Onlyoffice did not start in time!\" \"Skipping initialization and disabling onlyoffice app.\"\n        php /var/www/html/occ app:disable onlyoffice\n    else\n        # Install or enable OnlyOffice app as needed\n        if ! [ -d \"/var/www/html/custom_apps/onlyoffice\" ]; then\n            php /var/www/html/occ app:install onlyoffice\n        elif [ \"$(php /var/www/html/occ config:app:get onlyoffice enabled)\" != \"yes\" ]; then\n            php /var/www/html/occ app:enable onlyoffice\n        elif [ \"$SKIP_UPDATE\" != 1 ]; then\n            php /var/www/html/occ app:update onlyoffice\n        fi\n\n        # Set OnlyOffice configuration\n        php /var/www/html/occ config:system:set onlyoffice editors_check_interval --value=\"0\" --type=integer \n        php /var/www/html/occ config:system:set onlyoffice jwt_secret --value=\"$ONLYOFFICE_SECRET\"\n        php /var/www/html/occ config:app:set onlyoffice jwt_secret --value=\"$ONLYOFFICE_SECRET\"\n        php /var/www/html/occ config:system:set onlyoffice jwt_header --value=\"AuthorizationJwt\"\n\n        # Adjust the OnlyOffice host if using internal pattern\n        if echo \"$ONLYOFFICE_HOST\" | grep -q \"nextcloud-.*-onlyoffice\"; then\n            ONLYOFFICE_HOST=\"$NC_DOMAIN/onlyoffice\"\n            export ONLYOFFICE_HOST\n        fi\n\n        php /var/www/html/occ config:app:set onlyoffice DocumentServerUrl --value=\"https://$ONLYOFFICE_HOST\"\n    fi\nelse\n    # Remove OnlyOffice app if disabled and removal is requested\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ] && \\\n       [ -d \"/var/www/html/custom_apps/onlyoffice\" ] && \\\n       [ -n \"$ONLYOFFICE_SECRET\" ] && \\\n       [ \"$(php /var/www/html/occ config:system:get onlyoffice jwt_secret)\" = \"$ONLYOFFICE_SECRET\" ]; then\n        php /var/www/html/occ app:remove onlyoffice\n    fi\nfi\n\n# Talk\nif [ \"$TALK_ENABLED\" = 'yes' ]; then\n    set -x\n    if [ -z \"$TALK_HOST\" ] || echo \"$TALK_HOST\" | grep -q \"nextcloud-.*-talk\"; then\n        TALK_HOST=\"$NC_DOMAIN\"\n        HPB_PATH=\"/standalone-signaling/\"\n    fi\n    if [ -z \"$TURN_DOMAIN\" ]; then\n        TURN_DOMAIN=\"$TALK_HOST\"\n    fi\n    set +x\n    if ! [ -d \"/var/www/html/custom_apps/spreed\" ]; then\n        php /var/www/html/occ app:install spreed\n    elif [ \"$(php /var/www/html/occ config:app:get spreed enabled)\" != \"yes\" ]; then\n        php /var/www/html/occ app:enable spreed\n    elif [ \"$SKIP_UPDATE\" != 1 ]; then\n        php /var/www/html/occ app:update spreed\n    fi\n    # Based on https://github.com/nextcloud/spreed/issues/960#issuecomment-416993435\n    if [ -z \"$(php /var/www/html/occ talk:turn:list --output=\"plain\")\" ]; then\n        # shellcheck disable=SC2153\n        php /var/www/html/occ talk:turn:add turn \"$TURN_DOMAIN:$TALK_PORT\" \"udp,tcp\" --secret=\"$TURN_SECRET\"\n    fi\n    STUN_SERVER=\"$(php /var/www/html/occ talk:stun:list --output=\"plain\")\"\n    if [ -z \"$STUN_SERVER\" ] || echo \"$STUN_SERVER\" | grep -oP '[a-zA-Z.:0-9]+' | grep -q \"^stun.nextcloud.com:443$\"; then\n        php /var/www/html/occ talk:stun:add \"$TURN_DOMAIN:$TALK_PORT\"\n        php /var/www/html/occ talk:stun:delete \"stun.nextcloud.com:443\"\n    fi\n    if ! php /var/www/html/occ talk:signaling:list --output=\"plain\" | grep -q \"https://$TALK_HOST$HPB_PATH\"; then\n        php /var/www/html/occ talk:signaling:add \"https://$TALK_HOST$HPB_PATH\" \"$SIGNALING_SECRET\" --verify\n    fi\nelse\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ] && [ -d \"/var/www/html/custom_apps/spreed\" ]; then\n        php /var/www/html/occ app:remove spreed\n    fi\nfi\n\n# Talk recording\nif [ -d \"/var/www/html/custom_apps/spreed\" ]; then\n    if [ \"$TALK_RECORDING_ENABLED\" = 'yes' ]; then\n        while ! nc -z \"$TALK_RECORDING_HOST\" 1234; do\n            echo \"Waiting for Talk Recording to become available...\"\n            sleep 5\n        done\n        # TODO: migrate to occ command if that becomes available\n        RECORDING_SERVERS_STRING=\"{\\\"servers\\\":[{\\\"server\\\":\\\"http://$TALK_RECORDING_HOST:1234/\\\",\\\"verify\\\":true}],\\\"secret\\\":\\\"$RECORDING_SECRET\\\"}\"\n        php /var/www/html/occ config:app:set spreed recording_servers --value=\"$RECORDING_SERVERS_STRING\"\n    else\n        if [ \"$REMOVE_DISABLED_APPS\" = yes ]; then\n            php /var/www/html/occ config:app:delete spreed recording_servers\n        fi\n    fi\nfi\n\n# Clamav\nif [ \"$CLAMAV_ENABLED\" = 'yes' ]; then\n    count=0\n    while ! nc -z \"$CLAMAV_HOST\" 3310 && [ \"$count\" -lt 90 ]; do\n        echo \"Waiting for ClamAV to become available...\"\n        count=$((count+5))\n        sleep 5\n    done\n    if [ \"$count\" -ge 90 ]; then\n        bash /notify.sh \"ClamAV did not start in time!\" \"Skipping initialization and disabling files_antivirus app.\"\n        php /var/www/html/occ app:disable files_antivirus\n    else\n        if ! [ -d \"/var/www/html/custom_apps/files_antivirus\" ]; then\n            php /var/www/html/occ app:install files_antivirus\n        elif [ \"$(php /var/www/html/occ config:app:get files_antivirus enabled)\" != \"yes\" ]; then\n            php /var/www/html/occ app:enable files_antivirus\n        elif [ \"$SKIP_UPDATE\" != 1 ]; then\n            php /var/www/html/occ app:update files_antivirus\n        fi\n        php /var/www/html/occ config:app:set files_antivirus av_mode --value=\"daemon\"\n        php /var/www/html/occ config:app:set files_antivirus av_port --value=\"3310\"\n        php /var/www/html/occ config:app:set files_antivirus av_host --value=\"$CLAMAV_HOST\"\n        # av_stream_max_length must be synced with StreamMaxLength inside clamav\n        php /var/www/html/occ config:app:set files_antivirus av_stream_max_length --value=\"2147483648\"\n        php /var/www/html/occ config:app:set files_antivirus av_max_file_size --value=\"-1\"\n        php /var/www/html/occ config:app:set files_antivirus av_infected_action --value=\"only_log\"\n        if [ -n \"$CLAMAV_BLOCKLISTED_DIRECTORIES\" ]; then\n            php /var/www/html/occ config:app:set files_antivirus av_blocklisted_directories --value=\"$CLAMAV_BLOCKLISTED_DIRECTORIES\"\n        fi\n    fi\nelse\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ] && [ -d \"/var/www/html/custom_apps/files_antivirus\" ]; then\n        php /var/www/html/occ app:remove files_antivirus\n    fi\nfi\n\n# Imaginary\nif [ \"$IMAGINARY_ENABLED\" = 'yes' ]; then\n    php /var/www/html/occ config:system:set enabledPreviewProviders 0 --value=\"OC\\\\Preview\\\\Imaginary\"\n    php /var/www/html/occ config:system:set enabledPreviewProviders 23 --value=\"OC\\\\Preview\\\\ImaginaryPDF\"\n    php /var/www/html/occ config:system:set preview_imaginary_url --value=\"http://$IMAGINARY_HOST:9000\"\n    php /var/www/html/occ config:system:set preview_imaginary_key --value=\"$IMAGINARY_SECRET\"\nelse\n    if [ -n \"$(php /var/www/html/occ config:system:get preview_imaginary_url)\" ]; then\n        php /var/www/html/occ config:system:delete enabledPreviewProviders 0\n        php /var/www/html/occ config:system:delete preview_imaginary_url\n        php /var/www/html/occ config:system:delete enabledPreviewProviders 20\n        php /var/www/html/occ config:system:delete enabledPreviewProviders 21\n        php /var/www/html/occ config:system:delete enabledPreviewProviders 22\n        php /var/www/html/occ config:system:delete enabledPreviewProviders 23\n    fi\nfi\n\n# Fulltextsearch\nif [ \"$FULLTEXTSEARCH_ENABLED\" = 'yes' ]; then\n    count=0\n    while ! nc -z \"$FULLTEXTSEARCH_HOST\" \"$FULLTEXTSEARCH_PORT\" && [ \"$count\" -lt 90 ]; do\n        echo \"Waiting for Fulltextsearch to become available...\"\n        count=$((count+5))\n        sleep 5\n    done\n    if [ \"$count\" -ge 90 ]; then\n        echo \"Fulltextsearch did not start in time. Skipping initialization and disabling fulltextsearch apps.\"\n        php /var/www/html/occ app:disable fulltextsearch\n        php /var/www/html/occ app:disable fulltextsearch_elasticsearch\n        php /var/www/html/occ app:disable files_fulltextsearch\n    else\n        if [ -z \"$FULLTEXTSEARCH_PROTOCOL\" ]; then\n            FULLTEXTSEARCH_PROTOCOL=\"http\"\n        fi\n        if ! [ -d \"/var/www/html/custom_apps/fulltextsearch\" ]; then\n            php /var/www/html/occ app:install fulltextsearch\n        elif [ \"$(php /var/www/html/occ config:app:get fulltextsearch enabled)\" != \"yes\" ]; then\n            php /var/www/html/occ app:enable fulltextsearch\n        elif [ \"$SKIP_UPDATE\" != 1 ]; then\n            php /var/www/html/occ app:update fulltextsearch\n        fi    \n        if ! [ -d \"/var/www/html/custom_apps/fulltextsearch_elasticsearch\" ]; then\n            php /var/www/html/occ app:install fulltextsearch_elasticsearch\n        elif [ \"$(php /var/www/html/occ config:app:get fulltextsearch_elasticsearch enabled)\" != \"yes\" ]; then\n            php /var/www/html/occ app:enable fulltextsearch_elasticsearch\n        elif [ \"$SKIP_UPDATE\" != 1 ]; then\n            php /var/www/html/occ app:update fulltextsearch_elasticsearch\n        fi    \n        if ! [ -d \"/var/www/html/custom_apps/files_fulltextsearch\" ]; then\n            php /var/www/html/occ app:install files_fulltextsearch\n        elif [ \"$(php /var/www/html/occ config:app:get files_fulltextsearch enabled)\" != \"yes\" ]; then\n            php /var/www/html/occ app:enable files_fulltextsearch\n        elif [ \"$SKIP_UPDATE\" != 1 ]; then\n            php /var/www/html/occ app:update files_fulltextsearch\n        fi\n        php /var/www/html/occ fulltextsearch:configure '{\"search_platform\":\"OCA\\\\FullTextSearch_Elasticsearch\\\\Platform\\\\ElasticSearchPlatform\"}'\n        php /var/www/html/occ fulltextsearch_elasticsearch:configure \"{\\\"elastic_host\\\":\\\"$FULLTEXTSEARCH_PROTOCOL://$FULLTEXTSEARCH_USER:$FULLTEXTSEARCH_PASSWORD@$FULLTEXTSEARCH_HOST:$FULLTEXTSEARCH_PORT\\\",\\\"elastic_index\\\":\\\"$FULLTEXTSEARCH_INDEX\\\"}\"\n        php /var/www/html/occ files_fulltextsearch:configure \"{\\\"files_pdf\\\":true,\\\"files_office\\\":true}\"\n\n        # Do the index\n        if ! [ -f \"$NEXTCLOUD_DATA_DIR/fts-index.done\" ]; then\n            echo \"Waiting 10 seconds before activating fulltextsearch...\"\n            sleep 10\n            echo \"Activating fulltextsearch...\"\n            if php /var/www/html/occ fulltextsearch:test && php /var/www/html/occ fulltextsearch:index \"{\\\"errors\\\": \\\"reset\\\"}\" --no-readline; then\n                touch \"$NEXTCLOUD_DATA_DIR/fts-index.done\"\n            else\n                echo \"Fulltextsearch failed. Could not index.\"\n                echo \"If you want to skip indexing in the future, see https://github.com/nextcloud/all-in-one/discussions/1709\"\n            fi\n        fi\n    fi\nelse\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ]; then\n        if [ -d \"/var/www/html/custom_apps/fulltextsearch\" ]; then\n            php /var/www/html/occ app:remove fulltextsearch\n        fi\n        if [ -d \"/var/www/html/custom_apps/fulltextsearch_elasticsearch\" ]; then\n            php /var/www/html/occ app:remove fulltextsearch_elasticsearch\n        fi\n        if [ -d \"/var/www/html/custom_apps/files_fulltextsearch\" ]; then\n            php /var/www/html/occ app:remove files_fulltextsearch\n        fi\n    fi\nfi\n\n# Docker socket proxy / HaRP\n# app_api is a shipped app\nif [ -d \"/var/www/html/custom_apps/app_api\" ]; then\n    php /var/www/html/occ app:disable app_api\n    rm -r \"/var/www/html/custom_apps/app_api\"\nfi\nif [ \"$DOCKER_SOCKET_PROXY_ENABLED\" = 'yes' ] || [ \"$HARP_ENABLED\" = 'yes' ]; then\n    if [ \"$(php /var/www/html/occ config:app:get app_api enabled)\" != \"yes\" ]; then\n        php /var/www/html/occ app:enable app_api\n    fi\nelse\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ]; then\n        if [ \"$(php /var/www/html/occ config:app:get app_api enabled)\" != \"no\" ]; then\n            php /var/www/html/occ app:disable app_api\n        fi\n    fi\nfi\n\n# Whiteboard app\nif [ \"$WHITEBOARD_ENABLED\" = 'yes' ]; then\n    if ! [ -d \"/var/www/html/custom_apps/whiteboard\" ]; then\n        php /var/www/html/occ app:install whiteboard\n    elif [ \"$(php /var/www/html/occ config:app:get whiteboard enabled)\" != \"yes\" ]; then\n        php /var/www/html/occ app:enable whiteboard\n    elif [ \"$SKIP_UPDATE\" != 1 ]; then\n        php /var/www/html/occ app:update whiteboard\n    fi\n    php /var/www/html/occ config:app:set whiteboard collabBackendUrl --value=\"https://$NC_DOMAIN/whiteboard\"\n    php /var/www/html/occ config:app:set whiteboard jwt_secret_key --value=\"$WHITEBOARD_SECRET\"\nelse\n    if [ \"$REMOVE_DISABLED_APPS\" = yes ] && [ -d \"/var/www/html/custom_apps/whiteboard\" ]; then\n        php /var/www/html/occ app:remove whiteboard\n    fi\nfi\n\n# Remove the update skip file always\nrm -f \"$NEXTCLOUD_DATA_DIR\"/skip.update\n"
  },
  {
    "path": "Containers/nextcloud/healthcheck.sh",
    "content": "#!/bin/bash\n\n# Set a default value for POSTGRES_PORT\nif [ -z \"$POSTGRES_PORT\" ]; then\n    POSTGRES_PORT=5432\nfi\n\n\n# POSTGRES_HOST must be set in the containers env vars and POSTGRES_PORT has a default above\n# shellcheck disable=SC2153\nnc -z \"$POSTGRES_HOST\" \"$POSTGRES_PORT\" || exit 0\n\nif ! nc -z 127.0.0.1 9000; then\n    exit 1\nfi\n"
  },
  {
    "path": "Containers/nextcloud/notify-all.sh",
    "content": "#!/bin/bash\n\nif [[ \"$EUID\" = 0 ]]; then\n    COMMAND=(sudo -E -u www-data php /var/www/html/occ)\nelse\n    COMMAND=(php /var/www/html/occ)\nfi\n\nSUBJECT=\"$1\"\nMESSAGE=\"$2\"\n\nif [ \"$(\"${COMMAND[@]}\" config:app:get notifications enabled)\" = \"no\" ]; then\n    echo \"Cannot send notification as notification app is not enabled.\"\n    exit 1\nfi\n\necho \"Posting notifications to all users...\"\nNC_USERS=$(\"${COMMAND[@]}\" user:list | sed 's|^  - ||g' | sed 's|:.*||')\nmapfile -t NC_USERS <<< \"$NC_USERS\"\nfor user in \"${NC_USERS[@]}\"\ndo\n    echo \"Posting '$SUBJECT' to: $user\"\n    \"${COMMAND[@]}\" notification:generate \"$user\" \"$NC_DOMAIN: $SUBJECT\" -l \"$MESSAGE\" --object-type='update' --object-id=\"$SUBJECT\"\ndone\n\necho \"Done!\"\nexit 0"
  },
  {
    "path": "Containers/nextcloud/notify.sh",
    "content": "#!/bin/bash\n\nif [[ \"$EUID\" = 0 ]]; then\n    COMMAND=(sudo -E -u www-data php /var/www/html/occ)\nelse\n    COMMAND=(php /var/www/html/occ)\nfi\n\nSUBJECT=\"$1\"\nMESSAGE=\"$2\"\n\nif [ \"$(\"${COMMAND[@]}\" config:app:get notifications enabled)\" = \"no\" ]; then\n    echo \"Cannot send notification as notification app is not enabled.\"\n    exit 1\nfi\n\necho \"Posting notifications to users that are admins...\"\nNC_USERS=$(\"${COMMAND[@]}\" user:list | sed 's|^  - ||g' | sed 's|:.*||')\nmapfile -t NC_USERS <<< \"$NC_USERS\"\nfor user in \"${NC_USERS[@]}\"\ndo\n    if \"${COMMAND[@]}\" user:info \"$user\" | cut -d \"-\" -f2 | grep -x -q \" admin\"\n    then\n        NC_ADMIN_USER+=(\"$user\")\n    fi\ndone\n\nfor admin in \"${NC_ADMIN_USER[@]}\"\ndo\n    echo \"Posting '$SUBJECT' to: $admin\"\n    \"${COMMAND[@]}\" notification:generate \"$admin\" \"$NC_DOMAIN: $SUBJECT\" -l \"$MESSAGE\" --object-type='update' --object-id=\"$SUBJECT\"\ndone\n\necho \"Done!\"\nexit 0\n"
  },
  {
    "path": "Containers/nextcloud/root.motd",
    "content": "Warning: You have logged in into the Nextcloud container as root user.\nSee https://github.com/nextcloud/all-in-one#how-to-run-occ-commands if you want to run occ commands.\nApart from that, you can use 'sudo -E -u www-data php occ <your-command>' in order to run occ commands.\nOf course <your-command> needs to be substituted with the command that you want to use.\n"
  },
  {
    "path": "Containers/nextcloud/run-exec-commands.sh",
    "content": "#!/bin/bash\n\n# Wait until the apache container is ready\nwhile ! nc -z \"$APACHE_HOST\" \"$APACHE_PORT\"; do\n    echo \"Waiting for $APACHE_HOST to become available...\"\n    sleep 15\ndone\n\nif [ -n \"$NEXTCLOUD_EXEC_COMMANDS\" ]; then\n    echo \"#!/bin/bash\" > /tmp/nextcloud-exec-commands\n    echo \"$NEXTCLOUD_EXEC_COMMANDS\" >> /tmp/nextcloud-exec-commands\n    if ! grep \"one-click-instance\" /tmp/nextcloud-exec-commands; then\n        bash /tmp/nextcloud-exec-commands\n        rm /tmp/nextcloud-exec-commands\n    fi\nelse\n    # Collabora must work also if using manual-install \n    if [ \"$COLLABORA_ENABLED\" = yes ]; then\n        echo \"Activating Collabora config...\"\n        php /var/www/html/occ richdocuments:activate-config\n    fi\nfi\n\nsignal_handler() {\n    exit 0\n}\n\ntrap signal_handler SIGINT SIGTERM\n\nsleep inf &\nwait $!\n"
  },
  {
    "path": "Containers/nextcloud/start.sh",
    "content": "#!/bin/bash\n\n# Set a default value for POSTGRES_PORT\nif [ -z \"$POSTGRES_PORT\" ]; then\n    POSTGRES_PORT=5432\nfi\n\n# Only start container if database is accessible\n# POSTGRES_HOST must be set in the containers env vars and POSTGRES_PORT has a default above\n# shellcheck disable=SC2153\nwhile ! sudo -E -u www-data nc -z \"$POSTGRES_HOST\" \"$POSTGRES_PORT\"; do\n    echo \"Waiting for database to start...\"\n    sleep 5\ndone\n\n# Use the correct Postgres username\nPOSTGRES_USER=\"oc_$POSTGRES_USER\"\nexport POSTGRES_USER\n\n# Check that db type is not empty\nif [ -z \"$DATABASE_TYPE\" ]; then\n    export DATABASE_TYPE=postgres\nfi\n\n# Fix false database connection on old instances\nif [ -f \"/var/www/html/config/config.php\" ]; then\n    sleep 2\n    while ! sudo -E -u www-data psql -d \"postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB\" -c \"select now()\"; do\n        echo \"Waiting for the database to start...\"\n        sleep 5\n    done\n    if [ \"$POSTGRES_USER\" = \"oc_nextcloud\" ] && [ \"$POSTGRES_DB\" = \"nextcloud_database\" ] && echo \"$POSTGRES_PASSWORD\" | grep -q '^[a-z0-9]\\+$'; then\n        # This was introduced with https://github.com/nextcloud/all-in-one/pull/218\n        sed -i \"s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|\" /var/www/html/config/config.php\n        sed -i \"s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|\" /var/www/html/config/config.php\n        sed -i \"s|'db_name'.*=>.*$|'db_name' => '$POSTGRES_DB',|\" /var/www/html/config/config.php\n    fi\nfi\n\n# Trust additional Cacerts, if the user provided $TRUSTED_CACERTS_DIR\nif [ -n \"$TRUSTED_CACERTS_DIR\" ]; then\n    echo \"User required to trust additional CA certificates, running 'update-ca-certificates.'\"\n    update-ca-certificates\nfi\n\n# Check if /dev/dri device is present and apply correct permissions\nset -x\nif ! [ -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\n    # From https://memories.gallery/hw-transcoding/#docker-installations\n    GID=\"$(stat -c \"%g\" /dev/dri/renderD128)\"\n    groupadd -g \"$GID\" render2 || true # sometimes this is needed\n    GROUP=\"$(getent group \"$GID\" | cut -d: -f1)\"\n    usermod -aG \"$GROUP\" www-data\n    touch \"/dev-dri-group-was-added\"\nfi\nset +x\n\n# Check datadir permissions\nsudo -E -u www-data touch \"$NEXTCLOUD_DATA_DIR/this-is-a-test-file\" &>/dev/null\nif ! [ -f \"$NEXTCLOUD_DATA_DIR/this-is-a-test-file\" ]; then\n    chown -R www-data:root \"$NEXTCLOUD_DATA_DIR\"\n    chmod 750 -R \"$NEXTCLOUD_DATA_DIR\"\nfi\nsudo -E -u www-data rm -f \"$NEXTCLOUD_DATA_DIR/this-is-a-test-file\"\n\n# Install additional dependencies\nif [ -n \"$ADDITIONAL_APKS\" ]; then\n    if ! [ -f \"/additional-apks-are-installed\" ]; then\n        # Allow to disable imagemagick without having to download it each time\n        if ! echo \"$ADDITIONAL_APKS\" | grep -q imagemagick; then\n            apk del imagemagick imagemagick-svg imagemagick-heic imagemagick-tiff;\n        fi\n        read -ra ADDITIONAL_APKS_ARRAY <<< \"$ADDITIONAL_APKS\"\n        for app in \"${ADDITIONAL_APKS_ARRAY[@]}\"; do\n            if [ \"$app\" != imagemagick ]; then\n                echo \"Installing $app via apk...\"\n                if ! apk add --no-cache \"$app\" >/dev/null; then\n                    echo \"The packet $app was not installed!\"\n                fi\n            fi\n        done\n    fi\n    touch /additional-apks-are-installed\nfi\n\n# Install additional php extensions\nif [ -n \"$ADDITIONAL_PHP_EXTENSIONS\" ]; then\n    if ! [ -f \"/additional-php-extensions-are-installed\" ]; then\n        # Allow to disable imagick without having to enable it each time\n        if ! echo \"$ADDITIONAL_PHP_EXTENSIONS\" | grep -q imagick; then\n            # Remove the ini file as there is no docker-php-ext-disable script available\n            rm /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini\n        fi\n        read -ra ADDITIONAL_PHP_EXTENSIONS_ARRAY <<< \"$ADDITIONAL_PHP_EXTENSIONS\"\n        for app in \"${ADDITIONAL_PHP_EXTENSIONS_ARRAY[@]}\"; do\n            if [ \"$app\" = imagick ]; then\n                # imagick is already enabled by default, so does not need to be enabled anymore.\n                continue\n            fi\n            # shellcheck disable=SC2086\n            if [ \"$PHP_DEPS_ARE_INSTALLED\" != 1 ]; then\n                echo \"Installing PHP build dependencies...\"\n                    if ! apk add --no-cache --virtual .build-deps \\\n                        libxml2-dev \\\n                        autoconf \\\n                        $PHPIZE_DEPS >/dev/null; then\n                    echo \"Could not install build-deps!\"\n                fi\n                PHP_DEPS_ARE_INSTALLED=1\n            fi\n            if [ \"$app\" = inotify ]; then\n                echo \"Installing $app via PECL...\"\n                pecl install \"$app\" >/dev/null\n                if ! docker-php-ext-enable \"$app\" >/dev/null; then\n                    echo \"Could not install PHP extension $app!\"\n                fi\n            elif [ \"$app\" = soap ]; then\n                echo \"Installing $app from core...\"\n                if ! docker-php-ext-install -j \"$(nproc)\" \"$app\" >/dev/null; then\n                    echo \"Could not install PHP extension $app!\"\n                fi\n            else\n                echo \"Installing PHP extension $app ...\"\n                if ! docker-php-ext-install -j \"$(nproc)\" \"$app\" >/dev/null; then\n                    echo \"Could not install $app from core. Trying to install from PECL...\"\n                    pecl install \"$app\" >/dev/null\n                    if ! docker-php-ext-enable \"$app\" >/dev/null; then\n                        echo \"Could also not install $app from PECL. The PHP extensions was not installed!\"\n                    fi\n                fi\n            fi\n        done\n        if [ \"$PHP_DEPS_ARE_INSTALLED\" = 1 ]; then\n            rm -rf /tmp/pear\n            runDeps=\"$( \\\n                scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \\\n                    | tr ',' '\\n' \\\n                    | sort -u \\\n                    | awk 'system(\"[ -e /usr/local/lib/\" $1 \" ]\") == 0 { next } { print \"so:\" $1 }' \\\n            )\";\n            # shellcheck disable=SC2086\n            apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps >/dev/null\n            apk del .build-deps >/dev/null\n        fi\n    fi\n    touch /additional-php-extensions-are-installed\nfi\n\n# Run original entrypoint\nif ! sudo -E -u www-data bash /entrypoint.sh; then\n    exit 1\nfi\n\nwhile [ \"$THIS_IS_AIO\" = \"true\" ] && [ -z \"$(dig nextcloud-aio-apache A +short +search)\" ]; do\n    echo \"Waiting for nextcloud-aio-apache to start...\"\n    sleep 5\ndone\n\nset -x\n# shellcheck disable=SC2235\nif [ \"$THIS_IS_AIO\" = \"true\" ] && [ \"$APACHE_PORT\" = 443 ]; then\n    IPv4_ADDRESS_APACHE=\"$(dig nextcloud-aio-apache A +short +search | grep '^[0-9.]\\+$' | sort | head -n1)\"\n    IPv6_ADDRESS_APACHE=\"$(dig nextcloud-aio-apache AAAA +short +search | grep '^[0-9a-f:]\\+$' | sort | head -n1)\"\n    IPv4_ADDRESS_MASTERCONTAINER=\"$(dig nextcloud-aio-mastercontainer A +short +search | grep '^[0-9.]\\+$' | sort | head -n1)\"\n    IPv6_ADDRESS_MASTERCONTAINER=\"$(dig nextcloud-aio-mastercontainer AAAA +short +search | grep '^[0-9a-f:]\\+$' | sort | head -n1)\"\n\n    sed -i \"s|^;listen.allowed_clients|listen.allowed_clients|\" /usr/local/etc/php-fpm.d/www.conf\n    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\n    sed -i \"/^listen.allowed_clients/s/,,/,/g\" /usr/local/etc/php-fpm.d/www.conf\n    sed -i \"/^listen.allowed_clients/s/,$//\" /usr/local/etc/php-fpm.d/www.conf\n    grep listen.allowed_clients /usr/local/etc/php-fpm.d/www.conf\nfi\nset +x\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/nextcloud/supervisord.conf",
    "content": "# From https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/fpm/supervisord.conf\n[supervisord]\nnodaemon=true\nlogfile=/var/log/supervisord/supervisord.log\npidfile=/var/run/supervisord/supervisord.pid\nchildlogdir=/var/log/supervisord/\nlogfile_maxbytes=50MB                           ; maximum size of logfile before rotation\nlogfile_backups=10                              ; number of backed up logfiles\nloglevel=error\nuser=root\n\n[program:php-fpm]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=php-fpm\nuser=root\n\n[program:cron]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/cron.sh\nuser=www-data\n\n[program:run-exec-commands]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=/run-exec-commands.sh\nuser=www-data\n\n# This is a hack but no better solution is there\n[program:is-nextcloud-online]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n# Restart the netcat command once a day to ensure that it stays reachable\n# See https://github.com/nextcloud/all-in-one/issues/6334\ncommand=timeout 86400 nc -lk 9001\nuser=www-data\n"
  },
  {
    "path": "Containers/nextcloud/upgrade.exclude",
    "content": "/config/\n/data/\n/custom_apps/\n/themes/\n/version.php\n/lost+found\n"
  },
  {
    "path": "Containers/notify-push/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM alpine:3.23.3\n\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        ca-certificates \\\n        netcat-openbsd \\\n        tzdata \\\n        bash \\\n        openssl; \\\n# Give root a random password\n    echo \"root:$(openssl rand -base64 12)\" | chpasswd; \\\n    apk del --no-cache \\\n        openssl;\n\nUSER 33\nENTRYPOINT [\"/start.sh\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/notify-push/healthcheck.sh",
    "content": "#!/bin/bash\n\nif ! nc -z \"$NEXTCLOUD_HOST\" 9001; then\n    exit 0\nfi\n\nnc -z 127.0.0.1 7867 || exit 1\n"
  },
  {
    "path": "Containers/notify-push/start.sh",
    "content": "#!/bin/bash\n\nif [ -z \"$NEXTCLOUD_HOST\" ]; then\n    echo \"NEXTCLOUD_HOST needs to be provided. Exiting!\"\n    exit 1\nfi\n\n# Only start container if nextcloud is accessible\nwhile ! nc -z \"$NEXTCLOUD_HOST\" 9001; do\n    echo \"Waiting for Nextcloud to start...\"\n    sleep 5\ndone\n\n# Correctly set CPU_ARCH for notify_push\nCPU_ARCH=\"$(uname -m)\"\nexport CPU_ARCH\nif [ -z \"$CPU_ARCH\" ]; then\n    echo \"Could not get processor architecture. Exiting.\"\n    exit 1\nelif [ \"$CPU_ARCH\" != \"x86_64\" ]; then\n    export CPU_ARCH=\"aarch64\"\nfi\n\n# Add warning\nif ! [ -f /var/www/html/custom_apps/notify_push/bin/\"$CPU_ARCH\"/notify_push ]; then\n    echo \"The notify_push binary was not found.\"\n    echo \"Most likely is DNS resolution not working correctly.\"\n    echo \"You can try to fix this by configuring a DNS server globally in dockers daemon.json.\"\n    echo \"See https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html\"\n    echo \"Afterwards a restart of docker should automatically resolve this.\"\n    echo \"Additionally, make sure to disable VPN software that might be running on your server\"\n    echo \"Also check your firewall if it blocks connections to github\"\n    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.\"\n    echo \"\"\n    echo \"\"\n    exit 1\nfi\n\necho \"notify-push was started\"\n\n# Run it\n/var/www/html/custom_apps/notify_push/bin/\"$CPU_ARCH\"/notify_push \\\n    --port 7867 \\\n    /var/www/html/config/config.php\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/onlyoffice/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# From https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/Dockerfile\nFROM onlyoffice/documentserver:9.3.1.2\n\n# USER root is probably used\n\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nHEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/onlyoffice/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z 127.0.0.1 80 || exit 1\n"
  },
  {
    "path": "Containers/postgresql/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# From https://github.com/docker-library/postgres/blob/master/17/alpine3.23/Dockerfile\nFROM postgres:17.9-alpine\n\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\nCOPY --chmod=775 init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        bash \\\n        openssl \\\n        shadow \\\n        grep; \\\n    \\\n# We need to use the same gid and uid as on old installations\n    deluser postgres; \\\n    groupmod -g 9999 ping; \\\n    addgroup -g 999 -S postgres; \\\n    adduser -u 999 -S -D -G postgres -H -h /var/lib/postgresql -s /bin/sh postgres; \\\n    apk del --no-cache shadow; \\\n    \\\n# Fix default permissions\n    chown -R postgres:postgres /var/lib/postgresql; \\\n    chown -R postgres:postgres /var/run/postgresql; \\\n    chmod -R 777 /var/run/postgresql; \\\n    chown -R postgres:postgres \"$PGDATA\"; \\\n    \\\n    mkdir /mnt/data; \\\n    chown postgres:postgres /mnt/data; \\\n    \\\n# Give root a random password\n    echo \"root:$(openssl rand -base64 12)\" | chpasswd; \\\n    apk --no-cache del openssl; \\\n    \\\n# Get rid of unused binaries\n    rm -f /usr/local/bin/gosu /usr/local/bin/su-exec;\n\nVOLUME /mnt/data\n\nUSER 999\nENTRYPOINT [\"/start.sh\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/postgresql/healthcheck.sh",
    "content": "#!/bin/bash\n\ntest -f \"/mnt/data/backup-is-running\" && exit 0\n\npsql -d \"postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB\" -c \"select now()\" && exit 0\n\npsql -d \"postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:5432/$POSTGRES_DB\" -c \"select now()\" || exit 1\n"
  },
  {
    "path": "Containers/postgresql/init-user-db.sh",
    "content": "#!/bin/bash\nset -ex\n\ntouch \"$DUMP_DIR/initialization.failed\"\n\npsql -v ON_ERROR_STOP=1 --username \"$POSTGRES_USER\" --dbname \"$POSTGRES_DB\" <<-EOSQL\n\tCREATE USER \"oc_$POSTGRES_USER\" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB;\n\tALTER DATABASE \"$POSTGRES_DB\" OWNER TO \"oc_$POSTGRES_USER\";\n\tGRANT ALL PRIVILEGES ON DATABASE \"$POSTGRES_DB\" TO \"oc_$POSTGRES_USER\";\n\tGRANT ALL PRIVILEGES ON SCHEMA public TO \"oc_$POSTGRES_USER\";\nEOSQL\n\nrm \"$DUMP_DIR/initialization.failed\"\n\nset +ex\n"
  },
  {
    "path": "Containers/postgresql/start.sh",
    "content": "#!/bin/bash\n\n# Variables\nDATADIR=\"/var/lib/postgresql/data\"\nexport DUMP_DIR=\"/mnt/data\"\nDUMP_FILE=\"$DUMP_DIR/database-dump.sql\"\nexport PGPASSWORD=\"$POSTGRES_PASSWORD\"\n\n# Don't start database as long as backup is running\nwhile [ -f \"$DUMP_DIR/backup-is-running\" ]; do\n    echo \"Waiting for backup container to finish...\"\n    echo \"If this is incorrect because the backup container is not running anymore (because it was forcefully killed), you might delete the lock file:\"\n    echo \"sudo docker exec --user root nextcloud-aio-database rm /mnt/data/backup-is-running\"\n    sleep 10\ndone\n\n# Check if dump dir is writeable\nif ! [ -w \"$DUMP_DIR\" ]; then\n    echo \"DUMP dir is not writeable by postgres user.\"\n    exit 1\nfi\n\n# Don't start if import failed\nif [ -f \"$DUMP_DIR/import.failed\" ]; then\n    echo \"The database import failed. Please restore a backup and try again.\"\n    echo \"For further clues on what went wrong, look at the logs above.\"\n    exit 1\nfi\n\n# Don't start if initialization failed\nif [ -f \"$DUMP_DIR/initialization.failed\" ]; then\n    echo \"The database initialization failed. Most likely was a wrong timezone selected.\"\n    echo \"The selected timezone is '$TZ'.\" \n    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\"\n    echo \"For further clues on what went wrong, look at the logs above.\"\n    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.\"\n    exit 1\nfi\n\n# Delete the datadir once (needed for setting the correct credentials on old instances once)\nif ! [ -f \"$DUMP_DIR/export.failed\" ] && ! [ -f \"$DUMP_DIR/initial-cleanup-done\" ]; then\n    set -ex\n    rm -rf \"${DATADIR:?}/\"*\n    touch \"$DUMP_DIR/initial-cleanup-done\"\n    set +ex\nfi\n\n# Test if some things match\n# shellcheck disable=SC2235\nif ( [ -f \"$DATADIR/PG_VERSION\" ] && [ \"$PG_MAJOR\" != \"$(cat \"$DATADIR/PG_VERSION\")\" ] ) \\\n|| ( ! [ -f \"$DATADIR/PG_VERSION\" ] && ( [ -f \"$DUMP_FILE\" ] || [ -f \"$DUMP_DIR/export.failed\" ] ) ); then\n    # The DUMP_file must be provided\n    if ! [ -f \"$DUMP_FILE\" ]; then\n        echo \"Unable to restore the database because the database dump is missing.\"\n        exit 1\n    fi\n\n    # If database export was unsuccessful, skip update \n    if [ -f \"$DUMP_DIR/export.failed\" ]; then\n        echo \"Database export failed the last time. Most likely was the export time not high enough.\"\n        echo \"Please report this to https://github.com/nextcloud/all-in-one/issues. Thanks!\"\n        exit 1\n    fi\n\n    # Write output to logfile.\n    exec > >(tee -i \"$DUMP_DIR/database-import.log\")\n    exec 2>&1\n\n    # Inform\n    echo \"Restoring from database dump.\"\n\n    # Add import.failed file\n    touch \"$DUMP_DIR/import.failed\"\n\n    # Exit if any command fails\n    set -ex\n\n    # Remove old database files\n    rm -rf \"${DATADIR:?}/\"*\n\n    # Change database port to a random port temporarily\n    export PGPORT=11000\n\n    # Create new database\n    exec docker-entrypoint.sh postgres &\n\n    # Wait for creation\n    while ! psql -d \"postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB\" -c \"select now()\"; do\n        echo \"Waiting for the database to start.\"\n        sleep 5\n    done\n\n    # Check if the line we grep for later on is there\n    GREP_STRING='Name: oc_appconfig; Type: TABLE; Schema: public; Owner:'\n    if ! grep -qa \"$GREP_STRING\" \"$DUMP_FILE\"; then\n        echo \"The needed oc_appconfig line is not there which is unexpected.\"\n        echo \"Please report this to https://github.com/nextcloud/all-in-one/issues. Thanks!\"\n        exit 1\n    fi\n\n    # Get the Owner\n    DB_OWNER=\"$(grep -a \"$GREP_STRING\" \"$DUMP_FILE\" | head -1 | grep -oP 'Owner:.*$' | sed 's|Owner:||;s|[[:space:]]||g')\"\n    if [ \"$DB_OWNER\" = \"$POSTGRES_USER\" ]; then\n        echo \"Unfortunately was the found database owner of the dump file the same as the POSTGRES_USER $POSTGRES_USER\"\n        echo \"It is not possible to import a database dump from this database owner.\"\n        echo \"However you might rename the owner in the dumpfile to something else.\"\n        exit 1\n    elif [ \"$DB_OWNER\" != \"oc_$POSTGRES_USER\" ]; then\n        DIFFERENT_DB_OWNER=1\n        psql -v ON_ERROR_STOP=1 --username \"$POSTGRES_USER\" --dbname \"$POSTGRES_DB\" <<-EOSQL\n            CREATE USER \"$DB_OWNER\" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB;\n            ALTER DATABASE \"$POSTGRES_DB\" OWNER TO \"$DB_OWNER\";\n            GRANT ALL PRIVILEGES ON DATABASE \"$POSTGRES_DB\" TO \"$DB_OWNER\";\n            GRANT ALL PRIVILEGES ON SCHEMA public TO \"$DB_OWNER\";\nEOSQL\n    fi\n\n    # Restore database\n    echo \"Restoring the database from database dump\"\n    psql \"$POSTGRES_DB\" -U \"$POSTGRES_USER\" < \"$DUMP_FILE\"\n\n    # Correct permissions\n    if [ -n \"$DIFFERENT_DB_OWNER\" ]; then\n        psql -v ON_ERROR_STOP=1 --username \"$POSTGRES_USER\" --dbname \"$POSTGRES_DB\" <<-EOSQL\n            ALTER DATABASE \"$POSTGRES_DB\" OWNER TO \"oc_$POSTGRES_USER\";\n            REASSIGN OWNED BY \"$DB_OWNER\" TO \"oc_$POSTGRES_USER\";\nEOSQL\n    fi\n\n    # Shut down the database to be able to start it again\n    # The smart mode disallows new connections, then waits for all existing clients to disconnect and any online backup to finish\n    # Wait for 1800s to make sure that a checkpoint is completed successfully\n    pg_ctl stop -m smart -t 1800\n\n    # Change database port back to default\n    export PGPORT=5432\n\n    # Don't exit if command fails anymore\n    set +ex\n\n    # Remove import failed file if everything went correctly\n    rm \"$DUMP_DIR/import.failed\"\nfi\n\n# Cover the last case\nif ! [ -f \"$DATADIR/PG_VERSION\" ] && ! [ -f \"$DUMP_FILE\" ]; then\n    # Remove old database files if somehow there should be some\n    rm -rf \"${DATADIR:?}/\"*\nfi\n\n# Modify postgresql.conf\nif [ -f \"/var/lib/postgresql/data/postgresql.conf\" ]; then\n    echo \"Setting postgres values...\"\n\n    # Sync this with max pm.max_children and MaxRequestWorkers\n    # 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.\n    # We don't actually expect so many connections but don't want to limit it artificially because people will report issues otherwise\n    # Also connections should usually be closed again after the process is done\n    # 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\n    sed -i \"s|^max_connections =.*|max_connections = 5000|\" \"/var/lib/postgresql/data/postgresql.conf\"\n\n    # Do not log checkpoints\n    if grep -q \"#log_checkpoints\" /var/lib/postgresql/data/postgresql.conf; then\n        sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf\n    fi\n\n    # Closing idling connections automatically seems to break any logic so was reverted again to default where it is disabled\n    if grep -q \"^idle_session_timeout\" /var/lib/postgresql/data/postgresql.conf; then\n        sed -i 's|^idle_session_timeout.*|#idle_session_timeout|' /var/lib/postgresql/data/postgresql.conf\n    fi\nfi\n\ndo_database_dump() {\n    set -x\n    rm -f \"$DUMP_FILE.temp\"\n    touch \"$DUMP_DIR/export.failed\"\n    if pg_dump --username \"$POSTGRES_USER\" \"$POSTGRES_DB\" > \"$DUMP_FILE.temp\"; then\n        rm -f \"$DUMP_FILE\"\n        mv \"$DUMP_FILE.temp\" \"$DUMP_FILE\"\n        pg_ctl stop -m fast\n        rm \"$DUMP_DIR/export.failed\"\n        echo 'Database dump successful!'\n        set +x\n        exit 0\n    else\n        pg_ctl stop -m fast\n        echo \"Database dump unsuccessful!\"\n        set +x\n        exit 1\n    fi\n}\n\n# Catch docker stop attempts\ntrap do_database_dump SIGINT SIGTERM\n\n# Start the database\nexec docker-entrypoint.sh postgres &\nwait $!\n"
  },
  {
    "path": "Containers/redis/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# From https://github.com/redis/docker-library-redis/blob/release/8.2/alpine/Dockerfile\nFROM redis:8.6.1-alpine\n\nCOPY --chmod=775 start.sh /start.sh\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache openssl bash; \\\n    \\\n# Give root a random password\n    echo \"root:$(openssl rand -base64 12)\" | chpasswd; \\\n    apk --no-cache del openssl; \\\n    \\\n# Get rid of unused binaries\n    rm -f /usr/local/bin/gosu;\n\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nUSER 999\nENTRYPOINT [\"/start.sh\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/redis/healthcheck.sh",
    "content": "#!/bin/bash\n\nredis-cli -a \"$REDIS_HOST_PASSWORD\" PING || exit 1\n"
  },
  {
    "path": "Containers/redis/start.sh",
    "content": "#!/bin/bash\n\n# Show wiki if vm.overcommit is disabled\nif [ \"$(sysctl -n vm.overcommit_memory)\" != \"1\" ]; then\n    echo \"Memory overcommit is disabled but necessary for safe operation\"\n    echo \"See https://github.com/nextcloud/all-in-one/discussions/1731 how to enable overcommit\"\nfi\n\n# Run redis with a password if provided\necho \"Redis has started\"\nif [ -n \"$REDIS_HOST_PASSWORD\" ]; then\n    exec redis-server --requirepass \"$REDIS_HOST_PASSWORD\" --loglevel warning\nelse\n    exec redis-server --loglevel warning\nfi\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/talk/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM nats:2.12.5-scratch AS nats\nFROM eturnal/eturnal:1.12.2-alpine AS eturnal\nFROM strukturag/nextcloud-spreed-signaling:2.1.1 AS signaling\nFROM alpine:3.23.3 AS janus\n\nARG JANUS_VERSION=v1.4.0\nWORKDIR /src\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        ca-certificates \\\n        git \\\n        autoconf \\\n        automake \\\n        build-base \\\n        pkgconfig \\\n        libtool \\\n        util-linux \\\n        glib-dev \\\n        zlib-dev \\\n        openssl-dev \\\n        jansson-dev \\\n        libnice-dev \\\n        libconfig-dev \\\n        libsrtp-dev \\\n        libusrsctp-dev \\\n        gengetopt-dev \\\n        libwebsockets-dev; \\\n    git clone --recursive https://github.com/meetecho/janus-gateway --depth=1 --single-branch --branch \"$JANUS_VERSION\" /src; \\\n    /src/autogen.sh; \\\n    /src/configure --disable-rabbitmq --disable-mqtt --disable-boringssl; \\\n    make; \\\n    make install; \\\n    make configs; \\\n    rename -v \".jcfg.sample\" \".jcfg\" /usr/local/etc/janus/*.jcfg.sample\n\nFROM alpine:3.23.3\nENV ETURNAL_ETC_DIR=\"/conf\"\nENV SKIP_CERT_VERIFY=false\nCOPY --from=janus     --chmod=777 --chown=1000:1000 /usr/local                          /usr/local\nCOPY --from=eturnal   --chmod=777 --chown=1000:1000 /opt/eturnal                        /opt/eturnal\nCOPY --from=nats      --chmod=777 --chown=1000:1000 /nats-server                        /usr/local/bin/nats-server\nCOPY --from=signaling --chmod=777 --chown=1000:1000 /usr/bin/nextcloud-spreed-signaling /usr/local/bin/nextcloud-spreed-signaling\n\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\nCOPY --chmod=664 supervisord.conf /supervisord.conf\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        ca-certificates \\\n        tzdata \\\n        bash \\\n        openssl \\\n        supervisor \\\n        bind-tools \\\n        netcat-openbsd \\\n        \\\n        glib \\\n        zlib \\\n        libssl3 \\\n        libcrypto3 \\\n        jansson \\\n        libnice \\\n        libconfig \\\n        libsrtp \\\n        libusrsctp \\\n        libwebsockets \\\n        \\\n        shadow \\\n        grep \\\n        util-linux-misc; \\\n    useradd --system -u 1000 eturnal; \\\n    apk del --no-cache \\\n        shadow; \\\n    \\\n# Give root a random password\n    echo \"root:$(openssl rand -base64 12)\" | chpasswd; \\\n    \\\n    touch \\\n        /etc/nats.conf \\\n        /etc/eturnal.yml; \\\n    echo \"listen: 127.0.0.1:4222\" | tee /etc/nats.conf; \\\n    mkdir -p \\\n        /var/tmp \\\n        /conf \\\n        /var/lib/turn \\\n        /var/log/supervisord \\\n        /var/run/supervisord \\\n        /usr/local/lib/janus/loggers; \\\n    chown eturnal:eturnal -R \\\n        /etc/nats.conf \\\n        /var/log/supervisord \\\n        /var/run/supervisord; \\\n    chmod 777 -R \\\n        /tmp \\\n        /conf \\\n        /var/run/supervisord \\\n        /var/log/supervisord; \\\n    ln -s /opt/eturnal/bin/stun /usr/local/bin/stun; \\\n    ln -s /opt/eturnal/bin/eturnalctl /usr/local/bin/eturnalctl\n\nUSER 1000\nENTRYPOINT [\"/start.sh\"]\nCMD [\"supervisord\", \"-c\", \"/supervisord.conf\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/talk/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z 127.0.0.1 8081 || exit 1\nnc -z 127.0.0.1 8188 || exit 1\nnc -z 127.0.0.1 4222 || exit 1\nnc -z 127.0.0.1 \"$TALK_PORT\" || exit 1\neturnalctl status || exit 1\n"
  },
  {
    "path": "Containers/talk/server.conf.in",
    "content": "[http]\n# IP and port to listen on for HTTP requests.\n# Comment line to disable the listener.\n#listen = 127.0.0.1:8080\n\n# HTTP socket read timeout in seconds.\n#readtimeout = 15\n\n# HTTP socket write timeout in seconds.\n#writetimeout = 30\n\n[https]\n# IP and port to listen on for HTTPS requests.\n# Comment line to disable the listener.\n#listen = 127.0.0.1:8443\n\n# HTTPS socket read timeout in seconds.\n#readtimeout = 15\n\n# HTTPS socket write timeout in seconds.\n#writetimeout = 30\n\n# Certificate / private key to use for the HTTPS server.\ncertificate = /etc/nginx/ssl/server.crt\nkey = /etc/nginx/ssl/server.key\n\n[app]\n# Set to \"true\" to install pprof debug handlers. Access will only be possible\n# from IPs allowed through the \"allowed_ips\" option below.\n#\n# See \"https://golang.org/pkg/net/http/pprof/\" for further information.\ndebug = false\n\n# Set to \"true\" to allow subscribing any streams. This is insecure and should\n# only be enabled for testing. By default only streams of users in the same\n# room and call can be subscribed.\n#allowsubscribeany = false\n\n# Comma separated list of trusted proxies (IPs or CIDR networks) that may set\n# the \"X-Real-Ip\" or \"X-Forwarded-For\" headers. If both are provided, the\n# \"X-Real-Ip\" header will take precedence (if valid).\n# Leave empty to allow loopback and local addresses.\n#trustedproxies =\n\n[sessions]\n# Secret value used to generate checksums of sessions. This should be a random\n# string of 32 or 64 bytes.\nhashkey = the-secret-for-session-checksums\n\n# Optional key for encrypting data in the sessions. Must be either 16, 24 or\n# 32 bytes.\n# If no key is specified, data will not be encrypted (not recommended).\nblockkey = -encryption-key-\n\n[clients]\n# Shared secret for connections from internal clients. This must be the same\n# value as configured in the respective internal services.\ninternalsecret = the-shared-secret-for-internal-clients\n\n[federation]\n# If set to \"true\", certificate validation of federation targets will be skipped.\n# This should only be enabled during development, e.g. to work with self-signed\n# certificates.\n#skipverify = false\n\n# Timeout in seconds for requests to federation targets.\n#timeout = 10\n\n[backend]\n# Type of backend configuration.\n# Defaults to \"static\".\n#\n# Possible values:\n# - static: A comma-separated list of backends is given in the \"backends\" option.\n# - etcd: Backends are retrieved from an etcd cluster.\n#backendtype = static\n\n# For backend type \"static\":\n# Comma-separated list of backend ids from which clients are allowed to connect\n# from. Each backend will have isolated rooms, i.e. clients connecting to room\n# \"abc12345\" on backend 1 will be in a different room than clients connected to\n# a room with the same name on backend 2. Also sessions connected from different\n# backends will not be able to communicate with each other.\n#backends = backend-id, another-backend\n\n# For backend type \"etcd\":\n# Key prefix of backend entries. All keys below will be watched and assumed to\n# contain a JSON document with the following entries:\n# - \"urls\": List of urls of the Nextcloud instance.\n# - \"url\": Url of the Nextcloud instance (deprecated).\n# - \"secret\": Shared secret for requests from and to the backend servers.\n#\n# Additional optional entries:\n# - \"maxstreambitrate\": Maximum bitrate per publishing stream (in bits per second).\n# - \"maxscreenbitrate\": Maximum bitrate per screensharing stream (in bits per second).\n# - \"sessionlimit\": Number of sessions that are allowed to connect.\n#\n# Example:\n# \"/signaling/backend/one\" -> {\"urls\": [\"https://nextcloud.domain1.invalid\"], ...}\n# \"/signaling/backend/two\" -> {\"urls\": [\"https://domain2.invalid/nextcloud\"], ...}\n#backendprefix = /signaling/backend\n\n# Allow any hostname as backend endpoint. This is extremely insecure and should\n# only be used while running the benchmark client against the server.\nallowall = false\n\n# Common shared secret for requests from and to the backend servers. Used if\n# \"allowall\" is enabled or as fallback for individual backends that don't have\n# their own secret set.\n# This must be the same value as configured in the Nextcloud admin ui.\n#secret = the-shared-secret-for-allowall\n\n# Timeout in seconds for requests to the backend.\ntimeout = 10\n\n# Maximum number of concurrent backend connections per host.\nconnectionsperhost = 8\n\n# If set to \"true\", certificate validation of backend endpoints will be skipped.\n# This should only be enabled during development, e.g. to work with self-signed\n# certificates.\n#skipverify = false\n\n# For backendtype \"static\":\n# Backend configurations as defined in the \"[backend]\" section above. The\n# section names must match the ids used in \"backends\" above.\n#[backend-id]\n# Comma-separated list of urls of the Nextcloud instance\n#urls = https://cloud.domain.invalid\n\n# Shared secret for requests from and to the backend servers. Leave empty to use\n# the common shared secret from above.\n# This must be the same value as configured in the Nextcloud admin ui.\n#secret = the-shared-secret\n\n# Limit the number of sessions that are allowed to connect to this backend.\n# Omit or set to 0 to not limit the number of sessions.\n#sessionlimit = 10\n\n# The maximum bitrate per publishing stream (in bits per second).\n# Defaults to the maximum bitrate configured for the proxy / MCU.\n#maxstreambitrate = 1048576\n\n# The maximum bitrate per screensharing stream (in bits per second).\n# Defaults to the maximum bitrate configured for the proxy / MCU.\n#maxscreenbitrate = 2097152\n\n#[another-backend]\n# Comma-separated list of urls of the Nextcloud instance\n#urls = https://cloud.otherdomain.invalid\n\n# Shared secret for requests from and to the backend servers. Leave empty to use\n# the common shared secret from above.\n# This must be the same value as configured in the Nextcloud admin ui.\n#secret = the-shared-secret\n\n[nats]\n# Url of NATS backend to use. This can also be a list of URLs to connect to\n# multiple backends. For local development, this can be set to \"nats://loopback\"\n# to process NATS messages internally instead of sending them through an\n# external NATS backend.\n#url = nats://localhost:4222\n\n[mcu]\n# The type of the MCU to use. Currently only \"janus\" and \"proxy\" are supported.\n# Leave empty to disable MCU functionality.\n#type =\n\n# For type \"janus\": the URL to the websocket endpoint of the MCU server.\n# For type \"proxy\": a space-separated list of proxy URLs to connect to.\n#url =\n\n# The maximum bitrate per publishing stream (in bits per second).\n# Defaults to 1 mbit/sec.\n# For type \"proxy\": will be capped to the maximum bitrate configured at the\n# proxy server that is used.\n#maxstreambitrate = 1048576\n\n# The maximum bitrate per screensharing stream (in bits per second).\n# Default is 2 mbit/sec.\n# For type \"proxy\": will be capped to the maximum bitrate configured at the\n# proxy server that is used.\n#maxscreenbitrate = 2097152\n\n# List of IP addresses / subnets that are allowed to be used by clients in\n# candidates. The allowed list has preference over the blocked list below.\n#allowedcandidates = 10.0.0.0/8\n\n# List of IP addresses / subnets to filter from candidates received by clients.\n#blockedcandidates = 1.2.3.0/24\n\n# For type \"proxy\": timeout in seconds for requests to the proxy server.\n#proxytimeout = 2\n\n# For type \"proxy\": type of URL configuration for proxy servers.\n# Defaults to \"static\".\n#\n# Possible values:\n# - static: A space-separated list of proxy URLs is given in the \"url\" option.\n# - etcd: Proxy URLs are retrieved from an etcd cluster (see below).\n#urltype = static\n\n# If set to \"true\", certificate validation of proxy servers will be skipped.\n# This should only be enabled during development, e.g. to work with self-signed\n# certificates.\n#skipverify = false\n\n# For type \"proxy\": the id of the token to use when connecting to proxy servers.\n#token_id = server1\n\n# For type \"proxy\": the private key for the configured token id to use when\n# connecting to proxy servers.\n#token_key = privkey.pem\n\n# For url type \"static\": Enable DNS discovery on hostname of configured URL.\n# If the hostname resolves to multiple IP addresses, a connection is established\n# to each of them.\n# Changes to the DNS are monitored regularly and proxy connections are created\n# or deleted as necessary.\n#dnsdiscovery = true\n\n# For url type \"etcd\": Key prefix of MCU proxy entries. All keys below will be\n# watched and assumed to contain a JSON document. The entry \"address\" from this\n# document will be used as proxy URL, other contents in the document will be\n# ignored.\n#\n# Example:\n# \"/signaling/proxy/server/one\" -> {\"address\": \"https://proxy1.domain.invalid\"}\n# \"/signaling/proxy/server/two\" -> {\"address\": \"https://proxy2.domain.invalid\"}\n#keyprefix = /signaling/proxy/server\n\n[turn]\n# API key that the MCU will need to send when requesting TURN credentials.\n#apikey = the-api-key-for-the-rest-service\n\n# The shared secret to use for generating TURN credentials. This must be the\n# same as on the TURN server.\n#secret = 6d1c17a7-c736-4e22-b02c-e2955b7ecc64\n\n# A comma-separated list of TURN servers to use. Leave empty to disable the\n# TURN REST API.\n#servers = turn:1.2.3.4:9991?transport=udp,turn:1.2.3.4:9991?transport=tcp\n\n[geoip]\n# License key to use when downloading the MaxMind GeoIP database. You can\n# register an account at \"https://www.maxmind.com/en/geolite2/signup\" for\n# free. See \"https://dev.maxmind.com/geoip/geoip2/geolite2/\" for further\n# information.\n# You can also get a free GeoIP database from https://db-ip.com/ without\n# registration. Provide the URL below in this case.\n# Leave empty to disable GeoIP lookups.\n#license =\n\n# Optional URL to download a MaxMind GeoIP database from. Will be generated if\n# \"license\" is provided above. Can be a \"file://\" url if a local file should\n# be used. Please note that the database must provide a country field when\n# looking up IP addresses.\n#url =\n\n[geoip-overrides]\n# Optional overrides for GeoIP lookups. The key is an IP address / range, the\n# value the associated country code.\n#127.0.0.1 = DE\n#192.168.0.0/24 = DE\n\n[continent-overrides]\n# Optional overrides for continent mappings. The key is a continent code, the\n# value a comma-separated list of continent codes to map the continent to.\n# Use European servers for clients in Africa.\n#AF = EU\n# Use servers in North Africa for clients in South America.\n#SA = NA\n\n[stats]\n# Comma-separated list of IP addresses that are allowed to access the debug,\n# stats and metrics endpoints.\n# Leave empty (or commented) to only allow access from localhost.\n#allowed_ips =\n\n[etcd]\n# Comma-separated list of static etcd endpoints to connect to.\n#endpoints = 127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379\n\n# Options to perform endpoint discovery through DNS SRV.\n# Only used if no endpoints are configured manually.\n#discoverysrv = example.com\n#discoveryservice = foo\n\n# Path to private key, client certificate and CA certificate if TLS\n# authentication should be used.\n#clientkey = /path/to/etcd-client.key\n#clientcert = /path/to/etcd-client.crt\n#cacert = /path/to/etcd-ca.crt\n\n[grpc]\n# IP and port to listen on for GRPC requests.\n# Comment line to disable the listener.\n#listen = 0.0.0.0:9090\n\n# Certificate / private key to use for the GRPC server.\n# Omit to use unencrypted connections.\n#servercertificate = /path/to/grpc-server.crt\n#serverkey = /path/to/grpc-server.key\n\n# CA certificate that is allowed to issue certificates of GRPC servers.\n# Omit to expect unencrypted connections.\n#serverca = /path/to/grpc-ca.crt\n\n# Certificate / private key to use for the GRPC client.\n# Omit if clients don't need to authenticate on the server.\n#clientcertificate = /path/to/grpc-client.crt\n#clientkey = /path/to/grpc-client.key\n\n# CA certificate that is allowed to issue certificates of GRPC clients.\n# Omit to allow any clients to connect.\n#clientca = /path/to/grpc-ca.crt\n\n# Type of GRPC target configuration.\n# Defaults to \"static\".\n#\n# Possible values:\n# - static: A comma-separated list of targets is given in the \"targets\" option.\n# - etcd: Target URLs are retrieved from an etcd cluster.\n#targettype = static\n\n# For target type \"static\": Comma-separated list of GRPC targets to connect to\n# for clustering mode.\n#targets = 192.168.0.1:9090, 192.168.0.2:9090\n\n# For target type \"static\": Enable DNS discovery on hostnames of GRPC target.\n# If a hostname resolves to multiple IP addresses, a connection is established\n# to each of them.\n# Changes to the DNS are monitored regularly and GRPC clients are created or\n# deleted as necessary.\n#dnsdiscovery = true\n\n# For target type \"etcd\": Key prefix of GRPC target entries. All keys below will\n# be watched and assumed to contain a JSON document. The entry \"address\" from\n# this document will be used as target URL, other contents in the document will\n# be ignored.\n#\n# Example:\n# \"/signaling/cluster/grpc/one\" -> {\"address\": \"192.168.0.1:9090\"}\n# \"/signaling/cluster/grpc/two\" -> {\"address\": \"192.168.0.2:9090\"}\n#targetprefix = /signaling/cluster/grpc\n"
  },
  {
    "path": "Containers/talk/start.sh",
    "content": "#!/bin/bash\n\n# Variables\nif [ -z \"$NC_DOMAIN\" ]; then\n    echo \"You need to provide the NC_DOMAIN.\"\n    exit 1\nelif [ -z \"$TALK_PORT\" ]; then\n    echo \"You need to provide the TALK_PORT.\"\n    exit 1\nelif [ -z \"$TURN_SECRET\" ]; then\n    echo \"You need to provide the TURN_SECRET.\"\n    exit 1\nelif [ -z \"$SIGNALING_SECRET\" ]; then\n    echo \"You need to provide the SIGNALING_SECRET.\"\n    exit 1\nelif [ -z \"$INTERNAL_SECRET\" ]; then\n    echo \"You need to provide the INTERNAL_SECRET.\"\n    exit 1\nfi\n\n# Trust additional CA certificates, if the user provided NEXTCLOUD_TRUSTED_CACERTS_DIR\n# The container is read-only, so we build a custom bundle in /tmp (tmpfs) and\n# point Go's TLS stack to it via SSL_CERT_FILE.\nif mountpoint -q /usr/local/share/ca-certificates; then\n    echo \"Trusting additional CA certificates...\"\n    set -x\n    cp /etc/ssl/certs/ca-certificates.crt /tmp/ca-certificates.crt\n    for cert in /usr/local/share/ca-certificates/*; do\n        if [ -f \"$cert\" ]; then\n            cat \"$cert\" >> /tmp/ca-certificates.crt\n        fi\n    done\n    export SSL_CERT_FILE=/tmp/ca-certificates.crt\n    set +x\nfi\n\nset -x\nIPv4_ADDRESS_TALK_RELAY=\"$(hostname -i | grep -oP '[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+' | head -1)\"\n# shellcheck disable=SC2153\nIPv4_ADDRESS_TALK=\"$(dig \"$TALK_HOST\" IN A +short +search | grep '^[0-9.]\\+$' | sort | head -n1)\"\n# shellcheck disable=SC2153\nIPv6_ADDRESS_TALK=\"$(dig \"$TALK_HOST\" AAAA +short +search | grep '^[0-9a-f:]\\+$' | sort | head -n1)\"\nset +x\n\nif [ -n \"$IPv4_ADDRESS_TALK\" ] && [ \"$IPv4_ADDRESS_TALK_RELAY\" = \"$IPv4_ADDRESS_TALK\" ]; then\n    IPv4_ADDRESS_TALK=\"\"\nfi\n\nset -x\nIP_BINDING=\"::\"\nif grep -q \"1\" /sys/module/ipv6/parameters/disable \\\n|| grep -q \"1\" /proc/sys/net/ipv6/conf/all/disable_ipv6 \\\n|| grep -q \"1\" /proc/sys/net/ipv6/conf/default/disable_ipv6; then\n    IP_BINDING=\"0.0.0.0\"\nfi\nset +x\n\n# Turn\ncat << TURN_CONF > \"/conf/eturnal.yml\"\neturnal:\n  listen:\n    - ip: \"$IP_BINDING\"\n      port: $TALK_PORT\n      transport: udp\n    - ip: \"$IP_BINDING\"\n      port: $TALK_PORT\n      transport: tcp\n  log_dir: stdout\n  log_level: warning\n  secret: \"$TURN_SECRET\"\n  relay_ipv4_addr: \"$IPv4_ADDRESS_TALK_RELAY\"\n  relay_ipv6_addr: \"$IPv6_ADDRESS_TALK\"\n  blacklist_peers:\n  - recommended\n  whitelist_peers:\n  - 127.0.0.1\n  - ::1\n  - \"$IPv4_ADDRESS_TALK_RELAY\"\n  - \"$IPv4_ADDRESS_TALK\"\n  - \"$IPv6_ADDRESS_TALK\"\nTURN_CONF\n\n# Remove empty lines so that the config is not invalid\nsed -i '/\"\"/d' /conf/eturnal.yml\n\nif [ -z \"$TALK_MAX_STREAM_BITRATE\" ]; then\n    TALK_MAX_STREAM_BITRATE=1048576\nfi\n\nif [ -z \"$TALK_MAX_SCREEN_BITRATE\" ]; then\n    TALK_MAX_SCREEN_BITRATE=2097152\nfi\n\n# Signling\ncat << SIGNALING_CONF > \"/conf/signaling.conf\"\n[http]\nlisten = 0.0.0.0:8081\n\n[app]\ndebug = false\n\n[sessions]\nhashkey = $(openssl rand -hex 16)\nblockkey = $(openssl rand -hex 16)\n\n[clients]\ninternalsecret = ${INTERNAL_SECRET}\n\n[backend]\nbackends = backend-1\nallowall = false\ntimeout = 10\nconnectionsperhost = 8\nskipverify = ${SKIP_CERT_VERIFY}\n\n[backend-1]\nurls = https://${NC_DOMAIN}\nsecret = ${SIGNALING_SECRET}\nmaxstreambitrate = ${TALK_MAX_STREAM_BITRATE}\nmaxscreenbitrate = ${TALK_MAX_SCREEN_BITRATE}\n\n[nats]\nurl = nats://127.0.0.1:4222\n\n[mcu]\ntype = janus\nurl = ws://127.0.0.1:8188\nmaxstreambitrate = ${TALK_MAX_STREAM_BITRATE}\nmaxscreenbitrate = ${TALK_MAX_SCREEN_BITRATE}\nSIGNALING_CONF\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/talk/supervisord.conf",
    "content": "[supervisord]\nnodaemon=true\nlogfile=/var/log/supervisord/supervisord.log\npidfile=/var/run/supervisord/supervisord.pid\nchildlogdir=/var/log/supervisord/\nlogfile_maxbytes=50MB                           \nlogfile_backups=10                              \nloglevel=error\n\n[program:eturnal]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=eturnalctl foreground\n\n[program:nats-server]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=nats-server -c /etc/nats.conf\n\n[program:janus]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n# debug-level 3 means warning\ncommand=janus --config=/usr/local/etc/janus/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level 3\n\n[program:signaling]\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\ncommand=nextcloud-spreed-signaling -config /conf/signaling.conf\n"
  },
  {
    "path": "Containers/talk-recording/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM python:3.14.3-alpine3.23\n\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nENV RECORDING_VERSION=v0.2.1\nENV ALLOW_ALL=false\nENV HPB_PROTOCOL=https\nENV NC_PROTOCOL=https\nENV SKIP_VERIFY=false\nENV HPB_PATH=/standalone-signaling/\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        ca-certificates \\\n        tzdata \\\n        bash \\\n        xvfb \\\n        ffmpeg \\\n        firefox \\\n        font-noto-all \\\n        font-noto-cjk \\\n        font-noto-cjk-extra \\\n        bind-tools \\\n        netcat-openbsd \\\n        git \\\n        wget \\\n        shadow \\\n        pulseaudio \\\n        openssl \\\n        build-base \\\n        linux-headers \\\n        geckodriver; \\\n    useradd -d /tmp --system recording -u 122; \\\n# Give root a random password\n    echo \"root:$(openssl rand -base64 12)\" | chpasswd; \\\n    git clone --recursive https://github.com/nextcloud/nextcloud-talk-recording --depth=1 --single-branch --branch \"$RECORDING_VERSION\" /src; \\\n    python3 -m pip install --no-cache-dir /src; \\\n    rm -rf /src; \\\n    touch /etc/recording.conf; \\\n    chown recording:recording -R \\\n        /tmp /etc/recording.conf; \\\n    mkdir -p /conf; \\\n    chmod 777 /conf; \\\n    chmod 777 /tmp; \\\n    apk del --no-cache \\\n        git \\\n        wget \\\n        shadow \\\n        openssl \\\n        build-base \\\n        linux-headers;\n\nVOLUME /tmp\nWORKDIR /tmp\nUSER 122\nENTRYPOINT [\"/start.sh\"]\nCMD [\"python\", \"-m\", \"nextcloud.talk.recording\", \"--config\", \"/conf/recording.conf\"]\n\nHEALTHCHECK CMD /healthcheck.sh\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/talk-recording/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z 127.0.0.1 1234 || exit 1\n"
  },
  {
    "path": "Containers/talk-recording/recording.conf",
    "content": "# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n# SPDX-License-Identifier: AGPL-3.0-or-later\n[logs]\n# Log level based on numeric values of Python logging levels:\n# - Critical: 50\n# - Error:    40\n# - Warning:  30\n# - Info:     20\n# - Debug:    10\n# - Not set:   0\n#level = 20\n\n[http]\n# IP and port to listen on for HTTP requests.\n#listen = 127.0.0.1:8000\n\n[app]\n# Comma separated list of trusted proxies (IPs or CIDR networks) that may set\n# the \"X-Forwarded-For\" header.\n#trustedproxies =\n\n[backend]\n# Allow any hostname as backend endpoint. This is extremely insecure and should\n# only be used during development.\n#allowall = false\n\n# Common shared secret for requests from and to the backend servers if\n# \"allowall\" is enabled. This must be the same value as configured in the\n# Nextcloud admin ui.\n#secret = the-shared-secret\n\n# Comma-separated list of backend ids allowed to connect.\n#backends = backend-id, another-backend\n\n# If set to \"true\", certificate validation of backend endpoints will be skipped.\n# This should only be enabled during development, e.g. to work with self-signed\n# certificates.\n# Overridable by backend.\n#skipverify = false\n\n# Maximum allowed size in bytes for messages sent by the backend.\n# Overridable by backend.\n#maxmessagesize = 1024\n\n# Width for recorded videos.\n# Overridable by backend.\n#videowidth = 1920\n\n# Height for recorded videos.\n# Overridable by backend.\n#videoheight = 1080\n\n# Temporary directory used to store recordings until uploaded. It must be\n# writable by the user running the recording server.\n# Overridable by backend.\n#directory = /tmp\n\n# Backend configurations as defined in the \"[backend]\" section above. The\n# section names must match the ids used in \"backends\" above.\n#[backend-id]\n# URL of the Nextcloud instance\n#url = https://cloud.domain.invalid\n\n# Shared secret for requests from and to the backend servers. This must be the\n# same value as configured in the Nextcloud admin ui.\n#secret = the-shared-secret\n\n#[another-backend]\n# URL of the Nextcloud instance\n#url = https://cloud.otherdomain.invalid\n\n# Shared secret for requests from and to the backend servers. This must be the\n# same value as configured in the Nextcloud admin ui.\n#secret = the-shared-secret\n\n[signaling]\n# Common shared secret for authenticating as an internal client of signaling\n# servers if a specific secret is not set for a signaling server. This must be\n# the same value as configured in the signaling server configuration file.\n#internalsecret = the-shared-secret-for-internal-clients\n\n# Comma-separated list of signaling servers with specific internal secrets.\n#signalings = signaling-id, another-signaling\n\n# Signaling server configurations as defined in the \"[signaling]\" section above.\n# The section names must match the ids used in \"signalings\" above.\n#[signaling-id]\n# URL of the signaling server\n#url = https://signaling.domain.invalid\n\n# Shared secret for authenticating as an internal client of signaling servers.\n# This must be the same value as configured in the signaling server\n# configuration file.\n#internalsecret = the-shared-secret-for-internal-clients\n\n#[another-signaling]\n# URL of the signaling server\n#url = https://signaling.otherdomain.invalid\n\n# Shared secret for authenticating as an internal client of signaling servers.\n# This must be the same value as configured in the signaling server\n# configuration file.\n#internalsecret = the-shared-secret-for-internal-clients\n\n[ffmpeg]\n# The ffmpeg executable (name or full path) and the global options given to\n# ffmpeg. The options given here fully override the default global options.\n#common = ffmpeg -loglevel level+warning -n\n\n# The (additional) options given to ffmpeg for the audio input. The options\n# given here extend the default options for the audio input, although they do\n# not override them.\n# Default options: '-f pulse -i {AUDIO_SOURCE}'\n#inputaudio =\n\n# The (additional) options given to ffmpeg for the video input. The options\n# given here extend the default options for the video input, although they do\n# not override them.\n# Default options: '-f x11grab -draw_mouse 0 -video_size {WIDTH}x{HEIGHT} -i {VIDEO_SOURCE}'\n#inputvideo =\n\n# The options given to ffmpeg to encode the audio output. The options given here\n# fully override the default options for the audio output.\n#outputaudio = -c:a libopus\n\n# The options given to ffmpeg to encode the video output. The options given here\n# fully override the default options for the video output.\n#outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M\n\n# The extension of the file for audio only recordings.\n#extensionaudio = .ogg\n\n# The extension of the file for audio and video recordings.\n#extensionvideo = .webm\n\n[recording]\n# Browser to use for recordings. Please note that the \"chrome\" value does not\n# refer to the web browser, but to the Selenium WebDriver. In practice, \"chrome\"\n# will use Google Chrome, or Chromium if Google Chrome is not installed.\n# Allowed values: firefox, chrome\n# Defaults to firefox\n#browser = firefox\n\n# Path to the Selenium driver to use for recordings.\n# If set the driver must match the browser being used (for example,\n# \"/usr/bin/geckodriver\" for \"firefox\"). If no driver is explicitly set Selenium\n# Manager will try to find the right one in $PATH, downloading it as a fallback.\n# Note that Selenium Manager does not work in some architectures (for example,\n# Linux on arm64/aarch64), so in those architectures the driver must be\n# explicitly set.\n#driverPath =\n\n# Path to the browser executable to use for recordings.\n# If set the executable must match the browser being used (for example,\n# \"/usr/bin/firefox-esr\" for \"firefox\"). If no executable is explicitly set\n# Selenium Manager will try to find the right one in $PATH. Depending on the\n# installed Selenium version if the executable is not found Selenium Manager may\n# also download the browser as a fallback.\n# Note that Selenium Manager does not work in some architectures (for example,\n# Linux on arm64/aarch64); in those architectures the Selenium driver will try\n# to find the executable, but the executable may need to be explicitly set if\n# not found by the driver.\n#browserPath =\n\n[stats]\n# Comma-separated list of IP addresses (or CIDR networks) that are allowed to\n# access the stats endpoint.\n# Leave commented to only allow access from \"127.0.0.1\".\n#allowed_ips =\n"
  },
  {
    "path": "Containers/talk-recording/start.sh",
    "content": "#!/bin/bash\n\n# Variables\nif [ -z \"$NC_DOMAIN\" ]; then\n    echo \"You need to provide the NC_DOMAIN.\"\n    exit 1\nelif [ -z \"$RECORDING_SECRET\" ]; then\n    echo \"You need to provide the RECORDING_SECRET.\"\n    exit 1\nelif [ -z \"$INTERNAL_SECRET\" ]; then\n    echo \"You need to provide the INTERNAL_SECRET.\"\n    exit 1\nfi\n\nif [ -z \"$HPB_DOMAIN\" ]; then\n    export HPB_DOMAIN=\"$NC_DOMAIN\"\nfi\n\n# Delete all contents on startup to start fresh\nrm -fr /tmp/{*,.*}\n\ncat << RECORDING_CONF > \"/conf/recording.conf\"\n[logs]\n# 30 means Warning\nlevel = 30\n\n[http]\nlisten = 0.0.0.0:1234\n\n[backend]\nallowall = ${ALLOW_ALL}\n# The secret below is still needed if allowall is set to true, also it doesn't hurt to be here\nsecret = ${RECORDING_SECRET}\nbackends = backend-1\nskipverify = ${SKIP_VERIFY}\nmaxmessagesize = 1024\nvideowidth = 1920\nvideoheight = 1080\ndirectory = /tmp\n\n[backend-1]\nurl = ${NC_PROTOCOL}://${NC_DOMAIN}\nsecret = ${RECORDING_SECRET}\nskipverify = ${SKIP_VERIFY}\n\n[signaling]\nsignalings = signaling-1\n\n[signaling-1]\nurl = ${HPB_PROTOCOL}://${HPB_DOMAIN}${HPB_PATH}\ninternalsecret = ${INTERNAL_SECRET}\n\n[ffmpeg]\n# common = ffmpeg -loglevel level+warning -n\n# outputaudio = -c:a libopus\n# outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M\nextensionaudio = .ogg\nextensionvideo = .webm\n\n[recording]\nbrowser = firefox\ndriverPath = /usr/bin/geckodriver\nbrowserPath = /usr/bin/firefox\nRECORDING_CONF\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/watchtower/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\nFROM golang:1.26.1-alpine3.23 AS go\n\nENV WATCHTOWER_COMMIT_HASH=5a33e3c0aa3b2770c648a114b4a9d32e0a5b55ba\t\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache \\\n        build-base; \\\n    go install github.com/nicholas-fedor/watchtower@$WATCHTOWER_COMMIT_HASH # v1.14.4\n\nFROM alpine:3.23.3\n\nRUN set -ex; \\\n    apk upgrade --no-cache -a; \\\n    apk add --no-cache bash ca-certificates tzdata\n\nCOPY --from=go /go/bin/watchtower /watchtower\n\nCOPY --chmod=775 start.sh /start.sh\n\n# hadolint ignore=DL3002\nUSER root\n\nENTRYPOINT [\"/start.sh\"]\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/watchtower/start.sh",
    "content": "#!/bin/bash\n\n# Check if socket is available and readable\nif ! [ -e \"/var/run/docker.sock\" ]; then\n    echo \"Docker socket is not available. Cannot continue.\"\n    exit 1\nelif ! test -r /var/run/docker.sock; then\n    echo \"Docker socket is not readable by the root user. Cannot continue.\"\n    exit 1\nfi\n\nif [ -f /run/.containerenv ]; then\n    # If running under podman disable memory_swappiness setting in watchtower.\n    # It is a necessary workaround until https://github.com/containers/podman/issues/23824 gets fixed.\n    echo \"Running under Podman. Setting WATCHTOWER_DISABLE_MEMORY_SWAPPINESS to 1.\"\n    export WATCHTOWER_DISABLE_MEMORY_SWAPPINESS=1\nfi\n\nif [ -n \"$CONTAINER_TO_UPDATE\" ]; then\n    exec /watchtower --cleanup --debug --run-once \"$CONTAINER_TO_UPDATE\"\nelse\n    echo \"'CONTAINER_TO_UPDATE' is not set. Cannot update anything.\"\n    exit 1\nfi\n\nexec \"$@\"\n"
  },
  {
    "path": "Containers/whiteboard/Dockerfile",
    "content": "# syntax=docker/dockerfile:latest\n# Probably from this file: https://github.com/nextcloud/whiteboard/blob/main/Dockerfile\nFROM ghcr.io/nextcloud-releases/whiteboard:v1.5.7\n\nUSER root\nRUN set -ex; \\\n    apk add --no-cache bash jq; \\\n    chmod 777 -R /tmp; \\\n    if [ -f /usr/lib/chromium/chrome_crashpad_handler ] && [ ! -f /usr/lib/chromium/chrome_crashpad_handler.real ]; then \\\n        mv /usr/lib/chromium/chrome_crashpad_handler /usr/lib/chromium/chrome_crashpad_handler.real; \\\n        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; \\\n        chmod +x /usr/lib/chromium/chrome_crashpad_handler; \\\n    fi\nUSER 65534\n\nCOPY --chmod=775 start.sh /start.sh\nCOPY --chmod=775 healthcheck.sh /healthcheck.sh\n\nHEALTHCHECK CMD /healthcheck.sh\n\nWORKDIR /tmp\n\nENTRYPOINT [\"/start.sh\"]\n\nLABEL com.centurylinklabs.watchtower.enable=\"false\" \\\n    wud.watch=\"false\" \\\n    org.label-schema.vendor=\"Nextcloud\"\n"
  },
  {
    "path": "Containers/whiteboard/healthcheck.sh",
    "content": "#!/bin/bash\n\nnc -z \"$REDIS_HOST\" \"$REDIS_PORT\" || exit 0\nnc -z 127.0.0.1 3002 || exit 1\n"
  },
  {
    "path": "Containers/whiteboard/start.sh",
    "content": "#!/bin/bash\n\n# Only start container if nextcloud is accessible\nwhile ! nc -z \"$REDIS_HOST\" \"$REDIS_PORT\"; do\n    echo \"Waiting for redis to start...\"\n    sleep 5\ndone\n\n# Set a default for redis db index\nif [ -z \"$REDIS_DB_INDEX\" ]; then\n    REDIS_DB_INDEX=0\nfi\n\n# URL-encode password\nREDIS_HOST_PASSWORD=\"$(jq -rn --arg v \"$REDIS_HOST_PASSWORD\" '$v|@uri')\"\n\nexport REDIS_URL=\"redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST:$REDIS_PORT/$REDIS_DB_INDEX\"\n\n# Run it\nexec npm --prefix /app run server:start\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "app/.editorconfig",
    "content": "# https://editorconfig.org\n\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 4\nindent_style = tab\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.feature]\nindent_size = 2\nindent_style = space\n\n[*.yml]\nindent_size = 2\nindent_style = space\n"
  },
  {
    "path": "app/appinfo/info.xml",
    "content": "<?xml version=\"1.0\"?>\n<info xmlns:xsi= \"http://www.w3.org/2001/XMLSchema-instance\"\n\t  xsi:noNamespaceSchemaLocation=\"https://apps.nextcloud.com/schema/apps/info.xsd\">\n\t<id>nextcloud-aio</id>\n\t<name>Nextcloud All-in-One</name>\n\t<summary>Provides a login link for admins.</summary>\n\t<description>Add a link to the admin settings that gives access to the Nextcloud All-in-One admin interface</description>\n\t<version>0.8.0</version>\n\t<licence>agpl</licence>\n\t<author>Azul</author>\n\t<namespace>AllInOne</namespace>\n\t<default_enable/>\n\t<category>monitoring</category>\n\t<bugs>https://github.com/nextcloud/all-in-one/issues</bugs>\n\t<dependencies>\n\t\t<nextcloud min-version=\"31\" max-version=\"32\"/>\n\t</dependencies>\n\n\t<settings>\n\t\t<admin>OCA\\AllInOne\\Settings\\Admin</admin>\n\t</settings>\n\n</info>\n"
  },
  {
    "path": "app/composer/autoload.php",
    "content": "<?php\n\n// autoload.php @generated by Composer\n\nrequire_once __DIR__ . '/composer/autoload_real.php';\n\nreturn ComposerAutoloaderInitAllInOne::getLoader();\n"
  },
  {
    "path": "app/composer/composer/ClassLoader.php",
    "content": "<?php\n\n/*\n * This file is part of Composer.\n *\n * (c) Nils Adermann <naderman@naderman.de>\n *     Jordi Boggiano <j.boggiano@seld.be>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Composer\\Autoload;\n\n/**\n * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.\n *\n *     $loader = new \\Composer\\Autoload\\ClassLoader();\n *\n *     // register classes with namespaces\n *     $loader->add('Symfony\\Component', __DIR__.'/component');\n *     $loader->add('Symfony',           __DIR__.'/framework');\n *\n *     // activate the autoloader\n *     $loader->register();\n *\n *     // to enable searching the include path (eg. for PEAR packages)\n *     $loader->setUseIncludePath(true);\n *\n * In this example, if you try to use a class in the Symfony\\Component\n * namespace or one of its children (Symfony\\Component\\Console for instance),\n * the autoloader will first look for the class under the component/\n * directory, and it will then fallback to the framework/ directory if not\n * found before giving up.\n *\n * This class is loosely based on the Symfony UniversalClassLoader.\n *\n * @author Fabien Potencier <fabien@symfony.com>\n * @author Jordi Boggiano <j.boggiano@seld.be>\n * @see    https://www.php-fig.org/psr/psr-0/\n * @see    https://www.php-fig.org/psr/psr-4/\n */\nclass ClassLoader\n{\n    private $vendorDir;\n\n    // PSR-4\n    private $prefixLengthsPsr4 = array();\n    private $prefixDirsPsr4 = array();\n    private $fallbackDirsPsr4 = array();\n\n    // PSR-0\n    private $prefixesPsr0 = array();\n    private $fallbackDirsPsr0 = array();\n\n    private $useIncludePath = false;\n    private $classMap = array();\n    private $classMapAuthoritative = false;\n    private $missingClasses = array();\n    private $apcuPrefix;\n\n    private static $registeredLoaders = array();\n\n    public function __construct($vendorDir = null)\n    {\n        $this->vendorDir = $vendorDir;\n    }\n\n    public function getPrefixes()\n    {\n        if (!empty($this->prefixesPsr0)) {\n            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));\n        }\n\n        return array();\n    }\n\n    public function getPrefixesPsr4()\n    {\n        return $this->prefixDirsPsr4;\n    }\n\n    public function getFallbackDirs()\n    {\n        return $this->fallbackDirsPsr0;\n    }\n\n    public function getFallbackDirsPsr4()\n    {\n        return $this->fallbackDirsPsr4;\n    }\n\n    public function getClassMap()\n    {\n        return $this->classMap;\n    }\n\n    /**\n     * @param array $classMap Class to filename map\n     */\n    public function addClassMap(array $classMap)\n    {\n        if ($this->classMap) {\n            $this->classMap = array_merge($this->classMap, $classMap);\n        } else {\n            $this->classMap = $classMap;\n        }\n    }\n\n    /**\n     * Registers a set of PSR-0 directories for a given prefix, either\n     * appending or prepending to the ones previously set for this prefix.\n     *\n     * @param string       $prefix  The prefix\n     * @param array|string $paths   The PSR-0 root directories\n     * @param bool         $prepend Whether to prepend the directories\n     */\n    public function add($prefix, $paths, $prepend = false)\n    {\n        if (!$prefix) {\n            if ($prepend) {\n                $this->fallbackDirsPsr0 = array_merge(\n                    (array) $paths,\n                    $this->fallbackDirsPsr0\n                );\n            } else {\n                $this->fallbackDirsPsr0 = array_merge(\n                    $this->fallbackDirsPsr0,\n                    (array) $paths\n                );\n            }\n\n            return;\n        }\n\n        $first = $prefix[0];\n        if (!isset($this->prefixesPsr0[$first][$prefix])) {\n            $this->prefixesPsr0[$first][$prefix] = (array) $paths;\n\n            return;\n        }\n        if ($prepend) {\n            $this->prefixesPsr0[$first][$prefix] = array_merge(\n                (array) $paths,\n                $this->prefixesPsr0[$first][$prefix]\n            );\n        } else {\n            $this->prefixesPsr0[$first][$prefix] = array_merge(\n                $this->prefixesPsr0[$first][$prefix],\n                (array) $paths\n            );\n        }\n    }\n\n    /**\n     * Registers a set of PSR-4 directories for a given namespace, either\n     * appending or prepending to the ones previously set for this namespace.\n     *\n     * @param string       $prefix  The prefix/namespace, with trailing '\\\\'\n     * @param array|string $paths   The PSR-4 base directories\n     * @param bool         $prepend Whether to prepend the directories\n     *\n     * @throws \\InvalidArgumentException\n     */\n    public function addPsr4($prefix, $paths, $prepend = false)\n    {\n        if (!$prefix) {\n            // Register directories for the root namespace.\n            if ($prepend) {\n                $this->fallbackDirsPsr4 = array_merge(\n                    (array) $paths,\n                    $this->fallbackDirsPsr4\n                );\n            } else {\n                $this->fallbackDirsPsr4 = array_merge(\n                    $this->fallbackDirsPsr4,\n                    (array) $paths\n                );\n            }\n        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {\n            // Register directories for a new namespace.\n            $length = strlen($prefix);\n            if ('\\\\' !== $prefix[$length - 1]) {\n                throw new \\InvalidArgumentException(\"A non-empty PSR-4 prefix must end with a namespace separator.\");\n            }\n            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;\n            $this->prefixDirsPsr4[$prefix] = (array) $paths;\n        } elseif ($prepend) {\n            // Prepend directories for an already registered namespace.\n            $this->prefixDirsPsr4[$prefix] = array_merge(\n                (array) $paths,\n                $this->prefixDirsPsr4[$prefix]\n            );\n        } else {\n            // Append directories for an already registered namespace.\n            $this->prefixDirsPsr4[$prefix] = array_merge(\n                $this->prefixDirsPsr4[$prefix],\n                (array) $paths\n            );\n        }\n    }\n\n    /**\n     * Registers a set of PSR-0 directories for a given prefix,\n     * replacing any others previously set for this prefix.\n     *\n     * @param string       $prefix The prefix\n     * @param array|string $paths  The PSR-0 base directories\n     */\n    public function set($prefix, $paths)\n    {\n        if (!$prefix) {\n            $this->fallbackDirsPsr0 = (array) $paths;\n        } else {\n            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;\n        }\n    }\n\n    /**\n     * Registers a set of PSR-4 directories for a given namespace,\n     * replacing any others previously set for this namespace.\n     *\n     * @param string       $prefix The prefix/namespace, with trailing '\\\\'\n     * @param array|string $paths  The PSR-4 base directories\n     *\n     * @throws \\InvalidArgumentException\n     */\n    public function setPsr4($prefix, $paths)\n    {\n        if (!$prefix) {\n            $this->fallbackDirsPsr4 = (array) $paths;\n        } else {\n            $length = strlen($prefix);\n            if ('\\\\' !== $prefix[$length - 1]) {\n                throw new \\InvalidArgumentException(\"A non-empty PSR-4 prefix must end with a namespace separator.\");\n            }\n            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;\n            $this->prefixDirsPsr4[$prefix] = (array) $paths;\n        }\n    }\n\n    /**\n     * Turns on searching the include path for class files.\n     *\n     * @param bool $useIncludePath\n     */\n    public function setUseIncludePath($useIncludePath)\n    {\n        $this->useIncludePath = $useIncludePath;\n    }\n\n    /**\n     * Can be used to check if the autoloader uses the include path to check\n     * for classes.\n     *\n     * @return bool\n     */\n    public function getUseIncludePath()\n    {\n        return $this->useIncludePath;\n    }\n\n    /**\n     * Turns off searching the prefix and fallback directories for classes\n     * that have not been registered with the class map.\n     *\n     * @param bool $classMapAuthoritative\n     */\n    public function setClassMapAuthoritative($classMapAuthoritative)\n    {\n        $this->classMapAuthoritative = $classMapAuthoritative;\n    }\n\n    /**\n     * Should class lookup fail if not found in the current class map?\n     *\n     * @return bool\n     */\n    public function isClassMapAuthoritative()\n    {\n        return $this->classMapAuthoritative;\n    }\n\n    /**\n     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.\n     *\n     * @param string|null $apcuPrefix\n     */\n    public function setApcuPrefix($apcuPrefix)\n    {\n        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;\n    }\n\n    /**\n     * The APCu prefix in use, or null if APCu caching is not enabled.\n     *\n     * @return string|null\n     */\n    public function getApcuPrefix()\n    {\n        return $this->apcuPrefix;\n    }\n\n    /**\n     * Registers this instance as an autoloader.\n     *\n     * @param bool $prepend Whether to prepend the autoloader or not\n     */\n    public function register($prepend = false)\n    {\n        spl_autoload_register(array($this, 'loadClass'), true, $prepend);\n\n        if (null === $this->vendorDir) {\n            return;\n        }\n\n        if ($prepend) {\n            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;\n        } else {\n            unset(self::$registeredLoaders[$this->vendorDir]);\n            self::$registeredLoaders[$this->vendorDir] = $this;\n        }\n    }\n\n    /**\n     * Unregisters this instance as an autoloader.\n     */\n    public function unregister()\n    {\n        spl_autoload_unregister(array($this, 'loadClass'));\n\n        if (null !== $this->vendorDir) {\n            unset(self::$registeredLoaders[$this->vendorDir]);\n        }\n    }\n\n    /**\n     * Loads the given class or interface.\n     *\n     * @param  string    $class The name of the class\n     * @return true|null True if loaded, null otherwise\n     */\n    public function loadClass($class)\n    {\n        if ($file = $this->findFile($class)) {\n            includeFile($file);\n\n            return true;\n        }\n\n        return null;\n    }\n\n    /**\n     * Finds the path to the file where the class is defined.\n     *\n     * @param string $class The name of the class\n     *\n     * @return string|false The path if found, false otherwise\n     */\n    public function findFile($class)\n    {\n        // class map lookup\n        if (isset($this->classMap[$class])) {\n            return $this->classMap[$class];\n        }\n        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {\n            return false;\n        }\n        if (null !== $this->apcuPrefix) {\n            $file = apcu_fetch($this->apcuPrefix.$class, $hit);\n            if ($hit) {\n                return $file;\n            }\n        }\n\n        $file = $this->findFileWithExtension($class, '.php');\n\n        // Search for Hack files if we are running on HHVM\n        if (false === $file && defined('HHVM_VERSION')) {\n            $file = $this->findFileWithExtension($class, '.hh');\n        }\n\n        if (null !== $this->apcuPrefix) {\n            apcu_add($this->apcuPrefix.$class, $file);\n        }\n\n        if (false === $file) {\n            // Remember that this class does not exist.\n            $this->missingClasses[$class] = true;\n        }\n\n        return $file;\n    }\n\n    /**\n     * Returns the currently registered loaders indexed by their corresponding vendor directories.\n     *\n     * @return self[]\n     */\n    public static function getRegisteredLoaders()\n    {\n        return self::$registeredLoaders;\n    }\n\n    private function findFileWithExtension($class, $ext)\n    {\n        // PSR-4 lookup\n        $logicalPathPsr4 = strtr($class, '\\\\', DIRECTORY_SEPARATOR) . $ext;\n\n        $first = $class[0];\n        if (isset($this->prefixLengthsPsr4[$first])) {\n            $subPath = $class;\n            while (false !== $lastPos = strrpos($subPath, '\\\\')) {\n                $subPath = substr($subPath, 0, $lastPos);\n                $search = $subPath . '\\\\';\n                if (isset($this->prefixDirsPsr4[$search])) {\n                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);\n                    foreach ($this->prefixDirsPsr4[$search] as $dir) {\n                        if (file_exists($file = $dir . $pathEnd)) {\n                            return $file;\n                        }\n                    }\n                }\n            }\n        }\n\n        // PSR-4 fallback dirs\n        foreach ($this->fallbackDirsPsr4 as $dir) {\n            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {\n                return $file;\n            }\n        }\n\n        // PSR-0 lookup\n        if (false !== $pos = strrpos($class, '\\\\')) {\n            // namespaced class name\n            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)\n                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);\n        } else {\n            // PEAR-like class name\n            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;\n        }\n\n        if (isset($this->prefixesPsr0[$first])) {\n            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {\n                if (0 === strpos($class, $prefix)) {\n                    foreach ($dirs as $dir) {\n                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {\n                            return $file;\n                        }\n                    }\n                }\n            }\n        }\n\n        // PSR-0 fallback dirs\n        foreach ($this->fallbackDirsPsr0 as $dir) {\n            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {\n                return $file;\n            }\n        }\n\n        // PSR-0 include paths.\n        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {\n            return $file;\n        }\n\n        return false;\n    }\n}\n\n/**\n * Scope isolated include.\n *\n * Prevents access to $this/self from included files.\n */\nfunction includeFile($file)\n{\n    include $file;\n}\n"
  },
  {
    "path": "app/composer/composer/InstalledVersions.php",
    "content": "<?php\n\n/*\n * This file is part of Composer.\n *\n * (c) Nils Adermann <naderman@naderman.de>\n *     Jordi Boggiano <j.boggiano@seld.be>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Composer;\n\nuse Composer\\Autoload\\ClassLoader;\nuse Composer\\Semver\\VersionParser;\n\n/**\n * This class is copied in every Composer installed project and available to all\n *\n * See also https://getcomposer.org/doc/07-runtime.md#installed-versions\n *\n * To require it's presence, you can require `composer-runtime-api ^2.0`\n */\nclass InstalledVersions\n{\n    private static $installed;\n    private static $canGetVendors;\n    private static $installedByVendor = array();\n\n    /**\n     * Returns a list of all package names which are present, either by being installed, replaced or provided\n     *\n     * @return string[]\n     * @psalm-return list<string>\n     */\n    public static function getInstalledPackages()\n    {\n        $packages = array();\n        foreach (self::getInstalled() as $installed) {\n            $packages[] = array_keys($installed['versions']);\n        }\n\n        if (1 === \\count($packages)) {\n            return $packages[0];\n        }\n\n        return array_keys(array_flip(\\call_user_func_array('array_merge', $packages)));\n    }\n\n    /**\n     * Returns a list of all package names with a specific type e.g. 'library'\n     *\n     * @param  string   $type\n     * @return string[]\n     * @psalm-return list<string>\n     */\n    public static function getInstalledPackagesByType($type)\n    {\n        $packagesByType = array();\n\n        foreach (self::getInstalled() as $installed) {\n            foreach ($installed['versions'] as $name => $package) {\n                if (isset($package['type']) && $package['type'] === $type) {\n                    $packagesByType[] = $name;\n                }\n            }\n        }\n\n        return $packagesByType;\n    }\n\n    /**\n     * Checks whether the given package is installed\n     *\n     * This also returns true if the package name is provided or replaced by another package\n     *\n     * @param  string $packageName\n     * @param  bool   $includeDevRequirements\n     * @return bool\n     */\n    public static function isInstalled($packageName, $includeDevRequirements = true)\n    {\n        foreach (self::getInstalled() as $installed) {\n            if (isset($installed['versions'][$packageName])) {\n                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Checks whether the given package satisfies a version constraint\n     *\n     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:\n     *\n     *   Composer\\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')\n     *\n     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality\n     * @param  string        $packageName\n     * @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\n     * @return bool\n     */\n    public static function satisfies(VersionParser $parser, $packageName, $constraint)\n    {\n        $constraint = $parser->parseConstraints($constraint);\n        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));\n\n        return $provided->matches($constraint);\n    }\n\n    /**\n     * Returns a version constraint representing all the range(s) which are installed for a given package\n     *\n     * It is easier to use this via isInstalled() with the $constraint argument if you need to check\n     * whether a given version of a package is installed, and not just whether it exists\n     *\n     * @param  string $packageName\n     * @return string Version constraint usable with composer/semver\n     */\n    public static function getVersionRanges($packageName)\n    {\n        foreach (self::getInstalled() as $installed) {\n            if (!isset($installed['versions'][$packageName])) {\n                continue;\n            }\n\n            $ranges = array();\n            if (isset($installed['versions'][$packageName]['pretty_version'])) {\n                $ranges[] = $installed['versions'][$packageName]['pretty_version'];\n            }\n            if (array_key_exists('aliases', $installed['versions'][$packageName])) {\n                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);\n            }\n            if (array_key_exists('replaced', $installed['versions'][$packageName])) {\n                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);\n            }\n            if (array_key_exists('provided', $installed['versions'][$packageName])) {\n                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);\n            }\n\n            return implode(' || ', $ranges);\n        }\n\n        throw new \\OutOfBoundsException('Package \"' . $packageName . '\" is not installed');\n    }\n\n    /**\n     * @param  string      $packageName\n     * @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\n     */\n    public static function getVersion($packageName)\n    {\n        foreach (self::getInstalled() as $installed) {\n            if (!isset($installed['versions'][$packageName])) {\n                continue;\n            }\n\n            if (!isset($installed['versions'][$packageName]['version'])) {\n                return null;\n            }\n\n            return $installed['versions'][$packageName]['version'];\n        }\n\n        throw new \\OutOfBoundsException('Package \"' . $packageName . '\" is not installed');\n    }\n\n    /**\n     * @param  string      $packageName\n     * @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\n     */\n    public static function getPrettyVersion($packageName)\n    {\n        foreach (self::getInstalled() as $installed) {\n            if (!isset($installed['versions'][$packageName])) {\n                continue;\n            }\n\n            if (!isset($installed['versions'][$packageName]['pretty_version'])) {\n                return null;\n            }\n\n            return $installed['versions'][$packageName]['pretty_version'];\n        }\n\n        throw new \\OutOfBoundsException('Package \"' . $packageName . '\" is not installed');\n    }\n\n    /**\n     * @param  string      $packageName\n     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference\n     */\n    public static function getReference($packageName)\n    {\n        foreach (self::getInstalled() as $installed) {\n            if (!isset($installed['versions'][$packageName])) {\n                continue;\n            }\n\n            if (!isset($installed['versions'][$packageName]['reference'])) {\n                return null;\n            }\n\n            return $installed['versions'][$packageName]['reference'];\n        }\n\n        throw new \\OutOfBoundsException('Package \"' . $packageName . '\" is not installed');\n    }\n\n    /**\n     * @param  string      $packageName\n     * @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.\n     */\n    public static function getInstallPath($packageName)\n    {\n        foreach (self::getInstalled() as $installed) {\n            if (!isset($installed['versions'][$packageName])) {\n                continue;\n            }\n\n            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;\n        }\n\n        throw new \\OutOfBoundsException('Package \"' . $packageName . '\" is not installed');\n    }\n\n    /**\n     * @return array\n     * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}\n     */\n    public static function getRootPackage()\n    {\n        $installed = self::getInstalled();\n\n        return $installed[0]['root'];\n    }\n\n    /**\n     * Returns the raw installed.php data for custom implementations\n     *\n     * @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.\n     * @return array[]\n     * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}\n     */\n    public static function getRawData()\n    {\n        @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);\n\n        if (null === self::$installed) {\n            // only require the installed.php file if this file is loaded from its dumped location,\n            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937\n            if (substr(__DIR__, -8, 1) !== 'C') {\n                self::$installed = include __DIR__ . '/installed.php';\n            } else {\n                self::$installed = array();\n            }\n        }\n\n        return self::$installed;\n    }\n\n    /**\n     * Returns the raw data of all installed.php which are currently loaded for custom implementations\n     *\n     * @return array[]\n     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>\n     */\n    public static function getAllRawData()\n    {\n        return self::getInstalled();\n    }\n\n    /**\n     * Lets you reload the static array from another file\n     *\n     * This is only useful for complex integrations in which a project needs to use\n     * this class but then also needs to execute another project's autoloader in process,\n     * and wants to ensure both projects have access to their version of installed.php.\n     *\n     * A typical case would be PHPUnit, where it would need to make sure it reads all\n     * the data it needs from this class, then call reload() with\n     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure\n     * the project in which it runs can then also use this class safely, without\n     * interference between PHPUnit's dependencies and the project's dependencies.\n     *\n     * @param  array[] $data A vendor/composer/installed.php data set\n     * @return void\n     *\n     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data\n     */\n    public static function reload($data)\n    {\n        self::$installed = $data;\n        self::$installedByVendor = array();\n    }\n\n    /**\n     * @return array[]\n     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>\n     */\n    private static function getInstalled()\n    {\n        if (null === self::$canGetVendors) {\n            self::$canGetVendors = method_exists('Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders');\n        }\n\n        $installed = array();\n\n        if (self::$canGetVendors) {\n            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {\n                if (isset(self::$installedByVendor[$vendorDir])) {\n                    $installed[] = self::$installedByVendor[$vendorDir];\n                } elseif (is_file($vendorDir.'/composer/installed.php')) {\n                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';\n                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\\\', '/') === strtr(__DIR__, '\\\\', '/')) {\n                        self::$installed = $installed[count($installed) - 1];\n                    }\n                }\n            }\n        }\n\n        if (null === self::$installed) {\n            // only require the installed.php file if this file is loaded from its dumped location,\n            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937\n            if (substr(__DIR__, -8, 1) !== 'C') {\n                self::$installed = require __DIR__ . '/installed.php';\n            } else {\n                self::$installed = array();\n            }\n        }\n        $installed[] = self::$installed;\n\n        return $installed;\n    }\n}\n"
  },
  {
    "path": "app/composer/composer/LICENSE",
    "content": "\nCopyright (c) Nils Adermann, Jordi Boggiano\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"
  },
  {
    "path": "app/composer/composer/autoload_classmap.php",
    "content": "<?php\n\n// autoload_classmap.php @generated by Composer\n\n$vendorDir = dirname(dirname(__FILE__));\n$baseDir = $vendorDir;\n\nreturn array(\n    'Composer\\\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',\n    'OCA\\\\AllInOne\\\\Settings\\\\Admin' => $baseDir . '/../lib/Settings/Admin.php',\n);\n"
  },
  {
    "path": "app/composer/composer/autoload_namespaces.php",
    "content": "<?php\n\n// autoload_namespaces.php @generated by Composer\n\n$vendorDir = dirname(dirname(__FILE__));\n$baseDir = $vendorDir;\n\nreturn array(\n);\n"
  },
  {
    "path": "app/composer/composer/autoload_psr4.php",
    "content": "<?php\n\n// autoload_psr4.php @generated by Composer\n\n$vendorDir = dirname(dirname(__FILE__));\n$baseDir = $vendorDir;\n\nreturn array(\n    'OCA\\\\AllInOne\\\\' => array($baseDir . '/../lib'),\n);\n"
  },
  {
    "path": "app/composer/composer/autoload_real.php",
    "content": "<?php\n\n// autoload_real.php @generated by Composer\n\nclass ComposerAutoloaderInitAllInOne\n{\n    private static $loader;\n\n    public static function loadClassLoader($class)\n    {\n        if ('Composer\\Autoload\\ClassLoader' === $class) {\n            require __DIR__ . '/ClassLoader.php';\n        }\n    }\n\n    /**\n     * @return \\Composer\\Autoload\\ClassLoader\n     */\n    public static function getLoader()\n    {\n        if (null !== self::$loader) {\n            return self::$loader;\n        }\n\n        spl_autoload_register(array('ComposerAutoloaderInitAllInOne', 'loadClassLoader'), true, true);\n        self::$loader = $loader = new \\Composer\\Autoload\\ClassLoader(\\dirname(\\dirname(__FILE__)));\n        spl_autoload_unregister(array('ComposerAutoloaderInitAllInOne', 'loadClassLoader'));\n\n        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());\n        if ($useStaticLoader) {\n            require __DIR__ . '/autoload_static.php';\n\n            call_user_func(\\Composer\\Autoload\\ComposerStaticInitAllInOne::getInitializer($loader));\n        } else {\n            $classMap = require __DIR__ . '/autoload_classmap.php';\n            if ($classMap) {\n                $loader->addClassMap($classMap);\n            }\n        }\n\n        $loader->setClassMapAuthoritative(true);\n        $loader->register(true);\n\n        return $loader;\n    }\n}\n"
  },
  {
    "path": "app/composer/composer/autoload_static.php",
    "content": "<?php\n\n// autoload_static.php @generated by Composer\n\nnamespace Composer\\Autoload;\n\nclass ComposerStaticInitAllInOne\n{\n    public static $prefixLengthsPsr4 = array (\n        'O' => \n        array (\n            'OCA\\\\AllInOne\\\\' => 13,\n        ),\n    );\n\n    public static $prefixDirsPsr4 = array (\n        'OCA\\\\AllInOne\\\\' => \n        array (\n            0 => __DIR__ . '/..' . '/../lib',\n        ),\n    );\n\n    public static $classMap = array (\n        'Composer\\\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',\n        'OCA\\\\AllInOne\\\\Settings\\\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',\n    );\n\n    public static function getInitializer(ClassLoader $loader)\n    {\n        return \\Closure::bind(function () use ($loader) {\n            $loader->prefixLengthsPsr4 = ComposerStaticInitAllInOne::$prefixLengthsPsr4;\n            $loader->prefixDirsPsr4 = ComposerStaticInitAllInOne::$prefixDirsPsr4;\n            $loader->classMap = ComposerStaticInitAllInOne::$classMap;\n\n        }, null, ClassLoader::class);\n    }\n}\n"
  },
  {
    "path": "app/composer/composer/installed.json",
    "content": "{\n    \"packages\": [],\n    \"dev\": true,\n    \"dev-package-names\": []\n}\n"
  },
  {
    "path": "app/composer/composer/installed.php",
    "content": "<?php return array(\n    'root' => array(\n        'pretty_version' => 'dev-master',\n        'version' => 'dev-master',\n        'type' => 'library',\n        'install_path' => __DIR__ . '/../',\n        'aliases' => array(),\n        'reference' => '1b16a136ebd8f63e09df061d383f34170e2cef35',\n        'name' => '__root__',\n        'dev' => true,\n    ),\n    'versions' => array(\n        '__root__' => array(\n            'pretty_version' => 'dev-master',\n            'version' => 'dev-master',\n            'type' => 'library',\n            'install_path' => __DIR__ . '/../',\n            'aliases' => array(),\n            'reference' => '1b16a136ebd8f63e09df061d383f34170e2cef35',\n            'dev_requirement' => false,\n        ),\n    ),\n);\n"
  },
  {
    "path": "app/composer/composer.json",
    "content": "{\n    \"config\" : {\n        \"vendor-dir\": \".\",\n        \"optimize-autoloader\": true,\n        \"classmap-authoritative\": true,\n        \"autoloader-suffix\": \"AllInOne\"\n    },\n    \"autoload\" : {\n        \"psr-4\": {\n            \"OCA\\\\AllInOne\\\\\": \"../lib/\"\n        }\n    }\n}\n"
  },
  {
    "path": "app/lib/Settings/Admin.php",
    "content": "<?php\n\ndeclare(strict_types=1);\n\n/**\n * @copyright Copyright (c) 2021, Azul <azul@riseup.net>\n *\n * @author Azul <azul@riseup.net>\n *\n * @license AGPL-3.0\n *\n * This code is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License, version 3,\n * as published by the Free Software Foundation.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License, version 3,\n * along with this program. If not, see <http://www.gnu.org/licenses/>\n *\n */\nnamespace OCA\\AllInOne\\Settings;\n\nuse OCP\\AppFramework\\Http\\TemplateResponse;\nuse OCP\\IConfig;\nuse OCP\\IDateTimeFormatter;\nuse OCP\\L10N\\IFactory;\nuse OCP\\Settings\\ISettings;\n\nclass Admin implements ISettings {\n\t/** @var IConfig */\n\tprivate $config;\n\t/** @var IDateTimeFormatter */\n\tprivate $dateTimeFormatter;\n\t/** @var IFactory */\n\tprivate $l10nFactory;\n\n\tpublic function __construct(\n\t\tIConfig $config,\n\t\tIDateTimeFormatter $dateTimeFormatter,\n\t\tIFactory $l10nFactory\n\t) {\n\t\t$this->config = $config;\n\t\t$this->dateTimeFormatter = $dateTimeFormatter;\n\t\t$this->l10nFactory = $l10nFactory;\n\t}\n\n\t/**\n\t * @return TemplateResponse\n\t */\n\tpublic function getForm(): TemplateResponse {\n\t\t$lastUpdateCheckTimestamp = $this->config->getAppValue('core', 'lastupdatedat');\n\t\t$lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp);\n\n\t\t$token = urlencode(getenv('AIO_TOKEN'));\n\t\t$params = [\n\t\t\t'AIOLoginUrl' => 'https://' . getenv('AIO_URL') . '/api/auth/getlogin' . '?token=' . $token,\n\t\t];\n\n\t\treturn new TemplateResponse('nextcloud-aio', 'admin', $params, '');\n\t}\n\n\t/**\n\t * @return string the section ID, e.g. 'sharing'\n\t */\n\tpublic function getSection(): string {\n\t\treturn 'overview';\n\t}\n\n\t/**\n\t * @return int whether the form should be rather on the top or bottom of\n\t * the admin section. The forms are arranged in ascending order of the\n\t * priority values. It is required to return a value between 0 and 100.\n\t *\n\t * E.g.: 70\n\t */\n\tpublic function getPriority(): int {\n\t\treturn 0;\n\t}\n}\n"
  },
  {
    "path": "app/readme.md",
    "content": "## How to develop the app?\n\nPlease note that in order to check if an app is already downloaded\nNextcloud will look for a folder with the same name as the app.\n\nTherefore you need to add the app to one of the app directories\nnaming the directory `nextcloud-aio`.\n"
  },
  {
    "path": "app/templates/admin.php",
    "content": "<?php\ndeclare(strict_types=1);\n/**\n * @copyright (c) 2021 Azul <azul@riseup.net>\n *\n * @author Azul <azul@riseup.net>\n *\n * This file is licensed under the Affero General Public License version 3 or\n * later. See the COPYING file.\n */\n\t/** @var array $_ */ ?>\n<div id=\"allinone\" class=\"section\">\n\t<h2><?php p($l->t('Nextcloud All-in-One'));?></h2><br/>\n\t<a href=\"<?php p($_['AIOLoginUrl']);?>\" class=\"button\" target=\"_blank\">Open Nextcloud AIO Interface ↗</a><br><br>\n\t<p><a href=\"https://github.com/nextcloud/all-in-one#how-to-easily-log-in-to-the-aio-interface\">Click here for more infos on this feature (e.g. also on how to change the link in the button)</a></p>\n</div>\n"
  },
  {
    "path": "community-containers/borgbackup-viewer/borgbackup-viewer.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-borgbackup-viewer\",\n            \"image_tag\": \"v1\",\n            \"display_name\": \"Borg Backup Viewer\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer\",\n            \"image\": \"ghcr.io/szaimen/aio-borgbackup-viewer\",\n            \"internal_port\": \"5801\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"5801\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"BORG_HOST_ID=nextcloud-aio-borgbackup-viewer\",\n                \"WEB_AUTHENTICATION_USERNAME=nextcloud\",\n                \"WEB_AUTHENTICATION_PASSWORD=%BORGBACKUP_VIEWER_PASSWORD%\",\n                \"WEB_LISTENING_PORT=5801\",\n                \"BORG_PASSPHRASE=%BORGBACKUP_PASSWORD%\",\n                \"BORG_REPO=/mnt/borgbackup/borg\"\n            ],\n            \"secrets\": [\n                \"BORGBACKUP_VIEWER_PASSWORD\",\n                \"BORGBACKUP_PASSWORD\"\n            ],\n            \"ui_secret\": \"BORGBACKUP_VIEWER_PASSWORD\",\n            \"volumes\": [\n            {\n                \"source\": \"nextcloud_aio_backup_cache\",\n                \"destination\": \"/root\",\n                \"writeable\": true\n            },\n            {\n                \"source\": \"%NEXTCLOUD_DATADIR%\",\n                \"destination\": \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data\",\n                \"writeable\": true\n            },\n            {\n                \"source\": \"nextcloud_aio_mastercontainer\",\n                \"destination\": \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer\",\n                \"writeable\": true\n            },\n            {\n                \"source\": \"%BORGBACKUP_HOST_LOCATION%\",\n                \"destination\": \"/mnt/borgbackup\",\n                \"writeable\": true\n            },\n            {\n                \"source\": \"nextcloud_aio_elasticsearch\",\n                \"destination\": \"/nextcloud_aio_volumes/nextcloud_aio_elasticsearch\",\n                \"writeable\": true\n            },\n            {\n                \"source\": \"nextcloud_aio_redis\",\n                \"destination\": \"/mnt/redis\",\n                \"writeable\": true\n            }\n            ],\n            \"devices\": [\n                \"/dev/fuse\"\n            ],\n            \"cap_add\": [\n                \"SYS_ADMIN\"\n            ],\n            \"apparmor_unconfined\": true\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/borgbackup-viewer/readme.md",
    "content": "## Borgbackup Viewer\nThis 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.\n\n### Notes\n- 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).\n- 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!\n- 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.\n- 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.\n- ⚠️ 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-borgbackup-viewer\n\n### Maintainer\nhttps://github.com/szaimen\n\n"
  },
  {
    "path": "community-containers/caddy/caddy.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-caddy\",\n            \"display_name\": \"Caddy with geoblocking\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy\",\n            \"image\": \"ghcr.io/szaimen/aio-caddy\",\n            \"image_tag\": \"v4\",\n            \"internal_port\": \"443\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"443\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"NC_DOMAIN=%NC_DOMAIN%\",\n                \"APACHE_PORT=%APACHE_PORT%\",\n                \"APACHE_IP_BINDING=%APACHE_IP_BINDING%\",\n                \"NEXTCLOUD_EXPORTER_CADDY_PASSWORD=%NEXTCLOUD_EXPORTER_CADDY_PASSWORD%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_caddy\",\n                    \"destination\": \"/data\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/nextcloud\",\n                    \"writeable\": false\n                }\n            ],\n            \"secrets\": [\n                \"NEXTCLOUD_EXPORTER_CADDY_PASSWORD\"\n            ],\n            \"aio_variables\": [\n                \"apache_ip_binding=@INTERNAL\",\n                \"apache_port=11000\",\n                \"turn_domain=%NC_DOMAIN%\",\n                \"talk_port=443\"\n            ],\n            \"nextcloud_exec_commands\": [\n                \"mkdir '/mnt/ncdata/admin/files/nextcloud-aio-caddy'\",\n                \"touch '/mnt/ncdata/admin/files/nextcloud-aio-caddy/allowed-countries.txt'\",\n                \"echo 'Scanning nextcloud-aio-caddy folder for admin user...'\",\n                \"php /var/www/html/occ files:scan --path='/admin/files/nextcloud-aio-caddy'\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/caddy/readme.md",
    "content": "## Caddy with geoblocking\nThis 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.\n\n### Notes\n- 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!\n- 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.\n- 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.\n- 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.\n- 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).\n- 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.\n- 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.\n- 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.\n- 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.\n- 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.\n- 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.\n- 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.\n- 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.\n- 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!\n- 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n- 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\n\n### Repository\nhttps://github.com/szaimen/aio-caddy\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/calcardbackup/calcardbackup.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-calcardbackup\",\n            \"display_name\": \"Calendar and contacts backup\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/calcardbackup\",\n            \"image\": \"waja/calcardbackup\",\n            \"image_tag\": \"latest\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"CRON_TIME=0 0 * * *\",\n                \"INIT_BACKUP=yes\",\n                \"BACKUP_DIR=/backup\",\n                \"NC_DIR=/nextcloud\",\n                \"NC_HOST=%NC_DOMAIN%\",\n                \"DB_HOST=nextcloud-aio-database\",\n                \"DB_PORT=5432\",\n                \"CALCARD_OPTS=-ltm 5\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_calcardbackup\",\n                    \"destination\": \"/backup\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_nextcloud\",\n                    \"destination\": \"/nextcloud\",\n                    \"writeable\": false\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_calcardbackup\"\n            ]\n        }\n    ]\n}"
  },
  {
    "path": "community-containers/calcardbackup/readme.md",
    "content": "## calcardbackup  \nThis 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.\n  \n### Notes  \n- Backups will be created at 00:00 UTC every day. Make sure that this does not conflict with the configured daily backups inside AIO.\n- All the exports will be included in AIOs backup solution\n- You can find the exports in the nextcloud_aio_calcardbackup volume\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack  \n  \n### Repository  \nhttps://github.com/waja/docker-calcardbackup\n\n### Maintainer\nhttps://github.com/pailloM\n  \n"
  },
  {
    "path": "community-containers/container-management/container-management.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-container-management\",\n            \"display_name\": \"Container Management\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/container-management\",\n            \"image\": \"ghcr.io/szaimen/aio-container-management\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"5804\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"5804\",\n                    \"protocol\": \"tcp\"\n                }\n            ],\n            \"volumes\": [\n                {\n                  \"source\": \"%WATCHTOWER_DOCKER_SOCKET_PATH%\",\n                  \"destination\": \"/var/run/docker.sock\",\n                  \"writeable\": false\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"SECURE_CONNECTION=1\",\n                \"WEB_AUTHENTICATION=1\",\n                \"USER_ID=0\",\n                \"GROUP_ID=0\",\n                \"WEB_AUTHENTICATION_USERNAME=container-management\",\n                \"WEB_AUTHENTICATION_PASSWORD=%CONTAINER_MANAGEMENT_PASSWORD%\",\n                \"WEB_LISTENING_PORT=5804\"\n            ],\n            \"secrets\": [\n                \"CONTAINER_MANAGEMENT_PASSWORD\"\n            ],\n            \"ui_secret\": \"CONTAINER_MANAGEMENT_PASSWORD\"\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/container-management/readme.md",
    "content": "## Container-Management\nThis 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.\n\n### Notes\n- 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).\n- Then, you should see a terminal. There you can use any docker command. ⚠️ Be very carefully while doing that as can break your instance!\n- 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).\n- ⚠️ 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-container-management\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/dlna/dlna.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-dlna\",\n            \"display_name\": \"DLNA\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/dlna\",\n            \"image\": \"thanek/nextcloud-dlna\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"host\",\n            \"restart\": \"unless-stopped\",\n            \"depends_on\": [\n                \"nextcloud-aio-database\"\n            ],\n            \"environment\": [\n                \"NC_DOMAIN=%NC_DOMAIN%\",\n                \"NC_PORT=443\",\n                \"NEXTCLOUD_DLNA_SERVER_PORT=9999\",\n                \"NEXTCLOUD_DLNA_FRIENDLY_NAME=nextcloud-aio\",\n                \"NEXTCLOUD_DATA_DIR=/data\",\n                \"NEXTCLOUD_DB_TYPE=postgres\",\n                \"NEXTCLOUD_DB_HOST=%AIO_DATABASE_HOST%\",\n                \"NEXTCLOUD_DB_PORT=5432\",\n                \"NEXTCLOUD_DB_NAME=nextcloud_database\",\n                \"NEXTCLOUD_DB_USER=oc_nextcloud\",\n                \"NEXTCLOUD_DB_PASS=%DATABASE_PASSWORD%\"\n            ],\n            \"secrets\": [\n                \"DATABASE_PASSWORD\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/data\",\n                    \"writeable\": false\n                }\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/dlna/readme.md",
    "content": "## DLNA server\nThis 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.\n\n### Notes\n- This container will work only if the Nextcloud installation is in your home network, it is not suitable for installations on remote servers.\n- 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.\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/thanek/nextcloud-dlna\n\n### Maintainer\nhttps://github.com/thanek\n\n"
  },
  {
    "path": "community-containers/facerecognition/facerecognition.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-facerecognition\",\n            \"display_name\": \"Computing container for facerecognition\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/facerecognition\",\n            \"image\": \"matiasdelellis/facerecognition-external-model\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"5000\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"API_KEY=%FACERECOGNITION_API_KEY%\",\n                \"FACE_MODEL=3\"\n            ],\n            \"aio_variables\": [\n                \"nextcloud_memory_limit=2048M\"\n            ],\n            \"secrets\": [\n                \"FACERECOGNITION_API_KEY\"\n            ],\n            \"enable_nvidia_gpu\": false,\n            \"nextcloud_exec_commands\": [\n                \"php /var/www/html/occ app:install facerecognition\",\n                \"php /var/www/html/occ app:enable facerecognition\", \n                \"php /var/www/html/occ config:system:set facerecognition.external_model_url --value nextcloud-aio-facerecognition:5000\",\n                \"php /var/www/html/occ config:system:set facerecognition.external_model_api_key --value %FACERECOGNITION_API_KEY%\",\n                \"php /var/www/html/occ face:setup -m 5\",\n                \"php /var/www/html/occ face:setup -M 1G\",\n                \"php /var/www/html/occ config:app:set facerecognition analysis_image_area --value 4320000\",\n                \"php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 0 --value image/jpeg\",\n                \"php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 1 --value image/png\",\n                \"php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 2 --value image/heic\",\n                \"php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 3 --value image/tiff\",\n                \"php /var/www/html/occ config:system:set enabledFaceRecognitionMimetype 4 --value image/webp\",\n                \"php /var/www/html/occ face:background_job --defer-clustering &\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/facerecognition/readme.md",
    "content": "## Facerecognition\nThis container bundles the external model of facerecognition and auto-configures it for you.\n\n### Notes\n- 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.\n- 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)\n- 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:<br>\n**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`.\n    ```bash\n    # Go into the container\n    sudo docker exec --user www-data -it nextcloud-aio-nextcloud bash\n    ```\n    Now inside the container:\n    ```bash\n    NC_USERS_NEW=$(php occ user:list | sed 's|^  - ||g' | sed 's|:.*||')\n    mapfile -t NC_USERS_NEW <<< \"$NC_USERS_NEW\"\n    for user in \"${NC_USERS_NEW[@]}\"\n    do\n        php occ user:setting \"$user\" facerecognition full_image_scan_done false\n        php occ user:setting \"$user\" facerecognition enabled true\n    done\n\n    # Exit the container shell\n    exit\n    ```\n- 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.<br>\n**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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/matiasdelellis/facerecognition-external-model\n\n### Maintainer\nhttps://github.com/matiasdelellis\n"
  },
  {
    "path": "community-containers/fail2ban/fail2ban.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-fail2ban\",\n            \"display_name\": \"Fail2ban\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban\",\n            \"image\": \"ghcr.io/szaimen/aio-fail2ban\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"host\",\n            \"restart\": \"unless-stopped\",\n            \"cap_add\": [\n                \"NET_ADMIN\",\n                \"NET_RAW\"\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_nextcloud\",\n                    \"destination\": \"/nextcloud\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"nextcloud_aio_vaultwarden_logs\",\n                    \"destination\": \"/vaultwarden\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"nextcloud_aio_jellyfin\",\n                    \"destination\": \"/jellyfin\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"nextcloud_aio_jellyseerr\",\n                    \"destination\": \"/jellyseerr\",\n                    \"writeable\": false\n                }\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/fail2ban/readme.md",
    "content": "## Fail2ban\nThis 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.\n\n### Notes\n- 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`.\n- 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.\n- 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-fail2ban\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/glances/glances.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-glances\",\n            \"display_name\": \"Glances\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/glances\",\n            \"image\": \"nicolargo/glances\",\n            \"image_tag\": \"latest-full\",\n            \"internal_port\": \"61208\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"61208\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_glances\",\n                    \"destination\": \"/etc/glances\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%WATCHTOWER_DOCKER_SOCKET_PATH%\",\n                    \"destination\": \"/var/run/docker.sock\",\n                    \"writeable\": false\n                }\n            ],\n            \"environment\": [\n                \"GLANCES_OPT=-w\"\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_glances\"\n            ]\n        }\n    ]\n}"
  },
  {
    "path": "community-containers/glances/readme.md",
    "content": "## Glances\nThis container starts Glances, a web-based info-board, and auto-configures it for you.\n\n> [!CAUTION]\n> This container mounts the docker-socket from the host-system.\n\n### Notes\n- After adding and starting the container, you can directly visit http://ip.address.of.server:61208/ and access your new Glances instance!\n- 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.\n- 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).\n- The data of Glances will be automatically included in AIO's backup solution!\n- See [here](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) how to add it to the AIO stack.\n\n### Repository\nhttps://github.com/nicolargo/glances\n\n### Maintainer\nhttps://github.com/pi-farm\n"
  },
  {
    "path": "community-containers/helloworld/helloworld.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-helloworld\",\n            \"display_name\": \"Hello world\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/helloworld\",\n            \"image\": \"ghcr.io/docjyj/aio-helloworld\",\n            \"image_tag\": \"%AIO_CHANNEL%\",\n            \"restart\": \"unless-stopped\"\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/helloworld/readme.md",
    "content": "## Hello World\nThis container is a template for creating a community container.\n\n### Repository\nhttps://github.com/docjyj/aio-helloworld\n\n### Maintainer\nhttps://github.com/docjyj\n"
  },
  {
    "path": "community-containers/jellyfin/jellyfin.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-jellyfin\",\n            \"display_name\": \"Jellyfin\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyfin\",\n            \"image\": \"jellyfin/jellyfin\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"host\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_jellyfin\",\n                    \"destination\": \"/config\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/media\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_MOUNT%\",\n                    \"destination\": \"%NEXTCLOUD_MOUNT%\",\n                    \"writeable\": true\n                }\n            ],\n            \"devices\": [\n                \"/dev/dri\"\n            ],\n            \"enable_nvidia_gpu\": true,\n            \"backup_volumes\": [\n                \"nextcloud_aio_jellyfin\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/jellyfin/readme.md",
    "content": "## Jellyfin\nThis container bundles Jellyfin and auto-configures it for you.\n\n### Notes\n- 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!\n- After adding and starting the container, you can directly visit http://ip.address.of.server:8096/ and access your new Jellyfin instance!\n- 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.\n- 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.\n- ⚠️ 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.**\n- 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!\n- 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\n- The data of Jellyfin will be automatically included in AIO's backup solution!\n- See [here](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) how to add it to the AIO stack.\n\n\n### Repository\nhttps://github.com/jellyfin/jellyfin\n\n### Maintainer\nhttps://github.com/airopi\n"
  },
  {
    "path": "community-containers/jellyseerr/jellyseerr.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-jellyseerr\",\n            \"display_name\": \"Seerr\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/jellyseerr\",\n            \"image\": \"ghcr.io/seerr-team/seerr\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"5055\",\n            \"restart\": \"unless-stopped\",\n            \"init\": true,\n            \"ports\": [\n                {\n                    \"ip_binding\": \"%APACHE_IP_BINDING%\",\n                    \"port_number\": \"5055\",\n                    \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"PORT=5055\",\n                \"TZ=%TIMEZONE%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_jellyseerr\",\n                    \"destination\": \"/app/config\",\n                    \"writeable\": true\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_jellyseerr\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/jellyseerr/readme.md",
    "content": "## Seerr\nThis container bundles Seerr and auto-configures it for you.\n\n### Notes\n- **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`\n- This container is only intended to be used inside home networks as it uses http for its management page by default.\n- 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.\n- 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.\n- 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.\n- The config of Seerr will be automatically included in AIO's backup solution!\n- See [here](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) how to add it to the AIO stack.\n\n### Repository\nhttps://github.com/seerr-team/seerr\n\n### Maintainer\nhttps://github.com/Anvil5465\n"
  },
  {
    "path": "community-containers/languagetool/languagetool.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-languagetool\",\n            \"display_name\": \"LanguageTool for Collabora\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/languagetool\",\n            \"image\": \"erikvl87/languagetool\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"8010\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/languagetool/readme.md",
    "content": "## LanguageTool for Nextcloud Office\nThis container bundles a LanguageTool for Nextcloud Office which adds spell checking functionality to Nextcloud Office.\n\n### Notes\n- Make sure to have Nextcloud Office enabled via the AIO interface\n- 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`.\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/Erikvl87/docker-languagetool\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/libretranslate/libretranslate.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-libretranslate\",\n            \"display_name\": \"LibreTranslate (deprecated)\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/libretranslate\",\n            \"image\": \"ghcr.io/szaimen/aio-libretranslate\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"5000\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_libretranslate_db\",\n                    \"destination\": \"/app/db\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_libretranslate_models\",\n                    \"destination\": \"/home/libretranslate/.local\",\n                    \"writeable\": true\n                }\n            ],\n            \"nextcloud_exec_commands\": [\n                \"php /var/www/html/occ app:install integration_libretranslate\",\n                \"php /var/www/html/occ app:enable integration_libretranslate\",\n                \"php /var/www/html/occ config:app:set integration_libretranslate host --value='http://nextcloud-aio-libretranslate'\",\n                \"php /var/www/html/occ config:app:set integration_libretranslate port --value='5000'\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/libretranslate/readme.md",
    "content": "## LibreTranslate\nThis container bundles LibreTranslate and auto-configures it for you.\n\n> [!WARNING]\n> The LibreTranslate container and app is deprecated!\n> Please use the [translate2 app](https://apps.nextcloud.com/apps/translate2) instead.\n> 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.\n\n### Notes\n- After the initial startup is done, you might want to change the default language to translate from and to via:\n```bash\n# Adjust the values `en` and `de` in commands below accordingly\nsudo docker exec --user www-data nextcloud-aio-nextcloud php occ config:app:set integration_libretranslate from_lang --value=\"en\"\nsudo docker exec --user www-data nextcloud-aio-nextcloud php occ config:app:set integration_libretranslate to_lang --value=\"de\"\n```\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-libretranslate\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/lldap/lldap.json",
    "content": "{\n  \"aio_services_v1\": [\n    {\n      \"container_name\": \"nextcloud-aio-lldap\",\n      \"display_name\": \"Light LDAP implementation\",\n      \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/lldap\",\n      \"image\": \"lldap/lldap\",\n      \"image_tag\": \"v0-alpine\",\n      \"internal_port\": \"17170\",\n      \"restart\": \"unless-stopped\",\n      \"ports\": [\n        {\n          \"ip_binding\": \"%APACHE_IP_BINDING%\",\n          \"port_number\": \"17170\",\n          \"protocol\": \"tcp\"\n        }\n      ],\n      \"environment\": [\n        \"TZ=%TIMEZONE%\",\n        \"UID=65534\",\n        \"GID=65534\",\n        \"LLDAP_JWT_SECRET=%LLDAP_JWT_SECRET%\",\n        \"LLDAP_LDAP_USER_PASS=%LLDAP_LDAP_USER_PASS%\",\n        \"LLDAP_LDAP_BASE_DN=%NC_BASE_DN%\"\n      ],\n      \"secrets\": [\n        \"LLDAP_JWT_SECRET\",\n        \"LLDAP_LDAP_USER_PASS\"\n      ],\n      \"ui_secret\": \"LLDAP_LDAP_USER_PASS\",\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_lldap\",\n          \"destination\": \"/data\",\n          \"writeable\": true\n        }\n      ],\n      \"backup_volumes\": [\n        \"nextcloud_aio_lldap\"\n      ],\n      \"nextcloud_exec_commands\": [\n        \"php /var/www/html/occ app:install user_ldap\",\n        \"php /var/www/html/occ app:enable user_ldap\"\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "community-containers/lldap/readme.md",
    "content": "## Light LDAP server\nThis container bundles LLDAP server and auto-configures your Nextcloud instance for you.\n\n### Notes\n- 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.\n- 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.\n- To configure Nextcloud, you can use the generic configuration proposed below.\n- For advanced configurations, see how to configure a client with lldap https://github.com/lldap/lldap#client-configuration\n- Also, see how Nextcloud's LDAP application works https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/user_auth_ldap.html\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Generic Nextcloud LDAP config\nFunctionality with this configuration:\n- User and group management.\n- Login via username (or email) and password.\n- Profile picture sync.\n- Synchronization of administrator accounts (via the lldap_admin group).\n\n> For simplicity, this configuration is done via the command line (don't worry, it's very simple).\n\nFirst, 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.\n\nNow go into the Nextcloud container:<br>\n**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`.\n```bash\nsudo docker exec --user www-data -it nextcloud-aio-nextcloud bash\n```\nNow inside the container:\n```bash\n# Get Base\nBASE_DN=\"dc=${NC_DOMAIN//./,dc=}\"\n\n# Create a new empty ldap config\nCONF_NAME=$(php /var/www/html/occ ldap:create-empty-config -p)\n\n# Check that the base DN matches your domain and retrieve your configuration name\necho \"Base DN: '$BASE_DN', Config name: '$CONF_NAME'\"\n\n# Set the ldap password\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapAgentPassword \"<your-password>\"\n\n# Set the ldap config: Host and connection\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapAdminGroup       lldap_admin\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapAgentName        \"cn=admin,ou=people,$BASE_DN\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapBase             \"$BASE_DN\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapHost             \"ldap://nextcloud-aio-lldap\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapPort             3890\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapTLS              0\nphp /var/www/html/occ ldap:set-config $CONF_NAME turnOnPasswordChange 0\n\n# Set the ldap config: Users\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapBaseUsers             \"ou=people,$BASE_DN\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapEmailAttribute        mail\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapGidNumber             gidNumber\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapLoginFilter           \"(&(|(objectclass=person))(|(uid=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))))\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapLoginFilterEmail      1\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapLoginFilterUsername   1\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapUserAvatarRule        default\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapUserDisplayName       cn\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapUserFilter            \"(|(objectclass=person))\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapUserFilterMode        0\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapUserFilterObjectclass person\n\n# Set the ldap config: Groups\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapBaseGroups                \"ou=groups,$BASE_DN\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupDisplayName          cn\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupFilter               \"(&(|(objectclass=groupOfUniqueNames)))\"\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupFilterMode           0\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupFilterObjectclass    groupOfUniqueNames\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapGroupMemberAssocAttr      uniqueMember\nphp /var/www/html/occ ldap:set-config $CONF_NAME useMemberOfToDetectMembership 1\n\n# Optional : Check the configuration\n#php /var/www/html/occ ldap:show-config $CONF_NAME\n\n# Test the ldap config\nphp /var/www/html/occ ldap:test-config $CONF_NAME\n\n# Enable ldap config\nphp /var/www/html/occ ldap:set-config $CONF_NAME ldapConfigurationActive 1\n\n# Exit the container shell\nexit\n```\nIt's done ! All you have to do is go to the Nextcloud administration interface to see the magic of LDAP.\n\n### Repository\nhttps://github.com/lldap/lldap\n\n### Maintainer\nhttps://github.com/docjyj\n"
  },
  {
    "path": "community-containers/local-ai/local-ai.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-local-ai\",\n            \"display_name\": \"Local AI\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/local-ai\",\n            \"image\": \"ghcr.io/docjyj/aio-local-ai-vulkan\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"10078\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"LOCALAI_API_KEY=%LOCALAI_API_KEY%\",\n                \"LOCALAI_ADDRESS=:10078\",\n                \"LOCALAI_CONFIG_DIR=/configuration\",\n                \"LOCALAI_MODEL_PATH=/models\",\n                \"LOCALAI_BACKEND_PATH=/backends\"\n            ],\n            \"ports\": [\n                {\n                  \"ip_binding\": \"%APACHE_IP_BINDING%\",\n                  \"port_number\": \"10078\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"volumes\": [\n                {\n                  \"source\": \"nextcloud_aio_localai_configuration\",\n                  \"destination\": \"/configuration\",\n                  \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_localai_models\",\n                    \"destination\": \"/models\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_localai_backends\",\n                    \"destination\": \"/backends\",\n                    \"writeable\": true\n                }\n            ],\n            \"secrets\": [\n                \"LOCALAI_API_KEY\"\n            ],\n            \"ui_secret\": \"LOCALAI_API_KEY\",\n            \"devices\": [\n                \"/dev/dri\"\n            ],\n            \"nextcloud_exec_commands\": [\n                \"php /var/www/html/occ app:install integration_openai\",\n                \"php /var/www/html/occ app:enable integration_openai\",\n                \"php /var/www/html/occ config:app:set integration_openai url --value http://nextcloud-aio-local-ai:10078\",\n                \"php /var/www/html/occ config:app:set integration_openai api_key --value %LOCALAI_API_KEY%\",\n                \"php /var/www/html/occ app:install assistant\",\n                \"php /var/www/html/occ app:enable assistant\"\n            ],\n            \"backup_volumes\": [\n              \"nextcloud_aio_localai_configuration\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/local-ai/readme.md",
    "content": "## Local AI\nThis container bundles Local AI and auto-configures it for you. It support hardware acceleration with Vulkan.\n\n### Notes\nDocumentation 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!\n\n- See https://github.com/docjyJ/aio-local-ai-vulkan#getting-started for getting start with this container.\n- See [this guide](https://github.com/nextcloud/all-in-one/discussions/5430) for how to improve AI task pickup speed\n- Note that Nextcloud supports only one server for AI queries, so this container cannot be used at the same time as other AI containers.\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/docjyJ/aio-local-ai-vulkan\n\n### Maintainer\nhttps://github.com/docjyJ\n"
  },
  {
    "path": "community-containers/makemkv/makemkv.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-makekv\",\n            \"display_name\": \"MakeMKV\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/makemkv\",\n            \"image\": \"jlesage/makemkv\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"5802\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"5802\",\n                    \"protocol\": \"tcp\"\n                }\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_makemkv\",\n                    \"destination\": \"/config\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/storage\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_MOUNT%\",\n                    \"destination\": \"/output\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"/dev\",\n                    \"destination\": \"/dev\",\n                    \"writeable\": false\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"SECURE_CONNECTION=1\",\n                \"WEB_AUTHENTICATION=1\",\n                \"USER_ID=33\",\n                \"GROUP_ID=33\",\n                \"WEB_AUTHENTICATION_USERNAME=makemkv\",\n                \"WEB_AUTHENTICATION_PASSWORD=%MAKEMKV_PASSWORD%\",\n                \"WEB_LISTENING_PORT=5802\"\n            ],\n            \"secrets\": [\n                \"MAKEMKV_PASSWORD\"\n            ],\n            \"ui_secret\": \"MAKEMKV_PASSWORD\",\n            \"backup_volumes\": [\n                \"nextcloud_aio_makemkv\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/makemkv/readme.md",
    "content": "## MakeMKV\nThis container bundles MakeMKV and auto-configures it for you.\n\n### Notes\n- This container should only be run in home networks\n- ⚠️ 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.\n- This container only works on Linux and not on Docker-Desktop.\n- 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..\n- 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).\n- 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)\n- The configured `NEXTCLOUD_DATADIR` is getting mounted to `/storage` inside the container.\n- The config data of MakeMKV will be automatically included in AIOs backup solution!\n- ⚠️ 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/jlesage/docker-makemkv\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/memories/memories.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-memories\",\n            \"display_name\": \"Memories Transcoder\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/memories\",\n            \"image\": \"radialapps/go-vod\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"47788\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"NEXTCLOUD_HOST=https://%NC_DOMAIN%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/mnt/ncdata\",\n                    \"writeable\": false\n                },\n                { \n                    \"source\": \"%NEXTCLOUD_MOUNT%\", \n                    \"destination\": \"%NEXTCLOUD_MOUNT%\", \n                    \"writeable\": false \n                }\n            ],\n            \"devices\": [\n                \"/dev/dri\"\n            ],\n            \"enable_nvidia_gpu\": true,\n            \"nextcloud_exec_commands\": [\n                \"php /var/www/html/occ app:install memories\",\n                \"php /var/www/html/occ app:enable memories\",\n                \"php /var/www/html/occ config:system:set memories.vod.external --value true --type bool\",\n                \"php /var/www/html/occ config:system:set memories.vod.connect --value nextcloud-aio-memories:47788\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/memories/readme.md",
    "content": "## Memories\nThis container bundles the hardware-transcoding container of memories and auto-configures it for you.\n\n### Notes\n- 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/pulsejet/memories\n\n### Maintainer\nhttps://github.com/pulsejet\n"
  },
  {
    "path": "community-containers/minio/minio.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-minio\",\n            \"image_tag\": \"v2\",\n            \"display_name\": \"Minio S3 Storage\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/minio\",\n            \"image\": \"ghcr.io/szaimen/aio-minio\",\n            \"internal_port\": \"9000\",\n            \"environment\": [\n                \"MINIO_ROOT_USER=nextcloud\",\n                \"MINIO_ROOT_PASSWORD=%MINIO_ROOT_PASSWORD%\"\n            ],\n            \"secrets\": [\n                \"MINIO_ROOT_PASSWORD\"\n            ],\n            \"volumes\": [\n            {\n                \"source\": \"nextcloud_aio_minio\",\n                \"destination\": \"/data\",\n                \"writeable\": true\n            }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_minio\"\n            ],\n            \"nextcloud_exec_commands\": [\n                \"php /var/www/html/occ config:system:set objectstore class --value 'OC\\\\Files\\\\ObjectStore\\\\S3'\",\n                \"php /var/www/html/occ config:system:set objectstore arguments autocreate --value true --type bool\",\n                \"php /var/www/html/occ config:system:set objectstore arguments use_path_style --value true --type bool\",\n                \"php /var/www/html/occ config:system:set objectstore arguments use_ssl --value false --type bool\",\n                \"php /var/www/html/occ config:system:set objectstore arguments region --value ''\",\n                \"php /var/www/html/occ config:system:set objectstore arguments bucket --value nextcloud\",\n                \"php /var/www/html/occ config:system:set objectstore arguments key --value nextcloud\",\n                \"php /var/www/html/occ config:system:set objectstore arguments secret --value %MINIO_ROOT_PASSWORD%\",\n                \"php /var/www/html/occ config:system:set objectstore arguments port --value 9000\",\n                \"php /var/www/html/occ config:system:set objectstore arguments hostname --value nextcloud-aio-minio\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/minio/readme.md",
    "content": "## Minio\nThis container bundles minio s3 storage and auto-configures it for you.\n\n>[!WARNING]\n> Enabling this container will remove access to all the files formerly written to the data directory.\n> So only enable this on a clean instance directly after installing AIO.\n> All additional users that are added via Nextcloud afterwards are going to work correctly.\n> 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.\n\n### Notes\n- The data of Minio will be automatically included in AIOs backup solution!\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-minio\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/nextcloud-exporter/nextcloud-exporter.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-nextcloud-exporter\",\n            \"display_name\": \"Prometheus Nextcloud Exporter\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/nextcloud-exporter\",\n            \"image\": \"ghcr.io/xperimental/nextcloud-exporter\",\n            \"image_tag\": \"0.9.0\",\n            \"internal_port\": \"9205\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"127.0.0.1\",\n                  \"port_number\": \"9205\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"NEXTCLOUD_SERVER=https://%NC_DOMAIN%\",\n                \"NEXTCLOUD_AUTH_TOKEN=%NEXTCLOUD_EXPORTER_TOKEN%\",\n                \"NEXTCLOUD_LISTEN_ADDRESS=0.0.0.0:9205\",\n                \"NEXTCLOUD_TIMEOUT=5s\"\n            ],\n            \"ui_secret\": \"NEXTCLOUD_EXPORTER_CADDY_PASSWORD\",\n            \"secrets\": [\n                \"NEXTCLOUD_EXPORTER_TOKEN\",\n                \"NEXTCLOUD_EXPORTER_CADDY_PASSWORD\"\n            ],\n            \"nextcloud_exec_commands\": [\n                \"php /var/www/html/occ config:app:set serverinfo token --value %NEXTCLOUD_EXPORTER_TOKEN%\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/nextcloud-exporter/readme.md",
    "content": "## Prometheus Nextcloud Exporter\n\nA Prometheus exporter that collects metrics from your Nextcloud instance for monitoring and alerting.\n\n### How to install\n\nSee 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.\n\n### Security & Access\n\n**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.\n\n#### Access Options\n\n1. **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`\n\n   **Getting Authentication Credentials**: \n   - **Username**: Always `metrics`\n   - **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\". \n\n2. **Custom Reverse Proxy**: Set up your own reverse proxy (nginx, Apache, etc.) to provide HTTPS and authentication. See configuration guides:\n   - [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/)\n   - [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)\n   - [Traefik BasicAuth](https://doc.traefik.io/traefik/middlewares/http/basicauth/)\n   - [Prometheus Security Best Practices](https://prometheus.io/docs/operating/security/)\n\n3. **Direct Local Access**: Access metrics directly from the server at `http://127.0.0.1:9205/metrics` (no authentication)\n\n### What it monitors\n- User activity (active users hourly, daily)\n- File counts and storage usage\n- System health and database size\n- App statistics and update availability\n- Nextcloud performance metrics\n\n### Prometheus Configuration\n\nFor **local server access** (if Prometheus runs on the same server):\n```yaml\nscrape_configs:\n  - job_name: 'nextcloud'\n    scrape_interval: 90s\n    static_configs:\n      - targets: ['127.0.0.1:9205']\n    metrics_path: /metrics\n    scheme: http\n```\n\nFor **Caddy integration** (secure external access):\n```yaml\nscrape_configs:\n  - job_name: 'nextcloud'\n    scrape_interval: 90s\n    static_configs:\n      - targets: ['metrics.your-domain.com']\n    metrics_path: /\n    scheme: https\n    basic_auth:\n      username: 'metrics'\n      password: 'your-generated-password'\n```\n\n### Visualization\n\nCompatible with Grafana for creating monitoring dashboards:\n- Pre-built dashboard available: [Grafana Dashboard #20716](https://grafana.com/grafana/dashboards/20716-nextcloud/)\n\n### Repository\nhttps://github.com/xperimental/nextcloud-exporter\n\n### Maintainer\nhttps://github.com/grotax\n"
  },
  {
    "path": "community-containers/nocodb/nocodb.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-nocodb\",\n            \"display_name\": \"NocoDB (deprecated)\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/nocodb\",\n            \"image\": \"nocodb/nocodb\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"10028\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                    \"ip_binding\": \"%APACHE_IP_BINDING%\",\n                    \"port_number\": \"10028\",\n                    \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"NC_AUTH_JWT_SECRET=%NOCODB_JWT_SECRET%\",\n                \"NC_PUBLIC_URL=https://tables.%NC_DOMAIN%/\",\n                \"NC_DASHBOARD_URL=/\",\n                \"NC_ADMIN_EMAIL=admin@noco.db\",\n                \"NC_ADMIN_PASS=%NOCODB_USER_PASS%\",\n                \"PORT=10028\",\n                \"NC_DISABLE_TELE=true\"\n            ],\n            \"secrets\": [\n                \"NOCODB_JWT_SECRET\",\n                \"NOCODB_USER_PASS\"\n            ],\n            \"ui_secret\": \"NOCODB_USER_PASS\",\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_nocodb\",\n                    \"destination\": \"/usr/app/data\",\n                    \"writeable\": true\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_nocodb\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/nocodb/readme.md",
    "content": "> [!CAUTION]\n> NocoDB is licensed under a non-free license.\n> \n> And is no longer maintained.\n\n> [!NOTE]\n> This container is there to compensate for the lack of functionality in Nextcloud Tables.\n>\n> When Nextcloud Tables V2 is released, I will stop checking for updates, and will no longer fix any potential issues.\n>\n> Some missing functionality in Nextcloud Tables:\n> - Multiple view layout (Gantt, Kanban, Calendar...)\n> - Field (Person, Tag, File...)\n> - See more here https://github.com/nextcloud/tables/issues/103 \n\n## NocoDb server\nThis container bundles NocoDb without synchronization with Nextcloud.\n\nThis is an alternative of **Airtable**.\n\n### Notes\n- 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.\n- Currently, only `tables.$NC_DOMAIN` is supported as subdomain! So if Nextcloud is using `your-domain.com`, nocodb will use `tables.your-domain.com`.\n- The data of NocoDb will be automatically included in AIOs backup solution!\n- 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. \n- See https://docs.nocodb.com/ for usage of NocoDb\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/nocodb/nocodb\n\n### Maintainer\nhttps://github.com/docjyJ\n"
  },
  {
    "path": "community-containers/notifications/notifications.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-notifications\",\n            \"display_name\": \"Notifications\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/notifications\",\n            \"image\": \"ghcr.io/szaimen/aio-notifications\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"10000\",\n            \"restart\": \"unless-stopped\",\n            \"volumes\": [\n                {\n                  \"source\": \"%WATCHTOWER_DOCKER_SOCKET_PATH%\",\n                  \"destination\": \"/var/run/docker.sock\",\n                  \"writeable\": false\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/notifications/readme.md",
    "content": "## Notifications\nThis container allows other AIO community containers to send admin notifications to Nextcloud users. \n\n### Notes\n- 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.\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-notifications\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/npmplus/npmplus.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-npmplus\",\n            \"display_name\": \"NPMplus\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/npmplus\",\n            \"image\": \"ghcr.io/zoeyvid/npmplus\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"host\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"NC_AIO=true\",\n                \"NC_DOMAIN=%NC_DOMAIN%\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_npmplus\",\n                    \"destination\": \"/data\",\n                    \"writeable\": true\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_npmplus\"\n            ],\n            \"aio_variables\": [\n                \"apache_ip_binding=127.0.0.1\",\n                \"apache_port=11000\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/npmplus/readme.md",
    "content": "## NPMplus\nThis 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.\n\n### Notes\n- 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!\n- 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.\n- 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.\n- After the container was started the first time, please check the logs for errors. Then you can open NPMplus on `https://<ip>:81` and change the password. \n- The default password is `iArhP1j7p1P6TA92FA2FMbbUGYqwcYzxC4AVEe12Wbi94FY9gNN62aKyF1shrvG4NycjjX9KfmDQiwkLZH1ZDR9xMjiG2QmoHXi` and the default email is `admin@example.org`\n- 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.\n- 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\n- The data (certs, configs, etc.) of NPMplus will be automatically included in AIOs backup solution!\n- **Important:** you always need to enable https for your hosts, since `DISABLE_HTTP` is set to true by default\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository and Documentation\nhttps://github.com/ZoeyVid/NPMplus\n\n### Maintainer\nhttps://github.com/Zoey2936\n"
  },
  {
    "path": "community-containers/pi-hole/pi-hole.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-pihole\",\n            \"display_name\": \"Pi-hole\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/pi-hole\",\n            \"image\": \"pihole/pihole\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"8573\",\n            \"restart\": \"unless-stopped\",\n            \"init\": false,\n            \"ports\": [\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"53\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"53\",\n                    \"protocol\": \"udp\"\n                },\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"8573\",\n                    \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"FTLCONF_webserver_api_password=%PIHOLE_WEBPASSWORD%\",\n                \"FTLCONF_dns_listeningMode=all\",\n                \"FTLCONF_webserver_port=8573\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_pihole\",\n                    \"destination\": \"/etc/pihole\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_pihole_dnsmasq\",\n                    \"destination\": \"/etc/dnsmasq.d\",\n                    \"writeable\": true\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_pihole\",\n                \"nextcloud_aio_pihole_dnsmasq\"\n            ],\n            \"ui_secret\": \"PIHOLE_WEBPASSWORD\",\n            \"secrets\": [\n                \"PIHOLE_WEBPASSWORD\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/pi-hole/readme.md",
    "content": "## Pi-hole\nThis container bundles pi-hole and auto-configures it for you.\n\n### Notes\n- You should not run this container on a public VPS! It is only intended to run in home networks!\n- 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!\n- The DHCP functionality of Pi-hole has been disabled!\n- The data of pi-hole will be automatically included in AIOs backup solution!\n- 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.\n- You can configure your home network now to use pi-hole as its dns server by configuring your router.\n- 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\" ] } `.\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/pi-hole/docker-pi-hole\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/plex/plex.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-plex\",\n            \"display_name\": \"Plex\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/plex\",\n            \"image\": \"plexinc/pms-docker\",\n            \"image_tag\": \"latest\",\n            \"internal_port\": \"host\",\n            \"restart\": \"unless-stopped\",\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"PLEX_UID=33\",\n                \"PLEX_GID=33\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_plex\",\n                    \"destination\": \"/config\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/data\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_MOUNT%\",\n                    \"destination\": \"%NEXTCLOUD_MOUNT%\",\n                    \"writeable\": false\n                }\n            ],\n            \"devices\": [\n                \"/dev/dri\"\n            ],\n            \"enable_nvidia_gpu\": true,\n            \"backup_volumes\": [\n                \"nextcloud_aio_plex\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/plex/readme.md",
    "content": "## Plex\nThis container bundles Plex and auto-configures it for you.\n\n### Notes\n- 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!\n- This is not working on arm64 since Plex does only provide x64 docker images.\n- 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.\n- 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!\n- 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\n- The data of Plex will be automatically included in AIOs backup solution!\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/plexinc/pms-docker\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/readme.md",
    "content": "# Community containers\nThis directory features containers that are built for AIO which allows to add additional functionality very easily.\n\n## Disclaimers\nAll 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.\n\n## How to use this?\nStarting 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). \n⚠️⚠️⚠️ 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.\n\n## How to add containers?\nSimply 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.\n\n### Is there a list of ideas for new community containers?\nYes, 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.\n\n## How to remove containers from AIOs stack?\nYou can remove containers now via the web interface.\n\nAfter 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\n"
  },
  {
    "path": "community-containers/scrutiny/readme.md",
    "content": "## Scrutiny\nThis container bundles Scrutiny which is a frontend for SMART stats and auto-configures it for you.\n\n### Notes\n- This container should only be run in home networks\n- ⚠️ 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.\n- This container only works on Linux and not on Docker-Desktop.\n- After adding and starting the container, you need to visit `http://internal.ip.of.server:8000` which will show the dashboard for your drives.\n- 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\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-scrutiny\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/scrutiny/scrutiny.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-scrutiny\",\n            \"display_name\": \"Scrutiny\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/scrutiny\",\n            \"image\": \"ghcr.io/szaimen/aio-scrutiny\",\n            \"image_tag\": \"v2\",\n            \"internal_port\": \"8000\",\n            \"init\": false,\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"8000\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"cap_add\": [\n                \"SYS_RAWIO\",\n                \"SYS_ADMIN\"\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"SCRUTINY_WEB_LISTEN_PORT=8000\",\n                \"COLLECTOR_API_ENDPOINT=http://127.0.0.1:8000\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_scrutiny\",\n                    \"destination\": \"/opt/scrutiny/config\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_scrutiny_db\",\n                    \"destination\": \"/opt/scrutiny/influxdb\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"/run/udev\",\n                    \"destination\": \"/run/udev\",\n                    \"writeable\": false\n                },\n                {\n                    \"source\": \"/dev\",\n                    \"destination\": \"/dev\",\n                    \"writeable\": false\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_scrutiny\",\n                \"nextcloud_aio_scrutiny_db\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/smbserver/readme.md",
    "content": "## SMB-server\nThis container bundles an SMB-server and allows to configure it via a graphical shell script.\n\n### Notes\n- This container should only be run in home networks\n- 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.\n- The config data of SMB-server will be automatically included in AIOs backup solution!\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/szaimen/aio-smbserver/\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/smbserver/smbserver.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-smbserver\",\n            \"display_name\": \"SMB-server\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/smbserver\",\n            \"image\": \"ghcr.io/szaimen/aio-smbserver\",\n            \"image_tag\": \"v1\",\n            \"internal_port\": \"5803\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"5803\",\n                    \"protocol\": \"tcp\"\n                },\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"445\",\n                    \"protocol\": \"tcp\"\n                },\n                {\n                    \"ip_binding\": \"\",\n                    \"port_number\": \"139\",\n                    \"protocol\": \"tcp\"\n                }\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_smbserver\",\n                    \"destination\": \"/smbserver\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_DATADIR%\",\n                    \"destination\": \"/mnt/ncdata\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"%NEXTCLOUD_MOUNT%\",\n                    \"destination\": \"/mnt\",\n                    \"writeable\": true\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"WEB_AUTHENTICATION_USERNAME=smbserver\",\n                \"WEB_AUTHENTICATION_PASSWORD=%SMBSERVER_PASSWORD%\",\n                \"WEB_LISTENING_PORT=5803\"\n            ],\n            \"secrets\": [\n                \"SMBSERVER_PASSWORD\"\n            ],\n            \"ui_secret\": \"SMBSERVER_PASSWORD\",\n            \"backup_volumes\": [\n                \"nextcloud_aio_smbserver\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/stalwart/readme.md",
    "content": "> [!CAUTION]\n> Be aware that the mail server is the most difficult service to deploy.\n> \n> Do not use this feature as a main mail server or without a redundancy system and without knowledge.\n\n## Stalwart mail server\nThis container bundles stalwart mail server and auto-configures it for you.\n\n### Notes\nDocumentation is available on the container repository.\nThis documentation is regularly updated and is intended to be as simple and detailed as possible.\nThanks for all your feedback!\n\n- See https://github.com/docjyJ/aio-stalwart#getting-started for getting start with this container.\n- See https://stalw.art/docs/faq for further faq and docs on the project\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/docjyj/aio-stalwart\n\n### Maintainer\nhttps://github.com/docjyj\n"
  },
  {
    "path": "community-containers/stalwart/stalwart.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-stalwart\",\n            \"display_name\": \"Stalwart\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/stalwart\",\n            \"image\": \"ghcr.io/docjyj/aio-stalwart\",\n            \"image_tag\": \"v3\",\n            \"internal_port\": \"10003\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"25\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"143\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"465\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"587\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"993\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                  \"ip_binding\": \"\",\n                  \"port_number\": \"4190\",\n                  \"protocol\": \"tcp\"\n                },\n                {\n                  \"ip_binding\": \"%APACHE_IP_BINDING%\",\n                  \"port_number\": \"10003\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"NC_DOMAIN=%NC_DOMAIN%\",\n                \"STALWART_USER_PASS=%STALWART_USER_PASS%\",\n                \"CLAMAV_ENABLED=%CLAMAV_ENABLED%\"\n            ],\n            \"secrets\": [\n                \"STALWART_USER_PASS\"\n            ],\n            \"ui_secret\": \"STALWART_USER_PASS\",\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_stalwart\",\n                    \"destination\": \"/opt/stalwart-mail\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_caddy\",\n                    \"destination\": \"/caddy\",\n                    \"writeable\": false\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_stalwart\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "community-containers/vaultwarden/readme.md",
    "content": "## Vaultwarden\nThis container bundles vaultwarden and auto-configures it for you.\n\n### Notes\n- 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.\n- 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!\n- 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\n- The data of Vaultwarden will be automatically included in AIOs backup solution!\n- 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.\n- 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.\n- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack\n\n### Repository\nhttps://github.com/dani-garcia/vaultwarden\n\n### Maintainer\nhttps://github.com/szaimen\n"
  },
  {
    "path": "community-containers/vaultwarden/vaultwarden.json",
    "content": "{\n    \"aio_services_v1\": [\n        {\n            \"container_name\": \"nextcloud-aio-vaultwarden\",\n            \"display_name\": \"Vaultwarden\",\n            \"documentation\": \"https://github.com/nextcloud/all-in-one/tree/main/community-containers/vaultwarden\",\n            \"image\": \"ghcr.io/dani-garcia/vaultwarden\",\n            \"image_tag\": \"alpine\",\n            \"internal_port\": \"8812\",\n            \"restart\": \"unless-stopped\",\n            \"ports\": [\n                {\n                  \"ip_binding\": \"%APACHE_IP_BINDING%\",\n                  \"port_number\": \"8812\",\n                  \"protocol\": \"tcp\"\n                }\n            ],\n            \"environment\": [\n                \"TZ=%TIMEZONE%\",\n                \"ROCKET_PORT=8812\",\n                \"ADMIN_TOKEN=%VAULTWARDEN_ADMIN_TOKEN%\",\n                \"DOMAIN=https://bw.%NC_DOMAIN%\",\n                \"LOG_FILE=/logs/vaultwarden.log\",\n                \"LOG_LEVEL=warn\",\n                \"SIGNUPS_VERIFY=true\",\n                \"SIGNUPS_ALLOWED=false\"\n            ],\n            \"volumes\": [\n                {\n                    \"source\": \"nextcloud_aio_vaultwarden\",\n                    \"destination\": \"/data\",\n                    \"writeable\": true\n                },\n                {\n                    \"source\": \"nextcloud_aio_vaultwarden_logs\",\n                    \"destination\": \"/logs\",\n                    \"writeable\": true\n                }\n            ],\n            \"backup_volumes\": [\n                \"nextcloud_aio_vaultwarden\"\n            ],\n            \"ui_secret\": \"VAULTWARDEN_ADMIN_TOKEN\",\n            \"secrets\": [\n                \"VAULTWARDEN_ADMIN_TOKEN\"\n            ]\n        }\n    ]\n}\n"
  },
  {
    "path": "compose.yaml",
    "content": "name: nextcloud-aio # Add the container to the same compose project like all the sibling containers are added to automatically.\nservices:\n  nextcloud-aio-mastercontainer:\n    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\n    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\n    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\n    container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly\n    volumes:\n      - 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\n      - /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'!\n    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\n    # networks: [\"nextcloud-aio\"]\n    ports:\n      - \"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\n      - \"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\n      - \"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\n    # 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\n    # environment: # Is needed when using any of the options below\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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\n      # 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.\n      # 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\n      # 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\n      # 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\n      # 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'\n\n#   # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/discussions/575\n#   # Alternatively, use Tailscale if you don't have a domain yet. See https://github.com/nextcloud/all-in-one/discussions/6817\n#   # 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\n#   # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588\n#   caddy:\n#     image: caddy:alpine\n#     restart: always\n#     container_name: caddy\n#     volumes:\n#       - caddy_certs:/certs\n#       - caddy_config:/config\n#       - caddy_data:/data\n#       - caddy_sites:/srv\n#     network_mode: \"host\"\n#     configs:\n#       - source: Caddyfile\n#         target: /etc/caddy/Caddyfile\n# configs:\n#   Caddyfile:\n#     content: |\n#       # Adjust cloud.example.com to your domain below\n#       https://cloud.example.com:443 {\n#         reverse_proxy localhost:11000\n#       }\n\nvolumes: # 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\n  nextcloud_aio_mastercontainer:\n    name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work\n  # caddy_certs:\n  # caddy_config:\n  # caddy_data:\n  # caddy_sites:\n\n# # 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\n# networks:\n#   nextcloud-aio:\n#     name: nextcloud-aio\n#     driver_opts:\n#       com.docker.network.driver.mtu: 1440\n"
  },
  {
    "path": "develop.md",
    "content": "## Developer channel\nIf 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:\n```shell\nsudo docker run \\\n--init \\\n--sig-proxy=false \\\n--name nextcloud-aio-mastercontainer \\\n--restart always \\\n--publish 80:80 \\\n--publish 8080:8080 \\\n--publish 8443:8443 \\\n--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n--volume /var/run/docker.sock:/var/run/docker.sock:ro \\\nghcr.io/nextcloud-releases/all-in-one:develop\n```\nAnd you are done :)\nIt will now also select the developer channel for all other containers automatically.\n\n## How to publish new releases?\nSimply use https://github.com/nextcloud/all-in-one/issues/180 as template.\n\n## How to update existing instances to a new major Nextcloud version?\nSimply use https://github.com/nextcloud/all-in-one/issues/6198 as template.\n\n## How to build new containers\nGo 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`.\n\n## How to test things correctly?\nBefore 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.\n\nThere 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.\n\nAdditionally, there are now E2E tests available that can be run via https://github.com/nextcloud/all-in-one/actions/workflows/playwright.yml\n\n## How to promote builds from develop to beta\n1. Verify that GitHub Services are running correctly: https://www.githubstatus.com/\n1. Verify that no job is running here: https://github.com/nextcloud-releases/all-in-one/actions/workflows/build_images.yml\n2. Go to https://github.com/nextcloud-releases/all-in-one/actions/workflows/promote-to-beta.yml, click on `Run workflow`.\n\n## Where to find the VPS and other builds?\nThis is documented here: https://github.com/nextcloud-releases/all-in-one/tree/main/.build\n\n## How to promote builds from beta to latest\n\n1. Verify that GitHub Services are running correctly: https://www.githubstatus.com/\n1. Verify that no job is running here: https://github.com/nextcloud-releases/all-in-one/actions/workflows/promote-to-beta.yml\n1. Go to https://github.com/nextcloud-releases/all-in-one/actions/workflows/promote-to-latest.yml, click on `Run workflow`.\n\n## How to connect to the database?\nSimply run `sudo docker exec -it nextcloud-aio-database psql -U oc_nextcloud nextcloud_database` and you should be in.\n\n## How to locally build and test changes to mastercontainer\n1. Ensure you are on the developer channel per the instructions above.\n1. Use the commands below from the project root to build the mastercontainer image:\n```\ndocker buildx build --file Containers/mastercontainer/Dockerfile --tag ghcr.io/nextcloud-releases/all-in-one:develop --load .\n```\n1. Start a container with above built image.\n1. 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`\n\n## How to locally build and test changes to other containers using the bypass_container_update param\n1. Ensure you are on the developer channel per the instructions above.\n1. Use the commands below from the project root to build the container image:\n```\n# For the \"nextcloud\" container\ndocker buildx build --file Containers/nextcloud/Dockerfile --tag ghcr.io/nextcloud-releases/aio-nextcloud:develop --load .\n\n# For all other containers\ndocker buildx build --file Containers/{container}/Dockerfile --tag ghcr.io/nextcloud-releases/aio-{container}:develop --load Containers/{container}\n```\n1. Stop the containers using the AIO interface.\n1. 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`.\n1. Click \"Start and update containers\" and test your changes. Containers will not be updated, despite the button text.\n"
  },
  {
    "path": "docker-ipv6-support.md",
    "content": "# IPv6-Support for Docker\n\n## Docker on Linux and Docker-rootless\nFirst of all upgrade your docker installation to v27.0.1 or higher.\n1. Then edit `/etc/docker/daemon.json` (or `~/.config/docker/daemon.json` in case of docker-rootless), add the below json:\n\n> [!WARNING]\n> 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.\n\n```json\n{\n    \"default-network-opts\": {\"bridge\":{\"com.docker.network.enable_ipv6\":\"true\"}}\n}\n```\n\nAnd save the file.\n\n2.  Reload the Docker configuration file.\n\n```console\nsudo systemctl restart docker\n```\n\n3. 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.\n\n## Docker Desktop (Windows and macOS)\nFirst of all upgrade your docker desktop installation to v4.32.0 or higher.\nThen, 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. \n\n1. You need to now adjust this json file:\n\n> [!WARNING]\n> 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.\n\n```json\n\"default-network-opts\": {\"bridge\":{\"com.docker.network.enable_ipv6\":\"true\"}}\n```\n\n2. 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`.\n3. 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.\n\n---\n\n**Note**: This is a copy of the original docker docs at https://docs.docker.com/config/daemon/ipv6/ which apparently are not correct.\n"
  },
  {
    "path": "docker-rootless.md",
    "content": "# Docker rootless\r\n\r\n**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.\r\n\r\nYou can run AIO with docker rootless by following the steps below.\r\n\r\n0. If docker is already installed, you should consider disabling it first: (`sudo systemctl disable --now docker.service docker.socket`)\r\n1. 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`)\r\n1. If you need ipv6 support, you should enable it by following https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md.\r\n1. 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!\r\n1. 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.\r\n1. 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).\r\n1. 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`.\r\n1. 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.\r\n1. ⚠️ **Important:** Please read through all notes below!\r\n\r\n### Note regarding sudo in the documentation\r\nAlmost 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. \r\n\r\n### Note regarding permissions\r\nAll 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). \r\n\r\n\r\n### Note regarding docker network driver\r\nBy 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)).\r\nAs 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.\r\n* 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)).\r\n* Run `sudo sysctl --system` to propagate the change.\r\n* Create `~/.config/systemd/user/docker.service.d/override.conf`\r\n  with the following content:\r\n  ```\r\n  [Service]\r\n  Environment=\"DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns\"\r\n  Environment=\"DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns\"\r\n  ```\r\n* Restart the docker daemon\r\n  ```\r\n  systemctl --user restart docker\r\n  ```\r\n"
  },
  {
    "path": "local-instance.md",
    "content": "# Local instance\r\nIt 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.\r\n\r\n### Content\r\n- [1. Tailscale](#1-tailscale)\r\n- [2. The normal way](#2-the-normal-way)\r\n- [3. Use the ACME DNS-challenge](#3-use-the-acme-dns-challenge)\r\n- [4. Use Cloudflare](#4-use-cloudflare)\r\n- [5. Buy a certificate and use that](#5-buy-a-certificate-and-use-that)\r\n\r\n## 1. Tailscale\r\nThis 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\r\n\r\n## 2. The normal way\r\nThe normal way is the following:\r\n1. Set up your domain correctly to point to your home network\r\n1. 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).\r\n1. 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)\r\n1. 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.\r\n1. Now, entering the domain in the AIO-interface should work as expected and should allow you to continue with the setup\r\n\r\n**Hint:** You may have a look at [this video](https://youtu.be/zk-y2wVkY4c) for a more complete but possibly outdated example.\r\n\r\n## 3. Use the ACME DNS-challenge\r\nYou 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\r\n\r\n## 4. Use Cloudflare\r\nIf 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.\r\n\r\n## 5. Buy a certificate and use that\r\nIf 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.\r\n\r\n"
  },
  {
    "path": "manual-install/latest.yml",
    "content": "services:\n  nextcloud-aio-apache:\n    depends_on:\n      nextcloud-aio-onlyoffice:\n        condition: service_started\n        required: false\n      nextcloud-aio-collabora:\n        condition: service_started\n        required: false\n      nextcloud-aio-talk:\n        condition: service_started\n        required: false\n      nextcloud-aio-notify-push:\n        condition: service_started\n        required: false\n      nextcloud-aio-whiteboard:\n        condition: service_started\n        required: false\n      nextcloud-aio-nextcloud:\n        condition: service_started\n        required: false\n    image: ghcr.io/nextcloud-releases/aio-apache:latest\n    user: \"33\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    ports:\n      - ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/tcp\n      - ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/udp\n    environment:\n      - NC_DOMAIN\n      - NEXTCLOUD_HOST=nextcloud-aio-nextcloud\n      - APACHE_HOST=nextcloud-aio-apache\n      - COLLABORA_HOST=nextcloud-aio-collabora\n      - TALK_HOST=nextcloud-aio-talk\n      - APACHE_PORT\n      - ONLYOFFICE_HOST=nextcloud-aio-onlyoffice\n      - TZ=${TIMEZONE}\n      - APACHE_MAX_SIZE\n      - APACHE_MAX_TIME=${NEXTCLOUD_MAX_TIME}\n      - NOTIFY_PUSH_HOST=nextcloud-aio-notify-push\n      - WHITEBOARD_HOST=nextcloud-aio-whiteboard\n      - HARP_HOST=nextcloud-aio-harp\n    volumes:\n      - nextcloud_aio_nextcloud:/var/www/html:ro\n      - nextcloud_aio_apache:/mnt/data:rw\n    restart: unless-stopped\n    read_only: true\n    tmpfs:\n      - /var/log/supervisord\n      - /var/run/supervisord\n      - /usr/local/apache2/logs\n      - /tmp\n      - /home/www-data\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-database:\n    image: ghcr.io/nextcloud-releases/aio-postgresql:latest\n    user: \"999\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"5432\"\n    volumes:\n      - nextcloud_aio_database:/var/lib/postgresql/data:rw\n      - nextcloud_aio_database_dump:/mnt/data:rw\n    environment:\n      - POSTGRES_PASSWORD=${DATABASE_PASSWORD}\n      - POSTGRES_DB=nextcloud_database\n      - POSTGRES_USER=nextcloud\n      - TZ=${TIMEZONE}\n      - PGTZ=${TIMEZONE}\n    stop_grace_period: 1800s\n    restart: unless-stopped\n    shm_size: 268435456\n    read_only: true\n    tmpfs:\n      - /var/run/postgresql\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-nextcloud:\n    depends_on:\n      nextcloud-aio-database:\n        condition: service_started\n        required: false\n      nextcloud-aio-redis:\n        condition: service_started\n        required: false\n      nextcloud-aio-clamav:\n        condition: service_started\n        required: false\n      nextcloud-aio-fulltextsearch:\n        condition: service_started\n        required: false\n      nextcloud-aio-talk-recording:\n        condition: service_started\n        required: false\n      nextcloud-aio-imaginary:\n        condition: service_started\n        required: false\n    image: ghcr.io/nextcloud-releases/aio-nextcloud:latest\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"9000\"\n      - \"9001\"\n    volumes:\n      - nextcloud_aio_nextcloud:/var/www/html:rw\n      - ${NEXTCLOUD_DATADIR}:/mnt/ncdata:rw\n      - ${NEXTCLOUD_MOUNT}:${NEXTCLOUD_MOUNT}:rw\n      - ${NEXTCLOUD_TRUSTED_CACERTS_DIR}:/usr/local/share/ca-certificates:ro\n    environment:\n      - NEXTCLOUD_HOST=nextcloud-aio-nextcloud\n      - POSTGRES_HOST=nextcloud-aio-database\n      - POSTGRES_PORT=5432\n      - POSTGRES_PASSWORD=${DATABASE_PASSWORD}\n      - POSTGRES_DB=nextcloud_database\n      - POSTGRES_USER=nextcloud\n      - REDIS_HOST=nextcloud-aio-redis\n      - REDIS_PORT=6379\n      - REDIS_HOST_PASSWORD=${REDIS_PASSWORD}\n      - APACHE_HOST=nextcloud-aio-apache\n      - APACHE_PORT\n      - NC_DOMAIN\n      - ADMIN_USER=admin\n      - ADMIN_PASSWORD=${NEXTCLOUD_PASSWORD}\n      - NEXTCLOUD_DATA_DIR=/mnt/ncdata\n      - OVERWRITEHOST=${NC_DOMAIN}\n      - OVERWRITEPROTOCOL=https\n      - TURN_SECRET\n      - SIGNALING_SECRET\n      - ONLYOFFICE_SECRET\n      - NEXTCLOUD_MOUNT\n      - CLAMAV_ENABLED\n      - CLAMAV_HOST=nextcloud-aio-clamav\n      - ONLYOFFICE_ENABLED\n      - COLLABORA_ENABLED\n      - COLLABORA_HOST=nextcloud-aio-collabora\n      - TALK_ENABLED\n      - ONLYOFFICE_HOST=nextcloud-aio-onlyoffice\n      - UPDATE_NEXTCLOUD_APPS\n      - TZ=${TIMEZONE}\n      - TALK_PORT\n      - IMAGINARY_ENABLED\n      - IMAGINARY_HOST=nextcloud-aio-imaginary\n      - PHP_UPLOAD_LIMIT=${NEXTCLOUD_UPLOAD_LIMIT}\n      - PHP_MEMORY_LIMIT=${NEXTCLOUD_MEMORY_LIMIT}\n      - FULLTEXTSEARCH_ENABLED\n      - FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch\n      - FULLTEXTSEARCH_PROTOCOL=http\n      - FULLTEXTSEARCH_PORT=9200\n      - FULLTEXTSEARCH_USER=elastic\n      - FULLTEXTSEARCH_INDEX=nextcloud-aio\n      - PHP_MAX_TIME=${NEXTCLOUD_MAX_TIME}\n      - TRUSTED_CACERTS_DIR=${NEXTCLOUD_TRUSTED_CACERTS_DIR}\n      - STARTUP_APPS=${NEXTCLOUD_STARTUP_APPS}\n      - ADDITIONAL_APKS=${NEXTCLOUD_ADDITIONAL_APKS}\n      - ADDITIONAL_PHP_EXTENSIONS=${NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS}\n      - INSTALL_LATEST_MAJOR\n      - TALK_RECORDING_ENABLED\n      - RECORDING_SECRET\n      - TALK_RECORDING_HOST=nextcloud-aio-talk-recording\n      - FULLTEXTSEARCH_PASSWORD\n      - REMOVE_DISABLED_APPS\n      - IMAGINARY_SECRET\n      - WHITEBOARD_SECRET\n      - WHITEBOARD_ENABLED\n    stop_grace_period: 600s\n    restart: unless-stopped\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-notify-push:\n    image: ghcr.io/nextcloud-releases/aio-notify-push:latest\n    user: \"33\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"7867\"\n    volumes:\n      - nextcloud_aio_nextcloud:/var/www/html:ro\n    environment:\n      - NEXTCLOUD_HOST=nextcloud-aio-nextcloud\n      - TZ=${TIMEZONE}\n    restart: unless-stopped\n    read_only: true\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-redis:\n    image: ghcr.io/nextcloud-releases/aio-redis:latest\n    user: \"999\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"6379\"\n    environment:\n      - REDIS_HOST_PASSWORD=${REDIS_PASSWORD}\n      - TZ=${TIMEZONE}\n    volumes:\n      - nextcloud_aio_redis:/data:rw\n    restart: unless-stopped\n    read_only: true\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-collabora:\n    command: ${ADDITIONAL_COLLABORA_OPTIONS}\n    image: ghcr.io/nextcloud-releases/aio-collabora:latest\n    init: true\n    healthcheck:\n      start_period: 60s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 9\n    expose:\n      - \"9980\"\n    environment:\n      - aliasgroup1=https://${NC_DOMAIN}:443,http://nextcloud-aio-apache:23973\n      - 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]=.+\n      - dictionaries=${COLLABORA_DICTIONARIES}\n      - TZ=${TIMEZONE}\n      - server_name=${NC_DOMAIN}\n      - DONT_GEN_SSL_CERT=1\n    restart: unless-stopped\n    profiles:\n      - collabora\n    cap_add:\n      - MKNOD\n      - SYS_ADMIN\n      - SYS_CHROOT\n      - FOWNER\n      - CHOWN\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-talk:\n    image: ghcr.io/nextcloud-releases/aio-talk:latest\n    user: \"1000\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    ports:\n      - ${TALK_PORT}:${TALK_PORT}/tcp\n      - ${TALK_PORT}:${TALK_PORT}/udp\n    expose:\n      - \"8081\"\n    environment:\n      - NC_DOMAIN\n      - TALK_HOST=nextcloud-aio-talk\n      - TURN_SECRET\n      - SIGNALING_SECRET\n      - TZ=${TIMEZONE}\n      - TALK_PORT\n      - INTERNAL_SECRET=${TALK_INTERNAL_SECRET}\n    restart: unless-stopped\n    profiles:\n      - talk\n      - talk-recording\n    read_only: true\n    tmpfs:\n      - /var/log/supervisord\n      - /var/run/supervisord\n      - /opt/eturnal/run\n      - /conf\n      - /tmp\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-talk-recording:\n    image: ghcr.io/nextcloud-releases/aio-talk-recording:latest\n    user: \"122\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"1234\"\n    environment:\n      - NC_DOMAIN\n      - TZ=${TIMEZONE}\n      - RECORDING_SECRET\n      - INTERNAL_SECRET=${TALK_INTERNAL_SECRET}\n    volumes:\n      - nextcloud_aio_talk_recording:/tmp:rw\n    shm_size: 2147483648\n    restart: unless-stopped\n    profiles:\n      - talk-recording\n    read_only: true\n    tmpfs:\n      - /conf\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-clamav:\n    image: ghcr.io/nextcloud-releases/aio-clamav:latest\n    user: \"100\"\n    init: false\n    healthcheck:\n      start_period: 60s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 9\n    expose:\n      - \"3310\"\n    environment:\n      - TZ=${TIMEZONE}\n      - MAX_SIZE=${NEXTCLOUD_UPLOAD_LIMIT}\n    volumes:\n      - nextcloud_aio_clamav:/var/lib/clamav:rw\n    restart: unless-stopped\n    profiles:\n      - clamav\n    read_only: true\n    tmpfs:\n      - /tmp\n      - /var/log/clamav\n      - /run/clamav\n      - /var/log/supervisord\n      - /var/run/supervisord\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-onlyoffice:\n    image: ghcr.io/nextcloud-releases/aio-onlyoffice:latest\n    init: true\n    healthcheck:\n      start_period: 60s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 9\n    expose:\n      - \"80\"\n    environment:\n      - TZ=${TIMEZONE}\n      - JWT_ENABLED=true\n      - JWT_HEADER=AuthorizationJwt\n      - JWT_SECRET=${ONLYOFFICE_SECRET}\n    volumes:\n      - nextcloud_aio_onlyoffice:/var/lib/onlyoffice:rw\n    restart: unless-stopped\n    profiles:\n      - onlyoffice\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-imaginary:\n    image: ghcr.io/nextcloud-releases/aio-imaginary:latest\n    user: \"65534\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"9000\"\n    environment:\n      - TZ=${TIMEZONE}\n      - IMAGINARY_SECRET\n    restart: unless-stopped\n    cap_add:\n      - SYS_NICE\n    cap_drop:\n      - NET_RAW\n    profiles:\n      - imaginary\n    read_only: true\n    tmpfs:\n      - /tmp\n\n  nextcloud-aio-fulltextsearch:\n    image: ghcr.io/nextcloud-releases/aio-fulltextsearch:latest\n    init: false\n    healthcheck:\n      start_period: 60s\n      test: /healthcheck.sh\n      interval: 10s\n      timeout: 5s\n      start_interval: 5s\n      retries: 5\n    expose:\n      - \"9200\"\n    environment:\n      - TZ=${TIMEZONE}\n      - ES_JAVA_OPTS=${FULLTEXTSEARCH_JAVA_OPTIONS}\n      - bootstrap.memory_lock=false\n      - cluster.name=nextcloud-aio\n      - discovery.type=single-node\n      - logger.level=WARN\n      - http.port=9200\n      - xpack.license.self_generated.type=basic\n      - xpack.security.enabled=false\n      - FULLTEXTSEARCH_PASSWORD\n    volumes:\n      - nextcloud_aio_elasticsearch:/usr/share/elasticsearch/data:rw\n    restart: unless-stopped\n    profiles:\n      - fulltextsearch\n    cap_drop:\n      - NET_RAW\n\n  nextcloud-aio-whiteboard:\n    image: ghcr.io/nextcloud-releases/aio-whiteboard:latest\n    user: \"65534\"\n    init: true\n    healthcheck:\n      start_period: 0s\n      test: /healthcheck.sh\n      interval: 30s\n      timeout: 30s\n      start_interval: 5s\n      retries: 3\n    expose:\n      - \"3002\"\n    tmpfs:\n      - /tmp\n    environment:\n      - TZ=${TIMEZONE}\n      - NEXTCLOUD_URL=https://${NC_DOMAIN}\n      - JWT_SECRET_KEY=${WHITEBOARD_SECRET}\n      - STORAGE_STRATEGY=redis\n      - REDIS_HOST=nextcloud-aio-redis\n      - REDIS_PORT=6379\n      - REDIS_HOST_PASSWORD=${REDIS_PASSWORD}\n      - BACKUP_DIR=/tmp\n    restart: unless-stopped\n    profiles:\n      - whiteboard\n    read_only: true\n    cap_drop:\n      - NET_RAW\n\nvolumes:\n  nextcloud_aio_apache:\n    name: nextcloud_aio_apache\n  nextcloud_aio_clamav:\n    name: nextcloud_aio_clamav\n  nextcloud_aio_database:\n    name: nextcloud_aio_database\n  nextcloud_aio_database_dump:\n    name: nextcloud_aio_database_dump\n  nextcloud_aio_elasticsearch:\n    name: nextcloud_aio_elasticsearch\n  nextcloud_aio_nextcloud:\n    name: nextcloud_aio_nextcloud\n  nextcloud_aio_onlyoffice:\n    name: nextcloud_aio_onlyoffice\n  nextcloud_aio_redis:\n    name: nextcloud_aio_redis\n  nextcloud_aio_talk_recording:\n    name: nextcloud_aio_talk_recording\n  nextcloud_aio_nextcloud_data:\n    name: nextcloud_aio_nextcloud_data\n\nnetworks:\n  default:\n    driver: bridge\n"
  },
  {
    "path": "manual-install/readme.md",
    "content": "# Manual installation\r\n\r\nYou can run the containers that are build for AIO with docker-compose. This comes with a few downsides, that are discussed below.\r\n\r\n### Advantages\r\n- You can run it without a container having access to the docker socket\r\n- You can modify all values on your own\r\n- You can run the containers with docker swarm\r\n- 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).\r\n\r\n### Disadvantages\r\n- You lose the AIO interface\r\n- You lose update notifications and automatic updates\r\n- You lose all AIO backup and restore features\r\n- 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))\r\n- You lose all community containers: https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers\r\n- **You need to know what you are doing, especially when modifying the compose.yaml file**\r\n- For updating, you need to strictly follow the at the bottom described update routine\r\n- Probably more\r\n\r\n## How to use this?\r\nFirst, install docker and docker-compose (v2) if not already done. Then simply run the following:\r\n```bash\r\ngit clone https://github.com/nextcloud/all-in-one.git\r\ncd all-in-one/manual-install\r\n```\r\nThen 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.<br>\r\n⚠️ **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).\r\n\r\nNow copy the provided yaml file to a compose.yaml file by running `cp latest.yml compose.yaml`.\r\n\r\nNow you should be ready to go with `sudo docker compose up`.\r\n\r\n## Docker profiles\r\nThe 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`.\r\n\r\nFor 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`.\r\n\r\n## How to update?\r\nSince 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.\r\n1. 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`.\r\n1. Run `sudo docker compose down` to stop all running containers\r\n1. Back up all important files and folders\r\n1. If your compose file is still named `docker-compose.yml` rename it to `compose.yaml` by running `mv -vn docker-compose.yml compose.yaml`\r\n1. 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.\r\n1. 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.\r\n1. After the file update was successful, simply run `sudo docker compose pull` to pull the new images.\r\n1. At the end run `sudo docker compose up` in order to start and update the containers with the new configuration.\r\n\r\n## FAQ\r\n### Backup and restore?\r\nIf 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. \r\n\r\nObviously you also need to back up the conf file and the yaml file if you modified it.\r\n"
  },
  {
    "path": "manual-install/sample.conf",
    "content": "DATABASE_PASSWORD=          # TODO! This needs to be a unique and good password!\nFULLTEXTSEARCH_PASSWORD=          # TODO! This needs to be a unique and good password!\nIMAGINARY_SECRET=          # TODO! This needs to be a unique and good password!\nNC_DOMAIN=yourdomain.com          # TODO! Needs to be changed to the domain that you want to use for Nextcloud.\nNEXTCLOUD_PASSWORD=          # TODO! This is the password of the initially created Nextcloud admin with username \"admin\".\nONLYOFFICE_SECRET=          # TODO! This needs to be a unique and good password!\nRECORDING_SECRET=          # TODO! This needs to be a unique and good password!\nREDIS_PASSWORD=          # TODO! This needs to be a unique and good password!\nSIGNALING_SECRET=          # TODO! This needs to be a unique and good password!\nTALK_INTERNAL_SECRET=          # TODO! This needs to be a unique and good password!\nTIMEZONE=Europe/Berlin          # TODO! This is the timezone that your containers will use.\nTURN_SECRET=          # TODO! This needs to be a unique and good password!\nWHITEBOARD_SECRET=          # TODO! This needs to be a unique and good password!\n\nCLAMAV_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nCOLLABORA_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nFULLTEXTSEARCH_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nIMAGINARY_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nONLYOFFICE_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nTALK_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nTALK_RECORDING_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nWHITEBOARD_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\n\nAPACHE_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\nAPACHE_MAX_SIZE=17179869184          # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT\nAPACHE_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).\nADDITIONAL_COLLABORA_OPTIONS=['--o:security.seccomp=true']          # You can add additional collabora options here by using the array syntax.\nCOLLABORA_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\nFULLTEXTSEARCH_JAVA_OPTIONS=\"-Xms512M -Xmx512M\"          # Allows to adjust the fulltextsearch java options.\nINSTALL_LATEST_MAJOR=no        # Setting this to yes will install the latest Major Nextcloud version upon the first installation\nNEXTCLOUD_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.\nNEXTCLOUD_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.\nNEXTCLOUD_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!\nNEXTCLOUD_MAX_TIME=3600          # This allows to change the upload time limit of the Nextcloud container\nNEXTCLOUD_MEMORY_LIMIT=512M          # This allows to change the PHP memory limit of the Nextcloud container\nNEXTCLOUD_MOUNT=/mnt/          # This allows the Nextcloud container to access directories on the host. It must never be equal to the value of NEXTCLOUD_DATADIR!\nNEXTCLOUD_STARTUP_APPS=\"deck twofactor_totp tasks calendar contacts notes\"        # Allows to modify the Nextcloud apps that are installed on starting AIO the first time\nNEXTCLOUD_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.\nNEXTCLOUD_UPLOAD_LIMIT=16G          # This allows to change the upload limit of the Nextcloud container\nREMOVE_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.\nTALK_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!\nUPDATE_NEXTCLOUD_APPS=\"no\"          # When setting to \"yes\" (with quotes), it will automatically update all installed Nextcloud apps upon container startup on saturdays.\n"
  },
  {
    "path": "manual-install/update-yaml.sh",
    "content": "#!/bin/bash -ex\n\ntype {jq,sudo} || { echo \"Commands not found. Please install them\"; exit 127; }\n\njq -c . ./php/containers.json > /tmp/containers.json\nsed -i 's|aio_services_v1|services|g' /tmp/containers.json\nsed -i 's|\",\"destination\":\"|:|g' /tmp/containers.json\nsed -i 's|\",\"writeable\":false|:ro\"|g' /tmp/containers.json\nsed -i 's|\",\"writeable\":true|:rw\"|g' /tmp/containers.json\nsed -i 's|\",\"port_number\":\"|:|g' /tmp/containers.json\nsed -i 's|\",\"protocol\":\"|/|g' /tmp/containers.json\nsed -i 's|\"ip_binding\":\":|\"ip_binding\":\"|g' /tmp/containers.json\ncat /tmp/containers.json\nOUTPUT=\"$(cat /tmp/containers.json)\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].internal_port)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].secrets)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].ui_secrets)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].devices)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].enable_nvidia_gpu)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].backup_volumes)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].nextcloud_exec_commands)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].image_tag)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].networks)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[].documentation)')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[] | select(.container_name == \"nextcloud-aio-watchtower\"))')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[] | select(.container_name == \"nextcloud-aio-domaincheck\"))')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[] | select(.container_name == \"nextcloud-aio-borgbackup\"))')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[] | select(.container_name == \"nextcloud-aio-docker-socket-proxy\"))')\"\nOUTPUT=\"$(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')\"\nOUTPUT=\"$(echo \"$OUTPUT\" | jq 'del(.services[] | select(.container_name == \"nextcloud-aio-harp\"))')\"\nOUTPUT=\"$(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')\"\nOUTPUT=\"$(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')\"\n\nsudo snap install yq\nmkdir -p ./manual-install\necho \"$OUTPUT\" | yq -P > ./manual-install/containers.yml\n\ncd manual-install || exit\nsed -i \"s|'||g\" containers.yml\nsed -i '/display_name:/d' containers.yml\nsed -i '/THIS_IS_AIO/d' containers.yml\nsed -i \"s|%COLLABORA_SECCOMP_POLICY% ||g\" containers.yml\nsed -i '/stop_grace_period:/s/$/s/' containers.yml\nsed -i '/: \\[\\]/d' containers.yml\nsed -i 's|- source: |- |' containers.yml\nsed -i 's|- ip_binding: |- |' containers.yml\nsed -i '/AIO_TOKEN/d' containers.yml\nsed -i '/AIO_URL/d' containers.yml\nsed -i '/DOCKER_SOCKET_PROXY_ENABLED/d' containers.yml\nsed -i '/HARP_ENABLED/d' containers.yml\nsed -i '/HP_SHARED_KEY/d' containers.yml\nsed -i '/ADDITIONAL_TRUSTED_PROXY/d' containers.yml\nsed -i '/TURN_DOMAIN/d' containers.yml\nsed -i '/NC_AIO_VERSION/d' containers.yml\n\nTCP=\"$(grep -oP '[%A-Z0-9_]+/tcp' containers.yml | sort -u)\"\nmapfile -t TCP <<< \"$TCP\"\nfor port in \"${TCP[@]}\" \ndo\n    solve_port=\"${port%%/tcp}\"\n    sed -i \"s|$solve_port/tcp|$solve_port:$solve_port/tcp|\" containers.yml\ndone\n\nUDP=\"$(grep -oP '[%A-Z0-9_]+/udp' containers.yml | sort -u)\"\nmapfile -t UDP <<< \"$UDP\"\nfor port in \"${UDP[@]}\"\ndo\n    solve_port=\"${port%%/udp}\"\n    sed -i \"s|$solve_port/udp|$solve_port:$solve_port/udp|\" containers.yml\ndone\n\nrm -f sample.conf\nVARIABLES=\"$(grep -oP '%[A-Z_a-z0-6]+%' containers.yml | sort -u)\"\nmapfile -t VARIABLES <<< \"$VARIABLES\"\nfor variable in \"${VARIABLES[@]}\"\ndo\n    # shellcheck disable=SC2001\n    sole_variable=\"$(echo \"$variable\" | sed 's|%||g')\"\n    echo \"$sole_variable=\" >> sample.conf\n    sed -i \"s|$variable|\\${$sole_variable}|g\" containers.yml\ndone\n\nsed -i 's|_ENABLED=|_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.|' sample.conf\nsed -i 's|CLAMAV_ENABLED=no.*|CLAMAV_ENABLED=\"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.|' sample.conf\nsed -i 's|TALK_ENABLED=no|TALK_ENABLED=\"yes\"|' sample.conf\nsed -i 's|COLLABORA_ENABLED=no|COLLABORA_ENABLED=\"yes\"|' sample.conf\nsed -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\nsed -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\nsed -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\nsed -i 's|NEXTCLOUD_UPLOAD_LIMIT=|NEXTCLOUD_UPLOAD_LIMIT=16G          # This allows to change the upload limit of the Nextcloud container|' sample.conf\nsed -i 's|NEXTCLOUD_MEMORY_LIMIT=|NEXTCLOUD_MEMORY_LIMIT=512M          # This allows to change the PHP memory limit of the Nextcloud container|' sample.conf\nsed -i 's|APACHE_MAX_SIZE=|APACHE_MAX_SIZE=17179869184          # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT|' sample.conf\nsed -i 's|NEXTCLOUD_MAX_TIME=|NEXTCLOUD_MAX_TIME=3600          # This allows to change the upload time limit of the Nextcloud container|' sample.conf\nsed -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\nsed -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\nsed -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\nsed -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\nsed -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\nsed -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\nsed -i 's|NEXTCLOUD_PASSWORD=|NEXTCLOUD_PASSWORD=          # TODO! This is the password of the initially created Nextcloud admin with username \"admin\".|' sample.conf\nsed -i 's|TIMEZONE=|TIMEZONE=Europe/Berlin          # TODO! This is the timezone that your containers will use.|' sample.conf\nsed -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\nsed -i 's|FULLTEXTSEARCH_JAVA_OPTIONS=|FULLTEXTSEARCH_JAVA_OPTIONS=\"-Xms512M -Xmx512M\"          # Allows to adjust the fulltextsearch java options.|' sample.conf\nsed -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\nsed -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\nsed -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\nsed -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\nsed -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\nsed -i 's|=$|=          # TODO! This needs to be a unique and good password!|' sample.conf\n\ngrep  '# TODO!' sample.conf > todo.conf\ngrep -v '# TODO!\\|_ENABLED' sample.conf > temp.conf\ngrep '_ENABLED' sample.conf > enabled.conf\ncat todo.conf > sample.conf\n# shellcheck disable=SC2129\necho '' >> sample.conf\ncat enabled.conf >> sample.conf\necho '' >> sample.conf\ncat temp.conf >> sample.conf\nrm todo.conf temp.conf enabled.conf\ncat sample.conf\n\nOUTPUT=\"$(cat containers.yml)\"\nNAMES=\"$(grep -oP \"container_name:.*\" containers.yml | grep -oP 'nextcloud-aio.*')\"\nmapfile -t NAMES <<< \"$NAMES\"\nfor name in \"${NAMES[@]}\"\ndo\n    OUTPUT=\"$(echo \"$OUTPUT\" | sed \"/container_name.*$name$/i\\ \\ $name:\")\"\n    if [ \"$name\" != \"nextcloud-aio-apache\" ]; then\n        OUTPUT=\"$(echo \"$OUTPUT\" | sed \"/^  $name:/i\\ \")\"\n    fi\ndone\n\necho \"$OUTPUT\" > containers.yml\n\nsed -i '/container_name/d' containers.yml\nsed -i 's|^ $||' containers.yml\n\n# Additional config for collabora\ncat << EOL > /tmp/additional-collabora.config\n    command: \\${ADDITIONAL_COLLABORA_OPTIONS}\nEOL\nsed -i \"/^  nextcloud-aio-collabora:/r /tmp/additional-collabora.config\" containers.yml\nsed -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\n\nVOLUMES=\"$(grep -oP 'nextcloud_aio_[a-z_]+' containers.yml | sort -u)\"\nmapfile -t VOLUMES <<< \"$VOLUMES\"\necho \"\" >> containers.yml\necho \"volumes:\" >> containers.yml\nfor volume in \"${VOLUMES[@]}\" \"nextcloud_aio_nextcloud_data\"\ndo\n    cat << VOLUMES >> containers.yml\n  $volume:\n    name: $volume\nVOLUMES\ndone\n\ncat << NETWORK >> containers.yml\n\nnetworks:\n  default:\n    driver: bridge\nNETWORK\n\nmv containers.yml latest.yml\nsed -i \"/image:/s/$/:latest/\" latest.yml\nsed -i 's/\\( *- \\(\\w*\\)\\)=\\${\\2\\}/\\1/' latest.yml\n\nset +ex\n"
  },
  {
    "path": "manual-upgrade.md",
    "content": "# Manual upgrade\r\n\r\nIf 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.\r\nThere is unfortunately no way to fix this from a maintainer POV if you refrain from upgrading for so long.\r\n\r\nThe 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:\r\n\r\n---\r\n\r\n## Method 1 using `assaflavie/runlike`\r\n\r\n> [!Warning]\r\n> Please note that this method is apparently currently broken. See https://help.nextcloud.com/t/manual-upgrade-keeps-failing/217164/10\r\n> So please refer to method 2 using Portainer.\r\n\r\n1. Start all containers from the AIO interface \r\n    - Now, it will report that Nextcloud is restarting because it is not able to start due to the above mentioned problem\r\n    - #### Do **not** click on `Stop containers` because you will need them running going forward, see below\r\n2. Find out with which PHP version your installed Nextcloud is compatible by running `sudo docker exec nextcloud-aio-nextcloud cat lib/versioncheck.php`. \r\n    - There you will find information about the max. supported PHP version\r\n    - **Make a mental note of this**\r\n3. Stop the Nextcloud container and the Apache container by running \r\n    ```bash\r\n        sudo docker stop nextcloud-aio-nextcloud && sudo docker stop nextcloud-aio-apache\r\n    ```\r\n4. Run the following commands in order to reverse engineer the Nextcloud container:\r\n    ```bash\r\n        sudo docker pull assaflavie/runlike\r\n        echo '#!/bin/bash' > /tmp/nextcloud-aio-nextcloud\r\n        sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike -p nextcloud-aio-nextcloud >> /tmp/nextcloud-aio-nextcloud\r\n        sudo chown root:root /tmp/nextcloud-aio-nextcloud\r\n    ```\r\n5. Now open `/tmp/nextcloud-aio-nextcloud` with a text editor, and edit the container tag:\r\n\r\n\r\n| To change                              | Replace with                                        |\r\n|----------------------------------------|-----------------------------------------------------|\r\n| `ghcr.io/nextcloud-releases/aio-nextcloud:latest`       | `ghcr.io/nextcloud-releases/aio-nextcloud:php{version}-latest`       |\r\n| `ghcr.io/nextcloud-releases/aio-nextcloud:latest-arm64` | `ghcr.io/nextcloud-releases/aio-nextcloud:php{version}-latest-arm64` |\r\n\r\n\r\n\r\n - e.g. `ghcr.io/nextcloud-releases/aio-nextcloud:php8.0-latest` or `ghcr.io/nextcloud-releases/aio-nextcloud:php8.0-latest-arm64`\r\n - 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\r\n - Using nano and the arrow keys to navigate:\r\n  - `sudo nano /tmp/nextcloud-aio-nextcloud` making changes as above, then `[Ctrl]+[o]` -> `[Enter]` and `[Ctrl]+[x]` to save and exit.\r\n6. Next, stop and remove the current container: \r\n    ```bash\r\n        sudo docker stop nextcloud-aio-nextcloud\r\n        sudo docker rm nextcloud-aio-nextcloud\r\n    ```\r\n7. 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.<br>\r\n**Info**: You can open the Nextcloud container logs with `sudo docker logs -f nextcloud-aio-nextcloud`.\r\n8. 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.\r\n9. 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.\r\n10. 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.\r\n11. 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. \r\n\r\n---\r\n\r\n## Method 2 using Portainer\r\n#### *Approach using portainer if method 1 does not work for you*\r\n\r\nPrerequisite: have all containers from AIO interface running.\r\n\r\n##### 1. Install portainer if not installed:\r\n```bash\r\ndocker volume create portainer_data\r\ndocker 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\r\n```\r\n- If you have a reverse proxy\r\n    - you can setup and navigate using a domain name.\r\n- For the **standard** AIO install\r\n    - Open port 9443 on your firewall\r\n    - navigate to `https://<server-ip>:9443`\r\n- Accept the insecure self-signed certificate and set an admin password\r\n- If prompted to add an environment\r\n    - add local\r\n\r\n##### 2. Within the local portainer environment navigate to the **containers** tab \r\n- Here you should see all the various containers running\r\n\r\n##### 3. Now we need to stop the `nextcloud-aio-nextcloud` and `nextcloud-aio-apache` containers\r\n\r\n-  This can be done by selecting the checkbox's next to the containers' name and clicking the **Stop** button at the top\r\n    - or you can click into individual containers and stop them there\r\n\r\n##### 4. Find the version of PHP compatible with the running nextcloud container\r\n- navigate to ```nextcloud-aio-nextcloud``` and click on ```logs```, you should see something along the lines of:\r\n```logs\r\nThis version of nextcloud is not compatible with >=php 8.2, you are currently running php 8.2.18\r\n```\r\nMake **note** of the version which is compatible, rounding down to 1 digit after the dot. \r\n - In this example we would want php 8.1 since anything with 8.2 or above is incompatible\r\n\r\n##### 5. Find the correct container version\r\nIn 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.\r\nHowever, 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\r\n\r\n##### 6. Replace the container\r\n- Navigate to the ```nextcloud-aio-nextcloud``` container within portainer\r\n- Click ```Duplicate/Edit```\r\n- Within image, change this to the correct version from Step 5\r\n- Click ```Deploy the container```\r\n    - if you are prompted to force repull the image click the slider and press pull image\r\n\r\n*Navigate to the nextcloud-aio-nextcloud logs and you will see the container updating*\r\n\r\nOnce you see no more activities in the logs or a message like ```NOTICE: ready to handle connections```, we've done it!\r\n\r\n#### Now you can handle everything through the AIO interface and stop and restart the containers normally.\r\n\r\n---\r\n\r\n##### 7. Last Step is removing portainer if you don't want to keep it\r\n\r\n```bash\r\ndocker stop portainer\r\ndocker rm portainer\r\ndocker volume rm portainer_data\r\n```\r\n- Make sure you close port 9443 on your firewall and delete any necessary reverse proxy hosts.\r\n"
  },
  {
    "path": "migration.md",
    "content": "# How to migrate from an already existing Nextcloud installation to Nextcloud AIO?\n\nThere 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)):\n\n1. Migrate only the files which is the easiest way (this excludes all calendar data for example)\n1. Migrate the files and the database which is much more complicated (and doesn't work on former snap installations)\n1. 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\n\n## Migrate only the files \n**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).\n\nThe procedure for migrating only the files works like this:\n1. Take a backup of your former instance (especially from your datadirectory, see `'datadirectory'` in your `config.php`)\n1. Install Nextcloud AIO on a new server/linux installation, enter your domain and wait until all containers are running\n1. Recreate all users that were present on your former installation\n1. 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!)\n1. 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.\n1. 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.)\n1. Start the containers again and wait until all containers are running\n1. 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.\n1. 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.\n\n## Migrate the files and the database\n**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.\n\nThe procedure for migrating the files and the database works like this:\n1. 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.\n1. 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).\n1. 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):\n    1. Install Postgresql on your former installation: on a Debian based OS should the following command work:\n        ```\n        sudo apt update && sudo apt install postgresql -y\n        ```\n    1. Create a new database by running:\n        ```\n        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\n        export PG_PASSWORD=\"my-temporary-password\"\n        export PG_DATABASE=\"nextcloud_db\"\n        sudo -u postgres psql <<END\n        CREATE USER $PG_USER WITH PASSWORD '$PG_PASSWORD' CREATEDB;\n        CREATE DATABASE $PG_DATABASE WITH OWNER $PG_USER TEMPLATE template0 ENCODING 'UTF8';\n        GRANT ALL PRIVILEGES ON DATABASE $PG_DATABASE TO $PG_USER;\n        GRANT ALL PRIVILEGES ON SCHEMA public TO $PG_USER;\n        END\n        ```\n    1. Run the following command to start the conversion:\n        ```\n        occ db:convert-type --all-apps --password \"$PG_PASSWORD\" pgsql \"$PG_USER\" 127.0.0.1 \"$PG_DATABASE\"\n        ```\n        **Please note:** You might need to change the ip-address `127.0.0.1` and adjust the occ command (`occ`) based on your exact installation. Further information on the conversion is additionally available here: https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/db_conversion.html#converting-database-type<br>\n        **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`.\n    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.\n    1. If everything works as expected, feel free to continue with the steps below.\n1. Now, run a pg_dump to get an export of your current database. Something like the following command should work:\n    ```\n    sudo -Hiu postgres pg_dump \"$PG_DATABASE\"  > ./database-dump.sql\n    ```\n    **Please note:** The exact name of the database export file is important! (`database-dump.sql`)<br>\n    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).\n1. 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.\n1. 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!**\n1. 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:\n    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`.\n    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`\n    1. Next, open the database export with e.g. nano: `nano database-dump.sql`\n    1. Press `[CTRL] + [w]` in order to open the search\n    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.\n    1. Change it to look like this: `local::/mnt/ncdata/`.\n    1. Now save the file by pressing `[CTRL] + [o]` then `[ENTER]` and close nano by pressing `[CTRL] + [x]`\n    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.<br>\n    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`.\nThe 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`.\n1. 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: \n    ```\n    sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine rm /mnt/data/database-dump.sql\n    sudo docker cp database-dump.sql nextcloud-aio-database:/mnt/data/\n    sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine chmod 777 /mnt/data/database-dump.sql\n    sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine rm /mnt/data/initial-cleanup-done\n    ```\n1. 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.)\n1. 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.)\n1. 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).\n1. When you are done and saved your changes to the file, finally start the containers again and wait until all containers are running.\n\nNow the whole Nextcloud instance should work again.<br>\nIf not, feel free to restore the AIO instance from backup and start at step 8 again.\n\nIf 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.\n\n## Use the user_migration app\nA 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.\n\nIf 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.\n\n# Synchronising with clients after migration\n#### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery\nBy 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.\n\nIf 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.\n\n>[!Note]\n>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.\n\n\nIf 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.\n"
  },
  {
    "path": "multiple-instances.md",
    "content": "# Multiple AIO instances\r\nIt is possible to run multiple instances of AIO on one server.\r\n\r\nThere 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. \r\n\r\n\r\n## Run multiple AIO instances on the same server with docker rootless\r\n1. 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!\r\n1. 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).\r\n1. 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.<br>\r\n**⚠️ 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.\r\n1. 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).\r\n1. 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.\r\n1. 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. \r\n1. Finally type in the domain that you've configured for each of the instances during step 5 of this documentation and you are done.\r\n1. 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!\r\n\r\nNow everything should be set up correctly and you should have created multiple working instances of AIO on the same server!\r\n\r\n\r\n## Run multiple AIO instances on the same server inside their own virtual machines\r\nThis 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.\r\n\r\n<details><summary><strong>PLEASE READ: A few expectations about your network</strong></summary>\r\nThis 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 <a href=\"https://nextcloud.com/providers/\">Nextcloud's trusted providers.</a>\r\n</details>\r\n\r\n<details><summary><strong>A note for VPS users</strong></summary>\r\nIf 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.\r\n</details>\r\n\r\n**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.\r\nIf 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.\r\n\r\n**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**):\r\n<!--\r\n```shell\r\n# For host machines running Ubuntu Server:\r\napt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system virtinst ovmf bridge-utils\r\n```\r\n```shell\r\n# For host machines running Debian:\r\napt install --no-install-recommends qemu-system qemu-utils libvirt-clients libvirt-daemon-system virtinst ovmf bridge-utils dnsmasq-base\r\n```\r\n-->\r\n```shell\r\n# For host machines running Ubuntu Server or Debian:\r\napt install --no-install-recommends qemu-system qemu-utils libvirt-clients libvirt-daemon-system virtinst ovmf bridge-utils dnsmasq-base\r\n```\r\n\r\n**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).\r\n\r\n**Once you're ready, follow steps 1-4 below to set up your VMs. You will configure them one at a time.**\r\n\r\n1. 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.\r\n2. Choose the distribution you'd like to install within the VM:\r\n   <details><summary><strong>Ubuntu Server 22.04.4 LTS</strong></summary>\r\n       <h4>Downloading the .ISO image</h4>\r\n       You must first download an .ISO image to your host machine, and then provide virt-install with the path to that image.\r\n       <!-- This step is required because Ubuntu no longer hosts their \"Legacy Ubuntu Server Installer\" images, meaning we can no longer pass a URL to virt-install to use as a location. -->\r\n       <pre><code># Skip this part if you've already downloaded this image\r\n   curl -o /tmp/ubuntu-22.04.4-live-server-amd64.iso https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso\r\n   </code></pre>\r\n       <em>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.</em>\r\n       <h4>Creating the VM</h4>\r\n       Now create the Ubuntu Server VM (Don't forget to replace [VM_NAME]):\r\n       <pre><code>virt-install \\\r\n   --name [VM_NAME] \\\r\n   --virt-type kvm \\\r\n   --location /tmp/ubuntu-22.04.4-live-server-amd64.iso,kernel=casper/vmlinuz,initrd=casper/initrd \\\r\n   --os-variant ubuntujammy \\\r\n   --disk size=32 \\\r\n   --memory 2048 \\\r\n   --graphics none \\\r\n   --console pty,target_type=serial \\\r\n   --extra-args \"console=ttyS0\" \\\r\n   --autostart \\\r\n   --boot uefi\r\n   </code></pre>\r\n       <h4>Using a different version of Ubuntu Server</h4>\r\n       To use a different Ubuntu Server release, visit <a href=\"https://releases.ubuntu.com\">this page</a> 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.\r\n   </details>\r\n   <details><summary><strong>Debian 11</strong></summary>\r\n       <h4>Creating the VM</h4>\r\n       Create the Debian VM (Don't forget to replace [VM_NAME]):\r\n       <pre><code>virt-install \\\r\n   --name [VM_NAME] \\\r\n   --virt-type kvm \\\r\n   --location http://deb.debian.org/debian/dists/bullseye/main/installer-amd64/ \\\r\n   --os-variant debian11 \\\r\n   --disk size=32 \\\r\n   --memory 2048 \\\r\n   --graphics none \\\r\n   --console pty,target_type=serial \\\r\n   --extra-args \"console=ttyS0\" \\\r\n   --autostart \\\r\n   --boot uefi\r\n   </code></pre>\r\n   </details>\r\n   <details><summary><strong>Debian 12</strong></summary>\r\n       <h4>Creating the VM</h4>\r\n       Create the Debian VM (Don't forget to replace [VM_NAME]):\r\n       <pre><code># If the os-variant \"debian12\" is unknown, try \"debiantesting\" instead\r\n   virt-install \\\r\n   --name [VM_NAME] \\\r\n   --virt-type kvm \\\r\n   --location http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/ \\\r\n   --os-variant debian12 \\\r\n   --disk size=32 \\\r\n   --memory 2048 \\\r\n   --graphics none \\\r\n   --console pty,target_type=serial \\\r\n   --extra-args \"console=ttyS0\" \\\r\n   --autostart \\\r\n   --boot uefi\r\n   </code></pre>\r\n   </details>\r\n   <!--To learn more about virt-install or automating this process, see <a href=\"https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-guest_virtual_machine_installation_overview-creating_guests_with_virt_install\">this guide</a>.-->\r\n3. Navigate through the text-based installer. Most options can remain as default, but here are some tips:\r\n   <details><summary><strong>For the Ubuntu Server installer</strong></summary>\r\n   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 <strong>not</strong> 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.\r\n   </details>\r\n   <details><summary><strong>For the Debian installer</strong></summary>\r\n   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.\r\n   </details>\r\n4. Configure your new VM:\r\n\r\n   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.\r\n\r\n   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.\r\n\r\n   **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.**\r\n\r\n   Run these commands (**on the VM**):\r\n   ```shell\r\n   apt install -y curl\r\n   \r\n   curl -fsSL https://get.docker.com | sh\r\n\r\n   # Make sure you increment the TALK_PORT value every time you run this!\r\n   docker run \\\r\n   --init \\\r\n   --sig-proxy=false \\\r\n   --name nextcloud-aio-mastercontainer \\\r\n   --restart always \\\r\n   --publish 8080:8080 \\\r\n   --env APACHE_PORT=11000 \\\r\n   --env APACHE_IP_BINDING=0.0.0.0 \\\r\n   --env TALK_PORT=3478 \\\r\n   --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\r\n   --volume /var/run/docker.sock:/var/run/docker.sock:ro \\\r\n   ghcr.io/nextcloud-releases/all-in-one:latest\r\n   ```\r\n   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.\r\n\r\n   \r\n   ---\r\n6. 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.)*\r\n7. 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**):\r\n   ```shell\r\n   apt update -y\r\n   apt install -y debian-keyring debian-archive-keyring apt-transport-https curl\r\n   curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg\r\n   curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list\r\n   apt update -y\r\n   apt install -y caddy\r\n   ```\r\n   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.\r\n8. To configure Caddy, you need to know the IP address assigned to each VM. Run (**on the host physical machine**):\r\n    ```shell\r\n    virsh net-dhcp-leases default\r\n    ```\r\n    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.\r\n    Finally, you will configure Caddy using this information. Open the default Caddyfile with a text editor:\r\n    ```shell\r\n    nano /etc/caddy/Caddyfile\r\n    ```\r\n    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`.\r\n    ```shell\r\n    # Virtual machine #1 - \"example1-com\"\r\n    https://[DOMAIN_NAME_1]:8443 {\r\n        reverse_proxy https://[IP_ADDRESS_1]:8080 {\r\n            header_up Host {host}\r\n            transport http {\r\n                tls_insecure_skip_verify\r\n            }\r\n        }\r\n    }\r\n    https://[DOMAIN_NAME_1]:443 {\r\n        reverse_proxy [IP_ADDRESS_1]:11000\r\n    }\r\n    \r\n    # Virtual machine #2 - \"example2-com\"\r\n    https://[DOMAIN_NAME_2]:8443 {\r\n        reverse_proxy https://[IP_ADDRESS_2]:8080 {\r\n            header_up Host {host}\r\n            transport http {\r\n                tls_insecure_skip_verify\r\n            }\r\n        }\r\n    }\r\n    https://[DOMAIN_NAME_2]:443 {\r\n        reverse_proxy [IP_ADDRESS_2]:11000\r\n    }\r\n\r\n    # (Add more configurations here if you set up more than two VMs!)\r\n    ```\r\n    After making this change, you'll need to restart Caddy:\r\n   ```shell\r\n   systemctl restart caddy\r\n   ```\r\n9. 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!\r\n    \r\n    <details><summary><strong>A few extra tips for managing this setup</strong></summary>\r\n        <ul>\r\n            <li>You can easily connect to a VM to perform maintenance using this command (<strong>on the host physical machine</strong>): <pre><code>virsh console --domain [VM_NAME]</code></pre></li>\r\n            <li>If you chose to install an SSH Server, you can SSH in using this command (<strong>on the host physical machine</strong>): <pre><code>ssh [NONROOT_USER]@[IP_ADDRESS] # By default, OpenSSH does not allow logging in as root</code></pre></li>\r\n            <li>If you mess up the configuration of a VM, you may wish to completely delete it and start fresh with a new one. <strong>THIS WILL DELETE ALL DATA ASSOCIATED WITH THE VM INCLUDING ANYTHING IN YOUR AIO DATADIR!</strong> If you are sure you would like to do this, run (<strong>on the host physical machine</strong>): <pre><code>virsh destroy --domain [VM_NAME] ; virsh undefine --nvram --domain [VM_NAME] && rm -rfi /var/lib/libvirt/images/[VM_NAME].qcow2</code></pre></li>\r\n            <li>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 <a href=\"https://github.com/nextcloud/all-in-one#how-to-adjust-the-talk-port\">like so</a>. 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 <strong>https://[DOMAIN_NAME]/settings/admin/talk</strong> 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 <a href=\"https://github.com/nextcloud/all-in-one/discussions/2517\">here</a>). If you have figured this out or if any of this information is incorrect, please edit this section!</li>\r\n            <li>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 (<strong>on the host physical machine and on the VM</strong>): <pre><code>virsh attach-device --live --domain [VM_NAME] --file [USB_DEVICE_DEFINITION.xml]\r\n   virsh console --domain [VM_NAME]\r\n   # (Login to the VM with root privileges)\r\n   mkdir -p /mnt/[MOUNT_NAME]\r\n   mount /dev/disk/by-label/[DISK_NAME] /mnt/[MOUNT_NAME]</code></pre></li>\r\n            To create the XML device definition file, see <a href=\"https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-managing_guest_virtual_machines_with_virsh-attaching_and_updating_a_device_with_virsh\">this short guide</a>. 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.\r\n            <li>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!)</li>\r\n        </ul>\r\n    </details>\r\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/Chart.yaml",
    "content": "name: nextcloud-aio-helm-chart\ndescription: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose\nversion: 12.8.0\napiVersion: v2\nkeywords:\n  - latest\n  - nextcloud\n  - helm-chart\n  - open-source\n  - cloud\nsources:\n  - https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart\nhome: https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/readme.md",
    "content": "# Nextcloud AIO Helm-chart\n\n> [!NOTE]\n> 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/).\n\n> [!IMPORTANT]\n> 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.\n\nYou 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.\n\n### Advantages\n- You can run it without a container having access to the docker socket\n- You can run the containers with Kubernetes\n\n### Disadvantages\n- You lose the AIO interface\n- You lose update notifications and automatic updates\n- You lose all AIO backup and restore features\n- You lose all community containers: https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers\n- **You need to know what you are doing**\n- For updating, you need to strictly follow the at the bottom described update routine\n- 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\n- Probably more\n\n## How to use this?\n\nFirst 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!`<br>\n⚠️ **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!\n\nThen run:\n\n```\nhelm repo add nextcloud-aio https://nextcloud.github.io/all-in-one/\nhelm install nextcloud-aio nextcloud-aio/nextcloud-aio-helm-chart -f values.yaml\n```\n\nAnd after a while, everything should be set up.\n\n## How to update?\nSince 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.\n1. Stop all running pods\n1. Back up all volumes that got created by the Helm chart and the values.yaml file\n1. Run `helm repo update nextcloud-aio` in order to get the updated yaml files from the repository\n1. 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.\n1. 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.\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-deployment.yaml",
    "content": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-apache\n  name: nextcloud-aio-apache\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-apache\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-apache\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 33\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 33\n        runAsGroup: 33\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: ADDITIONAL_TRUSTED_DOMAIN\n              value: \"{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}\"\n            - name: APACHE_HOST\n              value: nextcloud-aio-apache\n            - name: APACHE_MAX_SIZE\n              value: \"{{ .Values.APACHE_MAX_SIZE }}\"\n            - name: APACHE_MAX_TIME\n              value: \"{{ .Values.NEXTCLOUD_MAX_TIME }}\"\n            - name: APACHE_PORT\n              value: \"{{ .Values.APACHE_PORT }}\"\n            - name: COLLABORA_HOST\n              value: nextcloud-aio-collabora\n            - name: HARP_HOST\n              value: nextcloud-aio-harp\n            - name: NC_DOMAIN\n              value: \"{{ .Values.NC_DOMAIN }}\"\n            - name: NEXTCLOUD_HOST\n              value: nextcloud-aio-nextcloud\n            - name: NOTIFY_PUSH_HOST\n              value: nextcloud-aio-notify-push\n            - name: ONLYOFFICE_HOST\n              value: nextcloud-aio-onlyoffice\n            - name: TALK_HOST\n              value: nextcloud-aio-talk\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n            - name: WHITEBOARD_HOST\n              value: nextcloud-aio-whiteboard\n          image: ghcr.io/nextcloud-releases/aio-apache:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-apache\n          ports:\n            - containerPort: {{ .Values.APACHE_PORT }}\n              protocol: TCP\n            - containerPort: {{ .Values.APACHE_PORT }}\n              protocol: UDP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n              add: [\"NET_BIND_SERVICE\"]\n          volumeMounts:\n            - mountPath: /var/www/html\n              name: nextcloud-aio-nextcloud\n              readOnly: true\n            - mountPath: /mnt/data\n              name: nextcloud-aio-apache\n      volumes:\n        - name: nextcloud-aio-nextcloud\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-nextcloud\n        - name: nextcloud-aio-apache\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-apache\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-apache\n  name: nextcloud-aio-apache\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.APACHE_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-apache-service.yaml",
    "content": "apiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-apache\n  name: nextcloud-aio-apache\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  type: LoadBalancer\n  externalTrafficPolicy: Local\n  ports:\n    - name: \"{{ .Values.APACHE_PORT }}\"\n      port: {{ .Values.APACHE_PORT }}\n      targetPort: {{ .Values.APACHE_PORT }}\n    - name: {{ .Values.APACHE_PORT }}-udp\n      port: {{ .Values.APACHE_PORT }}\n      protocol: UDP\n      targetPort: {{ .Values.APACHE_PORT }}\n  selector:\n    io.kompose.service: nextcloud-aio-apache\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-deployment.yaml",
    "content": "{{- if eq .Values.CLAMAV_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-clamav\n  name: nextcloud-aio-clamav\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-clamav\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-clamav\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 100\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 100\n        runAsGroup: 100\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      initContainers:\n        - name: init-subpath\n          image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319\n          command:\n            - mkdir\n            - \"-p\"\n            - /nextcloud-aio-clamav/data\n          volumeMounts:\n            - name: nextcloud-aio-clamav\n              mountPath: /nextcloud-aio-clamav\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n      containers:\n        - env:\n            - name: MAX_SIZE\n              value: \"{{ .Values.NEXTCLOUD_UPLOAD_LIMIT }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-clamav:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 9\n            initialDelaySeconds: 60\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 9\n            initialDelaySeconds: 60\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-clamav\n          ports:\n            - containerPort: 3310\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          volumeMounts:\n            - mountPath: /var/lib/clamav\n              subPath: data\n              name: nextcloud-aio-clamav\n      volumes:\n        - name: nextcloud-aio-clamav\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-clamav\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-persistentvolumeclaim.yaml",
    "content": "{{- if eq .Values.CLAMAV_ENABLED \"yes\" }}\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-clamav\n  name: nextcloud-aio-clamav\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.CLAMAV_STORAGE_SIZE }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-service.yaml",
    "content": "{{- if eq .Values.CLAMAV_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-clamav\n  name: nextcloud-aio-clamav\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"3310\"\n      port: 3310\n      targetPort: 3310\n  selector:\n    io.kompose.service: nextcloud-aio-clamav\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml",
    "content": "{{- if eq .Values.COLLABORA_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-collabora\n  name: nextcloud-aio-collabora\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-collabora\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-collabora\n    spec:\n      containers:\n        - args: {{ .Values.ADDITIONAL_COLLABORA_OPTIONS | default list | toJson }}\n          env:\n            - name: DONT_GEN_SSL_CERT\n              value: \"1\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n            - name: aliasgroup1\n              value: https://{{ .Values.NC_DOMAIN }}:443,http://nextcloud-aio-apache:23973\n            - name: dictionaries\n              value: \"{{ .Values.COLLABORA_DICTIONARIES }}\"\n            - name: extra_params\n              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]=.+\n            - name: server_name\n              value: \"{{ .Values.NC_DOMAIN }}\"\n          {{- if contains \"--o:support_key=\" (join \" \" (.Values.ADDITIONAL_COLLABORA_OPTIONS | default list)) }}\n          image: ghcr.io/nextcloud-releases/aio-collabora-online:20260306_081319\n          {{- else }}\n          image: ghcr.io/nextcloud-releases/aio-collabora:20260306_081319\n          {{- end }}\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 9\n            initialDelaySeconds: 60\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 9\n            initialDelaySeconds: 60\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-collabora\n          ports:\n            - containerPort: 9980\n              protocol: TCP\n          securityContext:\n            capabilities:\n              add:\n                - MKNOD\n                - CAP_SYS_ADMIN\n                - SYS_CHROOT\n                - FOWNER\n                - CHOWN\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-service.yaml",
    "content": "{{- if eq .Values.COLLABORA_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-collabora\n  name: nextcloud-aio-collabora\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"9980\"\n      port: 9980\n      targetPort: 9980\n  selector:\n    io.kompose.service: nextcloud-aio-collabora\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-database-deployment.yaml",
    "content": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-database\n  name: nextcloud-aio-database\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-database\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-database\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 999\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 999\n        runAsGroup: 999\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      initContainers:\n        - name: init-subpath\n          image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319\n          command:\n            - mkdir\n            - \"-p\"\n            - /nextcloud-aio-database/data\n          volumeMounts:\n            - name: nextcloud-aio-database\n              mountPath: /nextcloud-aio-database\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n      containers:\n        - env:\n            - name: PGTZ\n              value: \"{{ .Values.TIMEZONE }}\"\n            - name: POSTGRES_DB\n              value: nextcloud_database\n            - name: POSTGRES_PASSWORD\n              value: \"{{ .Values.DATABASE_PASSWORD }}\"\n            - name: POSTGRES_USER\n              value: nextcloud\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-postgresql:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-database\n          ports:\n            - containerPort: 5432\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          volumeMounts:\n            - mountPath: /var/lib/postgresql/data\n              subPath: data\n              name: nextcloud-aio-database\n            - mountPath: /mnt/data\n              name: nextcloud-aio-database-dump\n      terminationGracePeriodSeconds: 1800\n      volumes:\n        - name: nextcloud-aio-database\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-database\n        - name: nextcloud-aio-database-dump\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-database-dump\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-database-dump-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-database-dump\n  name: nextcloud-aio-database-dump\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.DATABASE_DUMP_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-database-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-database\n  name: nextcloud-aio-database\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.DATABASE_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-database-service.yaml",
    "content": "apiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-database\n  name: nextcloud-aio-database\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"5432\"\n      port: 5432\n      targetPort: 5432\n  selector:\n    io.kompose.service: nextcloud-aio-database\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml",
    "content": "{{- if eq .Values.FULLTEXTSEARCH_ENABLED \"yes\" }}\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-elasticsearch\n  name: nextcloud-aio-elasticsearch\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.ELASTICSEARCH_STORAGE_SIZE }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-fulltextsearch-deployment.yaml",
    "content": "{{- if eq .Values.FULLTEXTSEARCH_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-fulltextsearch\n  name: nextcloud-aio-fulltextsearch\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-fulltextsearch\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-fulltextsearch\n    spec:\n      initContainers:\n        - name: init-volumes\n          image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319\n          command:\n            - chmod\n            - \"777\"\n            - /nextcloud-aio-elasticsearch\n          volumeMounts:\n            - name: nextcloud-aio-elasticsearch\n              mountPath: /nextcloud-aio-elasticsearch\n      containers:\n        - env:\n            - name: ES_JAVA_OPTS\n              value: \"{{ .Values.FULLTEXTSEARCH_JAVA_OPTIONS | default \"-Xms512M -Xmx512M\" }}\"\n            - name: FULLTEXTSEARCH_PASSWORD\n              value: \"{{ .Values.FULLTEXTSEARCH_PASSWORD }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n            - name: bootstrap.memory_lock\n              value: \"false\"\n            - name: cluster.name\n              value: nextcloud-aio\n            - name: discovery.type\n              value: single-node\n            - name: http.port\n              value: \"9200\"\n            - name: logger.level\n              value: WARN\n            - name: xpack.license.self_generated.type\n              value: basic\n            - name: xpack.security.enabled\n              value: \"false\"\n          image: ghcr.io/nextcloud-releases/aio-fulltextsearch:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 5\n            initialDelaySeconds: 60\n            periodSeconds: 10\n            timeoutSeconds: 5\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 5\n            initialDelaySeconds: 60\n            periodSeconds: 10\n            timeoutSeconds: 5\n          name: nextcloud-aio-fulltextsearch\n          ports:\n            - containerPort: 9200\n              protocol: TCP\n          volumeMounts:\n            - mountPath: /usr/share/elasticsearch/data\n              name: nextcloud-aio-elasticsearch\n      volumes:\n        - name: nextcloud-aio-elasticsearch\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-elasticsearch\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-fulltextsearch-service.yaml",
    "content": "{{- if eq .Values.FULLTEXTSEARCH_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-fulltextsearch\n  name: nextcloud-aio-fulltextsearch\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"9200\"\n      port: 9200\n      targetPort: 9200\n  selector:\n    io.kompose.service: nextcloud-aio-fulltextsearch\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-imaginary-deployment.yaml",
    "content": "{{- if eq .Values.IMAGINARY_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-imaginary\n  name: nextcloud-aio-imaginary\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-imaginary\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-imaginary\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 65534\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 65534\n        runAsGroup: 65534\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: IMAGINARY_SECRET\n              value: \"{{ .Values.IMAGINARY_SECRET }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-imaginary:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-imaginary\n          ports:\n            - containerPort: 9000\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-imaginary-service.yaml",
    "content": "{{- if eq .Values.IMAGINARY_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-imaginary\n  name: nextcloud-aio-imaginary\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"9000\"\n      port: 9000\n      targetPort: 9000\n  selector:\n    io.kompose.service: nextcloud-aio-imaginary\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-namespace-namespace.yaml",
    "content": "{{- if and (ne .Values.NAMESPACE \"default\") (ne .Values.NAMESPACE_DISABLED \"yes\") }}\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: \"{{ .Values.NAMESPACE }}\"\n  namespace: \"{{ .Values.NAMESPACE }}\"\n  {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n  labels:\n    pod-security.kubernetes.io/enforce: restricted\n  {{- end }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-networkpolicy.yaml",
    "content": "{{- if eq .Values.NETWORK_POLICY_ENABLED \"yes\" }}\n# https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/04-deny-traffic-from-other-namespaces.md\nkind: NetworkPolicy\napiVersion: networking.k8s.io/v1\nmetadata:\n  namespace: \"{{ .Values.NAMESPACE }}\"\n  name: nextcloud-aio-deny-from-other-namespaces\nspec:\n  podSelector:\n    matchLabels:\n  policyTypes:\n    - Ingress\n    - Egress\n  ingress:\n  - from:\n    - podSelector: {}\n  egress:\n  - {} # Allows all egress traffic\n---\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n  namespace: \"{{ .Values.NAMESPACE }}\"\n  name: nextcloud-aio-webserver-allow\nspec:\n  podSelector:\n    matchExpressions:\n      - key: io.kompose.service\n        operator: In\n        values:\n          - nextcloud-aio-apache\n  policyTypes:\n    - Ingress\n  ingress:\n    - {} # Allows all ingress traffic\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-data-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-nextcloud-data\n  name: nextcloud-aio-nextcloud-data\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS_DATA }}\n  storageClassName: {{ .Values.STORAGE_CLASS_DATA }}\n  {{- else if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.NEXTCLOUD_DATA_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml",
    "content": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-nextcloud\n  name: nextcloud-aio-nextcloud\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-nextcloud\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-nextcloud\n    spec:\n      {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }} # AIO-config - do not change this comment!\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 33\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 33\n        runAsGroup: 33\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      {{- end }} # AIO-config - do not change this comment!\n# AIO settings start # Do not remove or change this line!\n      initContainers:\n        - name: init-volumes\n          image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319\n          command:\n            - chmod\n            - \"777\"\n            - /nextcloud-aio-nextcloud\n            - /nextcloud-aio-nextcloud-trusted-cacerts\n          volumeMounts:\n            - name: nextcloud-aio-nextcloud-trusted-cacerts\n              mountPath: /nextcloud-aio-nextcloud-trusted-cacerts\n            - name: nextcloud-aio-nextcloud\n              mountPath: /nextcloud-aio-nextcloud\n# AIO settings end # Do not remove or change this line!\n      containers:\n        - env:\n            - name: SMTP_HOST\n              value: \"{{ .Values.SMTP_HOST }}\"\n            - name: SMTP_SECURE\n              value: \"{{ .Values.SMTP_SECURE }}\"\n            - name: SMTP_PORT\n              value: \"{{ .Values.SMTP_PORT }}\"\n            - name: SMTP_AUTHTYPE\n              value: \"{{ .Values.SMTP_AUTHTYPE }}\"\n            - name: SMTP_NAME\n              value: \"{{ .Values.SMTP_NAME }}\"\n            - name: SMTP_PASSWORD\n              value: \"{{ .Values.SMTP_PASSWORD }}\"\n            - name: MAIL_FROM_ADDRESS\n              value: \"{{ .Values.MAIL_FROM_ADDRESS }}\"\n            - name: MAIL_DOMAIN\n              value: \"{{ .Values.MAIL_DOMAIN }}\"\n            - name: SUBSCRIPTION_KEY\n              value: \"{{ .Values.SUBSCRIPTION_KEY }}\"\n            - name: APPS_ALLOWLIST\n              value: \"{{ .Values.APPS_ALLOWLIST }}\"\n            - name: ADDITIONAL_TRUSTED_PROXY\n              value: \"{{ .Values.ADDITIONAL_TRUSTED_PROXY }}\"\n            - name: ADDITIONAL_TRUSTED_DOMAIN\n              value: \"{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}\"\n            - name: SERVERINFO_TOKEN\n              value: \"{{ .Values.SERVERINFO_TOKEN }}\"\n            - name: NEXTCLOUD_DEFAULT_QUOTA\n              value: \"{{ .Values.NEXTCLOUD_DEFAULT_QUOTA }}\"\n            - name: NEXTCLOUD_SKELETON_DIRECTORY\n              value: \"{{ .Values.NEXTCLOUD_SKELETON_DIRECTORY }}\"\n            - name: NEXTCLOUD_MAINTENANCE_WINDOW\n              value: \"{{ .Values.NEXTCLOUD_MAINTENANCE_WINDOW }}\"\n            - name: ADDITIONAL_APKS\n              value: \"{{ .Values.NEXTCLOUD_ADDITIONAL_APKS }}\"\n            - name: ADDITIONAL_PHP_EXTENSIONS\n              value: \"{{ .Values.NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS }}\"\n            - name: ADMIN_PASSWORD\n              value: \"{{ .Values.NEXTCLOUD_PASSWORD }}\"\n            - name: ADMIN_USER\n              value: admin\n            - name: APACHE_HOST\n              value: nextcloud-aio-apache\n            - name: APACHE_PORT\n              value: \"{{ .Values.APACHE_PORT }}\"\n            - name: CLAMAV_ENABLED\n              value: \"{{ .Values.CLAMAV_ENABLED }}\"\n            - name: CLAMAV_HOST\n              value: nextcloud-aio-clamav\n            - name: COLLABORA_ENABLED\n              value: \"{{ .Values.COLLABORA_ENABLED }}\"\n            - name: COLLABORA_HOST\n              value: nextcloud-aio-collabora\n            - name: FULLTEXTSEARCH_ENABLED\n              value: \"{{ .Values.FULLTEXTSEARCH_ENABLED }}\"\n            - name: FULLTEXTSEARCH_HOST\n              value: nextcloud-aio-fulltextsearch\n            - name: FULLTEXTSEARCH_INDEX\n              value: nextcloud-aio\n            - name: FULLTEXTSEARCH_PASSWORD\n              value: \"{{ .Values.FULLTEXTSEARCH_PASSWORD }}\"\n            - name: FULLTEXTSEARCH_PORT\n              value: \"9200\"\n            - name: FULLTEXTSEARCH_PROTOCOL\n              value: http\n            - name: FULLTEXTSEARCH_USER\n              value: elastic\n            - name: IMAGINARY_ENABLED\n              value: \"{{ .Values.IMAGINARY_ENABLED }}\"\n            - name: IMAGINARY_HOST\n              value: nextcloud-aio-imaginary\n            - name: IMAGINARY_SECRET\n              value: \"{{ .Values.IMAGINARY_SECRET }}\"\n            - name: INSTALL_LATEST_MAJOR\n              value: \"{{ .Values.INSTALL_LATEST_MAJOR }}\"\n            - name: NC_DOMAIN\n              value: \"{{ .Values.NC_DOMAIN }}\"\n            - name: NEXTCLOUD_DATA_DIR\n              value: /mnt/ncdata\n            - name: NEXTCLOUD_HOST\n              value: nextcloud-aio-nextcloud\n            - name: ONLYOFFICE_ENABLED\n              value: \"{{ .Values.ONLYOFFICE_ENABLED }}\"\n            - name: ONLYOFFICE_HOST\n              value: nextcloud-aio-onlyoffice\n            - name: ONLYOFFICE_SECRET\n              value: \"{{ .Values.ONLYOFFICE_SECRET }}\"\n            - name: OVERWRITEPROTOCOL\n              value: https\n            - name: PHP_MAX_TIME\n              value: \"{{ .Values.NEXTCLOUD_MAX_TIME }}\"\n            - name: PHP_MEMORY_LIMIT\n              value: \"{{ .Values.NEXTCLOUD_MEMORY_LIMIT }}\"\n            - name: PHP_UPLOAD_LIMIT\n              value: \"{{ .Values.NEXTCLOUD_UPLOAD_LIMIT }}\"\n            - name: POSTGRES_DB\n              value: nextcloud_database\n            - name: POSTGRES_HOST\n              value: nextcloud-aio-database\n            - name: POSTGRES_PASSWORD\n              value: \"{{ .Values.DATABASE_PASSWORD }}\"\n            - name: POSTGRES_PORT\n              value: \"5432\"\n            - name: POSTGRES_USER\n              value: nextcloud\n            - name: RECORDING_SECRET\n              value: \"{{ .Values.RECORDING_SECRET }}\"\n            - name: REDIS_HOST\n              value: nextcloud-aio-redis\n            - name: REDIS_HOST_PASSWORD\n              value: \"{{ .Values.REDIS_PASSWORD }}\"\n            - name: REDIS_PORT\n              value: \"6379\"\n            - name: REMOVE_DISABLED_APPS\n              value: \"{{ .Values.REMOVE_DISABLED_APPS }}\"\n            - name: SIGNALING_SECRET\n              value: \"{{ .Values.SIGNALING_SECRET }}\"\n            - name: STARTUP_APPS\n              value: \"{{ .Values.NEXTCLOUD_STARTUP_APPS }}\"\n            - name: TALK_ENABLED\n              value: \"{{ .Values.TALK_ENABLED }}\"\n            - name: TALK_PORT\n              value: \"{{ .Values.TALK_PORT }}\"\n            - name: TALK_RECORDING_ENABLED\n              value: \"{{ .Values.TALK_RECORDING_ENABLED }}\"\n            - name: TALK_RECORDING_HOST\n              value: nextcloud-aio-talk-recording\n            - name: TRUSTED_CACERTS_DIR\n              value: \"{{ .Values.NEXTCLOUD_TRUSTED_CACERTS_DIR }}\"\n            - name: TURN_SECRET\n              value: \"{{ .Values.TURN_SECRET }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n            - name: UPDATE_NEXTCLOUD_APPS\n              value: \"{{ .Values.UPDATE_NEXTCLOUD_APPS }}\"\n            - name: WHITEBOARD_ENABLED\n              value: \"{{ .Values.WHITEBOARD_ENABLED }}\"\n            - name: WHITEBOARD_SECRET\n              value: \"{{ .Values.WHITEBOARD_SECRET }}\"\n          image: ghcr.io/nextcloud-releases/aio-nextcloud:20260306_081319\n          {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }} # AIO-config - do not change this comment!\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          {{- end }} # AIO-config - do not change this comment!\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-nextcloud\n          ports:\n            - containerPort: 9000\n              protocol: TCP\n            - containerPort: 9001\n              protocol: TCP\n          volumeMounts:\n            - mountPath: /var/www/html\n              name: nextcloud-aio-nextcloud\n            - mountPath: /mnt/ncdata\n              name: nextcloud-aio-nextcloud-data\n            - mountPath: /usr/local/share/ca-certificates\n              name: nextcloud-aio-nextcloud-trusted-cacerts\n              readOnly: true\n      terminationGracePeriodSeconds: 600\n      volumes:\n        - name: nextcloud-aio-nextcloud\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-nextcloud\n        - name: nextcloud-aio-nextcloud-data\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-nextcloud-data\n        - name: nextcloud-aio-nextcloud-trusted-cacerts\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-nextcloud-trusted-cacerts\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-nextcloud\n  name: nextcloud-aio-nextcloud\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteMany\n  resources:\n    requests:\n      storage: {{ .Values.NEXTCLOUD_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-service.yaml",
    "content": "apiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-nextcloud\n  name: nextcloud-aio-nextcloud\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"9000\"\n      port: 9000\n      targetPort: 9000\n    - name: \"9001\"\n      port: 9001\n      targetPort: 9001\n  selector:\n    io.kompose.service: nextcloud-aio-nextcloud\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-trusted-cacerts-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-nextcloud-trusted-cacerts\n  name: nextcloud-aio-nextcloud-trusted-cacerts\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.NEXTCLOUD_TRUSTED_CACERTS_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-notify-push-deployment.yaml",
    "content": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-notify-push\n  name: nextcloud-aio-notify-push\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-notify-push\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-notify-push\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 33\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 33\n        runAsGroup: 33\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: NEXTCLOUD_HOST\n              value: nextcloud-aio-nextcloud\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-notify-push:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-notify-push\n          ports:\n            - containerPort: 7867\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          volumeMounts:\n            - mountPath: /var/www/html\n              name: nextcloud-aio-nextcloud\n              readOnly: true\n      volumes:\n        - name: nextcloud-aio-nextcloud\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-nextcloud\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-notify-push-service.yaml",
    "content": "apiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-notify-push\n  name: nextcloud-aio-notify-push\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"7867\"\n      port: 7867\n      targetPort: 7867\n  selector:\n    io.kompose.service: nextcloud-aio-notify-push\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-onlyoffice-deployment.yaml",
    "content": "{{- if eq .Values.ONLYOFFICE_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-onlyoffice\n  name: nextcloud-aio-onlyoffice\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-onlyoffice\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-onlyoffice\n    spec:\n      initContainers:\n        - name: init-volumes\n          image: ghcr.io/nextcloud-releases/aio-alpine:20260306_081319\n          command:\n            - chmod\n            - \"777\"\n            - /nextcloud-aio-onlyoffice\n          volumeMounts:\n            - name: nextcloud-aio-onlyoffice\n              mountPath: /nextcloud-aio-onlyoffice\n      containers:\n        - env:\n            - name: JWT_ENABLED\n              value: \"true\"\n            - name: JWT_HEADER\n              value: AuthorizationJwt\n            - name: JWT_SECRET\n              value: \"{{ .Values.ONLYOFFICE_SECRET }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-onlyoffice:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 9\n            initialDelaySeconds: 60\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 9\n            initialDelaySeconds: 60\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-onlyoffice\n          ports:\n            - containerPort: 80\n              protocol: TCP\n          volumeMounts:\n            - mountPath: /var/lib/onlyoffice\n              name: nextcloud-aio-onlyoffice\n      volumes:\n        - name: nextcloud-aio-onlyoffice\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-onlyoffice\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-onlyoffice-persistentvolumeclaim.yaml",
    "content": "{{- if eq .Values.ONLYOFFICE_ENABLED \"yes\" }}\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-onlyoffice\n  name: nextcloud-aio-onlyoffice\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.ONLYOFFICE_STORAGE_SIZE }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-onlyoffice-service.yaml",
    "content": "{{- if eq .Values.ONLYOFFICE_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-onlyoffice\n  name: nextcloud-aio-onlyoffice\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"80\"\n      port: 80\n      targetPort: 80\n  selector:\n    io.kompose.service: nextcloud-aio-onlyoffice\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-deployment.yaml",
    "content": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-redis\n  name: nextcloud-aio-redis\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-redis\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-redis\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 999\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 999\n        runAsGroup: 999\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: REDIS_HOST_PASSWORD\n              value: \"{{ .Values.REDIS_PASSWORD }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-redis:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-redis\n          ports:\n            - containerPort: 6379\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          volumeMounts:\n            - mountPath: /data\n              name: nextcloud-aio-redis\n      volumes:\n        - name: nextcloud-aio-redis\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-redis\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-persistentvolumeclaim.yaml",
    "content": "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-redis\n  name: nextcloud-aio-redis\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.REDIS_STORAGE_SIZE }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-service.yaml",
    "content": "apiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-redis\n  name: nextcloud-aio-redis\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"6379\"\n      port: 6379\n      targetPort: 6379\n  selector:\n    io.kompose.service: nextcloud-aio-redis\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-deployment.yaml",
    "content": "{{- if eq .Values.TALK_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-talk\n  name: nextcloud-aio-talk\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-talk\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-talk\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 1000\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 1000\n        runAsGroup: 1000\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: TALK_MAX_STREAM_BITRATE\n              value: \"{{ .Values.TALK_MAX_STREAM_BITRATE }}\"\n            - name: TALK_MAX_SCREEN_BITRATE\n              value: \"{{ .Values.TALK_MAX_SCREEN_BITRATE }}\"\n            - name: INTERNAL_SECRET\n              value: \"{{ .Values.TALK_INTERNAL_SECRET }}\"\n            - name: NC_DOMAIN\n              value: \"{{ .Values.NC_DOMAIN }}\"\n            - name: SIGNALING_SECRET\n              value: \"{{ .Values.SIGNALING_SECRET }}\"\n            - name: TALK_HOST\n              value: nextcloud-aio-talk\n            - name: TALK_PORT\n              value: \"{{ .Values.TALK_PORT }}\"\n            - name: TURN_SECRET\n              value: \"{{ .Values.TURN_SECRET }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-talk:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-talk\n          ports:\n            - containerPort: {{ .Values.TALK_PORT }}\n              protocol: TCP\n            - containerPort: {{ .Values.TALK_PORT }}\n              protocol: UDP\n            - containerPort: 8081\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-deployment.yaml",
    "content": "{{- if eq .Values.TALK_RECORDING_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-talk-recording\n  name: nextcloud-aio-talk-recording\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-talk-recording\n  strategy:\n    type: Recreate\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-talk-recording\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 122\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 122\n        runAsGroup: 122\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: INTERNAL_SECRET\n              value: \"{{ .Values.TALK_INTERNAL_SECRET }}\"\n            - name: NC_DOMAIN\n              value: \"{{ .Values.NC_DOMAIN }}\"\n            - name: RECORDING_SECRET\n              value: \"{{ .Values.RECORDING_SECRET }}\"\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-talk-recording:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-talk-recording\n          ports:\n            - containerPort: 1234\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          volumeMounts:\n            - mountPath: /tmp\n              name: nextcloud-aio-talk-recording\n      volumes:\n        - name: nextcloud-aio-talk-recording\n          persistentVolumeClaim:\n            claimName: nextcloud-aio-talk-recording\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-persistentvolumeclaim.yaml",
    "content": "{{- if eq .Values.TALK_RECORDING_ENABLED \"yes\" }}\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    io.kompose.service: nextcloud-aio-talk-recording\n  name: nextcloud-aio-talk-recording\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  {{- if .Values.STORAGE_CLASS }}\n  storageClassName: {{ .Values.STORAGE_CLASS }}\n  {{- end }}\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: {{ .Values.TALK_RECORDING_STORAGE_SIZE }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-service.yaml",
    "content": "{{- if eq .Values.TALK_RECORDING_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-talk-recording\n  name: nextcloud-aio-talk-recording\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"1234\"\n      port: 1234\n      targetPort: 1234\n  selector:\n    io.kompose.service: nextcloud-aio-talk-recording\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-service.yaml",
    "content": "{{- if eq .Values.TALK_ENABLED \"yes\" }}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-talk\n  name: nextcloud-aio-talk-public\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  type: LoadBalancer\n  ports:\n    - name: \"{{ .Values.TALK_PORT }}\"\n      port: {{ .Values.TALK_PORT }}\n      targetPort: {{ .Values.TALK_PORT }}\n    - name: {{ .Values.TALK_PORT }}-udp\n      port: {{ .Values.TALK_PORT }}\n      protocol: UDP\n      targetPort: {{ .Values.TALK_PORT }}\n  selector:\n    io.kompose.service: nextcloud-aio-talk\n---\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-talk\n  name: nextcloud-aio-talk\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"8081\"\n      port: 8081\n      targetPort: 8081\n  selector:\n    io.kompose.service: nextcloud-aio-talk\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-whiteboard-deployment.yaml",
    "content": "{{- if eq .Values.WHITEBOARD_ENABLED \"yes\" }}\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-whiteboard\n  name: nextcloud-aio-whiteboard\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      io.kompose.service: nextcloud-aio-whiteboard\n  template:\n    metadata:\n      annotations:\n        kompose.version: 1.38.0 (a8f5d1cbd)\n      labels:\n        io.kompose.service: nextcloud-aio-whiteboard\n    spec:\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: 65534\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: 65534\n        runAsGroup: 65534\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\n      containers:\n        - env:\n            - name: BACKUP_DIR\n              value: /tmp\n            - name: JWT_SECRET_KEY\n              value: \"{{ .Values.WHITEBOARD_SECRET }}\"\n            - name: NEXTCLOUD_URL\n              value: https://{{ .Values.NC_DOMAIN }}\n            - name: REDIS_HOST\n              value: nextcloud-aio-redis\n            - name: REDIS_HOST_PASSWORD\n              value: \"{{ .Values.REDIS_PASSWORD }}\"\n            - name: REDIS_PORT\n              value: \"6379\"\n            - name: STORAGE_STRATEGY\n              value: redis\n            - name: TZ\n              value: \"{{ .Values.TIMEZONE }}\"\n          image: ghcr.io/nextcloud-releases/aio-whiteboard:20260306_081319\n          readinessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          livenessProbe:\n            exec:\n              command:\n                - /healthcheck.sh\n            failureThreshold: 3\n            periodSeconds: 30\n            timeoutSeconds: 30\n          name: nextcloud-aio-whiteboard\n          ports:\n            - containerPort: 3002\n              protocol: TCP\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/templates/nextcloud-aio-whiteboard-service.yaml",
    "content": "{{- if eq .Values.WHITEBOARD_ENABLED \"yes\" }}\napiVersion: v1\nkind: Service\nmetadata:\n  annotations:\n    kompose.version: 1.38.0 (a8f5d1cbd)\n  labels:\n    io.kompose.service: nextcloud-aio-whiteboard\n  name: nextcloud-aio-whiteboard\n  namespace: \"{{ .Values.NAMESPACE }}\"\nspec:\n  ipFamilyPolicy: PreferDualStack\n  ports:\n    - name: \"3002\"\n      port: 3002\n      targetPort: 3002\n  selector:\n    io.kompose.service: nextcloud-aio-whiteboard\n{{- end }}\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/update-helm.sh",
    "content": "#!/bin/bash\n\n[ -z \"$1\" ] && { echo \"Error: Docker tag is not specified. Usage: ./nextcloud-aio-helm-chart/update-helm.sh <Docker tag>\"; exit 2; }\n\nDOCKER_TAG=\"$1\"\n\n# The logic needs the files in ./helm-chart\ncp -r ./nextcloud-aio-helm-chart ./helm-chart\n\n# Clean\nrm -f ./helm-chart/values.yaml\nrm -rf ./helm-chart/templates\n\n# Install kompose\ncurl -L https://github.com/kubernetes/kompose/releases/latest/download/kompose-linux-amd64 -o kompose\nchmod +x kompose\nsudo mv ./kompose /usr/local/bin/kompose\n\n# Install yq\nsudo snap install yq\n\nset -ex\n\n# Conversion of docker-compose\ncd manual-install\ncp latest.yml latest.yml.backup\n\n# Additional config\n# shellcheck disable=SC1083\nsed -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\ncp sample.conf /tmp/\nsed -i 's|^|export |' /tmp/sample.conf\n# shellcheck disable=SC1091\nsource /tmp/sample.conf\nrm /tmp/sample.conf\nsed -i '/OVERWRITEHOST/d' latest.yml\nsed -i \"s|:latest$|:$DOCKER_TAG|\" latest.yml\nsed -i \"s|\\${APACHE_IP_BINDING}:||\" latest.yml\nsed -i '/APACHE_IP_BINDING/d' latest.yml\nsed -i \"s|\\${APACHE_PORT}:\\${APACHE_PORT}/|$APACHE_PORT:$APACHE_PORT/|\" latest.yml\nsed -i \"s|\\${TALK_PORT}:\\${TALK_PORT}/|$TALK_PORT:$TALK_PORT/|g\" latest.yml\nsed -i \"s|- \\${APACHE_PORT}|- $APACHE_PORT|\" latest.yml\nsed -i \"s|- \\${TALK_PORT}|- $TALK_PORT|\" latest.yml\nsed -i \"s|\\${NEXTCLOUD_DATADIR}|$NEXTCLOUD_DATADIR|\" latest.yml\nsed -i \"s|\\${ADDITIONAL_COLLABORA_OPTIONS}|ADDITIONAL_COLLABORA_OPTIONS_PLACEHOLDER|\" latest.yml\nsed -i \"/name: nextcloud-aio/,$ d\" latest.yml\nsed -i \"/NEXTCLOUD_DATADIR/d\" latest.yml\nsed -i \"/\\${NEXTCLOUD_MOUNT}/d\" latest.yml\nsed -i \"/^volumes:/a\\ \\ nextcloud_aio_nextcloud_trusted_cacerts:\\n \\ \\ \\ \\ name: nextcloud_aio_nextcloud_trusted_cacerts\" latest.yml\nsed -i \"s|\\${NEXTCLOUD_TRUSTED_CACERTS_DIR}:|nextcloud_aio_nextcloud_trusted_cacerts:|g#\" latest.yml\nsed -i 's/\\${/{{ .Values./g; s/}/ }}/g' latest.yml\nyq -i 'del(.services.[].profiles)' latest.yml\n# Delete read_only and tmpfs setting while https://github.com/kubernetes/kubernetes/issues/48912 is not fixed\nyq -i 'del(.services.[].read_only)' latest.yml\nyq -i 'del(.services.[].tmpfs)' latest.yml\n# Remove cap_drop in order to add it later again easier\nyq -i 'del(.services.[].cap_drop)' latest.yml\n# Remove SYS_NICE for imaginary as it is not supported with RPSS\nyq -i 'del(.services.\"nextcloud-aio-imaginary\".cap_add)' latest.yml\n# cap SYS_ADMIN is called CAP_SYS_ADMIN in k8s\nsed -i \"s|- SYS_ADMIN$|- CAP_SYS_ADMIN|\" latest.yml\n\ncat latest.yml\nkompose convert -c -f latest.yml --namespace nextcloud-aio-namespace\ncd latest\n\nif [ -f ./templates/manual-install-nextcloud-aio-networkpolicy.yaml ]; then\n    mv ./templates/manual-install-nextcloud-aio-networkpolicy.yaml ./templates/nextcloud-aio-networkpolicy.yaml\nfi\n# shellcheck disable=SC1083\nfind ./ -name '*networkpolicy.yaml' -exec sed -i \"s|manual-install-nextcloud-aio|nextcloud-aio|\" \\{} \\; \ncat << EOL > /tmp/initcontainers\n      initContainers:\n        - name: init-volumes\n          image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG\n          command:\n            - chmod\n            - \"777\"\n          volumeMountsInitContainer:\nEOL\ncat << EOL > /tmp/initcontainers.database\n      initContainers:\n        - name: init-subpath\n          image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG\n          command:\n            - mkdir\n            - \"-p\"\n            - /nextcloud-aio-database/data\n          volumeMounts:\n            - name: nextcloud-aio-database\n              mountPath: /nextcloud-aio-database\n          securityContext:\nEOL\ncat << EOL > /tmp/initcontainers.clamav\n      initContainers:\n        - name: init-subpath\n          image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG\n          command:\n            - mkdir\n            - \"-p\"\n            - /nextcloud-aio-clamav/data\n          volumeMounts:\n            - name: nextcloud-aio-clamav\n              mountPath: /nextcloud-aio-clamav\n          securityContext:\nEOL\ncat << EOL > /tmp/initcontainers.nextcloud\n# AIO settings start # Do not remove or change this line!\n      initContainers:\n        - name: init-volumes\n          image: ghcr.io/nextcloud-releases/aio-alpine:$DOCKER_TAG\n          command:\n            - chmod\n            - \"777\"\n          volumeMountsInitContainer:\n# AIO settings end # Do not remove or change this line!\nEOL\n\n# shellcheck disable=SC1083\nDEPLOYMENTS=\"$(find ./ -name '*deployment.yaml')\"\nmapfile -t DEPLOYMENTS <<< \"$DEPLOYMENTS\"\nfor variable in \"${DEPLOYMENTS[@]}\"; do\n    if grep -q livenessProbe \"$variable\"; then\n        sed -n \"/.*livenessProbe/,/timeoutSeconds.*/p\" \"$variable\" > /tmp/liveness.probe\n        cat /tmp/liveness.probe\n        sed -i \"s|livenessProbe|readinessProbe|\" /tmp/liveness.probe\n        sed -i \"/^          image:/r /tmp/liveness.probe\" \"$variable\"\n    fi\n    if grep -q volumeMounts \"$variable\"; then\n        if echo \"$variable\" | grep -q database; then\n            sed -i \"/^    spec:/r /tmp/initcontainers.database\" \"$variable\"\n        elif echo \"$variable\" | grep -q clamav; then\n            sed -i \"/^    spec:/r /tmp/initcontainers.clamav\" \"$variable\"\n        elif echo \"$variable\" | grep -q \"nextcloud-deployment.yaml\"; then\n            sed -i \"/^    spec:/r /tmp/initcontainers.nextcloud\" \"$variable\"\n        elif echo \"$variable\" | grep -q \"fulltextsearch\" || echo \"$variable\" | grep -q \"onlyoffice\" || echo \"$variable\" | grep -q \"collabora\"; then\n            sed -i \"/^    spec:/r /tmp/initcontainers\" \"$variable\"\n        fi\n        volumeNames=\"$(grep -A1 mountPath \"$variable\" | grep -v mountPath | sed 's|.*name: ||' | sed '/^--$/d')\"\n        mapfile -t volumeNames <<< \"$volumeNames\"\n        for volumeName in \"${volumeNames[@]}\"; do\n            # 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\n            if [ \"$volumeName\" != \"nextcloud-aio-nextcloud-data\" ]; then\n                sed -i \"/^.*volumeMountsInitContainer:/i\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ - /$volumeName\" \"$variable\"\n                sed -i \"/volumeMountsInitContainer:/a\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ - name: $volumeName\\n\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ mountPath: /$volumeName\" \"$variable\"\n                # Workaround for the database volume\n                if [ \"$volumeName\" = nextcloud-aio-database ]; then\n                    sed -i \"/mountPath: \\/var\\/lib\\/postgresql\\/data/a\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ subPath: data\" \"$variable\"\n                elif [ \"$volumeName\" = nextcloud-aio-clamav ]; then\n                    sed -i \"/mountPath: \\/var\\/lib\\/clamav/a\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ subPath: data\" \"$variable\"\n                fi\n                \n            fi\n        done\n        sed -i \"s|volumeMountsInitContainer:|volumeMounts:|\" \"$variable\"\n        if grep -q claimName \"$variable\"; then\n            claimNames=\"$(grep claimName \"$variable\")\"\n            mapfile -t claimNames <<< \"$claimNames\"\n            for claimName in \"${claimNames[@]}\"; do\n                if grep -A1 \"^$claimName$\" \"$variable\" | grep -q \"readOnly: true\"; then\n                    sed -i \"/^$claimName$/{n;d}\" \"$variable\"\n                fi\n            done\n        fi\n    fi\n    if grep -q runAsUser \"$variable\" || echo \"$variable\" | grep -q \"nextcloud-deployment.yaml\"; then\n        if echo \"$variable\" | grep -q \"nextcloud-deployment.yaml\"; then\n            USER=33\n            GROUP=33\n            echo '      {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }} # AIO-config - do not change this comment!' > /tmp/pod.securityContext\n        else\n            USER=\"$(grep runAsUser \"$variable\" | grep -oP '[0-9]+')\"\n            GROUP=\"$USER\"\n            rm -f /tmp/pod.securityContext\n        fi\n        sed -i \"/runAsUser:/d\" \"$variable\"\n        sed -i \"/capabilities:/d\" \"$variable\"\n        if [ -n \"$USER\" ]; then\n            cat << EOL >> /tmp/pod.securityContext\n      securityContext:\n        # The items below only work in pod context\n        fsGroup: $USER\n        fsGroupChangePolicy: \"OnRootMismatch\"\n        # The items below work in both contexts\n        runAsUser: $USER\n        runAsGroup: $GROUP\n        runAsNonRoot: true\n        {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n        seccompProfile:\n          type: RuntimeDefault\n        {{- end }}\nEOL\n            if echo \"$variable\" | grep -q \"nextcloud-deployment.yaml\"; then\n                echo \"      {{- end }} # AIO-config - do not change this comment!\" >> /tmp/pod.securityContext\n            fi\n            sed -i \"/^    spec:$/r /tmp/pod.securityContext\" \"$variable\"\n        fi\n    fi\ndone\n# shellcheck disable=SC1083\nfind ./ -name '*.yaml' -exec sed -i 's|nextcloud-aio-namespace|\"\\{\\{ .Values.NAMESPACE \\}\\}\"|' \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*service.yaml' -exec sed -i \"/^status:/,$ d\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*deployment.yaml' -exec sed -i \"s|manual-install-nextcloud-aio|nextcloud-aio|\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*deployment.yaml' -exec sed -i \"/medium: Memory/d\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*.yaml' -exec sed -i \"/kompose.cmd/d\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*deployment.yaml' -exec sed -i \"s|emptyDir:|emptyDir: \\{\\}|\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*deployment.yaml' -exec sed -i \"/hostPort:/d\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*persistentvolumeclaim.yaml' -exec sed -i \"s|ReadOnlyMany|ReadWriteOnce|\" \\{} \\;   \n# shellcheck disable=SC1083\nfind ./ -name 'nextcloud-aio-nextcloud-persistentvolumeclaim.yaml' -exec sed -i \"s|ReadWriteOnce|ReadWriteMany|\"  \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*persistentvolumeclaim.yaml' -exec sed -i \"/accessModes:/i\\ \\ {{- if .Values.STORAGE_CLASS }}\" \\{} \\;  \n# shellcheck disable=SC1083\nfind ./ -name '*persistentvolumeclaim.yaml' -exec sed -i \"/accessModes:/i\\ \\ storageClassName: {{ .Values.STORAGE_CLASS }}\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*persistentvolumeclaim.yaml' -exec sed -i \"/accessModes:/i\\ \\ {{- end }}\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -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 }}\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name 'nextcloud-aio-nextcloud-data-persistentvolumeclaim.yaml' -exec sed -i \"s/{{- if .Values.STORAGE_CLASS }}/{{- else if .Values.STORAGE_CLASS }}/\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*deployment.yaml' -exec sed -i \"/restartPolicy:/d\" \\{} \\;  \n# shellcheck disable=SC1083\nfind ./ -name '*apache*' -exec sed -i \"s|$APACHE_PORT|{{ .Values.APACHE_PORT }}|\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*talk*' -exec sed -i \"s|$TALK_PORT|{{ .Values.TALK_PORT }}|\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*apache-service.yaml' -exec sed -i \"/^spec:/a\\ \\ type: LoadBalancer\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*talk-service.yaml' -exec sed -i \"/^spec:/a\\ \\ type: LoadBalancer\" \\{} \\;\necho '---' > /tmp/talk-service.copy\n# shellcheck disable=SC1083\nfind ./ -name '*talk-service.yaml' -exec cat \\{} \\; >> /tmp/talk-service.copy\nsed -i 's|name: nextcloud-aio-talk|name: nextcloud-aio-talk-public|' /tmp/talk-service.copy\n# shellcheck disable=SC1083\nINTERNAL_TALK_PORTS=\"$(find ./ -name '*talk-deployment.yaml' -exec grep -oP 'containerPort: [0-9]+' \\{} \\;)\"\nmapfile -t INTERNAL_TALK_PORTS <<< \"$INTERNAL_TALK_PORTS\"\nfor port in \"${INTERNAL_TALK_PORTS[@]}\"; do\n    port=\"$(echo \"$port\" | grep -oP '[0-9]+')\"\n    sed -i \"/$port/d\" /tmp/talk-service.copy\ndone\necho '---' >>  /tmp/talk-service.copy\n# shellcheck disable=SC1083\nfind ./ -name '*talk-service.yaml' -exec grep -v '{{ .Values.TALK.*}}\\|protocol: UDP\\|type: LoadBalancer' \\{} \\; >> /tmp/talk-service.copy\n# shellcheck disable=SC1083\nfind ./ -name '*talk-service.yaml' -exec mv /tmp/talk-service.copy \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*apache-service.yaml' -exec sed -i \"/type: LoadBalancer/a\\ \\ externalTrafficPolicy: Local\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*service.yaml' -exec sed -i \"/^spec:/a\\ \\ ipFamilyPolicy: PreferDualStack\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*.yaml' -exec sed -i \"s|'{{|\\\"{{|g;s|}}'|}}\\\"|g\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ \\( -not -name '*service.yaml' -name '*.yaml' \\) -exec sed -i \"/^status:/d\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ \\( -not -name '*persistentvolumeclaim.yaml' -name '*.yaml' \\) -exec sed -i \"/resources:/d\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name \"*namespace.yaml\" -exec sed -i \"1i\\\\{{- if and \\(ne .Values.NAMESPACE \\\"default\\\"\\) \\(ne .Values.NAMESPACE_DISABLED \\\"yes\\\"\\) }}\" \\{} \\; \n# Additional config\ncat << EOL > /tmp/additional-namespace.config\n  {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n  labels:\n    pod-security.kubernetes.io/enforce: restricted\n  {{- end }}\nEOL\n# shellcheck disable=SC1083\nfind ./ -name \"*namespace.yaml\" -exec sed -i \"/namespace.*/r /tmp/additional-namespace.config\"  \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name \"*namespace.yaml\" -exec sed -i \"$ a {{- end }}\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name '*.yaml' -exec sed -i \"/creationTimestamp: null/d\" \\{} \\; \nVOLUMES=\"$(find ./ -name '*persistentvolumeclaim.yaml' | sed 's|-persistentvolumeclaim.yaml||g;s|.*nextcloud-aio-||g' | sort)\"\nmapfile -t VOLUMES <<< \"$VOLUMES\"\nfor variable in \"${VOLUMES[@]}\"; do\n    name=\"$(echo \"$variable\" | sed 's|-|_|g' | tr '[:lower:]' '[:upper:]')_STORAGE_SIZE\"\n    VOLUME_VARIABLE+=(\"$name\")\n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$variable-persistentvolumeclaim.yaml\" -exec sed -i \"s|storage: 100Mi|storage: {{ .Values.$name }}|\" \\{} \\; \ndone\n\n# Additional config\ncat << EOL > /tmp/additional.config\n            - name: SMTP_HOST\n              value: \"{{ .Values.SMTP_HOST }}\"\n            - name: SMTP_SECURE\n              value: \"{{ .Values.SMTP_SECURE }}\"\n            - name: SMTP_PORT\n              value: \"{{ .Values.SMTP_PORT }}\"\n            - name: SMTP_AUTHTYPE\n              value: \"{{ .Values.SMTP_AUTHTYPE }}\"\n            - name: SMTP_NAME\n              value: \"{{ .Values.SMTP_NAME }}\"\n            - name: SMTP_PASSWORD\n              value: \"{{ .Values.SMTP_PASSWORD }}\"\n            - name: MAIL_FROM_ADDRESS\n              value: \"{{ .Values.MAIL_FROM_ADDRESS }}\"\n            - name: MAIL_DOMAIN\n              value: \"{{ .Values.MAIL_DOMAIN }}\"\n            - name: SUBSCRIPTION_KEY\n              value: \"{{ .Values.SUBSCRIPTION_KEY }}\"\n            - name: APPS_ALLOWLIST\n              value: \"{{ .Values.APPS_ALLOWLIST }}\"\n            - name: ADDITIONAL_TRUSTED_PROXY\n              value: \"{{ .Values.ADDITIONAL_TRUSTED_PROXY }}\"\n            - name: ADDITIONAL_TRUSTED_DOMAIN\n              value: \"{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}\"\n            - name: SERVERINFO_TOKEN\n              value: \"{{ .Values.SERVERINFO_TOKEN }}\"\n            - name: NEXTCLOUD_DEFAULT_QUOTA\n              value: \"{{ .Values.NEXTCLOUD_DEFAULT_QUOTA }}\"\n            - name: NEXTCLOUD_SKELETON_DIRECTORY\n              value: \"{{ .Values.NEXTCLOUD_SKELETON_DIRECTORY }}\"\n            - name: NEXTCLOUD_MAINTENANCE_WINDOW\n              value: \"{{ .Values.NEXTCLOUD_MAINTENANCE_WINDOW }}\"\nEOL\n# shellcheck disable=SC1083\nfind ./ -name '*nextcloud-deployment.yaml' -exec sed -i \"/^.*\\- env:/r /tmp/additional.config\"  \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*fulltextsearch-deployment.yaml' -exec sed -i 's/{{ .Values.FULLTEXTSEARCH_JAVA_OPTIONS }}/{{ .Values.FULLTEXTSEARCH_JAVA_OPTIONS | default \"-Xms512M -Xmx512M\" }}/'  \\{} \\;\n\n# Additional config\ncat << EOL > /tmp/additional-apache.config\n            - name: ADDITIONAL_TRUSTED_DOMAIN\n              value: \"{{ .Values.ADDITIONAL_TRUSTED_DOMAIN }}\"\nEOL\n# shellcheck disable=SC1083\nfind ./ -name '*apache-deployment.yaml' -exec sed -i \"/^.*\\- env:/r /tmp/additional-apache.config\"  \\{} \\;\n\n# Additional config\ncat << EOL > /tmp/additional-talk.config\n            - name: TALK_MAX_STREAM_BITRATE\n              value: \"{{ .Values.TALK_MAX_STREAM_BITRATE }}\"\n            - name: TALK_MAX_SCREEN_BITRATE\n              value: \"{{ .Values.TALK_MAX_SCREEN_BITRATE }}\"\nEOL\n# shellcheck disable=SC1083\nfind ./ -name '*talk-deployment.yaml' -exec sed -i \"/^.*\\- env:/r /tmp/additional-talk.config\"  \\{} \\;\n\n# Additional collabora config\n# shellcheck disable=SC1083\nfind ./ -name '*collabora-deployment.yaml' -exec sed -i \"s/image: ghcr.io.*/IMAGE_PLACEHOLDER/\"  \\{} \\;\ncat << EOL > /tmp/additional-collabora.config\n          {{- if contains \"--o:support_key=\" (join \" \" (.Values.ADDITIONAL_COLLABORA_OPTIONS | default list)) }}\n          image: ghcr.io/nextcloud-releases/aio-collabora-online:$DOCKER_TAG\n          {{- else }}\n          image: ghcr.io/nextcloud-releases/aio-collabora:$DOCKER_TAG\n          {{- end }}\nEOL\n# shellcheck disable=SC1083\nfind ./ -name '*collabora-deployment.yaml' -exec sed -i \"/IMAGE_PLACEHOLDER/r /tmp/additional-collabora.config\"  \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*collabora-deployment.yaml' -exec sed -i \"/IMAGE_PLACEHOLDER/d\"  \\{} \\;\n\ncat << EOL > templates/nextcloud-aio-networkpolicy.yaml\n{{- if eq .Values.NETWORK_POLICY_ENABLED \"yes\" }}\n# https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/04-deny-traffic-from-other-namespaces.md\nkind: NetworkPolicy\napiVersion: networking.k8s.io/v1\nmetadata:\n  namespace: \"{{ .Values.NAMESPACE }}\"\n  name: nextcloud-aio-deny-from-other-namespaces\nspec:\n  podSelector:\n    matchLabels:\n  policyTypes:\n    - Ingress\n    - Egress\n  ingress:\n  - from:\n    - podSelector: {}\n  egress:\n  - {} # Allows all egress traffic\n---\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n  namespace: \"{{ .Values.NAMESPACE }}\"\n  name: nextcloud-aio-webserver-allow\nspec:\n  podSelector:\n    matchExpressions:\n      - key: io.kompose.service\n        operator: In\n        values:\n          - nextcloud-aio-apache\n  policyTypes:\n    - Ingress\n  ingress:\n    - {} # Allows all ingress traffic\n{{- end }}\nEOL\n\ncd ../\nmkdir -p ../helm-chart/\nrm latest/Chart.yaml\nrm latest/README.md\nmv latest/* ../helm-chart/\nrm -r latest\nrm latest.yml\nmv latest.yml.backup latest.yml\n\n# Get version of AIO\nAIO_VERSION=\"$(grep -oP '[0-9]+.[0-9]+.[0-9]+' ../php/templates/includes/aio-version.twig)\"\nsed -i \"s|^version:.*|version: $AIO_VERSION|\" ../helm-chart/Chart.yaml\n\n# Conversion of sample.conf\ncp sample.conf /tmp/\nsed -i 's|\"||g' /tmp/sample.conf\nsed -i 's|=|: |' /tmp/sample.conf\nsed -i 's|= |: |' /tmp/sample.conf\nsed -i '/^NEXTCLOUD_DATADIR/d' /tmp/sample.conf\nsed -i '/^APACHE_IP_BINDING/d' /tmp/sample.conf\nsed -i '/^NEXTCLOUD_MOUNT/d' /tmp/sample.conf\nsed -i 's/ yes / \"yes\" /' /tmp/sample.conf\nsed -i 's/ no / \"no\" /' /tmp/sample.conf\nsed -i 's/\"no\" authentication/no authentication/' /tmp/sample.conf\nsed -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\nsed -i 's|17179869184|\"17179869184\"|' /tmp/sample.conf\n# shellcheck disable=SC2129\necho \"\" >> /tmp/sample.conf\n# shellcheck disable=SC2129\necho '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\necho '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\nfor variable in \"${VOLUME_VARIABLE[@]}\"; do\n    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\ndone\nsed -i \"s|NEXTCLOUD_STORAGE_SIZE: 1Gi|NEXTCLOUD_STORAGE_SIZE: 5Gi|\" /tmp/sample.conf\nsed -i \"s|NEXTCLOUD_DATA_STORAGE_SIZE: 1Gi|NEXTCLOUD_DATA_STORAGE_SIZE: 5Gi|\" /tmp/sample.conf\n\n# Additional config\ncat << ADDITIONAL_CONFIG >> /tmp/sample.conf\n\nNAMESPACE: default        # By changing this, you can adjust the namespace of the installation which allows to install multiple instances on one kubernetes cluster\nNAMESPACE_DISABLED: \"no\"        # By setting this to \"yes\", you can disabled the creation of the namespace so that you can use a pre-created one\nNETWORK_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.\nSUBSCRIPTION_KEY:        # This allows to set the Nextcloud Enterprise key via ENV\nSERVERINFO_TOKEN:        # This allows to set the serverinfo app token for monitoring your Nextcloud via the serverinfo app\nAPPS_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'\nADDITIONAL_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.\nADDITIONAL_TRUSTED_DOMAIN:        # Allows to add one domain to Nextcloud's trusted domains and also generates a certificate automatically for it\nNEXTCLOUD_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\nNEXTCLOUD_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.\nNEXTCLOUD_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\nSMTP_HOST:        # (empty by default): The hostname of the SMTP server.\nSMTP_SECURE:         # (empty by default): Set to 'ssl' to use SSL, or 'tls' to use STARTTLS.\nSMTP_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.\nSMTP_AUTHTYPE:         # (default: 'LOGIN'): The method used for authentication. Use 'PLAIN' if no authentication or STARTLS is required.\nSMTP_NAME:         # (empty by default): The username for the authentication.\nSMTP_PASSWORD:         # (empty by default): The password for the authentication.\nMAIL_FROM_ADDRESS:         # (not set by default): Set the local-part for the 'from' field in the emails sent by Nextcloud.\nMAIL_DOMAIN:         # (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed.\nTALK_MAX_STREAM_BITRATE: \"1048576\"         # This allows to adjust the max stream bitrate of the talk hpb\nTALK_MAX_SCREEN_BITRATE: \"2097152\"         # This allows to adjust the max stream bitrate of the talk hpb\nADDITIONAL_CONFIG\n\nmv /tmp/sample.conf ../helm-chart/values.yaml\n\nENABLED_VARIABLES=\"$(grep -oP '^[A-Z_]+_ENABLED' ../helm-chart/values.yaml)\"\nmapfile -t ENABLED_VARIABLES <<< \"$ENABLED_VARIABLES\"\n\ncd ../helm-chart/\nfor variable in \"${ENABLED_VARIABLES[@]}\"; do\n    name=\"$(echo \"$variable\" | sed 's|_ENABLED||g;s|_|-|g' | tr '[:upper:]' '[:lower:]')\"\n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$name-deployment.yaml\" -exec sed -i \"1i\\\\{{- if eq .Values.$variable \\\"yes\\\" }}\" \\{} \\; \n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$name-deployment.yaml\" -exec sed -i \"$ a {{- end }}\" \\{} \\; \n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$name-service.yaml\" -exec sed -i \"1i\\\\{{- if eq .Values.$variable \\\"yes\\\" }}\" \\{} \\; \n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$name-service.yaml\" -exec sed -i \"$ a {{- end }}\" \\{} \\; \n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$name-persistentvolumeclaim.yaml\" -exec sed -i \"1i\\\\{{- if eq .Values.$variable \\\"yes\\\" }}\" \\{} \\; \n    # shellcheck disable=SC1083\n    find ./ -name \"*nextcloud-aio-$name-persistentvolumeclaim.yaml\" -exec sed -i \"$ a {{- end }}\" \\{} \\; \ndone\n\n# Additional case for FTS volume\n# shellcheck disable=SC1083\nfind ./ -name \"*nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml\" -exec sed -i \"1i\\\\{{- if eq .Values.FULLTEXTSEARCH_ENABLED \\\"yes\\\" }}\" \\{} \\; \n# shellcheck disable=SC1083\nfind ./ -name \"*nextcloud-aio-elasticsearch-persistentvolumeclaim.yaml\" -exec sed -i \"$ a {{- end }}\" \\{} \\; \n\ncat << EOL > /tmp/security.conf\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\nEOL\n# shellcheck disable=SC1083\nfind ./ \\( -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\" \\{} \\; \n\n# shellcheck disable=SC1083\nfind ./ -name '*collabora-deployment.yaml*' -exec sed -i \"/ADDITIONAL_COLLABORA_OPTIONS_PLACEHOLDER/d\" \\{} \\;\n# shellcheck disable=SC1083\nfind ./ -name '*collabora-deployment.yaml*' -exec sed -i \"s/- args:/- args: \\{\\{ .Values.ADDITIONAL_COLLABORA_OPTIONS | default list | toJson \\}\\}/\" \\{} \\;\n\ncat << EOL > /tmp/security.conf\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n              add: [\"NET_BIND_SERVICE\"]\nEOL\n\n# shellcheck disable=SC1083\nfind ./ -name '*apache-deployment.yaml*' -exec sed -i \"/^          securityContext:$/r /tmp/security.conf\" \\{} \\; \n\ncat << EOL > /tmp/security.conf\n          {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }} # AIO-config - do not change this comment!\n          securityContext:\n            # The items below only work in container context\n            allowPrivilegeEscalation: false\n            capabilities:\n              {{- if eq (.Values.RPSS_ENABLED | default \"no\") \"yes\" }}\n              drop: [\"ALL\"]\n              {{- else }}\n              drop: [\"NET_RAW\"]\n              {{- end }}\n          {{- end }} # AIO-config - do not change this comment!\nEOL\n# shellcheck disable=SC1083\nfind ./ -name '*nextcloud-deployment.yaml*' -exec sed -i \"/image: .*nextcloud.*aio-nextcloud:.*/r /tmp/security.conf\" \\{} \\; \n\nchmod 777 -R ./\n\n# Seems like the dir needs to match the name of the chart\ncd ../\nrm -rf ./nextcloud-aio-helm-chart\nmv ./helm-chart ./nextcloud-aio-helm-chart\n\nset +ex\n"
  },
  {
    "path": "nextcloud-aio-helm-chart/values.yaml",
    "content": "DATABASE_PASSWORD:           # TODO! This needs to be a unique and good password!\nFULLTEXTSEARCH_PASSWORD:           # TODO! This needs to be a unique and good password!\nIMAGINARY_SECRET:           # TODO! This needs to be a unique and good password!\nNC_DOMAIN: yourdomain.com          # TODO! Needs to be changed to the domain that you want to use for Nextcloud.\nNEXTCLOUD_PASSWORD:           # TODO! This is the password of the initially created Nextcloud admin with username admin.\nONLYOFFICE_SECRET:           # TODO! This needs to be a unique and good password!\nRECORDING_SECRET:           # TODO! This needs to be a unique and good password!\nREDIS_PASSWORD:           # TODO! This needs to be a unique and good password!\nSIGNALING_SECRET:           # TODO! This needs to be a unique and good password!\nTALK_INTERNAL_SECRET:           # TODO! This needs to be a unique and good password!\nTIMEZONE: Europe/Berlin          # TODO! This is the timezone that your containers will use.\nTURN_SECRET:           # TODO! This needs to be a unique and good password!\nWHITEBOARD_SECRET:           # TODO! This needs to be a unique and good password!\n\nCLAMAV_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nCOLLABORA_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nFULLTEXTSEARCH_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nIMAGINARY_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nONLYOFFICE_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nTALK_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nTALK_RECORDING_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\nWHITEBOARD_ENABLED: \"no\"          # Setting this to \"yes\" (with quotes) enables the option in Nextcloud automatically.\n\nAPACHE_MAX_SIZE: \"17179869184\"          # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT\nAPACHE_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).\nADDITIONAL_COLLABORA_OPTIONS: ['--o:security.seccomp=true']          # You can add additional collabora options here by using the array syntax.\nCOLLABORA_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\nFULLTEXTSEARCH_JAVA_OPTIONS: -Xms512M -Xmx512M          # Allows to adjust the fulltextsearch java options.\nINSTALL_LATEST_MAJOR: \"no\"        # Setting this to \"yes\" will install the latest Major Nextcloud version upon the first installation\nNEXTCLOUD_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.\nNEXTCLOUD_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.\nNEXTCLOUD_MAX_TIME: 3600          # This allows to change the upload time limit of the Nextcloud container\nNEXTCLOUD_MEMORY_LIMIT: 512M          # This allows to change the PHP memory limit of the Nextcloud container\nNEXTCLOUD_STARTUP_APPS: deck twofactor_totp tasks calendar contacts notes        # Allows to modify the Nextcloud apps that are installed on starting AIO the first time\nNEXTCLOUD_TRUSTED_CACERTS_DIR:        # Setting this to any value allows to automatically import root certificates into the Nextcloud container\nNEXTCLOUD_UPLOAD_LIMIT: 16G          # This allows to change the upload limit of the Nextcloud container\nREMOVE_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.\nTALK_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!\nUPDATE_NEXTCLOUD_APPS: \"no\"          # When setting to \"yes\" (with quotes), it will automatically update all installed Nextcloud apps upon container startup on saturdays.\n\nSTORAGE_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).\nSTORAGE_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!\nAPACHE_STORAGE_SIZE: 1Gi       # You can change the size of the apache volume that default to 1Gi with this value\nCLAMAV_STORAGE_SIZE: 1Gi       # You can change the size of the clamav volume that default to 1Gi with this value\nDATABASE_STORAGE_SIZE: 1Gi       # You can change the size of the database volume that default to 1Gi with this value\nDATABASE_DUMP_STORAGE_SIZE: 1Gi       # You can change the size of the database-dump volume that default to 1Gi with this value\nELASTICSEARCH_STORAGE_SIZE: 1Gi       # You can change the size of the elasticsearch volume that default to 1Gi with this value\nNEXTCLOUD_STORAGE_SIZE: 5Gi       # You can change the size of the nextcloud volume that default to 1Gi with this value\nNEXTCLOUD_DATA_STORAGE_SIZE: 5Gi       # You can change the size of the nextcloud-data volume that default to 1Gi with this value\nNEXTCLOUD_TRUSTED_CACERTS_STORAGE_SIZE: 1Gi       # You can change the size of the nextcloud-trusted-cacerts volume that default to 1Gi with this value\nONLYOFFICE_STORAGE_SIZE: 1Gi       # You can change the size of the onlyoffice volume that default to 1Gi with this value\nREDIS_STORAGE_SIZE: 1Gi       # You can change the size of the redis volume that default to 1Gi with this value\nTALK_RECORDING_STORAGE_SIZE: 1Gi       # You can change the size of the talk-recording volume that default to 1Gi with this value\n\nNAMESPACE: default        # By changing this, you can adjust the namespace of the installation which allows to install multiple instances on one kubernetes cluster\nNAMESPACE_DISABLED: \"no\"        # By setting this to \"yes\", you can disabled the creation of the namespace so that you can use a pre-created one\nNETWORK_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.\nSUBSCRIPTION_KEY:        # This allows to set the Nextcloud Enterprise key via ENV\nSERVERINFO_TOKEN:        # This allows to set the serverinfo app token for monitoring your Nextcloud via the serverinfo app\nAPPS_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'\nADDITIONAL_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.\nADDITIONAL_TRUSTED_DOMAIN:        # Allows to add one domain to Nextcloud's trusted domains and also generates a certificate automatically for it\nNEXTCLOUD_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\nNEXTCLOUD_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.\nNEXTCLOUD_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\nSMTP_HOST:        # (empty by default): The hostname of the SMTP server.\nSMTP_SECURE:         # (empty by default): Set to 'ssl' to use SSL, or 'tls' to use STARTTLS.\nSMTP_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.\nSMTP_AUTHTYPE:         # (default: 'LOGIN'): The method used for authentication. Use 'PLAIN' if no authentication or STARTLS is required.\nSMTP_NAME:         # (empty by default): The username for the authentication.\nSMTP_PASSWORD:         # (empty by default): The password for the authentication.\nMAIL_FROM_ADDRESS:         # (not set by default): Set the local-part for the 'from' field in the emails sent by Nextcloud.\nMAIL_DOMAIN:         # (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed.\nTALK_MAX_STREAM_BITRATE: \"1048576\"         # This allows to adjust the max stream bitrate of the talk hpb\nTALK_MAX_SCREEN_BITRATE: \"2097152\"         # This allows to adjust the max stream bitrate of the talk hpb\n"
  },
  {
    "path": "php/README.md",
    "content": "# PHP Docker Controller\n\nThis is the code for the PHP Docker controller.\n\n## How to run\n\nRunning this locally requires :\n\n### 1. Install the development environment\n\nThis project uses Composer as dependency management software. It is very similar to NPM.\nThe command to install all dependencies is:\n\n```bash\ncomposer install\n```\n\n### 2. Access to docker socket\n\nThe `root` user has all privileges including access to the Docker socket. \nBut **it is not recommended to launch the local instance with full privileges**, consider the docker group for docker access without being `root`.\nSee https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user\n\n### 3. Run a `nextcloud-aio-mastercontainer` container\n\nThis application manages containers, including its own container.\nSo you need to run a `nextcloud-aio-mastercontainer` container for the application to work properly.\n\nHere is a command to quickly launch a container :\n\n```bash\ndocker run \\\n--rm \\\n--name nextcloud-aio-mastercontainer \\\n--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n--volume /var/run/docker.sock:/var/run/docker.sock \\\nghcr.io/nextcloud-releases/all-in-one:latest\n```\n\n### 4. Start your server\n\nWith this command you will launch the server:\n\n```bash\n# Make sure to launch this command with a user having access to the docker socket.\nSKIP_DOMAIN_VALIDATION=true composer run dev\n```\n\nYou can then access the web interface at http://localhost:8080.\n\nNote: You can restart the server by preceding the command with other environment variables.\n\n## Composer routine\n\n| Command                                 | Description                            |\n|-----------------------------------------|----------------------------------------|\n| `composer run dev`                      | Starts the development server          |\n| `composer run psalm`                    | Run Psalm static analysis              |\n| `composer run psalm:strict`             | Run Psalm static analysis strict       |\n| `composer run psalm:update-baseline`    | Run Psalm with `--update-baseline` arg |\n| `composer run lint`                     | Run PHP Syntax check                   |\n| `composer run lint:twig`                | Run Twig Syntax check                  |\n| `composer run php-deprecation-detector` | Run PHP Deprecation Detector           |\n\n\n"
  },
  {
    "path": "php/composer.json",
    "content": "{\n\t\"autoload\": {\n\t\t\"psr-4\": {\n\t\t\t\"AIO\\\\\": [\"src/\"]\n\t\t}\n\t},\n\t\"require\": {\n\t\t\"php\": \"8.5.*\",\n\t\t\"ext-json\": \"*\",\n\t\t\"ext-sodium\": \"*\",\n\t\t\"ext-curl\": \"*\",\n\t\t\"slim/slim\": \"^4.11\",\n\t\t\"php-di/slim-bridge\": \"^3.3\",\n\t\t\"guzzlehttp/guzzle\": \"^7.5\",\n\t\t\"guzzlehttp/psr7\": \"^2.4\",\n\t\t\"http-interop/http-factory-guzzle\": \"^1.2\",\n\t\t\"slim/twig-view\": \"^3.3\",\n\t\t\"slim/csrf\": \"^1.3\",\n\t\t\"ext-apcu\": \"*\",\n\t\t\"slim/psr7\": \"^1.8\"\n\t},\n\t\"require-dev\": {\n\t\t\"sserbin/twig-linter\": \"@dev\",\n\t\t\"vimeo/psalm\": \"^6.0\",\n\t\t\"wapmorgan/php-deprecation-detector\": \"dev-master\"\n\t},\n\t\"scripts\": {\n\t\t\"dev\": [\n\t\t\t\"Composer\\\\Config::disableProcessTimeout\",\n\t\t\t\"php -S localhost:8080 -t public\"\n\t\t],\n\t\t\"psalm\": \"psalm --threads=1\",\n\t\t\"psalm:update-baseline\": \"psalm --threads=1 --monochrome --no-progress --output-format=text --update-baseline\",\n\t\t\"psalm:strict\": \"psalm --threads=1 --show-info=true\",\n\t\t\"lint\": \"php -l src/*.php src/**/*.php public/index.php\",\n\t\t\"lint:twig\": \"twig-linter lint ./templates\",\n\t\t\"php-deprecation-detector\": \"phpdd scan -n -t 8.5 src/*.php src/**/*.php public/index.php\"\n\t}\n}\n"
  },
  {
    "path": "php/containers-schema.json",
    "content": "{\n\t\"type\": \"object\",\n\t\"description\": \"AIO containers definition schema\",\n\t\"minProperties\": 1,\n\t\"required\": [\"aio_services_v1\"],\n\t\"properties\": {\n\t\t\"aio_services_v1\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": false,\n\t\t\t\t\"minProperties\": 2,\n\t\t\t\t\"required\": [\"image\", \"container_name\", \"image_tag\"],\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"image\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"minLength\": 1,\n\t\t\t\t\t\t\"pattern\": \"^(ghcr.io/)?[a-z0-9/-]+$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"expose\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^([0-9]{1,5})$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"cap_add\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^[A-Z_]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"cap_drop\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^[A-Z_]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"depends_on\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^nextcloud-aio-[a-z-]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"display_name\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^[()A-Za-z &0-9-]+$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"hide_from_list\": {\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t\"environment\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^.*=.*$\",\n\t\t\t\t\t\t\t\"minlength\": 1\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"container_name\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^nextcloud-aio-[a-z0-9-]+$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"internal_port\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^(([0-9]{1,5})|host|(%[A-Z_]+%))$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"stop_grace_period\": {\n\t\t\t\t\t\t\"type\": \"integer\"\n\t\t\t\t\t},\n\t\t\t\t\t\"user\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^[0-9]{1,6}$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"ports\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"additionalProperties\": false,\n\t\t\t\t\t\t\t\"minProperties\": 3,\n\t\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\t\"ip_binding\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^((%[A-Z_]+%)|127\\\\.0\\\\.0\\\\.1)?$\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"port_number\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^(%[A-Z_]+%|[0-9]{1,5})$\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"protocol\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^(tcp|udp)$\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"healthcheck\": {\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"additionalProperties\": false,\n\t\t\t\t\t\t\"minProperties\": 6,\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"interval\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]+s$\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"timeout\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]+s$\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"retries\": {\n\t\t\t\t\t\t\t\t\"type\": \"integer\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"start_period\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]+s$\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"start_interval\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]+s$\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"test\": {\n\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\"pattern\": \"^.*$\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"aio_variables\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^[A-Z_a-z-]+=.*$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"restart\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^unless-stopped$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"shm_size\": {\n\t\t\t\t\t\t\"type\": \"integer\"\n\t\t\t\t\t},\n\t\t\t\t\t\"secrets\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^[A-Z_]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"ui_secret\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^[A-Z_]+$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"image_tag\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^([a-z0-9.-]+|%AIO_CHANNEL%)$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"documentation\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"pattern\": \"^https://.*$\"\n\t\t\t\t\t},\n\t\t\t\t\t\"devices\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^/dev/[a-z]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"enable_nvidia_gpu\": {\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t\"apparmor_unconfined\": {\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t\"backup_volumes\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^nextcloud_aio_[a-z_]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"nextcloud_exec_commands\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^(php /var/www/html/occ .*|echo .*|touch .*|mkdir .*)$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"profiles\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^[a-z-]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"read_only\": {\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t\"init\": {\n\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t},\n\t\t\t\t\t\"tmpfs\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\"pattern\": \"^/[a-z/_0-9-:]+$\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"volumes\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"additionalProperties\": false,\n\t\t\t\t\t\t\t\"minProperties\": 3,\n\t\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\t\"destination\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^((/[a-z_/.-]+)|(%[A-Z_]+%))$\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"source\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^((nextcloud_aio_[a-z_]+)|(%[A-Z_]+%)|(/dev)|(/run/udev))$\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"writeable\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"boolean\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "php/containers.json",
    "content": "{\n  \"aio_services_v1\": [\n    {\n      \"container_name\": \"nextcloud-aio-apache\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"documentation\": \"https://github.com/nextcloud/all-in-one/discussions/2105\",\n      \"depends_on\": [\n        \"nextcloud-aio-onlyoffice\",\n        \"nextcloud-aio-collabora\",\n        \"nextcloud-aio-talk\",\n        \"nextcloud-aio-notify-push\",\n        \"nextcloud-aio-whiteboard\",\n        \"nextcloud-aio-harp\",\n        \"nextcloud-aio-nextcloud\"\n      ],\n      \"display_name\": \"Apache & Caddy\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-apache\",\n      \"user\": \"33\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"ports\": [\n        {\n          \"ip_binding\": \"%APACHE_IP_BINDING%\",\n          \"port_number\": \"%APACHE_PORT%\",\n          \"protocol\": \"tcp\"\n        },\n        {\n          \"ip_binding\": \"%APACHE_IP_BINDING%\",\n          \"port_number\": \"%APACHE_PORT%\",\n          \"protocol\": \"udp\"\n        }\n      ],\n      \"internal_port\": \"%APACHE_PORT%\",\n      \"environment\": [\n        \"NC_DOMAIN=%NC_DOMAIN%\",\n        \"NEXTCLOUD_HOST=nextcloud-aio-nextcloud\",\n        \"APACHE_HOST=nextcloud-aio-apache\",\n        \"COLLABORA_HOST=nextcloud-aio-collabora\",\n        \"TALK_HOST=nextcloud-aio-talk\",\n        \"APACHE_PORT=%APACHE_PORT%\",\n        \"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice\",\n        \"TZ=%TIMEZONE%\",\n        \"APACHE_MAX_SIZE=%APACHE_MAX_SIZE%\",\n        \"APACHE_MAX_TIME=%NEXTCLOUD_MAX_TIME%\",\n        \"NOTIFY_PUSH_HOST=nextcloud-aio-notify-push\",\n        \"WHITEBOARD_HOST=nextcloud-aio-whiteboard\",\n        \"HARP_HOST=nextcloud-aio-harp\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_nextcloud\",\n          \"destination\": \"/var/www/html\",\n          \"writeable\": false\n        },\n        {\n          \"source\": \"nextcloud_aio_apache\",\n          \"destination\": \"/mnt/data\",\n          \"writeable\": true\n        }\n      ],\n      \"restart\": \"unless-stopped\",\n      \"backup_volumes\": [\n        \"nextcloud_aio_nextcloud\",\n        \"nextcloud_aio_apache\"\n      ],\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/var/log/supervisord\",\n        \"/var/run/supervisord\",\n        \"/usr/local/apache2/logs\",\n        \"/tmp\",\n        \"/home/www-data\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-database\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"PostgreSQL\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-postgresql\",\n      \"user\": \"999\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"5432\"\n      ],\n      \"internal_port\": \"5432\",\n      \"secrets\": [\n        \"DATABASE_PASSWORD\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_database\",\n          \"destination\": \"/var/lib/postgresql/data\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"nextcloud_aio_database_dump\",\n          \"destination\": \"/mnt/data\",\n          \"writeable\": true\n        }\n      ],\n      \"environment\": [\n        \"POSTGRES_PASSWORD=%DATABASE_PASSWORD%\",\n        \"POSTGRES_DB=nextcloud_database\",\n        \"POSTGRES_USER=nextcloud\",\n        \"TZ=%TIMEZONE%\",\n        \"PGTZ=%TIMEZONE%\"\n      ],\n      \"stop_grace_period\": 1800,\n      \"restart\": \"unless-stopped\",\n      \"shm_size\": 268435456,\n      \"backup_volumes\": [\n        \"nextcloud_aio_database\",\n        \"nextcloud_aio_database_dump\"\n      ],\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/var/run/postgresql\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-nextcloud\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"depends_on\": [\n        \"nextcloud-aio-database\",\n        \"nextcloud-aio-redis\",\n        \"nextcloud-aio-clamav\",\n        \"nextcloud-aio-fulltextsearch\",\n        \"nextcloud-aio-talk-recording\",\n        \"nextcloud-aio-imaginary\",\n        \"nextcloud-aio-docker-socket-proxy\"\n      ],\n      \"display_name\": \"Nextcloud\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-nextcloud\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"9000\",\n        \"9001\"\n      ],\n      \"internal_port\": \"9000\",\n      \"secrets\": [\n        \"DATABASE_PASSWORD\",\n        \"REDIS_PASSWORD\",\n        \"NEXTCLOUD_PASSWORD\",\n        \"TURN_SECRET\",\n        \"SIGNALING_SECRET\",\n        \"FULLTEXTSEARCH_PASSWORD\",\n        \"IMAGINARY_SECRET\",\n        \"WHITEBOARD_SECRET\",\n        \"HP_SHARED_KEY\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_nextcloud\",\n          \"destination\": \"/var/www/html\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"%NEXTCLOUD_DATADIR%\",\n          \"destination\": \"/mnt/ncdata\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"%NEXTCLOUD_MOUNT%\",\n          \"destination\": \"%NEXTCLOUD_MOUNT%\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"%NEXTCLOUD_TRUSTED_CACERTS_DIR%\",\n          \"destination\": \"/usr/local/share/ca-certificates\",\n          \"writeable\": false\n        }\n      ],\n      \"environment\": [\n        \"NEXTCLOUD_HOST=nextcloud-aio-nextcloud\",\n        \"POSTGRES_HOST=nextcloud-aio-database\",\n        \"POSTGRES_PORT=5432\",\n        \"POSTGRES_PASSWORD=%DATABASE_PASSWORD%\",\n        \"POSTGRES_DB=nextcloud_database\",\n        \"POSTGRES_USER=nextcloud\",\n        \"REDIS_HOST=nextcloud-aio-redis\",\n        \"REDIS_PORT=6379\",\n        \"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%\",\n        \"APACHE_HOST=nextcloud-aio-apache\",\n        \"APACHE_PORT=%APACHE_PORT%\",\n        \"AIO_TOKEN=%AIO_TOKEN%\",\n        \"NC_DOMAIN=%NC_DOMAIN%\",\n        \"ADMIN_USER=admin\",\n        \"ADMIN_PASSWORD=%NEXTCLOUD_PASSWORD%\",\n        \"NEXTCLOUD_DATA_DIR=/mnt/ncdata\",\n        \"OVERWRITEHOST=%NC_DOMAIN%\",\n        \"OVERWRITEPROTOCOL=https\",\n        \"TURN_SECRET=%TURN_SECRET%\",\n        \"SIGNALING_SECRET=%SIGNALING_SECRET%\",\n        \"ONLYOFFICE_SECRET=%ONLYOFFICE_SECRET%\",\n        \"AIO_URL=%AIO_URL%\",\n        \"NC_AIO_VERSION=v%AIO_VERSION%\",\n        \"NEXTCLOUD_MOUNT=%NEXTCLOUD_MOUNT%\",\n        \"CLAMAV_ENABLED=%CLAMAV_ENABLED%\",\n        \"CLAMAV_HOST=nextcloud-aio-clamav\",\n        \"ONLYOFFICE_ENABLED=%ONLYOFFICE_ENABLED%\",\n        \"COLLABORA_ENABLED=%COLLABORA_ENABLED%\",\n        \"COLLABORA_HOST=nextcloud-aio-collabora\",\n        \"TALK_ENABLED=%TALK_ENABLED%\",\n        \"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice\",\n        \"UPDATE_NEXTCLOUD_APPS=%UPDATE_NEXTCLOUD_APPS%\",\n        \"TZ=%TIMEZONE%\",\n        \"TALK_PORT=%TALK_PORT%\",\n        \"TURN_DOMAIN=%TURN_DOMAIN%\",\n        \"IMAGINARY_ENABLED=%IMAGINARY_ENABLED%\",\n        \"IMAGINARY_HOST=nextcloud-aio-imaginary\",\n        \"PHP_UPLOAD_LIMIT=%NEXTCLOUD_UPLOAD_LIMIT%\",\n        \"PHP_MEMORY_LIMIT=%NEXTCLOUD_MEMORY_LIMIT%\",\n        \"FULLTEXTSEARCH_ENABLED=%FULLTEXTSEARCH_ENABLED%\",\n        \"FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch\",\n        \"FULLTEXTSEARCH_PROTOCOL=http\",\n        \"FULLTEXTSEARCH_PORT=9200\",\n        \"FULLTEXTSEARCH_USER=elastic\",\n        \"FULLTEXTSEARCH_INDEX=nextcloud-aio\",\n        \"PHP_MAX_TIME=%NEXTCLOUD_MAX_TIME%\",\n        \"TRUSTED_CACERTS_DIR=%NEXTCLOUD_TRUSTED_CACERTS_DIR%\",\n        \"STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%\",\n        \"ADDITIONAL_APKS=%NEXTCLOUD_ADDITIONAL_APKS%\",\n        \"ADDITIONAL_PHP_EXTENSIONS=%NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS%\",\n        \"INSTALL_LATEST_MAJOR=%INSTALL_LATEST_MAJOR%\",\n        \"TALK_RECORDING_ENABLED=%TALK_RECORDING_ENABLED%\",\n        \"RECORDING_SECRET=%RECORDING_SECRET%\",\n        \"TALK_RECORDING_HOST=nextcloud-aio-talk-recording\",\n        \"FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%\",\n        \"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%\",\n        \"REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%\",\n        \"ADDITIONAL_TRUSTED_PROXY=%CADDY_IP_ADDRESS%\",\n        \"THIS_IS_AIO=true\",\n        \"IMAGINARY_SECRET=%IMAGINARY_SECRET%\",\n        \"WHITEBOARD_SECRET=%WHITEBOARD_SECRET%\",\n        \"WHITEBOARD_ENABLED=%WHITEBOARD_ENABLED%\",\n        \"HARP_ENABLED=%HARP_ENABLED%\",\n        \"HP_SHARED_KEY=%HP_SHARED_KEY%\"\n      ],\n      \"stop_grace_period\": 600,\n      \"restart\": \"unless-stopped\",\n      \"devices\": [\n        \"/dev/dri\"\n      ],\n      \"enable_nvidia_gpu\": true,\n      \"backup_volumes\": [\n        \"nextcloud_aio_nextcloud\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-notify-push\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"Client Push\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-notify-push\",\n      \"user\": \"33\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"7867\"\n      ],\n      \"internal_port\": \"7867\",\n      \"secrets\": [\n        \"REDIS_PASSWORD\",\n        \"DATABASE_PASSWORD\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_nextcloud\",\n          \"destination\": \"/var/www/html\",\n          \"writeable\": false\n        }\n      ],\n      \"environment\": [\n        \"NEXTCLOUD_HOST=nextcloud-aio-nextcloud\",\n        \"TZ=%TIMEZONE%\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"read_only\": true,\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-redis\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"Redis\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-redis\",\n      \"user\": \"999\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"6379\"\n      ],\n      \"internal_port\": \"6379\",\n      \"environment\": [\n        \"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%\",\n        \"TZ=%TIMEZONE%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_redis\",\n          \"destination\": \"/data\",\n          \"writeable\": true\n        }\n      ],\n      \"secrets\": [\n        \"REDIS_PASSWORD\",\n        \"ONLYOFFICE_SECRET\",\n        \"RECORDING_SECRET\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"read_only\": true,\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-collabora\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"documentation\": \"https://github.com/nextcloud/all-in-one/discussions/1358\",\n      \"display_name\": \"Nextcloud Office\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-collabora\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"60s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 9\n      },\n      \"expose\": [\n        \"9980\"\n      ],\n      \"internal_port\": \"9980\",\n      \"environment\": [\n        \"aliasgroup1=https://%NC_DOMAIN%:443,http://nextcloud-aio-apache.nextcloud-aio:23973\",\n        \"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]=.+\",\n        \"dictionaries=%COLLABORA_DICTIONARIES%\",\n        \"TZ=%TIMEZONE%\",\n        \"server_name=%NC_DOMAIN%\",\n        \"DONT_GEN_SSL_CERT=1\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"nextcloud_exec_commands\": [\n        \"echo 'Activating Collabora config...'\",\n        \"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'\"\n      ],\n      \"profiles\": [\n        \"collabora\"\n      ],\n      \"cap_add\": [\n        \"SYS_ADMIN\",\n        \"SYS_CHROOT\",\n        \"FOWNER\",\n        \"CHOWN\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-talk\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"documentation\": \"https://github.com/nextcloud/all-in-one/discussions/1358\",\n      \"display_name\": \"Nextcloud Talk\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-talk\",\n      \"user\": \"1000\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"ports\": [\n        {\n          \"ip_binding\": \"\",\n          \"port_number\": \"%TALK_PORT%\",\n          \"protocol\": \"tcp\"\n        },\n        {\n          \"ip_binding\": \"\",\n          \"port_number\": \"%TALK_PORT%\",\n          \"protocol\": \"udp\"\n        }\n      ],\n      \"expose\": [\n        \"8081\"\n      ],\n      \"internal_port\": \"%TALK_PORT%\",\n      \"volumes\": [\n        {\n          \"source\": \"%NEXTCLOUD_TRUSTED_CACERTS_DIR%\",\n          \"destination\": \"/usr/local/share/ca-certificates\",\n          \"writeable\": false\n        }\n      ],\n      \"environment\": [\n        \"NC_DOMAIN=%NC_DOMAIN%\",\n        \"TALK_HOST=nextcloud-aio-talk\",\n        \"TURN_SECRET=%TURN_SECRET%\",\n        \"SIGNALING_SECRET=%SIGNALING_SECRET%\",\n        \"TZ=%TIMEZONE%\",\n        \"TALK_PORT=%TALK_PORT%\",\n        \"INTERNAL_SECRET=%TALK_INTERNAL_SECRET%\"\n      ],\n      \"secrets\": [\n        \"TURN_SECRET\",\n        \"SIGNALING_SECRET\",\n        \"TALK_INTERNAL_SECRET\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"profiles\": [\n        \"talk\",\n        \"talk-recording\"\n      ],\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/var/log/supervisord\",\n        \"/var/run/supervisord\",\n        \"/opt/eturnal/run\",\n        \"/conf\",\n        \"/tmp\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-talk-recording\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"Nextcloud Talk Recording\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-talk-recording\",\n      \"user\": \"122\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"1234\"\n      ],\n      \"internal_port\": \"1234\",\n      \"environment\": [\n        \"NC_DOMAIN=%NC_DOMAIN%\",\n        \"TZ=%TIMEZONE%\",\n        \"RECORDING_SECRET=%RECORDING_SECRET%\",\n        \"INTERNAL_SECRET=%TALK_INTERNAL_SECRET%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_talk_recording\",\n          \"destination\": \"/tmp\",\n          \"writeable\": true\n        }\n      ],\n      \"shm_size\": 2147483648,\n      \"secrets\": [\n        \"RECORDING_SECRET\",\n        \"TALK_INTERNAL_SECRET\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"profiles\": [\n        \"talk-recording\"\n      ],\n      \"devices\": [\n        \"/dev/dri\"\n      ],\n      \"enable_nvidia_gpu\": true,\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/conf\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-borgbackup\",\n      \"display_name\": \"Borgbackup\",\n      \"hide_from_list\": true,\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-borgbackup\",\n      \"init\": true,\n      \"environment\": [\n        \"BORG_REMOTE_REPO=%BORGBACKUP_REMOTE_REPO%\",\n        \"BORG_PASSWORD=%BORGBACKUP_PASSWORD%\",\n        \"BORG_MODE=%BORGBACKUP_MODE%\",\n        \"SELECTED_RESTORE_TIME=%SELECTED_RESTORE_TIME%\",\n        \"RESTORE_EXCLUDE_PREVIEWS=%RESTORE_EXCLUDE_PREVIEWS%\",\n        \"BACKUP_RESTORE_PASSWORD=%BACKUP_RESTORE_PASSWORD%\",\n        \"ADDITIONAL_DIRECTORIES_BACKUP=%ADDITIONAL_DIRECTORIES_BACKUP%\",\n        \"BORGBACKUP_HOST_LOCATION=%BORGBACKUP_HOST_LOCATION%\",\n        \"BORG_HOST_ID=nextcloud-aio-borgbackup\",\n        \"BORG_RETENTION_POLICY=%BORG_RETENTION_POLICY%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_backup_cache\",\n          \"destination\": \"/root\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"%NEXTCLOUD_DATADIR%\",\n          \"destination\": \"/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"nextcloud_aio_mastercontainer\",\n          \"destination\": \"/nextcloud_aio_volumes/nextcloud_aio_mastercontainer\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"%BORGBACKUP_HOST_LOCATION%\",\n          \"destination\": \"/mnt/borgbackup\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"nextcloud_aio_elasticsearch\",\n          \"destination\": \"/nextcloud_aio_volumes/nextcloud_aio_elasticsearch\",\n          \"writeable\": true\n        },\n        {\n          \"source\": \"nextcloud_aio_redis\",\n          \"destination\": \"/mnt/redis\",\n          \"writeable\": true\n        }\n      ],\n      \"secrets\": [\n        \"BORGBACKUP_PASSWORD\"\n      ],\n      \"devices\": [\n        \"/dev/fuse\"\n      ],\n      \"cap_add\": [\n        \"SYS_ADMIN\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ],\n      \"apparmor_unconfined\": true,\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/tmp\",\n        \"/nextcloud_aio_volumes\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-watchtower\",\n      \"display_name\": \"Watchtower\",\n      \"hide_from_list\": true,\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-watchtower\",\n      \"init\": true,\n      \"environment\": [\n        \"CONTAINER_TO_UPDATE=nextcloud-aio-mastercontainer\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"%WATCHTOWER_DOCKER_SOCKET_PATH%\",\n          \"destination\": \"/var/run/docker.sock\",\n          \"writeable\": false\n        }\n      ],\n      \"read_only\": true,\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-domaincheck\",\n      \"display_name\": \"Domaincheck\",\n      \"hide_from_list\": true,\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-domaincheck\",\n      \"init\": true,\n      \"ports\": [\n        {\n          \"ip_binding\": \"%APACHE_IP_BINDING%\",\n          \"port_number\": \"%APACHE_PORT%\",\n          \"protocol\": \"tcp\"\n        }\n      ],\n      \"internal_port\": \"%APACHE_PORT%\",\n      \"environment\": [\n        \"INSTANCE_ID=%INSTANCE_ID%\",\n        \"APACHE_PORT=%APACHE_PORT%\"\n      ],\n      \"secrets\": [\n        \"INSTANCE_ID\"\n      ],\n      \"stop_grace_period\": 1,\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/etc/lighttpd\",\n        \"/var/www/domaincheck\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-clamav\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"ClamAV\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-clamav\",\n      \"user\": \"100\",\n      \"init\": false,\n      \"healthcheck\": {\n        \"start_period\": \"60s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 9\n      },\n      \"expose\": [\n        \"3310\"\n      ],\n      \"internal_port\": \"3310\",\n      \"environment\": [\n        \"TZ=%TIMEZONE%\",\n        \"MAX_SIZE=%NEXTCLOUD_UPLOAD_LIMIT%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_clamav\",\n          \"destination\": \"/var/lib/clamav\",\n          \"writeable\": true\n        }\n      ],\n      \"restart\": \"unless-stopped\",\n      \"profiles\": [\n        \"clamav\"\n      ],\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/tmp\",\n        \"/var/log/clamav\",\n        \"/run/clamav\",\n        \"/var/log/supervisord\",\n        \"/var/run/supervisord\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-onlyoffice\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"OnlyOffice\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-onlyoffice\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"60s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 9\n      },\n      \"expose\": [\n        \"80\"\n      ],\n      \"internal_port\": \"80\",\n      \"environment\": [\n        \"TZ=%TIMEZONE%\",\n        \"JWT_ENABLED=true\",\n        \"JWT_HEADER=AuthorizationJwt\",\n        \"JWT_SECRET=%ONLYOFFICE_SECRET%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_onlyoffice\",\n          \"destination\": \"/var/lib/onlyoffice\",\n          \"writeable\": true\n        }\n      ],\n      \"secrets\": [\n        \"ONLYOFFICE_SECRET\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"profiles\": [\n        \"onlyoffice\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-imaginary\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"Imaginary\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-imaginary\",\n      \"user\": \"65534\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"9000\"\n      ],\n      \"internal_port\": \"9000\",\n      \"environment\": [\n        \"TZ=%TIMEZONE%\",\n        \"IMAGINARY_SECRET=%IMAGINARY_SECRET%\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"cap_add\": [\n        \"SYS_NICE\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ],\n      \"profiles\": [\n        \"imaginary\"\n      ],\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/tmp\"\n      ],\n      \"secrets\": [\n        \"IMAGINARY_SECRET\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-fulltextsearch\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"documentation\": \"https://github.com/nextcloud/all-in-one/discussions/1709\",\n      \"display_name\": \"Fulltextsearch\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-fulltextsearch\",\n      \"init\": false,\n      \"healthcheck\": {\n        \"start_period\": \"60s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"10s\",\n        \"timeout\": \"5s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 5\n      },\n      \"expose\": [\n        \"9200\"\n      ],\n      \"internal_port\": \"9200\",\n      \"environment\": [\n        \"TZ=%TIMEZONE%\",\n        \"ES_JAVA_OPTS=%FULLTEXTSEARCH_JAVA_OPTIONS%\",\n        \"bootstrap.memory_lock=false\",\n        \"cluster.name=nextcloud-aio\",\n        \"discovery.type=single-node\",\n        \"logger.level=WARN\",\n        \"http.port=9200\",\n        \"xpack.license.self_generated.type=basic\",\n        \"xpack.security.enabled=false\",\n        \"FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"nextcloud_aio_elasticsearch\",\n          \"destination\": \"/usr/share/elasticsearch/data\",\n          \"writeable\": true\n        }\n      ],\n      \"restart\": \"unless-stopped\",\n      \"profiles\": [\n        \"fulltextsearch\"\n      ],\n      \"secrets\": [\n        \"FULLTEXTSEARCH_PASSWORD\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-docker-socket-proxy\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"Docker Socket Proxy (deprecated)\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-docker-socket-proxy\",\n      \"init\": true,\n      \"internal_port\": \"2375\",\n      \"environment\": [\n        \"TZ=%TIMEZONE%\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"%WATCHTOWER_DOCKER_SOCKET_PATH%\",\n          \"destination\": \"/var/run/docker.sock\",\n          \"writeable\": false\n        }\n      ],\n      \"restart\": \"unless-stopped\",\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/tmp\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-harp\",\n      \"image_tag\": \"release\",\n      \"display_name\": \"HaRP\",\n      \"image\": \"ghcr.io/nextcloud/nextcloud-appapi-harp\",\n      \"init\": true,\n      \"internal_port\": \"8780\",\n      \"expose\": [\n        \"8780\"\n      ],\n      \"environment\": [\n        \"HP_SHARED_KEY=%HP_SHARED_KEY%\",\n        \"NC_INSTANCE_URL=https://%NC_DOMAIN%\",\n        \"HP_LOG_LEVEL=warning\",\n        \"HP_FRP_DISABLE_TLS=true\",\n        \"TZ=%TIMEZONE%\"\n      ],\n      \"secrets\": [\n        \"HP_SHARED_KEY\"\n      ],\n      \"volumes\": [\n        {\n          \"source\": \"%WATCHTOWER_DOCKER_SOCKET_PATH%\",\n          \"destination\": \"/var/run/docker.sock\",\n          \"writeable\": false\n        },\n        {\n          \"source\": \"nextcloud_aio_harp\",\n          \"destination\": \"/certs\",\n          \"writeable\": true\n        }\n      ],\n      \"restart\": \"unless-stopped\",\n      \"read_only\": true,\n      \"tmpfs\": [\n        \"/tmp\",\n        \"/run/harp\"\n      ],\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    },\n    {\n      \"container_name\": \"nextcloud-aio-whiteboard\",\n      \"image_tag\": \"%AIO_CHANNEL%\",\n      \"display_name\": \"Nextcloud Whiteboard\",\n      \"image\": \"ghcr.io/nextcloud-releases/aio-whiteboard\",\n      \"user\": \"65534\",\n      \"init\": true,\n      \"healthcheck\": {\n        \"start_period\": \"0s\",\n        \"test\": \"/healthcheck.sh\",\n        \"interval\": \"30s\",\n        \"timeout\": \"30s\",\n        \"start_interval\": \"5s\",\n        \"retries\": 3\n      },\n      \"expose\": [\n        \"3002\"\n      ],\n      \"tmpfs\": [\n        \"/tmp\"\n      ],\n      \"internal_port\": \"3002\",\n      \"environment\": [\n        \"TZ=%TIMEZONE%\",\n        \"NEXTCLOUD_URL=https://%NC_DOMAIN%\",\n        \"JWT_SECRET_KEY=%WHITEBOARD_SECRET%\",\n        \"STORAGE_STRATEGY=redis\",\n        \"REDIS_HOST=nextcloud-aio-redis\",\n        \"REDIS_PORT=6379\",\n        \"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%\",\n        \"BACKUP_DIR=/tmp\"\n      ],\n      \"secrets\": [\n        \"WHITEBOARD_SECRET\",\n        \"REDIS_PASSWORD\"\n      ],\n      \"restart\": \"unless-stopped\",\n      \"profiles\": [\n        \"whiteboard\"\n      ],\n      \"read_only\": true,\n      \"cap_drop\": [\n        \"NET_RAW\"\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "php/cool-seccomp-profile.json",
    "content": "{\n  \"defaultAction\": \"SCMP_ACT_ERRNO\",\n  \"defaultErrnoRet\": 1,\n  \"archMap\": [\n    {\n      \"architecture\": \"SCMP_ARCH_X86_64\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_X86\",\n        \"SCMP_ARCH_X32\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_AARCH64\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_ARM\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_MIPS64\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_MIPS\",\n        \"SCMP_ARCH_MIPS64N32\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_MIPS64N32\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_MIPS\",\n        \"SCMP_ARCH_MIPS64\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_MIPSEL64\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_MIPSEL\",\n        \"SCMP_ARCH_MIPSEL64N32\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_MIPSEL64N32\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_MIPSEL\",\n        \"SCMP_ARCH_MIPSEL64\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_S390X\",\n      \"subArchitectures\": [\n        \"SCMP_ARCH_S390\"\n      ]\n    },\n    {\n      \"architecture\": \"SCMP_ARCH_RISCV64\",\n      \"subArchitectures\": null\n    }\n  ],\n  \"syscalls\": [\n    {\n      \"names\": [\n        \"unshare\",\n        \"mount\",\n        \"setns\",\n        \"clone\",\n        \"chroot\",\n        \"umount2\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\"\n    },\n    {\n      \"names\": [\n        \"accept\",\n        \"accept4\",\n        \"access\",\n        \"adjtimex\",\n        \"alarm\",\n        \"bind\",\n        \"brk\",\n        \"cachestat\",\n        \"capget\",\n        \"capset\",\n        \"chdir\",\n        \"chmod\",\n        \"chown\",\n        \"chown32\",\n        \"clock_adjtime\",\n        \"clock_adjtime64\",\n        \"clock_getres\",\n        \"clock_getres_time64\",\n        \"clock_gettime\",\n        \"clock_gettime64\",\n        \"clock_nanosleep\",\n        \"clock_nanosleep_time64\",\n        \"close\",\n        \"close_range\",\n        \"connect\",\n        \"copy_file_range\",\n        \"creat\",\n        \"dup\",\n        \"dup2\",\n        \"dup3\",\n        \"epoll_create\",\n        \"epoll_create1\",\n        \"epoll_ctl\",\n        \"epoll_ctl_old\",\n        \"epoll_pwait\",\n        \"epoll_pwait2\",\n        \"epoll_wait\",\n        \"epoll_wait_old\",\n        \"eventfd\",\n        \"eventfd2\",\n        \"execve\",\n        \"execveat\",\n        \"exit\",\n        \"exit_group\",\n        \"faccessat\",\n        \"faccessat2\",\n        \"fadvise64\",\n        \"fadvise64_64\",\n        \"fallocate\",\n        \"fanotify_mark\",\n        \"fchdir\",\n        \"fchmod\",\n        \"fchmodat\",\n        \"fchmodat2\",\n        \"fchown\",\n        \"fchown32\",\n        \"fchownat\",\n        \"fcntl\",\n        \"fcntl64\",\n        \"fdatasync\",\n        \"fgetxattr\",\n        \"flistxattr\",\n        \"flock\",\n        \"fork\",\n        \"fremovexattr\",\n        \"fsetxattr\",\n        \"fstat\",\n        \"fstat64\",\n        \"fstatat64\",\n        \"fstatfs\",\n        \"fstatfs64\",\n        \"fsync\",\n        \"ftruncate\",\n        \"ftruncate64\",\n        \"futex\",\n        \"futex_requeue\",\n        \"futex_time64\",\n        \"futex_wait\",\n        \"futex_waitv\",\n        \"futex_wake\",\n        \"futimesat\",\n        \"getcpu\",\n        \"getcwd\",\n        \"getdents\",\n        \"getdents64\",\n        \"getegid\",\n        \"getegid32\",\n        \"geteuid\",\n        \"geteuid32\",\n        \"getgid\",\n        \"getgid32\",\n        \"getgroups\",\n        \"getgroups32\",\n        \"getitimer\",\n        \"getpeername\",\n        \"getpgid\",\n        \"getpgrp\",\n        \"getpid\",\n        \"getppid\",\n        \"getpriority\",\n        \"getrandom\",\n        \"getresgid\",\n        \"getresgid32\",\n        \"getresuid\",\n        \"getresuid32\",\n        \"getrlimit\",\n        \"get_robust_list\",\n        \"getrusage\",\n        \"getsid\",\n        \"getsockname\",\n        \"getsockopt\",\n        \"get_thread_area\",\n        \"gettid\",\n        \"gettimeofday\",\n        \"getuid\",\n        \"getuid32\",\n        \"getxattr\",\n        \"inotify_add_watch\",\n        \"inotify_init\",\n        \"inotify_init1\",\n        \"inotify_rm_watch\",\n        \"io_cancel\",\n        \"ioctl\",\n        \"io_destroy\",\n        \"io_getevents\",\n        \"io_pgetevents\",\n        \"io_pgetevents_time64\",\n        \"ioprio_get\",\n        \"ioprio_set\",\n        \"io_setup\",\n        \"io_submit\",\n        \"ipc\",\n        \"kill\",\n        \"landlock_add_rule\",\n        \"landlock_create_ruleset\",\n        \"landlock_restrict_self\",\n        \"lchown\",\n        \"lchown32\",\n        \"lgetxattr\",\n        \"link\",\n        \"linkat\",\n        \"listen\",\n        \"listxattr\",\n        \"llistxattr\",\n        \"_llseek\",\n        \"lremovexattr\",\n        \"lseek\",\n        \"lsetxattr\",\n        \"lstat\",\n        \"lstat64\",\n        \"madvise\",\n        \"map_shadow_stack\",\n        \"membarrier\",\n        \"memfd_create\",\n        \"memfd_secret\",\n        \"mincore\",\n        \"mkdir\",\n        \"mkdirat\",\n        \"mknod\",\n        \"mknodat\",\n        \"mlock\",\n        \"mlock2\",\n        \"mlockall\",\n        \"mmap\",\n        \"mmap2\",\n        \"mprotect\",\n        \"mq_getsetattr\",\n        \"mq_notify\",\n        \"mq_open\",\n        \"mq_timedreceive\",\n        \"mq_timedreceive_time64\",\n        \"mq_timedsend\",\n        \"mq_timedsend_time64\",\n        \"mq_unlink\",\n        \"mremap\",\n        \"msgctl\",\n        \"msgget\",\n        \"msgrcv\",\n        \"msgsnd\",\n        \"msync\",\n        \"munlock\",\n        \"munlockall\",\n        \"munmap\",\n        \"name_to_handle_at\",\n        \"nanosleep\",\n        \"newfstatat\",\n        \"_newselect\",\n        \"open\",\n        \"openat\",\n        \"openat2\",\n        \"pause\",\n        \"pidfd_open\",\n        \"pidfd_send_signal\",\n        \"pipe\",\n        \"pipe2\",\n        \"pkey_alloc\",\n        \"pkey_free\",\n        \"pkey_mprotect\",\n        \"poll\",\n        \"ppoll\",\n        \"ppoll_time64\",\n        \"prctl\",\n        \"pread64\",\n        \"preadv\",\n        \"preadv2\",\n        \"prlimit64\",\n        \"process_mrelease\",\n        \"pselect6\",\n        \"pselect6_time64\",\n        \"pwrite64\",\n        \"pwritev\",\n        \"pwritev2\",\n        \"read\",\n        \"readahead\",\n        \"readlink\",\n        \"readlinkat\",\n        \"readv\",\n        \"recv\",\n        \"recvfrom\",\n        \"recvmmsg\",\n        \"recvmmsg_time64\",\n        \"recvmsg\",\n        \"remap_file_pages\",\n        \"removexattr\",\n        \"rename\",\n        \"renameat\",\n        \"renameat2\",\n        \"restart_syscall\",\n        \"rmdir\",\n        \"rseq\",\n        \"rt_sigaction\",\n        \"rt_sigpending\",\n        \"rt_sigprocmask\",\n        \"rt_sigqueueinfo\",\n        \"rt_sigreturn\",\n        \"rt_sigsuspend\",\n        \"rt_sigtimedwait\",\n        \"rt_sigtimedwait_time64\",\n        \"rt_tgsigqueueinfo\",\n        \"sched_getaffinity\",\n        \"sched_getattr\",\n        \"sched_getparam\",\n        \"sched_get_priority_max\",\n        \"sched_get_priority_min\",\n        \"sched_getscheduler\",\n        \"sched_rr_get_interval\",\n        \"sched_rr_get_interval_time64\",\n        \"sched_setaffinity\",\n        \"sched_setattr\",\n        \"sched_setparam\",\n        \"sched_setscheduler\",\n        \"sched_yield\",\n        \"seccomp\",\n        \"select\",\n        \"semctl\",\n        \"semget\",\n        \"semop\",\n        \"semtimedop\",\n        \"semtimedop_time64\",\n        \"send\",\n        \"sendfile\",\n        \"sendfile64\",\n        \"sendmmsg\",\n        \"sendmsg\",\n        \"sendto\",\n        \"setfsgid\",\n        \"setfsgid32\",\n        \"setfsuid\",\n        \"setfsuid32\",\n        \"setgid\",\n        \"setgid32\",\n        \"setgroups\",\n        \"setgroups32\",\n        \"setitimer\",\n        \"setpgid\",\n        \"setpriority\",\n        \"setregid\",\n        \"setregid32\",\n        \"setresgid\",\n        \"setresgid32\",\n        \"setresuid\",\n        \"setresuid32\",\n        \"setreuid\",\n        \"setreuid32\",\n        \"setrlimit\",\n        \"set_robust_list\",\n        \"setsid\",\n        \"setsockopt\",\n        \"set_thread_area\",\n        \"set_tid_address\",\n        \"setuid\",\n        \"setuid32\",\n        \"setxattr\",\n        \"shmat\",\n        \"shmctl\",\n        \"shmdt\",\n        \"shmget\",\n        \"shutdown\",\n        \"sigaltstack\",\n        \"signalfd\",\n        \"signalfd4\",\n        \"sigprocmask\",\n        \"sigreturn\",\n        \"socketcall\",\n        \"socketpair\",\n        \"splice\",\n        \"stat\",\n        \"stat64\",\n        \"statfs\",\n        \"statfs64\",\n        \"statx\",\n        \"symlink\",\n        \"symlinkat\",\n        \"sync\",\n        \"sync_file_range\",\n        \"syncfs\",\n        \"sysinfo\",\n        \"tee\",\n        \"tgkill\",\n        \"time\",\n        \"timer_create\",\n        \"timer_delete\",\n        \"timer_getoverrun\",\n        \"timer_gettime\",\n        \"timer_gettime64\",\n        \"timer_settime\",\n        \"timer_settime64\",\n        \"timerfd_create\",\n        \"timerfd_gettime\",\n        \"timerfd_gettime64\",\n        \"timerfd_settime\",\n        \"timerfd_settime64\",\n        \"times\",\n        \"tkill\",\n        \"truncate\",\n        \"truncate64\",\n        \"ugetrlimit\",\n        \"umask\",\n        \"uname\",\n        \"unlink\",\n        \"unlinkat\",\n        \"utime\",\n        \"utimensat\",\n        \"utimensat_time64\",\n        \"utimes\",\n        \"vfork\",\n        \"vmsplice\",\n        \"wait4\",\n        \"waitid\",\n        \"waitpid\",\n        \"write\",\n        \"writev\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\"\n    },\n    {\n      \"names\": [\n        \"process_vm_readv\",\n        \"process_vm_writev\",\n        \"ptrace\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"minKernel\": \"4.8\"\n      }\n    },\n    {\n      \"names\": [\n        \"socket\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 40,\n          \"op\": \"SCMP_CMP_NE\"\n        }\n      ]\n    },\n    {\n      \"names\": [\n        \"personality\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 0,\n          \"op\": \"SCMP_CMP_EQ\"\n        }\n      ]\n    },\n    {\n      \"names\": [\n        \"personality\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 8,\n          \"op\": \"SCMP_CMP_EQ\"\n        }\n      ]\n    },\n    {\n      \"names\": [\n        \"personality\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 131072,\n          \"op\": \"SCMP_CMP_EQ\"\n        }\n      ]\n    },\n    {\n      \"names\": [\n        \"personality\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 131080,\n          \"op\": \"SCMP_CMP_EQ\"\n        }\n      ]\n    },\n    {\n      \"names\": [\n        \"personality\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 4294967295,\n          \"op\": \"SCMP_CMP_EQ\"\n        }\n      ]\n    },\n    {\n      \"names\": [\n        \"sync_file_range2\",\n        \"swapcontext\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"arches\": [\n          \"ppc64le\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"arm_fadvise64_64\",\n        \"arm_sync_file_range\",\n        \"sync_file_range2\",\n        \"breakpoint\",\n        \"cacheflush\",\n        \"set_tls\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"arches\": [\n          \"arm\",\n          \"arm64\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"arch_prctl\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"arches\": [\n          \"amd64\",\n          \"x32\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"modify_ldt\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"arches\": [\n          \"amd64\",\n          \"x32\",\n          \"x86\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"s390_pci_mmio_read\",\n        \"s390_pci_mmio_write\",\n        \"s390_runtime_instr\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"arches\": [\n          \"s390\",\n          \"s390x\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"riscv_flush_icache\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"arches\": [\n          \"riscv64\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"open_by_handle_at\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_DAC_READ_SEARCH\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"bpf\",\n        \"clone\",\n        \"clone3\",\n        \"fanotify_init\",\n        \"fsconfig\",\n        \"fsmount\",\n        \"fsopen\",\n        \"fspick\",\n        \"lookup_dcookie\",\n        \"mount\",\n        \"mount_setattr\",\n        \"move_mount\",\n        \"open_tree\",\n        \"perf_event_open\",\n        \"quotactl\",\n        \"quotactl_fd\",\n        \"setdomainname\",\n        \"sethostname\",\n        \"setns\",\n        \"syslog\",\n        \"umount\",\n        \"umount2\",\n        \"unshare\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_ADMIN\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"clone\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 0,\n          \"value\": 2114060288,\n          \"op\": \"SCMP_CMP_MASKED_EQ\"\n        }\n      ],\n      \"excludes\": {\n        \"caps\": [\n          \"CAP_SYS_ADMIN\"\n        ],\n        \"arches\": [\n          \"s390\",\n          \"s390x\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"clone\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"args\": [\n        {\n          \"index\": 1,\n          \"value\": 2114060288,\n          \"op\": \"SCMP_CMP_MASKED_EQ\"\n        }\n      ],\n      \"comment\": \"s390 parameter ordering for clone is different\",\n      \"includes\": {\n        \"arches\": [\n          \"s390\",\n          \"s390x\"\n        ]\n      },\n      \"excludes\": {\n        \"caps\": [\n          \"CAP_SYS_ADMIN\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"clone3\"\n      ],\n      \"action\": \"SCMP_ACT_ERRNO\",\n      \"errnoRet\": 38,\n      \"excludes\": {\n        \"caps\": [\n          \"CAP_SYS_ADMIN\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"reboot\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_BOOT\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"chroot\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_CHROOT\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"delete_module\",\n        \"init_module\",\n        \"finit_module\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_MODULE\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"acct\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_PACCT\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"kcmp\",\n        \"pidfd_getfd\",\n        \"process_madvise\",\n        \"process_vm_readv\",\n        \"process_vm_writev\",\n        \"ptrace\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_PTRACE\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"iopl\",\n        \"ioperm\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_RAWIO\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"settimeofday\",\n        \"stime\",\n        \"clock_settime\",\n        \"clock_settime64\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_TIME\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"vhangup\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_TTY_CONFIG\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"get_mempolicy\",\n        \"mbind\",\n        \"set_mempolicy\",\n        \"set_mempolicy_home_node\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYS_NICE\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"syslog\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_SYSLOG\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"bpf\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_BPF\"\n        ]\n      }\n    },\n    {\n      \"names\": [\n        \"perf_event_open\"\n      ],\n      \"action\": \"SCMP_ACT_ALLOW\",\n      \"includes\": {\n        \"caps\": [\n          \"CAP_PERFMON\"\n        ]\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "php/data/.gitkeep",
    "content": ""
  },
  {
    "path": "php/domain-validator.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n$domain = '';\nif (isset($_GET['domain']) && is_string($_GET['domain'])) {\n    $domain = $_GET['domain'];\n}\n\nif (!str_contains($domain, '.')) { \n    http_response_code(400);\n} elseif (str_contains($domain, '/')) { \n    http_response_code(400);\n} elseif (str_contains($domain, ':')) { \n    http_response_code(400);\n} elseif (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) { \n    http_response_code(400);\n} elseif (filter_var($domain, FILTER_VALIDATE_IP)) { \n    http_response_code(400);\n} else {\n    // Commented because logging is disabled as otherwise all attempts will be logged which spams the logs\n    // error_log($domain . ' was accepted as valid domain.');\n    http_response_code(200);\n}\n"
  },
  {
    "path": "php/get-configurable-aio-variables.sh",
    "content": "#!/usr/bin/env bash\n\nawk '/^    public [^f][^u][^n]/ { sub(/\\$/, \"\", $3); print $3 }' src/Data/ConfigurationManager.php | sort\n"
  },
  {
    "path": "php/psalm-baseline.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<files psalm-version=\"6.16.1@f1f5de594dc76faf8784e02d3dc4716c91c6f6ac\"/>\n"
  },
  {
    "path": "php/psalm.xml",
    "content": "<?xml version=\"1.0\"?>\n<psalm\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\txmlns=\"https://getpsalm.org/schema/config\"\n\txsi:schemaLocation=\"https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd\"\n\terrorBaseline=\"psalm-baseline.xml\"\n\tfindUnusedBaselineEntry=\"true\"\n\tfindUnusedCode=\"false\"\n>\n\t<projectFiles>\n\t\t<directory name=\"templates\"/>\n\t\t<directory name=\"src\"/>\n\t\t<file name=\"public/index.php\"/>\n\t\t<ignoreFiles>\n\t\t\t<directory name=\"vendor\" />\n\t\t</ignoreFiles>\n\t</projectFiles>\n\t<extraFiles>\n\t\t<directory name=\"vendor\" />\n\t</extraFiles>\n\t<issueHandlers>\n  \t\t<ClassMustBeFinal errorLevel=\"suppress\" />\n        <MissingConstructor>\n            <errorLevel type=\"suppress\">\n                <file name=\"src/Data/ConfigurationManager.php\" />  <!-- We're using property hooks with virtual properties in that file, which Psalm wrongly complains about. See <https://github.com/vimeo/psalm/issues/11435>.  -->\n            </errorLevel>\n        </MissingConstructor>\n\t</issueHandlers>\n</psalm>\n"
  },
  {
    "path": "php/public/automatic_reload.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    if (document.hasFocus()) {\n        // hide reload button if the site reloads automatically\n        let list = document.getElementsByClassName(\"reload button\");\n        for (let i = 0; i < list.length; i++) {\n            // list[i] is a node with the desired class name\n            list[i].style.display = 'none';\n        }\n\n        // set timeout for reload\n        setTimeout(function(){\n        window.location.reload(1);\n        }, 5000);\n    } else {\n        window.addEventListener(\"beforeunload\", function() {\n            document.getElementById('overlay').classList.add('loading')\n        });\n    }\n});\n"
  },
  {
    "path": "php/public/base_path.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function() {\n    basePath = document.getElementById(\"base_path\")\n    if (basePath) {\n        // Remove '/containers' from the end of the path, to get the base path only\n        basePath.value = window.location.pathname.slice(0, -11);\n    }\n});"
  },
  {
    "path": "php/public/before-unload.js",
    "content": "window.addEventListener(\"beforeunload\", function() {\n    document.getElementById('overlay').classList.add('loading')\n});"
  },
  {
    "path": "php/public/containers-form-submit.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function () {\n    // Don't run if the expected form isn't present.\n    if (document.getElementById('options-form') === null) {\n        return;\n    }\n\n    // Hide submit button initially\n    const optionsFormSubmit = document.querySelectorAll(\".options-form-submit\");\n    optionsFormSubmit.forEach(element => {\n        element.style.display = 'none';\n    });\n\n    const communityFormSubmit = document.getElementById(\"community-form-submit\");\n    communityFormSubmit.style.display = 'none';\n\n    // Store initial states for all checkboxes\n    const initialStateOptionsContainers = {};\n    const initialStateCommunityContainers = {};\n    const optionsContainersCheckboxes = document.querySelectorAll(\"#options-form input[type='checkbox']\");\n    const communityContainersCheckboxes = document.querySelectorAll(\"#community-form input[type='checkbox']\");\n\n    // Office suite radio buttons\n    const collaboraRadio = document.getElementById('office-collabora');\n    const onlyofficeRadio = document.getElementById('office-onlyoffice');\n    const noneRadio = document.getElementById('office-none');\n    const collaboraHidden = document.getElementById('collabora');\n    const onlyofficeHidden = document.getElementById('onlyoffice');\n    let initialOfficeSelection = null;\n\n    optionsContainersCheckboxes.forEach(checkbox => {\n        initialStateOptionsContainers[checkbox.id] = checkbox.checked;  // Use checked property to capture actual initial state\n    });\n\n    communityContainersCheckboxes.forEach(checkbox => {\n        initialStateCommunityContainers[checkbox.id] = checkbox.checked;  // Use checked property to capture actual initial state\n    });\n\n    // Store initial office suite selection\n    if (collaboraRadio && onlyofficeRadio && noneRadio) {\n        if (collaboraRadio.checked) {\n            initialOfficeSelection = 'collabora';\n        } else if (onlyofficeRadio.checked) {\n            initialOfficeSelection = 'onlyoffice';\n        } else {\n            initialOfficeSelection = 'none';\n        }\n    }\n\n    // Function to compare current states to initial states\n    function checkForOptionContainerChanges() {\n        let hasChanges = false;\n\n        optionsContainersCheckboxes.forEach(checkbox => {\n            if (checkbox.checked !== initialStateOptionsContainers[checkbox.id]) {\n                hasChanges = true;\n            }\n        });\n\n        // Check office suite changes and sync to hidden inputs\n        if (collaboraRadio && onlyofficeRadio && noneRadio && collaboraHidden && onlyofficeHidden) {\n            let currentOfficeSelection = null;\n            if (collaboraRadio.checked) {\n                currentOfficeSelection = 'collabora';\n                collaboraHidden.value = 'on';\n                onlyofficeHidden.value = '';\n            } else if (onlyofficeRadio.checked) {\n                currentOfficeSelection = 'onlyoffice';\n                collaboraHidden.value = '';\n                onlyofficeHidden.value = 'on';\n            } else {\n                currentOfficeSelection = 'none';\n                collaboraHidden.value = '';\n                onlyofficeHidden.value = '';\n            }\n\n            if (currentOfficeSelection !== initialOfficeSelection) {\n                hasChanges = true;\n            }\n        }\n\n        // Show or hide submit button based on changes\n        optionsFormSubmit.forEach(element => {\n            element.style.display = hasChanges ? 'block' : 'none';\n        });\n    }\n\n    // Function to compare current states to initial states\n    function checkForCommunityContainerChanges() {\n        let hasChanges = false;\n\n        communityContainersCheckboxes.forEach(checkbox => {\n            if (checkbox.checked !== initialStateCommunityContainers[checkbox.id]) {\n                hasChanges = true;\n            }\n        });\n\n        // Show or hide submit button based on changes\n        communityFormSubmit.style.display = hasChanges ? 'block' : 'none';\n    }\n\n    // Event listener to trigger visibility check on each change\n    optionsContainersCheckboxes.forEach(checkbox => {\n        checkbox.addEventListener(\"change\", checkForOptionContainerChanges);\n    });\n\n    communityContainersCheckboxes.forEach(checkbox => {\n        checkbox.addEventListener(\"change\", checkForCommunityContainerChanges);\n    });\n\n    // Custom behaviors for specific options\n    function handleTalkVisibility() {\n        const talkRecording = document.getElementById(\"talk-recording\");\n        if (document.getElementById(\"talk\").checked) {\n            talkRecording.disabled = false;\n        } else {\n            talkRecording.checked = false;\n            talkRecording.disabled = true;\n        }\n        checkForOptionContainerChanges();  // Check changes after toggling Talk Recording\n    }\n\n    function handleDockerSocketProxyWarning() {\n        if (document.getElementById(\"docker-socket-proxy\").checked) {\n            // TODO: remove the line below and uncomment the lines further down once https://github.com/nextcloud/app_api/pull/800 is included\n            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!');\n            // alert('⚠️ The docker socket proxy container is deprecated. Please use the HaRP (High-availability Reverse Proxy for Nextcloud ExApps) instead!');\n            // document.getElementById(\"docker-socket-proxy\").checked = false\n        }\n    }\n\n    function handleHarpWarning() {\n        if (document.getElementById(\"harp\").checked) {\n            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!');\n            document.getElementById(\"docker-socket-proxy\").checked = false\n        }\n    }\n\n    // Initialize event listeners for specific behaviors\n    document.getElementById(\"talk\").addEventListener('change', handleTalkVisibility);\n    document.getElementById(\"docker-socket-proxy\").addEventListener('change', handleDockerSocketProxyWarning);\n    if (document.getElementById(\"harp\")) {\n        document.getElementById(\"harp\").addEventListener('change', handleHarpWarning);\n    }\n\n    // Initialize talk-recording visibility on page load\n    handleTalkVisibility();  // Ensure talk-recording is correctly initialized\n\n    // Add event listeners for office suite radio buttons\n    if (collaboraRadio && onlyofficeRadio && noneRadio) {\n        collaboraRadio.addEventListener('change', checkForOptionContainerChanges);\n        onlyofficeRadio.addEventListener('change', checkForOptionContainerChanges);\n        noneRadio.addEventListener('change', checkForOptionContainerChanges);\n    }\n\n    // Initial call to check for changes\n    checkForOptionContainerChanges();\n    checkForCommunityContainerChanges();\n});\n"
  },
  {
    "path": "php/public/disable-clamav.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // Clamav\n    let clamav = document.getElementById(\"clamav\");\n    clamav.disabled = true;\n});"
  },
  {
    "path": "php/public/disable-collabora.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // Collabora\n    const collabora = document.getElementById(\"office-collabora\");\n    collabora.disabled = true;\n});"
  },
  {
    "path": "php/public/disable-docker-socket-proxy.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // Docker socket proxy\n    let dockerSocketProxy = document.getElementById(\"docker-socket-proxy\");\n    if (dockerSocketProxy) {\n        dockerSocketProxy.disabled = true;\n    }\n});\n"
  },
  {
    "path": "php/public/disable-fulltextsearch.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\r\n    // Fulltextsearch\r\n    let fulltextsearch = document.getElementById(\"fulltextsearch\");\r\n    fulltextsearch.disabled = true;\r\n}); "
  },
  {
    "path": "php/public/disable-harp.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // HaRP\n    let harp = document.getElementById(\"harp\");\n    if (harp) {\n        harp.disabled = true;\n    }\n});\n"
  },
  {
    "path": "php/public/disable-imaginary.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\r\n    // Imaginary\r\n    let imaginary = document.getElementById(\"imaginary\");\r\n    imaginary.disabled = true;\r\n});"
  },
  {
    "path": "php/public/disable-onlyoffice.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\r\n    // OnlyOffice\r\n    const onlyoffice = document.getElementById(\"office-onlyoffice\");\r\n    onlyoffice.disabled = true;\r\n});"
  },
  {
    "path": "php/public/disable-talk-recording.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // Talk-recording\n    document.getElementById(\"talk-recording\").disabled = true;\n});\n"
  },
  {
    "path": "php/public/disable-talk.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // Talk\n    let talk = document.getElementById(\"talk\");\n    talk.disabled = true;\n});"
  },
  {
    "path": "php/public/disable-whiteboard.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // Whiteboard\n    let whiteboard = document.getElementById(\"whiteboard\");\n    whiteboard.disabled = true;\n});\n"
  },
  {
    "path": "php/public/forms.js",
    "content": "\"use strict\";\n\nfunction showPassword(id) {\n  let passwordField = document.getElementById(id);\n  if (passwordField.type === \"password\" && passwordField.value !== \"\") {\n    passwordField.type = \"text\";\n  } else if (passwordField.type === \"text\" && passwordField.value === \"\") {\n    passwordField.type = \"password\";\n  }\n}\n\n(function (){\n  let lastError;\n\n  function showError(message) {\n    const body = document.getElementsByTagName('body')[0]\n    const toast = document.createElement(\"div\")\n    toast.className = \"toast error\"\n    toast.prepend(message)\n    if (lastError) {\n      lastError.remove()\n    }\n    lastError = toast\n    body.prepend(toast)\n    setTimeout(toast.remove.bind(toast), 10000)\n  }\n\n  function handleEvent(e) {\n    const xhr = e.target;\n    if (xhr.status === 201) {\n      window.location.replace(xhr.getResponseHeader('Location'));\n    } else if (xhr.status === 422) {\n      disableSpinner()\n      showError(xhr.response);\n    } else if (xhr.status === 500) {\n      showError(\"Server error. Please check the mastercontainer logs for details. This page will reload after 10s automatically. Then you can check the mastercontainer logs.\");\n      // Reload after 10s since it is expected that the updated view is shown (e.g. after starting containers)\n      setTimeout(function(){\n        window.location.reload(1);\n      }, 10000);\n    } else {\n      // If the responose is not one of the above, we should reload to show the latest content\n      window.location.reload(1);\n    }\n  }\n\n  function enableSpinner() {\n    document.getElementById('overlay').classList.add('loading');\n  }\n\n  function disableSpinner() {\n    document.getElementById('overlay').classList.remove('loading');\n  }\n\n  function initForm(form) {\n    function submit(event)\n    {\n      if (lastError) {\n        lastError.remove()\n      }\n      let xhr = new XMLHttpRequest();\n      xhr.addEventListener('load', handleEvent);\n      xhr.addEventListener('error', () => showError(\"Failed to talk to server.\"));\n      xhr.addEventListener('error', () => disableSpinner());\n      xhr.open(form.method, form.getAttribute(\"action\"));\n      xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n      enableSpinner();\n      xhr.send(new URLSearchParams(new FormData(form)));\n      event.preventDefault();\n    }\n\n    form.onsubmit = submit;\n  }\n\n  function initForms() {\n    const forms = document.querySelectorAll('form.xhr')\n    for (const form of forms) {\n      initForm(form);\n    }\n    const overlayLogForms = document.querySelectorAll('form[target=\"overlay-log\"]')\n    for (const form of overlayLogForms) {\n        form.onsubmit = function() {\n            enableSpinner();\n            document.getElementById('overlay-log')?.classList.add('visible');\n            // Reload the page after the response was fully loaded into the iframe.\n            document.querySelector('iframe[name=\"overlay-log\"]').addEventListener('load', () => {\n                location.reload();\n            });\n        };\n    }\n  }\n\n  if (document.readyState === 'loading') {\n    // Loading hasn't finished yet\n    document.addEventListener('DOMContentLoaded', initForms);\n  } else {  // `DOMContentLoaded` has already fired\n    initForms();\n  }\n})()\n"
  },
  {
    "path": "php/public/index.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n// increase memory limit to 2GB\nini_set('memory_limit', '2048M');\n\n// set max execution time to 2h just in case of a very slow internet connection\nini_set('max_execution_time', '7200');\n\n// Log whole log messages\nini_set('log_errors_max_len', '0');\n\nuse DI\\Container;\nuse DI\\NotFoundException;\nuse Slim\\Csrf\\Guard;\nuse Slim\\Factory\\AppFactory;\nuse Slim\\Views\\Twig;\nuse Slim\\Views\\TwigMiddleware;\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\n$container = \\AIO\\DependencyInjection::GetContainer();\n$dataConst = $container->get(\\AIO\\Data\\DataConst::class);\nini_set('session.save_path', $dataConst->GetSessionDirectory());\n\n// Auto logout on browser close\nini_set('session.cookie_lifetime', '0');\n\n# Keep session for 24h max\nini_set('session.gc_maxlifetime', '86400');\n\n// Create app\nAppFactory::setContainer($container);\n$app = AppFactory::create();\n$responseFactory = $app->getResponseFactory();\n\n// Register Middleware On Container\n$container->set(Guard::class, function () use ($responseFactory) {\n    $guard = new Guard($responseFactory);\n    $guard->setPersistentTokenMode(true);\n    return $guard;\n});\n\n// Register Middleware To Be Executed On All Routes\nsession_start();\n$app->add(Guard::class);\n\n// Create Twig\n$twig = Twig::create(__DIR__ . '/../templates/', ['cache' => false]);\n$app->add(TwigMiddleware::create($app, $twig));\n$twig->addExtension(new \\AIO\\Twig\\CsrfExtension($container->get(Guard::class)));\n\n// Auth Middleware\n$app->add(new \\AIO\\Middleware\\AuthMiddleware($container->get(\\AIO\\Auth\\AuthManager::class)));\n\n// API\n$app->post('/api/docker/watchtower', AIO\\Controller\\DockerController::class . ':StartWatchtowerContainer');\n$app->get('/api/docker/getwatchtower', AIO\\Controller\\DockerController::class . ':StartWatchtowerContainer');\n$app->post('/api/docker/start', AIO\\Controller\\DockerController::class . ':StartContainer');\n$app->post('/api/docker/backup', AIO\\Controller\\DockerController::class . ':StartBackupContainerBackup');\n$app->post('/api/docker/backup-check', AIO\\Controller\\DockerController::class . ':StartBackupContainerCheck');\n$app->post('/api/docker/backup-list', AIO\\Controller\\DockerController::class . ':StartBackupContainerList');\n$app->post('/api/docker/backup-check-repair', AIO\\Controller\\DockerController::class . ':StartBackupContainerCheckRepair');\n$app->post('/api/docker/backup-test', AIO\\Controller\\DockerController::class . ':StartBackupContainerTest');\n$app->post('/api/docker/restore', AIO\\Controller\\DockerController::class . ':StartBackupContainerRestore');\n$app->post('/api/docker/stop', AIO\\Controller\\DockerController::class . ':StopContainer');\n$app->get('/api/docker/logs', AIO\\Controller\\DockerController::class . ':GetLogs');\n$app->post('/api/auth/login', AIO\\Controller\\LoginController::class . ':TryLogin');\n$app->get('/api/auth/getlogin', AIO\\Controller\\LoginController::class . ':GetTryLogin');\n$app->post('/api/auth/logout', AIO\\Controller\\LoginController::class . ':Logout');\n$app->post('/api/configuration', \\AIO\\Controller\\ConfigurationController::class . ':SetConfig');\n\n// Views\n$app->get('/containers', function (Request $request, Response $response, array $args) use ($container) {\n    $view = Twig::fromRequest($request);\n    $view->addExtension(new \\AIO\\Twig\\ClassExtension());\n    /** @var \\AIO\\Data\\ConfigurationManager $configurationManager */\n    $configurationManager = $container->get(\\AIO\\Data\\ConfigurationManager::class);\n    /** @var \\AIO\\Docker\\DockerActionManager $dockerActionManager */\n    $dockerActionManager = $container->get(\\AIO\\Docker\\DockerActionManager::class);\n    /** @var \\AIO\\Controller\\DockerController $dockerController */\n    $dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\n    $dockerActionManager->ConnectMasterContainerToNetwork();\n    $dockerController->StartDomaincheckContainer();\n\n    // Check if bypass_mastercontainer_update is provided on the URL, a special developer mode to bypass a mastercontainer update and use local image.\n    $params = $request->getQueryParams();\n    $bypass_mastercontainer_update = isset($params['bypass_mastercontainer_update']);\n    $bypass_container_update = isset($params['bypass_container_update']);\n    $skip_domain_validation = isset($params['skip_domain_validation']);\n\n    return $view->render($response, 'containers.twig', [\n        'domain' => $configurationManager->domain,\n        'apache_port' => $configurationManager->apachePort,\n        'borg_backup_host_location' => $configurationManager->borgBackupHostLocation,\n        'borg_remote_repo' => $configurationManager->borgRemoteRepo,\n        'borg_public_key' => $configurationManager->getBorgPublicKey(),\n        'nextcloud_password' => $configurationManager->getAndGenerateSecret('NEXTCLOUD_PASSWORD'),\n        'containers' => (new \\AIO\\ContainerDefinitionFetcher($container->get(\\AIO\\Data\\ConfigurationManager::class), $container))->FetchDefinition(),\n        'borgbackup_password' => $configurationManager->getAndGenerateSecret('BORGBACKUP_PASSWORD'),\n        'is_mastercontainer_update_available' => ( $bypass_mastercontainer_update ? false : $dockerActionManager->IsMastercontainerUpdateAvailable() ),\n        'has_backup_run_once' => $configurationManager->hasBackupRunOnce(),\n        'is_backup_container_running' => $dockerActionManager->isBackupContainerRunning(),\n        'backup_exit_code' => $dockerActionManager->GetBackupcontainerExitCode(),\n        'is_instance_restore_attempt' => $configurationManager->instanceRestoreAttempt,\n        'borg_backup_mode' => $configurationManager->backupMode,\n        'was_start_button_clicked' => $configurationManager->wasStartButtonClicked,\n        'has_update_available' => $dockerActionManager->isAnyUpdateAvailable(),\n        'last_backup_time' => $configurationManager->getLastBackupTime(),\n        'backup_times' => $configurationManager->getBackupTimes(),\n        'current_channel' => $dockerActionManager->GetCurrentChannel(),\n        'is_clamav_enabled' => $configurationManager->isClamavEnabled,\n        'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled,\n        'is_collabora_enabled' => $configurationManager->isCollaboraEnabled,\n        'is_talk_enabled' => $configurationManager->isTalkEnabled,\n        'borg_restore_password' => $configurationManager->borgRestorePassword,\n        'daily_backup_time' => $configurationManager->getDailyBackupTime(),\n        'is_daily_backup_running' => $configurationManager->isDailyBackupRunning(),\n        'timezone' => $configurationManager->timezone,\n        'skip_domain_validation' => $configurationManager->shouldDomainValidationBeSkipped($skip_domain_validation),\n        'talk_port' => $configurationManager->talkPort,\n        'collabora_dictionaries' => $configurationManager->collaboraDictionaries,\n        'collabora_additional_options' => $configurationManager->collaboraAdditionalOptions,\n        'automatic_updates' => $configurationManager->areAutomaticUpdatesEnabled(),\n        'is_backup_section_enabled' => !$configurationManager->disableBackupSection,\n        'is_imaginary_enabled' => $configurationManager->isImaginaryEnabled,\n        'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled,\n        'additional_backup_directories' => $configurationManager->getAdditionalBackupDirectoriesString(),\n        'nextcloud_datadir' => $configurationManager->nextcloudDatadirMount,\n        'nextcloud_mount' => $configurationManager->nextcloudMount,\n        'nextcloud_upload_limit' => $configurationManager->nextcloudUploadLimit,\n        'nextcloud_max_time' => $configurationManager->nextcloudMaxTime,\n        'nextcloud_memory_limit' => $configurationManager->nextcloudMemoryLimit,\n        'is_dri_device_enabled' => $configurationManager->nextcloudEnableDriDevice,\n        'is_nvidia_gpu_enabled' => $configurationManager->enableNvidiaGpu,\n        'is_talk_recording_enabled' => $configurationManager->isTalkRecordingEnabled,\n        'is_docker_socket_proxy_enabled' => $configurationManager->isDockerSocketProxyEnabled,\n        'is_harp_enabled' => $configurationManager->isHarpEnabled,\n        'is_whiteboard_enabled' => $configurationManager->isWhiteboardEnabled,\n        'community_containers' => $configurationManager->listAvailableCommunityContainers(),\n        'community_containers_enabled' => $configurationManager->aioCommunityContainers,\n        'bypass_container_update' => $bypass_container_update,\n    ]);\n})->setName('profile');\n$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {\n    $view = Twig::fromRequest($request);\n    /** @var \\AIO\\Docker\\DockerActionManager $dockerActionManager */\n    $dockerActionManager = $container->get(\\AIO\\Docker\\DockerActionManager::class);\n    return $view->render($response, 'login.twig', [\n        'is_login_allowed' => $dockerActionManager->isLoginAllowed(),\n    ]);\n});\n$app->get('/setup', function (Request $request, Response $response, array $args) use ($container) {\n    $view = Twig::fromRequest($request);\n    /** @var \\AIO\\Data\\Setup $setup */\n    $setup = $container->get(\\AIO\\Data\\Setup::class);\n\n    if(!$setup->CanBeInstalled()) {\n        return $view->render(\n            $response,\n            'already-installed.twig'\n        );\n    }\n\n    return $view->render(\n        $response,\n        'setup.twig',\n        [\n            'password' => $setup->Setup(),\n        ]\n    );\n});\n$app->get('/log', function (Request $request, Response $response, array $args) use ($container) {\n    $params = $request->getQueryParams();\n    $id = $params['id'] ?? '';\n    if (!str_starts_with($id, 'nextcloud-aio-')) {\n        throw new DI\\NotFoundException();\n    }\n    $view = Twig::fromRequest($request);\n    return $view->render($response, 'log.twig', ['id' => $id]);\n});\n\n// Auth Redirector\n$app->get('/', function (\\Psr\\Http\\Message\\RequestInterface $request, Response $response, array $args) use ($container) {\n    /** @var \\AIO\\Auth\\AuthManager $authManager */\n    $authManager = $container->get(\\AIO\\Auth\\AuthManager::class);\n\n    /** @var \\AIO\\Data\\Setup $setup */\n    $setup = $container->get(\\AIO\\Data\\Setup::class);\n    if($setup->CanBeInstalled()) {\n        return $response\n            ->withHeader('Location', 'setup')\n            ->withStatus(302);\n    }\n\n    if($authManager->IsAuthenticated()) {\n        return $response\n            ->withHeader('Location', 'containers')\n            ->withStatus(302);\n    } else {\n        return $response\n            ->withHeader('Location', 'login')\n            ->withStatus(302);\n    }\n});\n\n$errorMiddleware = $app->addErrorMiddleware(false, true, true);\n\n// Set a custom Not Found handler, which doesn't pollute the app output with 404 errors.\n$errorMiddleware->setErrorHandler(\n    \\Slim\\Exception\\HttpNotFoundException::class,\n    function (Request $request, Throwable $exception, bool $displayErrorDetails) use ($app) {\n        $response = $app->getResponseFactory()->createResponse();\n        $response->getBody()->write('Not Found');\n        return $response->withStatus(404);\n    });\n\n$app->run();\n"
  },
  {
    "path": "php/public/log-view.js",
    "content": "class LogViewer {\n    // Configure the interval in seconds for autoloading log data.\n    autoloadIntervalSec = 5;\n    // Set to true to see some debug log statements in the browser console.\n    debugLog = false;\n\n    // Don't touch these, please.\n    containerId;\n    apiBaseUrl = 'api/docker/logs';\n    autoloadIntervalId = null;\n    logElem;\n    lastLogTimestamp = '';\n    autoloadingDisabledFromButton = false;\n    loaderElem;\n    dataLoadingLock;\n\n    constructor() {\n        const id = document.body.dataset.containerId;\n        if (typeof(id) !== 'string' || !id.startsWith('nextcloud-aio-')) {\n            throw new Exception('Invalid container ID');\n        }\n        this.containerId = id;\n        this.logElem = document.querySelector('pre');\n        this.loaderElem = document.querySelector('.loader');\n        this.initAutoloadingControls();\n        // Enable automatic log data loading.\n        this.startAutoloading();\n    }\n\n    startAutoloading() {\n        // Load log data immediately.\n        this.loadAndAppendLogData();\n        // Load new log data repeatedly.\n        this.debug(\"Starting autoloading\");\n        this.autoloadIntervalId = setInterval(() => {\n            if (this.isAutoloadingEnabled()) {\n                this.loadAndAppendLogData();\n            }\n        }, 5000);\n    }\n\n    stopAutoloading() {\n        this.debug(\"Stopping autoloading\");\n        clearInterval(this.autoloadIntervalId);\n        this.autoloadIntervalId = null;\n    }\n\n    isAutoloadingEnabled() {\n        return !!this.autoloadIntervalId;\n    }\n\n    getUrl() {\n        return `${this.apiBaseUrl}?id=${this.containerId}&since=${this.lastLogTimestamp}`;\n    }\n\n    debug(...args) {\n        if (this.debugLog) {\n            console.debug('LogViewer:', ...args);\n        }\n    }\n\n    // Load log data and append it to the DOM.\n    loadAndAppendLogData() {\n        if (this.dataLoadingLock) {\n            this.debug(\"Another log data loading request is still running, cancelling this request\");\n            return;\n        }\n        this.debug(\"Loading new log data\");\n        this.dataLoadingLock = true;\n        this.loaderElem.classList.remove('hidden');\n        fetch(this.getUrl())\n            .then((response) => {\n                if (!response.ok) {\n                    throw new Error(\"Error while fetching log data!\");\n                }\n                return response;\n            })\n            .then((response) => response.text())\n            .then((text) => {\n                text = text.trim();\n                if (text.length === 0) {\n                    this.debug(\"Received no new log data from server\");\n                    return;\n                }\n                this.debug(\"Received\", Math.round(text.length / 1024), \"KB of new log data from server\");\n                this.logElem.append(text + \"\\n\");\n                this.scrollToBottom();\n                this.lastLogTimestamp = text.split(\"\\n\").at(-1)?.split(' ')[0] ?? '';\n            })\n            .finally(() => {\n                this.dataLoadingLock = false;\n                this.loaderElem.classList.add('hidden');\n                this.debug(\"Finished log data loading\");\n            })\n            .catch((err) => console.error(err));\n    }\n\n    scrollToBottom() {\n        window.scrollTo(0, document.body.scrollHeight);\n    }\n\n    initAutoloadingControls() {\n        // Provide a button that allows to manually disable the autoloading.\n        const button = document.getElementById('autoloading-control');\n        const statusElem = document.getElementById('autoloading-status');\n        if (!button) {\n            return;\n        }\n        button.addEventListener('click', (event) => {\n            event.preventDefault();\n            if (this.isAutoloadingEnabled()) {\n                this.stopAutoloading();\n                statusElem.textContent = 'disabled';\n                button.textContent = 'Enable';\n                this.autoloadingDisabledFromButton = true;\n            } else {\n                this.startAutoloading();\n                statusElem.textContent = 'enabled';\n                button.textContent = 'Disable';\n                this.autoloadingDisabledFromButton = false;\n            }\n        });\n\n        // Load new data immediately if the window gets visible to the user again (unless autoloading has been\n        // disabled).\n        document.addEventListener('visibilitychange', () => {\n            if (document.visibilityState === 'visible') {\n                this.debug(\"Window became visible\");\n                if (!this.autoloadingDisabledFromButton) {\n                    this.startAutoloading();\n                }\n            } else {\n                this.debug(\"Window became hidden\");\n                this.stopAutoloading();\n            }\n        });\n    }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n    new LogViewer();\n});\n"
  },
  {
    "path": "php/public/robots.txt",
    "content": "User-agent: *\nDisallow: /\n"
  },
  {
    "path": "php/public/second-tab-warning.js",
    "content": "const channel = new BroadcastChannel('tab')\r\n\r\nchannel.postMessage('second-tab')\r\n// note that listener is added after posting the message\r\n\r\nchannel.addEventListener('message', (msg) => {\r\n    if (msg.data === 'second-tab') {\r\n        // message received from 2nd tab\r\n        document.getElementById('overlay').classList.add('loading')\r\n        alert('Cannot open multiple instances. You can use AIO here by reloading the page.')\r\n    }\r\n});"
  },
  {
    "path": "php/public/style.css",
    "content": ":root {\n    --color-nextcloud-blue: #0082c9;\n    --color-nextcloud-logo: var(--color-nextcloud-blue);\n    --color-main-background: white;\n    --color-input-background: white;\n    --color-main-text: black;\n    --color-main-border: black;\n    --color-main-border-hover: var(--color-main-border);\n    --color-error: #db0606;\n    --color-error-hover: #df2525;\n    --color-error-text: #c20505;\n    --color-success: #46ba61;\n    --color-running: #ffd000;\n    --color-primary-element: #00679e;\n    --color-primary-element-hover: #005a8a;\n    --color-primary-element-text: #ffffff;\n    --color-primary-element-light: #e5eff5;\n    --color-primary-element-light-hover: #dbe4ea;\n    --color-primary-element-light-text: #00293f;\n    --color-border-maxcontrast: #7d7d7d;\n    --color-loader: #f3f3f3;\n    --color-disabled: #d3d3d3; /* light gray background for disabled checkboxes */\n    --color-border-disabled: #a9a9a9; /* darker gray border for disabled checkboxes */\n    --color-text-disabled: #a9a9a9; /* matching label text color for disabled checkboxes */\n    --border: .5px;\n    --border-hover: 2px;\n    --border-radius: 7px;\n    --border-radius-large: 12px;\n    --default-font-size: 13px;\n    --checkbox-size: 16px;\n    --max-width: 580px;\n    --container-top-margin: 20px;\n    --container-bottom-margin: 20px;\n    --container-padding: 2px;\n    --container-height-calculation-difference: calc(var(--container-top-margin) + var(--container-bottom-margin));\n    --main-height-calculation-difference: calc(var(--container-height-calculation-difference) + calc(var(--container-padding) * 2));\n    --main-padding: 50px;\n}\n\n/* Breakpoint calculation: 580px (max-width) + 100px (main-padding * 2) + 200px (additional space) = 880px\nNote: Unfortunately, it's not possible to calculate this dynamically using CSS variables in media queries */\n@media only screen and (max-width: 880px) {\n    :root {\n        --container-top-margin: 50px;\n        --container-bottom-margin: 0px;\n    }\n}\n\n[data-theme=\"dark\"] {\n    --color-main-background: #171717;\n    --color-input-background: #ebebeb;\n    --color-main-text: #ebebeb;\n    --color-nextcloud-logo: var(--color-main-text);\n    --color-main-border: var(--color-border-maxcontrast);\n    --color-main-border-hover: var(--color-main-text);\n    --color-error: #ff3333;\n    --color-error-hover: #ff6666;\n    --color-error-text: #ff8080;\n    --color-primary-element:#0091f2;\n    --color-primary-element-hover:#079cff;\n    --color-primary-element-text:#000000;\n    --color-primary-element-light:#14232c;\n    --color-primary-element-light-hover:#1e2d35;\n    --color-primary-element-light-text:#99d3f9;\n    --color-loader: var(--color-border-maxcontrast);\n    --border-hover: var(--border);\n}\n\nhtml, body {\n    padding: 0;\n    margin: 0;\n    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';\n    background-color: var(--color-main-background);\n    color: var(--color-main-text);\n}\n\na {\n    text-decoration: none;\n    color: var(--color-primary-element);\n}\n\na:hover {\n    color: var(--color-primary-element-hover);\n}\n\na.button,\ninput[type=\"submit\"] {\n    padding: 8px 16px;\n    width: auto;\n    height: 34px;\n    cursor: pointer;\n    background-color: var(--color-primary-element);\n    font-weight: bold;\n    border-radius: var(--border-radius);\n    margin: 3px 3px 3px 0;\n    font-size: var(--default-font-size);\n    color: var(--color-primary-element-text);\n    border: none;\n    outline: none;\n}\n\na.button:focus,\ninput[type=\"submit\"]:focus {\n    outline: 2px solid var(--color-main-border);\n}\n\na.button:hover,\ninput[type=\"submit\"]:hover {\n    background-color: var(--color-primary-element-hover);\n}\n\n\na.button.light:hover,\ninput[type=\"submit\"].light:hover {\n    background-color: var(--color-primary-element-light);\n    color: var(--color-primary-element-light-text);\n}\n\n\na.button.light,\ninput[type=\"submit\"].light {\n    background-color: var(--color-primary-element-light);\n}\n\na.button.error,\ninput[type=\"submit\"].error {\n    background-color: var(--color-error);\n}\n\na.button.error:hover,\ninput[type=\"submit\"].error:hover {\n    background-color: var(--color-error-hover);\n}\n\n\n\n\nsummary {\n    cursor: pointer;\n}\n\nul {\n    list-style: none;\n    padding: 0;\n}\n\nli {\n    padding-bottom: 5px;\n    text-indent: 0;\n    padding-left: 0;\n}\n\nspan.error {\n    background-color: var(--color-error);\n}\n\ndiv.toast.error {\n    border-left-color: var(--color-error);\n}\n\n.status {\n    display: inline-block;\n    height: var(--checkbox-size);\n    width: var(--checkbox-size);\n    vertical-align: text-bottom;\n    border-radius: 50%\n}\n\nspan.success {\n    background-color: var(--color-success);\n}\n\nspan.running {\n    background-color: var(--color-running);\n}\n\ndiv.toast.success {\n    border-left-color: var(--color-success);\n}\n\ndiv.toast {\n    border-left: 3px solid;\n    right: 10px;\n    min-width: 200px;\n    box-shadow: 0 0 6px 0 rgba(77, 77, 77, 0.3);\n    padding: 12px;\n    margin-top: 45px;\n    position: fixed;\n    z-index: 1000;\n    border-radius: var(--border-radius);\n    background: var(--color-main-background) none;\n    color: var(--color-main-text);\n}\n\n.nextcloud-logo {\n    margin-left: auto;\n    margin-right: auto;\n    display: block;\n    color: var(--color-nextcloud-logo);\n}\n\n.fallback-text {\n   display: none;\n}\n\nsvg:not(:has(use)) .fallback-text {\n    display: block;\n}\n\n.login {\n    padding: 50px;\n    background-color: var(--color-main-background);\n    color: var(--color-main-text);\n    width: 500px;\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    border-radius: var(--border-radius-large);\n}\n\n.login > .monospace {\n    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';\n    font-size: 17px;\n}\n\n.login > form > input[type=\"password\"],\n.login > form > input[type=\"text\"],\n.login > form > input[type=\"submit\"] {\n    width: 100%;\n}\n\n.login > img {\n    margin-left: auto;\n    margin-right: auto;\n    display: block;\n}\n\n.login a.button,\n.login input[type=\"submit\"] {\n    margin-left: auto;\n    margin-right: auto;\n    display: block;\n    text-align: center;\n    padding: 0px;\n    align-content: center;\n}\n\n.wrapper {\n    min-height: 100dvh;\n    min-width: 100vw;\n    position: fixed;\n    width: 100vw;\n    background-image: url(\"img/jo-myoung-hee-fluid.webp\");\n    background-position: center;\n    background-repeat: no-repeat;\n    background-size: cover;\n    box-sizing: border-box;\n    overflow: hidden;\n}\n\nhtml[data-theme=\"dark\"] .wrapper {\n    background-image: url(\"img/jo-myoung-hee-fluid-dark.webp\");\n}\n\nform {\n    margin: 0;\n}\n\ninput[type=\"text\"],\ninput[type=\"password\"],\nselect {\n    padding-left: 8px;\n    padding-right: 8px;\n    height: 34px;\n    margin-bottom: 15px;\n    border-radius: var(--border-radius);\n    border: var(--border) solid var(--color-border-maxcontrast);\n    background: var(--color-main-background);\n    color: var(--color-main-text);\n}\n\ninput[type=\"text\"]:hover,\ninput[type=\"password\"]:hover,\nselect:hover {\n    border: var(--border-hover) solid var(--color-main-border-hover);\n}\n\ntextarea {\n    border-radius: var(--border-radius);\n    border: .5px solid var(--color-main-border);\n    max-width: 100%;\n}\n\ninput[type=\"text\"]:focus,\ninput[type=\"password\"]:focus,\ntextarea:focus,\nselect:focus {\n    border: 1px solid var(--color-main-border);\n}\n\n/* Scroll bar for dark mode */\nhtml[data-theme=\"dark\"] ::-webkit-scrollbar {\n    width: 8px; /* Width of the scroll bar */\n}\n\nhtml[data-theme=\"dark\"] ::-webkit-scrollbar-thumb {\n    background-color: #444; /* Dark mode scrollbar thumb color */\n    border-radius: 4px; /* Rounded corners for the thumb */\n}\n\nhtml[data-theme=\"dark\"] ::-webkit-scrollbar-track {\n    background-color: #333; /* Dark mode scrollbar track color */\n}\n\n/* Scroll bar for light mode */\n::-webkit-scrollbar {\n    width: 8px; /* Width of the scroll bar */\n}\n\n::-webkit-scrollbar-thumb {\n    background-color: #888; /* Light mode scrollbar thumb color */\n    border-radius: 4px; /* Rounded corners for the thumb */\n}\n\n::-webkit-scrollbar-track {\n    background-color: #f0f0f0; /* Light mode scrollbar track color */\n}\n\n.container {\n    margin: var(--container-top-margin) auto var(--container-bottom-margin) auto;\n    padding: var(--container-padding);\n    max-width: calc(var(--max-width) + calc(var(--main-padding) * 2) + 8px);\n    background-color: var(--color-main-background);\n    border-radius: var(--border-radius-large);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n    max-height: calc(100dvh - var(--container-height-calculation-difference));\n    overflow: hidden;\n}\n\nmain {\n    padding-left: var(--main-padding);\n    padding-right: var(--main-padding);\n    background-color: transparent; /* transparent, since color comes from outer container */\n    color: var(--color-main-text);\n    max-height: calc(100dvh - var(--main-height-calculation-difference));\n    overflow-y: auto;\n    box-sizing: border-box;\n    word-break: break-word;\n    max-width: calc(var(--max-width) + calc(var(--main-padding) * 2));\n    margin: 0 auto;\n    padding-bottom: var(--main-padding);\n}\n\n.logo {\n    color: white;\n    height: 50px;\n    width: 62px;\n    position: absolute;\n    left: 12px;\n    top: 1px;\n    bottom: 1px;\n}\n\nheader {\n    position: fixed;\n    top: 0;\n    width: 100%;\n    background-color: transparent;\n    height: 50px;\n    justify-content: space-between;\n    align-items: center;\n    display: flex;\n    padding: 0 20px;\n    z-index: 1000;\n}\n\nheader > form {\n    margin-left: auto;\n    margin-right: 30px;\n}\n\n/* Standard styling for enabled checkboxes */\ninput[type=\"checkbox\"]:not(:disabled) {\n    width: var(--checkbox-size);\n    height: var(--checkbox-size);\n    -webkit-appearance: none; /* remove default styling */\n    -moz-appearance: none;\n    appearance: none;\n    border: 1px solid var(--color-primary-element);\n    border-radius: 2px;\n    cursor: pointer;\n    position: relative;\n    vertical-align: middle; /* align checkbox vertically with text */\n    margin-top: -1px; /* adjust for better alignment */\n}\n\n/* Hover effects for enabled checkboxes */\ninput[type=\"checkbox\"]:not(:disabled):hover {\n    border-color: var(--color-primary-element-hover);\n}\n\n/* Checkmark styling for enabled checkboxes */\ninput[type=\"checkbox\"]:checked:not(:disabled) {\n    background-color: var(--color-primary-element);\n    border-color: var(--color-border-maxcontrast);\n}\n\ninput[type=\"checkbox\"]:checked:not(:disabled)::after {\n    content: ''; /* Creates a pseudo-element for the checkmark */\n    position: absolute; /* Positions it absolutely */\n    left: 4px; /* Positioning of the checkmark */\n    top: 0; /* Positioning of the checkmark */\n    width: 4px; /* Width of the checkmark */\n    height: 9px; /* Height of the checkmark */\n    border: solid white; /* Color of the checkmark */\n    border-width: 0 2px 3px 0; /* Creates the checkmark shape */\n    transform: rotate(45deg); /* Rotates to form a checkmark */\n}\n\n/* Styling for disabled checkboxes (grayed out, no hover, no pointer) */\ninput[type=\"checkbox\"]:disabled:not(:checked) {\n    background-color: var(--color-disabled);\n    border-color: var(--color-border-disabled);\n    cursor: default;\n    opacity: 0.5; /* Makes the checkbox appear faded */\n}\n\n/* Styling for disabled checked checkboxes (no pointer) */\ninput[type=\"checkbox\"]:disabled:checked {\n    cursor: default;\n}\n\ninput[type=\"checkbox\"]:disabled:hover {\n    border-color: var(--color-border-disabled); /* Keeps disabled state without hover effect */\n}\n\n/* General Label styling */\nlabel {\n    cursor: pointer;\n    margin-left: 4px;\n    line-height: var(--checkbox-size);\n}\n\n/* Label cursor for disabled checkboxes */\ninput[type=\"checkbox\"]:disabled + label {\n    cursor: default;\n}\n\n/* Label styling for disabled, not checked checkboxes */\ninput[type=\"checkbox\"]:disabled:not(:checked) + label {\n    color: var(--color-text-disabled);\n}\n\n.loading {\n    color: grey;\n}\n\n#overlay {\n    position: fixed; /* Sit on top of the page content */\n    display: none; /* Hidden by default */\n    width: 100%; /* Full width (cover the whole page) */\n    height: 100%; /* Full height (cover the whole page) */\n    top: 0;\n    left: 0;\n    background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */\n    z-index: 2;\n}\n\n#overlay.loading {\n    display: grid;\n    justify-items: center;\n    row-gap: 2rem;\n}\n\n#overlay #overlay-log.visible {\n    visibility: visible;\n    opacity: 1;\n    transition: opacity 1s ease-in;\n}\n\n#overlay #overlay-log {\n    visibility: hidden;\n    opacity: 0;\n    align-self: start;\n    width: 300px;\n    height: 200px;\n    border-radius: var(--border-radius-large);\n    border: solid thin rgb(192, 192, 192);\n}\n\n.overlay-iframe {\n    padding: 1rem;\n}\n\n.loader {\n    border: 16px solid var(--color-loader);\n    border-radius: 50%;\n    border-top: 16px solid var(--color-nextcloud-blue);\n    width: 120px;\n    height: 120px;\n    -webkit-animation: spin 2s linear infinite; /* Safari */\n    animation: spin 2s linear infinite;\n    align-self: end;\n}\n\n/* Safari */\n@-webkit-keyframes spin {\n    0% { -webkit-transform: rotate(0deg); }\n    100% { -webkit-transform: rotate(360deg); }\n}\n\n@keyframes spin {\n    0% { transform: rotate(0deg); }\n    100% { transform: rotate(360deg); }\n}\n\n/* General theme button styling */\n#theme-toggle {\n    position: fixed; /* Keep the button in the same position */\n    right: 30px; /* Adjust the distance from the right */\n    bottom: 30px; /* Adjust the distance from the bottom */\n    background-color: transparent; /* Make the background transparent */\n    border: none; /* Remove border */\n    font-size: 36px; /* Adjust font size */\n    cursor: pointer; /* Change cursor to pointer */\n    outline: none;\n    z-index: 9999; /* Ensures the icon is on top of every layer */\n}\n\n/* Icon styling: default state */\n#theme-icon {\n    display: inline-block;\n    border-radius: 50%; /* Round shape */\n    position: relative; /* For the pseudo-element positioning */\n    transition: box-shadow 0.3s, background-color 0.3s; /* Smooth transition for hover effect */\n    opacity: 0.6; /* Slightly transparent by default */\n    filter: grayscale(100%); /* Make the icon black and white */\n}\n\n/* Create the inner glow effect with ::after */\n#theme-icon::after {\n    content: ''; /* Empty content for the pseudo-element */\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    width: 0px; /* Invisible dot */\n    height: 0px; /* Invisible dot */\n    background-color: transparent; /* Invisible by default */\n    border-radius: 50%; /* Circle shape */\n    transform: translate(-50%, -50%); /* Center the dot */\n    transition: box-shadow 0.3s, background-color 0.3s; /* Smooth transition for hover */\n}\n\n/* Hover effect for both light and dark modes */\n#theme-toggle:hover #theme-icon {\n    position: relative; /* Ensures stacking order */\n    filter: grayscale(0%); /* Restore full color */\n    opacity: 1; /* Fully visible on hover */\n}\n\n/* Inner glow when hovered */\n#theme-toggle:hover #theme-icon::after {\n    box-shadow: 0 0 40px 40px rgba(128, 128, 128, 0.4); /* Blur effect from inside */\n    background-color: rgba(128, 128, 128, 0.2); /* Light glow inside */\n}\n\n/* Remove hover effects when not hovering */\n#theme-toggle:not(:hover) #theme-icon {\n    opacity: 0.6; /* Slightly transparent */\n}\n/* Office Suite Feature Cards */\n.office-suite-cards {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));\n    gap: 16px;\n    margin: 20px 0;\n    align-items: stretch;\n}\n\n.office-radio {\n    display: none;\n}\n\n.office-card {\n    position: relative;\n    border: 2px solid var(--color-border-maxcontrast);\n    border-radius: var(--border-radius-large);\n    padding: 20px;\n    cursor: pointer;\n    transition: all 0.3s ease;\n    background-color: var(--color-main-background);\n    display: flex;\n    flex-direction: column;\n}\n\n.office-card-disabled {\n    opacity: 50%;\n    pointer-events: none;\n}\n\n.office-card:hover {\n    border-color: var(--color-primary-element);\n    box-shadow: 0 4px 12px rgba(0, 130, 201, 0.15);\n    transform: translateY(-2px);\n}\n\n#office-collabora:checked + .office-card,\n#office-onlyoffice:checked + .office-card {\n    border-color: var(--color-nextcloud-blue);\n    background: linear-gradient(135deg, rgba(0, 130, 201, 0.08) 0%, rgba(0, 130, 201, 0.02) 100%);\n}\n\n[data-theme=\"dark\"] #office-collabora:checked + .office-card,\n[data-theme=\"dark\"] #office-onlyoffice:checked + .office-card {\n    background: linear-gradient(135deg, rgba(0, 145, 242, 0.15) 0%, rgba(0, 145, 242, 0.03) 100%);\n}\n\n.office-card-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 16px;\n}\n\n.office-card h4 {\n    margin: 0;\n    height: 24px;\n    font-size: 18px;\n    font-weight: 600;\n    color: var(--color-main-text);\n}\n\n.office-checkmark {\n    flex-shrink: 0;\n    display: none;\n}\n\n#office-collabora:checked + .office-card .office-checkmark,\n#office-onlyoffice:checked + .office-card .office-checkmark {\n    display: block;\n}\n\n.office-features {\n    list-style: none;\n    padding: 0;\n    margin: 0;\n}\n\n.office-features li {\n    position: relative;\n    padding-left: 20px;\n    margin-bottom: 4px;\n    font-size: var(--default-font-size);\n    line-height: 1.5;\n    color: var(--color-main-text);\n}\n\n.office-features li::before {\n    content: '•';\n    position: absolute;\n    left: 6px;\n    color: var(--color-nextcloud-blue);\n    font-weight: bold;\n}\n\n.office-checkbox {\n    position: absolute;\n    opacity: 0;\n    pointer-events: none;\n}\n\n.office-learn-more {\n    display: inline-flex;\n    align-items: center;\n    margin-top: 12px;\n    color: var(--color-primary-element);\n    text-decoration: none;\n    font-size: var(--default-font-size);\n    font-weight: 500;\n    transition: color 0.2s ease;\n}\n\n.office-learn-more:hover {\n    color: var(--color-primary-element-hover);\n}\n\n.office-learn-more svg {\n    transition: transform 0.2s ease;\n}\n\n.office-learn-more:hover svg {\n    transform: translateX(3px);\n}\n\n.office-none-card {\n    text-align: center;\n    margin: 12px 0 20px 0;\n}\n\n.office-none-label {\n    display: inline-flex;\n    align-items: center;\n    font-size: 13px;\n    color: var(--color-primary-element);\n    cursor: pointer;\n    opacity: 0.7;\n    transition: opacity 0.2s ease;\n    padding: 8px 12px;\n    border-radius: var(--border-radius);\n}\n\n.office-none-label:hover {\n    opacity: 1;\n    background-color: var(--color-primary-element-light);\n}\n\n#office-none:checked + .office-none-label {\n    opacity: 1;\n    font-weight: 600;\n}\n\n/* Responsive adjustments for mobile */\n@media only screen and (max-width: 800px) {\n    .office-suite-cards {\n        grid-template-columns: 1fr;\n    }\n}\n"
  },
  {
    "path": "php/public/timezone.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", function(event) {\n    // timezone\n    let timezone = document.getElementById(\"timezone\");\n    if (timezone) {\n        timezone.value = Intl.DateTimeFormat().resolvedOptions().timeZone\n    }\n});\n"
  },
  {
    "path": "php/public/toggle-dark-mode.js",
    "content": "// Function to toggle theme\nfunction toggleTheme() {\n    const currentTheme = document.documentElement.getAttribute('data-theme');\n    const newTheme = (currentTheme === 'dark') ? '' : 'dark'; // Toggle between no theme and dark theme\n    setThemeToDOM(newTheme);\n    localStorage.setItem('theme', newTheme);\n\n    // Change the icon based on the current theme\n    setThemeIcon(newTheme);\n}\n\nfunction setThemeToDOM(value) {\n    // Set the theme to the root document and all possible iframe documents (so they can adapt their styling, too).\n    const documents = [document, Array.from(document.querySelectorAll('iframe')).map((iframe) => iframe.contentDocument)].flat()\n    documents.forEach((doc) => doc.documentElement.setAttribute('data-theme', value));\n}\n\nfunction getSavedTheme() {\n    return localStorage.getItem('theme') ?? '';\n}\n\n// Function to apply theme-icon update\nfunction setThemeIcon(theme) {\n    if (theme === 'dark') {\n        document.getElementById('theme-icon').textContent = '☀️'; // Sun icon for dark mode\n    } else {\n        document.getElementById('theme-icon').textContent = '🌙'; // Moon icon for light mode\n    }\n}\n\n// Immediately apply the saved theme to avoid flickering\nsetThemeToDOM(getSavedTheme());\n\n// Apply theme when the page loads\ndocument.addEventListener('DOMContentLoaded', () => setThemeIcon(getSavedTheme()));\n"
  },
  {
    "path": "php/session/.gitkeep",
    "content": ""
  },
  {
    "path": "php/src/Auth/AuthManager.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Auth;\n\nuse AIO\\Data\\ConfigurationManager;\nuse AIO\\Data\\DataConst;\nuse \\DateTime;\n\nreadonly class AuthManager {\n    private const string SESSION_KEY = 'aio_authenticated';\n\n    public function __construct(\n        private ConfigurationManager $configurationManager\n    ) {\n    }\n\n    public function CheckCredentials(string $password) : bool {\n        return hash_equals($this->configurationManager->password, $password);\n    }\n\n    public function CheckToken(string $token) : bool {\n        return hash_equals($this->configurationManager->aioToken, $token);\n    }\n\n    public function SetAuthState(bool $isLoggedIn) : void {\n\n        if (!$this->IsAuthenticated() && $isLoggedIn === true) {\n            $date = new DateTime();\n            $dateTime = $date->getTimestamp();\n            $_SESSION['date_time'] = $dateTime;\n\n            $df = disk_free_space(DataConst::GetSessionDirectory());\n            if ($df !== false && (int)$df < 10240) {\n                error_log(DataConst::GetSessionDirectory() . \" has only less than 10KB free space. The login might not succeed because of that!\");\n            }\n\n            file_put_contents(DataConst::GetSessionDateFile(), (string)$dateTime);\n        }\n\n        $_SESSION[self::SESSION_KEY] = $isLoggedIn;\n    }\n\n    public function IsAuthenticated() : bool {\n        return isset($_SESSION[self::SESSION_KEY]) && $_SESSION[self::SESSION_KEY] === true;\n    }\n}\n"
  },
  {
    "path": "php/src/Auth/PasswordGenerator.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Auth;\n\nuse AIO\\Data\\ConfigurationManager;\n\nclass PasswordGenerator\n{\n    private array $words = [\n        'abacus',\n        'abdomen',\n        'abdominal',\n        'abide',\n        'abiding',\n        'ability',\n        'ablaze',\n        'able',\n        'abnormal',\n        'abrasion',\n        'abrasive',\n        'abreast',\n        'abridge',\n        'abroad',\n        'abruptly',\n        'absence',\n        'absentee',\n        'absently',\n        'absinthe',\n        'absolute',\n        'absolve',\n        'abstain',\n        'abstract',\n        'absurd',\n        'accent',\n        'acclaim',\n        'acclimate',\n        'accompany',\n        'account',\n        'accuracy',\n        'accurate',\n        'accustom',\n        'acetone',\n        'achiness',\n        'aching',\n        'acid',\n        'acorn',\n        'acquaint',\n        'acquire',\n        'acre',\n        'acrobat',\n        'acronym',\n        'acting',\n        'action',\n        'activate',\n        'activator',\n        'active',\n        'activism',\n        'activist',\n        'activity',\n        'actress',\n        'acts',\n        'acutely',\n        'acuteness',\n        'aeration',\n        'aerobics',\n        'aerosol',\n        'aerospace',\n        'afar',\n        'affair',\n        'affected',\n        'affecting',\n        'affection',\n        'affidavit',\n        'affiliate',\n        'affirm',\n        'affix',\n        'afflicted',\n        'affluent',\n        'afford',\n        'affront',\n        'aflame',\n        'afloat',\n        'aflutter',\n        'afoot',\n        'afraid',\n        'afterglow',\n        'afterlife',\n        'aftermath',\n        'aftermost',\n        'afternoon',\n        'aged',\n        'ageless',\n        'agency',\n        'agenda',\n        'agent',\n        'aggregate',\n        'aghast',\n        'agile',\n        'agility',\n        'aging',\n        'agnostic',\n        'agonize',\n        'agonizing',\n        'agony',\n        'agreeable',\n        'agreeably',\n        'agreed',\n        'agreeing',\n        'agreement',\n        'aground',\n        'ahead',\n        'ahoy',\n        'aide',\n        'aids',\n        'aim',\n        'ajar',\n        'alabaster',\n        'alarm',\n        'albatross',\n        'album',\n        'alfalfa',\n        'algebra',\n        'algorithm',\n        'alias',\n        'alibi',\n        'alienable',\n        'alienate',\n        'aliens',\n        'alike',\n        'alive',\n        'alkaline',\n        'alkalize',\n        'almanac',\n        'almighty',\n        'almost',\n        'aloe',\n        'aloft',\n        'aloha',\n        'alone',\n        'alongside',\n        'aloof',\n        'alphabet',\n        'alright',\n        'although',\n        'altitude',\n        'alto',\n        'aluminum',\n        'alumni',\n        'always',\n        'amaretto',\n        'amaze',\n        'amazingly',\n        'amber',\n        'ambiance',\n        'ambiguity',\n        'ambiguous',\n        'ambition',\n        'ambitious',\n        'ambulance',\n        'ambush',\n        'amendable',\n        'amendment',\n        'amends',\n        'amenity',\n        'amiable',\n        'amicably',\n        'amid',\n        'amigo',\n        'amino',\n        'amiss',\n        'ammonia',\n        'ammonium',\n        'amnesty',\n        'amniotic',\n        'among',\n        'amount',\n        'amperage',\n        'ample',\n        'amplifier',\n        'amplify',\n        'amply',\n        'amuck',\n        'amulet',\n        'amusable',\n        'amused',\n        'amusement',\n        'amuser',\n        'amusing',\n        'anaconda',\n        'anaerobic',\n        'anagram',\n        'anatomist',\n        'anatomy',\n        'anchor',\n        'anchovy',\n        'ancient',\n        'android',\n        'anemia',\n        'anemic',\n        'aneurism',\n        'anew',\n        'angelfish',\n        'angelic',\n        'anger',\n        'angled',\n        'angler',\n        'angles',\n        'angling',\n        'angrily',\n        'angriness',\n        'anguished',\n        'angular',\n        'animal',\n        'animate',\n        'animating',\n        'animation',\n        'animator',\n        'anime',\n        'animosity',\n        'ankle',\n        'annex',\n        'annotate',\n        'announcer',\n        'annoying',\n        'annually',\n        'annuity',\n        'anointer',\n        'another',\n        'answering',\n        'antacid',\n        'antarctic',\n        'anteater',\n        'antelope',\n        'antennae',\n        'anthem',\n        'anthill',\n        'anthology',\n        'antibody',\n        'antics',\n        'antidote',\n        'antihero',\n        'antiquely',\n        'antiques',\n        'antiquity',\n        'antirust',\n        'antitoxic',\n        'antitrust',\n        'antiviral',\n        'antivirus',\n        'antler',\n        'antonym',\n        'antsy',\n        'anvil',\n        'anybody',\n        'anyhow',\n        'anymore',\n        'anyone',\n        'anyplace',\n        'anything',\n        'anytime',\n        'anyway',\n        'anywhere',\n        'aorta',\n        'apache',\n        'apostle',\n        'appealing',\n        'appear',\n        'appease',\n        'appeasing',\n        'appendage',\n        'appendix',\n        'appetite',\n        'appetizer',\n        'applaud',\n        'applause',\n        'apple',\n        'appliance',\n        'applicant',\n        'applied',\n        'apply',\n        'appointee',\n        'appraisal',\n        'appraiser',\n        'apprehend',\n        'approach',\n        'approval',\n        'approve',\n        'apricot',\n        'april',\n        'apron',\n        'aptitude',\n        'aptly',\n        'aqua',\n        'aqueduct',\n        'arbitrary',\n        'arbitrate',\n        'ardently',\n        'area',\n        'arena',\n        'arguable',\n        'arguably',\n        'argue',\n        'arise',\n        'armadillo',\n        'armband',\n        'armchair',\n        'armed',\n        'armful',\n        'armhole',\n        'arming',\n        'armless',\n        'armoire',\n        'armored',\n        'armory',\n        'armrest',\n        'army',\n        'aroma',\n        'arose',\n        'around',\n        'arousal',\n        'arrange',\n        'array',\n        'arrest',\n        'arrival',\n        'arrive',\n        'arrogance',\n        'arrogant',\n        'arson',\n        'art',\n        'ascend',\n        'ascension',\n        'ascent',\n        'ascertain',\n        'ashamed',\n        'ashen',\n        'ashes',\n        'ashy',\n        'aside',\n        'askew',\n        'asleep',\n        'asparagus',\n        'aspect',\n        'aspirate',\n        'aspire',\n        'aspirin',\n        'astonish',\n        'astound',\n        'astride',\n        'astrology',\n        'astronaut',\n        'astronomy',\n        'astute',\n        'atlantic',\n        'atlas',\n        'atom',\n        'atonable',\n        'atop',\n        'atrium',\n        'atrocious',\n        'atrophy',\n        'attach',\n        'attain',\n        'attempt',\n        'attendant',\n        'attendee',\n        'attention',\n        'attentive',\n        'attest',\n        'attic',\n        'attire',\n        'attitude',\n        'attractor',\n        'attribute',\n        'atypical',\n        'auction',\n        'audacious',\n        'audacity',\n        'audible',\n        'audibly',\n        'audience',\n        'audio',\n        'audition',\n        'augmented',\n        'august',\n        'authentic',\n        'author',\n        'autism',\n        'autistic',\n        'autograph',\n        'automaker',\n        'automated',\n        'automatic',\n        'autopilot',\n        'available',\n        'avalanche',\n        'avatar',\n        'avenge',\n        'avenging',\n        'avenue',\n        'average',\n        'aversion',\n        'avert',\n        'aviation',\n        'aviator',\n        'avid',\n        'avoid',\n        'await',\n        'awaken',\n        'award',\n        'aware',\n        'awhile',\n        'awkward',\n        'awning',\n        'awoke',\n        'awry',\n        'axis',\n        'babble',\n        'babbling',\n        'babied',\n        'baboon',\n        'backache',\n        'backboard',\n        'backboned',\n        'backdrop',\n        'backed',\n        'backer',\n        'backfield',\n        'backfire',\n        'backhand',\n        'backing',\n        'backlands',\n        'backlash',\n        'backless',\n        'backlight',\n        'backlit',\n        'backlog',\n        'backpack',\n        'backpedal',\n        'backrest',\n        'backroom',\n        'backshift',\n        'backside',\n        'backslid',\n        'backspace',\n        'backspin',\n        'backstab',\n        'backstage',\n        'backtalk',\n        'backtrack',\n        'backup',\n        'backward',\n        'backwash',\n        'backwater',\n        'backyard',\n        'bacon',\n        'bacteria',\n        'bacterium',\n        'badass',\n        'badge',\n        'badland',\n        'badly',\n        'badness',\n        'baffle',\n        'baffling',\n        'bagel',\n        'bagful',\n        'baggage',\n        'bagged',\n        'baggie',\n        'bagginess',\n        'bagging',\n        'baggy',\n        'bagpipe',\n        'baguette',\n        'baked',\n        'bakery',\n        'bakeshop',\n        'baking',\n        'balance',\n        'balancing',\n        'balcony',\n        'balmy',\n        'balsamic',\n        'bamboo',\n        'banana',\n        'banish',\n        'banister',\n        'banjo',\n        'bankable',\n        'bankbook',\n        'banked',\n        'banker',\n        'banking',\n        'banknote',\n        'bankroll',\n        'banner',\n        'bannister',\n        'banshee',\n        'banter',\n        'barbecue',\n        'barbed',\n        'barbell',\n        'barber',\n        'barcode',\n        'barge',\n        'bargraph',\n        'barista',\n        'baritone',\n        'barley',\n        'barmaid',\n        'barman',\n        'barn',\n        'barometer',\n        'barrack',\n        'barracuda',\n        'barrel',\n        'barrette',\n        'barricade',\n        'barrier',\n        'barstool',\n        'bartender',\n        'barterer',\n        'bash',\n        'basically',\n        'basics',\n        'basil',\n        'basin',\n        'basis',\n        'basket',\n        'batboy',\n        'batch',\n        'bath',\n        'baton',\n        'bats',\n        'battalion',\n        'battered',\n        'battering',\n        'battery',\n        'batting',\n        'battle',\n        'bauble',\n        'bazooka',\n        'blabber',\n        'bladder',\n        'blade',\n        'blah',\n        'blame',\n        'blaming',\n        'blanching',\n        'blandness',\n        'blank',\n        'blaspheme',\n        'blasphemy',\n        'blast',\n        'blatancy',\n        'blatantly',\n        'blazer',\n        'blazing',\n        'bleach',\n        'bleak',\n        'bleep',\n        'blemish',\n        'blend',\n        'bless',\n        'blighted',\n        'blimp',\n        'bling',\n        'blinked',\n        'blinker',\n        'blinking',\n        'blinks',\n        'blip',\n        'blissful',\n        'blitz',\n        'blizzard',\n        'bloated',\n        'bloating',\n        'blob',\n        'blog',\n        'bloomers',\n        'blooming',\n        'blooper',\n        'blot',\n        'blouse',\n        'blubber',\n        'bluff',\n        'bluish',\n        'blunderer',\n        'blunt',\n        'blurb',\n        'blurred',\n        'blurry',\n        'blurt',\n        'blush',\n        'blustery',\n        'boaster',\n        'boastful',\n        'boasting',\n        'boat',\n        'bobbed',\n        'bobbing',\n        'bobble',\n        'bobcat',\n        'bobsled',\n        'bobtail',\n        'bodacious',\n        'body',\n        'bogged',\n        'boggle',\n        'bogus',\n        'boil',\n        'bok',\n        'bolster',\n        'bolt',\n        'bonanza',\n        'bonded',\n        'bonding',\n        'bondless',\n        'boned',\n        'bonehead',\n        'boneless',\n        'bonelike',\n        'boney',\n        'bonfire',\n        'bonnet',\n        'bonsai',\n        'bonus',\n        'bony',\n        'boogeyman',\n        'boogieman',\n        'book',\n        'boondocks',\n        'booted',\n        'booth',\n        'bootie',\n        'booting',\n        'bootlace',\n        'bootleg',\n        'boots',\n        'boozy',\n        'borax',\n        'boring',\n        'borough',\n        'borrower',\n        'borrowing',\n        'boss',\n        'botanical',\n        'botanist',\n        'botany',\n        'botch',\n        'both',\n        'bottle',\n        'bottling',\n        'bottom',\n        'bounce',\n        'bouncing',\n        'bouncy',\n        'bounding',\n        'boundless',\n        'bountiful',\n        'bovine',\n        'boxcar',\n        'boxer',\n        'boxing',\n        'boxlike',\n        'boxy',\n        'breach',\n        'breath',\n        'breeches',\n        'breeching',\n        'breeder',\n        'breeding',\n        'breeze',\n        'breezy',\n        'brethren',\n        'brewery',\n        'brewing',\n        'briar',\n        'bribe',\n        'brick',\n        'bride',\n        'bridged',\n        'brigade',\n        'bright',\n        'brilliant',\n        'brim',\n        'bring',\n        'brink',\n        'brisket',\n        'briskly',\n        'briskness',\n        'bristle',\n        'brittle',\n        'broadband',\n        'broadcast',\n        'broaden',\n        'broadly',\n        'broadness',\n        'broadside',\n        'broadways',\n        'broiler',\n        'broiling',\n        'broken',\n        'broker',\n        'bronchial',\n        'bronco',\n        'bronze',\n        'bronzing',\n        'brook',\n        'broom',\n        'brought',\n        'browbeat',\n        'brownnose',\n        'browse',\n        'browsing',\n        'bruising',\n        'brunch',\n        'brunette',\n        'brunt',\n        'brush',\n        'brussels',\n        'brute',\n        'brutishly',\n        'bubble',\n        'bubbling',\n        'bubbly',\n        'buccaneer',\n        'bucked',\n        'bucket',\n        'buckle',\n        'buckshot',\n        'buckskin',\n        'bucktooth',\n        'buckwheat',\n        'buddhism',\n        'buddhist',\n        'budding',\n        'buddy',\n        'budget',\n        'buffalo',\n        'buffed',\n        'buffer',\n        'buffing',\n        'buffoon',\n        'buggy',\n        'bulb',\n        'bulge',\n        'bulginess',\n        'bulgur',\n        'bulk',\n        'bulldog',\n        'bulldozer',\n        'bullfight',\n        'bullfrog',\n        'bullhorn',\n        'bullion',\n        'bullish',\n        'bullpen',\n        'bullring',\n        'bullseye',\n        'bullwhip',\n        'bully',\n        'bunch',\n        'bundle',\n        'bungee',\n        'bunion',\n        'bunkbed',\n        'bunkhouse',\n        'bunkmate',\n        'bunny',\n        'bunt',\n        'busboy',\n        'bush',\n        'busily',\n        'busload',\n        'bust',\n        'busybody',\n        'buzz',\n        'cabana',\n        'cabbage',\n        'cabbie',\n        'cabdriver',\n        'cable',\n        'caboose',\n        'cache',\n        'cackle',\n        'cacti',\n        'cactus',\n        'caddie',\n        'caddy',\n        'cadet',\n        'cadillac',\n        'cadmium',\n        'cage',\n        'cahoots',\n        'cake',\n        'calamari',\n        'calamity',\n        'calcium',\n        'calculate',\n        'calculus',\n        'caliber',\n        'calibrate',\n        'calm',\n        'caloric',\n        'calorie',\n        'calzone',\n        'camcorder',\n        'cameo',\n        'camera',\n        'camisole',\n        'camper',\n        'campfire',\n        'camping',\n        'campsite',\n        'campus',\n        'canal',\n        'canary',\n        'cancel',\n        'candied',\n        'candle',\n        'candy',\n        'cane',\n        'canine',\n        'canister',\n        'cannabis',\n        'canned',\n        'canning',\n        'cannon',\n        'cannot',\n        'canola',\n        'canon',\n        'canopener',\n        'canopy',\n        'canteen',\n        'canyon',\n        'capable',\n        'capably',\n        'capacity',\n        'cape',\n        'capillary',\n        'capital',\n        'capitol',\n        'capped',\n        'capricorn',\n        'capsize',\n        'capsule',\n        'caption',\n        'captivate',\n        'captive',\n        'captivity',\n        'capture',\n        'caramel',\n        'carat',\n        'caravan',\n        'carbon',\n        'cardboard',\n        'carded',\n        'cardiac',\n        'cardigan',\n        'cardinal',\n        'cardstock',\n        'carefully',\n        'caregiver',\n        'careless',\n        'caress',\n        'caretaker',\n        'cargo',\n        'caring',\n        'carless',\n        'carload',\n        'carmaker',\n        'carnage',\n        'carnation',\n        'carnival',\n        'carnivore',\n        'carol',\n        'carpenter',\n        'carpentry',\n        'carpool',\n        'carport',\n        'carried',\n        'carrot',\n        'carrousel',\n        'carry',\n        'cartel',\n        'cartload',\n        'carton',\n        'cartoon',\n        'cartridge',\n        'cartwheel',\n        'carve',\n        'carving',\n        'carwash',\n        'cascade',\n        'case',\n        'cash',\n        'casing',\n        'casino',\n        'casket',\n        'cassette',\n        'casually',\n        'casualty',\n        'catacomb',\n        'catalog',\n        'catalyst',\n        'catalyze',\n        'catapult',\n        'cataract',\n        'catatonic',\n        'catcall',\n        'catchable',\n        'catcher',\n        'catching',\n        'catchy',\n        'caterer',\n        'catering',\n        'catfight',\n        'catfish',\n        'cathedral',\n        'cathouse',\n        'catlike',\n        'catnap',\n        'catnip',\n        'catsup',\n        'cattail',\n        'cattishly',\n        'cattle',\n        'catty',\n        'catwalk',\n        'caucasian',\n        'caucus',\n        'causal',\n        'causation',\n        'cause',\n        'causing',\n        'cauterize',\n        'caution',\n        'cautious',\n        'cavalier',\n        'cavalry',\n        'caviar',\n        'cavity',\n        'cedar',\n        'celery',\n        'celestial',\n        'celibacy',\n        'celibate',\n        'celtic',\n        'cement',\n        'census',\n        'ceramics',\n        'ceremony',\n        'certainly',\n        'certainty',\n        'certified',\n        'certify',\n        'cesarean',\n        'cesspool',\n        'chafe',\n        'chaffing',\n        'chain',\n        'chair',\n        'chalice',\n        'challenge',\n        'chamber',\n        'chamomile',\n        'champion',\n        'chance',\n        'change',\n        'channel',\n        'chant',\n        'chaos',\n        'chaperone',\n        'chaplain',\n        'chapped',\n        'chaps',\n        'chapter',\n        'character',\n        'charbroil',\n        'charcoal',\n        'charger',\n        'charging',\n        'chariot',\n        'charity',\n        'charm',\n        'charred',\n        'charter',\n        'charting',\n        'chase',\n        'chasing',\n        'chaste',\n        'chastise',\n        'chastity',\n        'chatroom',\n        'chatter',\n        'chatting',\n        'chatty',\n        'cheating',\n        'cheddar',\n        'cheek',\n        'cheer',\n        'cheese',\n        'cheesy',\n        'chef',\n        'chemicals',\n        'chemist',\n        'chemo',\n        'cherisher',\n        'cherub',\n        'chess',\n        'chest',\n        'chevron',\n        'chevy',\n        'chewable',\n        'chewer',\n        'chewing',\n        'chewy',\n        'chief',\n        'chihuahua',\n        'childcare',\n        'childhood',\n        'childish',\n        'childless',\n        'childlike',\n        'chili',\n        'chill',\n        'chimp',\n        'chip',\n        'chirping',\n        'chirpy',\n        'chitchat',\n        'chivalry',\n        'chive',\n        'chloride',\n        'chlorine',\n        'choice',\n        'chokehold',\n        'choking',\n        'chomp',\n        'chooser',\n        'choosing',\n        'choosy',\n        'chop',\n        'chosen',\n        'chowder',\n        'chowtime',\n        'chrome',\n        'chubby',\n        'chuck',\n        'chug',\n        'chummy',\n        'chump',\n        'chunk',\n        'churn',\n        'chute',\n        'cider',\n        'cilantro',\n        'cinch',\n        'cinema',\n        'cinnamon',\n        'circle',\n        'circling',\n        'circular',\n        'circulate',\n        'circus',\n        'citable',\n        'citadel',\n        'citation',\n        'citizen',\n        'citric',\n        'citrus',\n        'city',\n        'civic',\n        'civil',\n        'clad',\n        'claim',\n        'clambake',\n        'clammy',\n        'clamor',\n        'clamp',\n        'clamshell',\n        'clang',\n        'clanking',\n        'clapped',\n        'clapper',\n        'clapping',\n        'clarify',\n        'clarinet',\n        'clarity',\n        'clash',\n        'clasp',\n        'class',\n        'clatter',\n        'clause',\n        'clavicle',\n        'claw',\n        'clay',\n        'clean',\n        'clear',\n        'cleat',\n        'cleaver',\n        'cleft',\n        'clench',\n        'clergyman',\n        'clerical',\n        'clerk',\n        'clever',\n        'clicker',\n        'client',\n        'climate',\n        'climatic',\n        'cling',\n        'clinic',\n        'clinking',\n        'clip',\n        'clique',\n        'cloak',\n        'clobber',\n        'clock',\n        'clone',\n        'cloning',\n        'closable',\n        'closure',\n        'clothes',\n        'clothing',\n        'cloud',\n        'clover',\n        'clubbed',\n        'clubbing',\n        'clubhouse',\n        'clump',\n        'clumsily',\n        'clumsy',\n        'clunky',\n        'clustered',\n        'clutch',\n        'clutter',\n        'coach',\n        'coagulant',\n        'coastal',\n        'coaster',\n        'coasting',\n        'coastland',\n        'coastline',\n        'coat',\n        'coauthor',\n        'cobalt',\n        'cobbler',\n        'cobweb',\n        'cocoa',\n        'coconut',\n        'cod',\n        'coeditor',\n        'coerce',\n        'coexist',\n        'coffee',\n        'cofounder',\n        'cognition',\n        'cognitive',\n        'cogwheel',\n        'coherence',\n        'coherent',\n        'cohesive',\n        'coil',\n        'coke',\n        'cola',\n        'cold',\n        'coleslaw',\n        'coliseum',\n        'collage',\n        'collapse',\n        'collar',\n        'collected',\n        'collector',\n        'collide',\n        'collie',\n        'collision',\n        'colonial',\n        'colonist',\n        'colonize',\n        'colony',\n        'colossal',\n        'colt',\n        'coma',\n        'come',\n        'comfort',\n        'comfy',\n        'comic',\n        'coming',\n        'comma',\n        'commence',\n        'commend',\n        'comment',\n        'commerce',\n        'commode',\n        'commodity',\n        'commodore',\n        'common',\n        'commotion',\n        'commute',\n        'commuting',\n        'compacted',\n        'compacter',\n        'compactly',\n        'compactor',\n        'companion',\n        'company',\n        'compare',\n        'compel',\n        'compile',\n        'comply',\n        'component',\n        'composed',\n        'composer',\n        'composite',\n        'compost',\n        'composure',\n        'compound',\n        'compress',\n        'comprised',\n        'computer',\n        'computing',\n        'comrade',\n        'concave',\n        'conceal',\n        'conceded',\n        'concept',\n        'concerned',\n        'concert',\n        'conch',\n        'concierge',\n        'concise',\n        'conclude',\n        'concrete',\n        'concur',\n        'condense',\n        'condiment',\n        'condition',\n        'condone',\n        'conducive',\n        'conductor',\n        'conduit',\n        'cone',\n        'confess',\n        'confetti',\n        'confidant',\n        'confident',\n        'confider',\n        'confiding',\n        'configure',\n        'confined',\n        'confining',\n        'confirm',\n        'conflict',\n        'conform',\n        'confound',\n        'confront',\n        'confused',\n        'confusing',\n        'confusion',\n        'congenial',\n        'congested',\n        'congrats',\n        'congress',\n        'conical',\n        'conjoined',\n        'conjure',\n        'conjuror',\n        'connected',\n        'connector',\n        'consensus',\n        'consent',\n        'console',\n        'consoling',\n        'consonant',\n        'constable',\n        'constant',\n        'constrain',\n        'constrict',\n        'construct',\n        'consult',\n        'consumer',\n        'consuming',\n        'contact',\n        'container',\n        'contempt',\n        'contend',\n        'contented',\n        'contently',\n        'contents',\n        'contest',\n        'context',\n        'contort',\n        'contour',\n        'contrite',\n        'control',\n        'contusion',\n        'convene',\n        'convent',\n        'copartner',\n        'cope',\n        'copied',\n        'copier',\n        'copilot',\n        'coping',\n        'copious',\n        'copper',\n        'copy',\n        'coral',\n        'cork',\n        'cornball',\n        'cornbread',\n        'corncob',\n        'cornea',\n        'corned',\n        'corner',\n        'cornfield',\n        'cornflake',\n        'cornhusk',\n        'cornmeal',\n        'cornstalk',\n        'corny',\n        'coronary',\n        'coroner',\n        'corporal',\n        'corporate',\n        'corral',\n        'correct',\n        'corridor',\n        'corrode',\n        'corroding',\n        'corrosive',\n        'corsage',\n        'corset',\n        'cortex',\n        'cosigner',\n        'cosmetics',\n        'cosmic',\n        'cosmos',\n        'cosponsor',\n        'cost',\n        'cottage',\n        'cotton',\n        'couch',\n        'cough',\n        'could',\n        'countable',\n        'countdown',\n        'counting',\n        'countless',\n        'country',\n        'county',\n        'courier',\n        'covenant',\n        'cover',\n        'coveted',\n        'coveting',\n        'coyness',\n        'cozily',\n        'coziness',\n        'cozy',\n        'crabbing',\n        'crabgrass',\n        'crablike',\n        'crabmeat',\n        'cradle',\n        'cradling',\n        'crafter',\n        'craftily',\n        'craftsman',\n        'craftwork',\n        'crafty',\n        'cramp',\n        'cranberry',\n        'crane',\n        'cranial',\n        'cranium',\n        'crank',\n        'crate',\n        'crave',\n        'craving',\n        'crawfish',\n        'crawlers',\n        'crawling',\n        'crayfish',\n        'crayon',\n        'crazed',\n        'crazily',\n        'craziness',\n        'crazy',\n        'creamed',\n        'creamer',\n        'creamlike',\n        'crease',\n        'creasing',\n        'creatable',\n        'create',\n        'creation',\n        'creative',\n        'creature',\n        'credible',\n        'credibly',\n        'credit',\n        'creed',\n        'creme',\n        'creole',\n        'crepe',\n        'crept',\n        'crescent',\n        'crested',\n        'cresting',\n        'crestless',\n        'crevice',\n        'crewless',\n        'crewman',\n        'crewmate',\n        'crib',\n        'cricket',\n        'cried',\n        'crier',\n        'crimp',\n        'crimson',\n        'cringe',\n        'cringing',\n        'crinkle',\n        'crinkly',\n        'crisped',\n        'crisping',\n        'crisply',\n        'crispness',\n        'crispy',\n        'criteria',\n        'critter',\n        'croak',\n        'crock',\n        'crook',\n        'croon',\n        'crop',\n        'cross',\n        'crouch',\n        'crouton',\n        'crowbar',\n        'crowd',\n        'crown',\n        'crucial',\n        'crudely',\n        'crudeness',\n        'cruelly',\n        'cruelness',\n        'cruelty',\n        'crumb',\n        'crummiest',\n        'crummy',\n        'crumpet',\n        'crumpled',\n        'cruncher',\n        'crunching',\n        'crunchy',\n        'crusader',\n        'crushable',\n        'crushed',\n        'crusher',\n        'crushing',\n        'crust',\n        'crux',\n        'crying',\n        'cryptic',\n        'crystal',\n        'cubbyhole',\n        'cube',\n        'cubical',\n        'cubicle',\n        'cucumber',\n        'cuddle',\n        'cuddly',\n        'cufflink',\n        'culinary',\n        'culminate',\n        'culpable',\n        'culprit',\n        'cultivate',\n        'cultural',\n        'culture',\n        'cupbearer',\n        'cupcake',\n        'cupid',\n        'cupped',\n        'cupping',\n        'curable',\n        'curator',\n        'curdle',\n        'cure',\n        'curfew',\n        'curing',\n        'curled',\n        'curler',\n        'curliness',\n        'curling',\n        'curly',\n        'curry',\n        'curse',\n        'cursive',\n        'cursor',\n        'curtain',\n        'curtly',\n        'curtsy',\n        'curvature',\n        'curve',\n        'curvy',\n        'cushy',\n        'cusp',\n        'cussed',\n        'custard',\n        'custodian',\n        'custody',\n        'customary',\n        'customer',\n        'customize',\n        'customs',\n        'cut',\n        'cycle',\n        'cyclic',\n        'cycling',\n        'cyclist',\n        'cylinder',\n        'cymbal',\n        'cytoplasm',\n        'cytoplast',\n        'dab',\n        'dad',\n        'daffodil',\n        'dagger',\n        'daily',\n        'daintily',\n        'dainty',\n        'dairy',\n        'daisy',\n        'dallying',\n        'dance',\n        'dancing',\n        'dandelion',\n        'dander',\n        'dandruff',\n        'dandy',\n        'danger',\n        'dangle',\n        'dangling',\n        'daredevil',\n        'dares',\n        'daringly',\n        'darkened',\n        'darkening',\n        'darkish',\n        'darkness',\n        'darkroom',\n        'darling',\n        'darn',\n        'dart',\n        'darwinism',\n        'dash',\n        'dastardly',\n        'data',\n        'datebook',\n        'dating',\n        'daughter',\n        'daunting',\n        'dawdler',\n        'dawn',\n        'daybed',\n        'daybreak',\n        'daycare',\n        'daydream',\n        'daylight',\n        'daylong',\n        'dayroom',\n        'daytime',\n        'dazzler',\n        'dazzling',\n        'deacon',\n        'deafening',\n        'deafness',\n        'dealer',\n        'dealing',\n        'dealmaker',\n        'dealt',\n        'dean',\n        'debatable',\n        'debate',\n        'debating',\n        'debit',\n        'debrief',\n        'debtless',\n        'debtor',\n        'debug',\n        'debunk',\n        'decade',\n        'decaf',\n        'decal',\n        'decathlon',\n        'decay',\n        'deceased',\n        'deceit',\n        'deceiver',\n        'deceiving',\n        'december',\n        'decency',\n        'decent',\n        'deception',\n        'deceptive',\n        'decibel',\n        'decidable',\n        'decimal',\n        'decimeter',\n        'decipher',\n        'deck',\n        'declared',\n        'decline',\n        'decode',\n        'decompose',\n        'decorated',\n        'decorator',\n        'decoy',\n        'decrease',\n        'decree',\n        'dedicate',\n        'dedicator',\n        'deduce',\n        'deduct',\n        'deed',\n        'deem',\n        'deepen',\n        'deeply',\n        'deepness',\n        'deface',\n        'defacing',\n        'defame',\n        'default',\n        'defeat',\n        'defection',\n        'defective',\n        'defendant',\n        'defender',\n        'defense',\n        'defensive',\n        'deferral',\n        'deferred',\n        'defiance',\n        'defiant',\n        'defile',\n        'defiling',\n        'define',\n        'definite',\n        'deflate',\n        'deflation',\n        'deflator',\n        'deflected',\n        'deflector',\n        'defog',\n        'deforest',\n        'defraud',\n        'defrost',\n        'deftly',\n        'defuse',\n        'defy',\n        'degraded',\n        'degrading',\n        'degrease',\n        'degree',\n        'dehydrate',\n        'deity',\n        'dejected',\n        'delay',\n        'delegate',\n        'delegator',\n        'delete',\n        'deletion',\n        'delicacy',\n        'delicate',\n        'delicious',\n        'delighted',\n        'delirious',\n        'delirium',\n        'deliverer',\n        'delivery',\n        'delouse',\n        'delta',\n        'deluge',\n        'delusion',\n        'deluxe',\n        'demanding',\n        'demeaning',\n        'demeanor',\n        'demise',\n        'democracy',\n        'democrat',\n        'demote',\n        'demotion',\n        'demystify',\n        'denatured',\n        'deniable',\n        'denial',\n        'denim',\n        'denote',\n        'dense',\n        'density',\n        'dental',\n        'dentist',\n        'denture',\n        'deny',\n        'deodorant',\n        'deodorize',\n        'departed',\n        'departure',\n        'depict',\n        'deplete',\n        'depletion',\n        'deplored',\n        'deploy',\n        'deport',\n        'depose',\n        'depraved',\n        'depravity',\n        'deprecate',\n        'depress',\n        'deprive',\n        'depth',\n        'deputize',\n        'deputy',\n        'derail',\n        'deranged',\n        'derby',\n        'derived',\n        'desecrate',\n        'deserve',\n        'deserving',\n        'designate',\n        'designed',\n        'designer',\n        'designing',\n        'deskbound',\n        'desktop',\n        'deskwork',\n        'desolate',\n        'despair',\n        'despise',\n        'despite',\n        'destiny',\n        'destitute',\n        'destruct',\n        'detached',\n        'detail',\n        'detection',\n        'detective',\n        'detector',\n        'detention',\n        'detergent',\n        'detest',\n        'detonate',\n        'detonator',\n        'detoxify',\n        'detract',\n        'deuce',\n        'devalue',\n        'deviancy',\n        'deviant',\n        'deviate',\n        'deviation',\n        'deviator',\n        'device',\n        'devious',\n        'devotedly',\n        'devotee',\n        'devotion',\n        'devourer',\n        'devouring',\n        'devoutly',\n        'dexterity',\n        'dexterous',\n        'diabetes',\n        'diabetic',\n        'diabolic',\n        'diagnoses',\n        'diagnosis',\n        'diagram',\n        'dial',\n        'diameter',\n        'diaper',\n        'diaphragm',\n        'diary',\n        'dice',\n        'dicing',\n        'dictate',\n        'dictation',\n        'dictator',\n        'difficult',\n        'diffused',\n        'diffuser',\n        'diffusion',\n        'diffusive',\n        'dig',\n        'dilation',\n        'diligence',\n        'diligent',\n        'dill',\n        'dilute',\n        'dime',\n        'diminish',\n        'dimly',\n        'dimmed',\n        'dimmer',\n        'dimness',\n        'dimple',\n        'diner',\n        'dingbat',\n        'dinghy',\n        'dinginess',\n        'dingo',\n        'dingy',\n        'dining',\n        'dinner',\n        'diocese',\n        'dioxide',\n        'diploma',\n        'dipped',\n        'dipper',\n        'dipping',\n        'directed',\n        'direction',\n        'directive',\n        'directly',\n        'directory',\n        'direness',\n        'dirtiness',\n        'disabled',\n        'disagree',\n        'disallow',\n        'disarm',\n        'disarray',\n        'disaster',\n        'disband',\n        'disbelief',\n        'disburse',\n        'discard',\n        'discern',\n        'discharge',\n        'disclose',\n        'discolor',\n        'discount',\n        'discourse',\n        'discover',\n        'discuss',\n        'disdain',\n        'disengage',\n        'disfigure',\n        'disgrace',\n        'dish',\n        'disinfect',\n        'disjoin',\n        'disk',\n        'dislike',\n        'disliking',\n        'dislocate',\n        'dislodge',\n        'disloyal',\n        'dismantle',\n        'dismay',\n        'dismiss',\n        'dismount',\n        'disobey',\n        'disorder',\n        'disown',\n        'disparate',\n        'disparity',\n        'dispatch',\n        'dispense',\n        'dispersal',\n        'dispersed',\n        'disperser',\n        'displace',\n        'display',\n        'displease',\n        'disposal',\n        'dispose',\n        'disprove',\n        'dispute',\n        'disregard',\n        'disrupt',\n        'dissuade',\n        'distance',\n        'distant',\n        'distaste',\n        'distill',\n        'distinct',\n        'distort',\n        'distract',\n        'distress',\n        'district',\n        'distrust',\n        'ditch',\n        'ditto',\n        'ditzy',\n        'dividable',\n        'divided',\n        'dividend',\n        'dividers',\n        'dividing',\n        'divinely',\n        'diving',\n        'divinity',\n        'divisible',\n        'divisibly',\n        'division',\n        'divisive',\n        'divorcee',\n        'dizziness',\n        'dizzy',\n        'doable',\n        'docile',\n        'dock',\n        'doctrine',\n        'document',\n        'dodge',\n        'dodgy',\n        'doily',\n        'doing',\n        'dole',\n        'dollar',\n        'dollhouse',\n        'dollop',\n        'dolly',\n        'dolphin',\n        'domain',\n        'domelike',\n        'domestic',\n        'dominion',\n        'dominoes',\n        'donated',\n        'donation',\n        'donator',\n        'donor',\n        'donut',\n        'doodle',\n        'doorbell',\n        'doorframe',\n        'doorknob',\n        'doorman',\n        'doormat',\n        'doornail',\n        'doorpost',\n        'doorstep',\n        'doorstop',\n        'doorway',\n        'doozy',\n        'dork',\n        'dormitory',\n        'dorsal',\n        'dosage',\n        'dose',\n        'dotted',\n        'doubling',\n        'douche',\n        'dove',\n        'down',\n        'dowry',\n        'doze',\n        'drab',\n        'dragging',\n        'dragonfly',\n        'dragonish',\n        'dragster',\n        'drainable',\n        'drainage',\n        'drained',\n        'drainer',\n        'drainpipe',\n        'dramatic',\n        'dramatize',\n        'drank',\n        'drapery',\n        'drastic',\n        'draw',\n        'dreaded',\n        'dreadful',\n        'dreadlock',\n        'dreamboat',\n        'dreamily',\n        'dreamland',\n        'dreamless',\n        'dreamlike',\n        'dreamt',\n        'dreamy',\n        'drearily',\n        'dreary',\n        'drench',\n        'dress',\n        'drew',\n        'dribble',\n        'dried',\n        'drier',\n        'drift',\n        'driller',\n        'drilling',\n        'drinkable',\n        'drinking',\n        'dripping',\n        'drippy',\n        'drivable',\n        'driven',\n        'driver',\n        'driveway',\n        'driving',\n        'drizzle',\n        'drizzly',\n        'drone',\n        'drool',\n        'droop',\n        'drop-down',\n        'dropbox',\n        'dropkick',\n        'droplet',\n        'dropout',\n        'dropper',\n        'drove',\n        'drown',\n        'drowsily',\n        'drudge',\n        'drum',\n        'dry',\n        'dubbed',\n        'dubiously',\n        'duchess',\n        'duckbill',\n        'ducking',\n        'duckling',\n        'ducktail',\n        'ducky',\n        'duct',\n        'dude',\n        'duffel',\n        'dugout',\n        'duh',\n        'duke',\n        'duller',\n        'dullness',\n        'duly',\n        'dumping',\n        'dumpling',\n        'dumpster',\n        'duo',\n        'dupe',\n        'duplex',\n        'duplicate',\n        'duplicity',\n        'durable',\n        'durably',\n        'duration',\n        'duress',\n        'during',\n        'dusk',\n        'dust',\n        'dutiful',\n        'duty',\n        'duvet',\n        'dwarf',\n        'dweeb',\n        'dwelled',\n        'dweller',\n        'dwelling',\n        'dwindle',\n        'dwindling',\n        'dynamic',\n        'dynamite',\n        'dynasty',\n        'dyslexia',\n        'dyslexic',\n        'each',\n        'eagle',\n        'earache',\n        'eardrum',\n        'earflap',\n        'earful',\n        'earlobe',\n        'early',\n        'earmark',\n        'earmuff',\n        'earphone',\n        'earpiece',\n        'earplugs',\n        'earring',\n        'earshot',\n        'earthen',\n        'earthlike',\n        'earthling',\n        'earthly',\n        'earthworm',\n        'earthy',\n        'earwig',\n        'easeful',\n        'easel',\n        'easiest',\n        'easily',\n        'easiness',\n        'easing',\n        'eastbound',\n        'eastcoast',\n        'easter',\n        'eastward',\n        'eatable',\n        'eaten',\n        'eatery',\n        'eating',\n        'eats',\n        'ebay',\n        'ebony',\n        'ebook',\n        'ecard',\n        'eccentric',\n        'echo',\n        'eclair',\n        'eclipse',\n        'ecologist',\n        'ecology',\n        'economic',\n        'economist',\n        'economy',\n        'ecosphere',\n        'ecosystem',\n        'edge',\n        'edginess',\n        'edging',\n        'edgy',\n        'edition',\n        'editor',\n        'educated',\n        'education',\n        'educator',\n        'eel',\n        'effective',\n        'effects',\n        'efficient',\n        'effort',\n        'eggbeater',\n        'egging',\n        'eggnog',\n        'eggplant',\n        'eggshell',\n        'egomaniac',\n        'egotism',\n        'egotistic',\n        'either',\n        'eject',\n        'elaborate',\n        'elastic',\n        'elated',\n        'elbow',\n        'eldercare',\n        'elderly',\n        'eldest',\n        'electable',\n        'election',\n        'elective',\n        'elephant',\n        'elevate',\n        'elevating',\n        'elevation',\n        'elevator',\n        'eleven',\n        'elf',\n        'eligible',\n        'eligibly',\n        'eliminate',\n        'elite',\n        'elitism',\n        'elixir',\n        'elk',\n        'ellipse',\n        'elliptic',\n        'elm',\n        'elongated',\n        'elope',\n        'eloquence',\n        'eloquent',\n        'elsewhere',\n        'elude',\n        'elusive',\n        'elves',\n        'email',\n        'embargo',\n        'embark',\n        'embassy',\n        'embattled',\n        'embellish',\n        'ember',\n        'embezzle',\n        'emblaze',\n        'emblem',\n        'embody',\n        'embolism',\n        'emboss',\n        'embroider',\n        'emcee',\n        'emerald',\n        'emergency',\n        'emission',\n        'emit',\n        'emote',\n        'emoticon',\n        'emotion',\n        'empathic',\n        'empathy',\n        'emperor',\n        'emphases',\n        'emphasis',\n        'emphasize',\n        'emphatic',\n        'empirical',\n        'employed',\n        'employee',\n        'employer',\n        'emporium',\n        'empower',\n        'emptier',\n        'emptiness',\n        'empty',\n        'emu',\n        'enable',\n        'enactment',\n        'enamel',\n        'enchanted',\n        'enchilada',\n        'encircle',\n        'enclose',\n        'enclosure',\n        'encode',\n        'encore',\n        'encounter',\n        'encourage',\n        'encroach',\n        'encrust',\n        'encrypt',\n        'endanger',\n        'endeared',\n        'endearing',\n        'ended',\n        'ending',\n        'endless',\n        'endnote',\n        'endocrine',\n        'endorphin',\n        'endorse',\n        'endowment',\n        'endpoint',\n        'endurable',\n        'endurance',\n        'enduring',\n        'energetic',\n        'energize',\n        'energy',\n        'enforced',\n        'enforcer',\n        'engaged',\n        'engaging',\n        'engine',\n        'engorge',\n        'engraved',\n        'engraver',\n        'engraving',\n        'engross',\n        'engulf',\n        'enhance',\n        'enigmatic',\n        'enjoyable',\n        'enjoyably',\n        'enjoyer',\n        'enjoying',\n        'enjoyment',\n        'enlarged',\n        'enlarging',\n        'enlighten',\n        'enlisted',\n        'enquirer',\n        'enrage',\n        'enrich',\n        'enroll',\n        'enslave',\n        'ensnare',\n        'ensure',\n        'entail',\n        'entangled',\n        'entering',\n        'entertain',\n        'enticing',\n        'entire',\n        'entitle',\n        'entity',\n        'entomb',\n        'entourage',\n        'entrap',\n        'entree',\n        'entrench',\n        'entrust',\n        'entryway',\n        'entwine',\n        'enunciate',\n        'envelope',\n        'enviable',\n        'enviably',\n        'envious',\n        'envision',\n        'envoy',\n        'envy',\n        'enzyme',\n        'epic',\n        'epidemic',\n        'epidermal',\n        'epidermis',\n        'epidural',\n        'epilepsy',\n        'epileptic',\n        'epilogue',\n        'epiphany',\n        'episode',\n        'equal',\n        'equate',\n        'equation',\n        'equator',\n        'equinox',\n        'equipment',\n        'equity',\n        'equivocal',\n        'eradicate',\n        'erasable',\n        'erased',\n        'eraser',\n        'erasure',\n        'ergonomic',\n        'errand',\n        'errant',\n        'erratic',\n        'error',\n        'erupt',\n        'escalate',\n        'escalator',\n        'escapable',\n        'escapade',\n        'escapist',\n        'escargot',\n        'eskimo',\n        'esophagus',\n        'espionage',\n        'espresso',\n        'esquire',\n        'essay',\n        'essence',\n        'essential',\n        'establish',\n        'estate',\n        'esteemed',\n        'estimate',\n        'estimator',\n        'estranged',\n        'estrogen',\n        'etching',\n        'eternal',\n        'eternity',\n        'ethanol',\n        'ether',\n        'ethically',\n        'ethics',\n        'euphemism',\n        'evacuate',\n        'evacuee',\n        'evade',\n        'evaluate',\n        'evaluator',\n        'evaporate',\n        'evasion',\n        'evasive',\n        'even',\n        'everglade',\n        'evergreen',\n        'everybody',\n        'everyday',\n        'everyone',\n        'evict',\n        'evidence',\n        'evident',\n        'evil',\n        'evoke',\n        'evolution',\n        'evolve',\n        'exact',\n        'exalted',\n        'example',\n        'excavate',\n        'excavator',\n        'exceeding',\n        'exception',\n        'excess',\n        'exchange',\n        'excitable',\n        'exciting',\n        'exclaim',\n        'exclude',\n        'excluding',\n        'exclusion',\n        'exclusive',\n        'excretion',\n        'excretory',\n        'excursion',\n        'excusable',\n        'excusably',\n        'excuse',\n        'exemplary',\n        'exemplify',\n        'exemption',\n        'exerciser',\n        'exert',\n        'exes',\n        'exfoliate',\n        'exhale',\n        'exhaust',\n        'exhume',\n        'exile',\n        'existing',\n        'exit',\n        'exodus',\n        'exonerate',\n        'exorcism',\n        'exorcist',\n        'expand',\n        'expanse',\n        'expansion',\n        'expansive',\n        'expectant',\n        'expedited',\n        'expediter',\n        'expel',\n        'expend',\n        'expenses',\n        'expensive',\n        'expert',\n        'expire',\n        'expiring',\n        'explain',\n        'expletive',\n        'explicit',\n        'explode',\n        'exploit',\n        'explore',\n        'exploring',\n        'exponent',\n        'exporter',\n        'exposable',\n        'expose',\n        'exposure',\n        'express',\n        'expulsion',\n        'exquisite',\n        'extended',\n        'extending',\n        'extent',\n        'extenuate',\n        'exterior',\n        'external',\n        'extinct',\n        'extortion',\n        'extradite',\n        'extras',\n        'extrovert',\n        'extrude',\n        'extruding',\n        'exuberant',\n        'fable',\n        'fabric',\n        'fabulous',\n        'facebook',\n        'facecloth',\n        'facedown',\n        'faceless',\n        'facelift',\n        'faceplate',\n        'faceted',\n        'facial',\n        'facility',\n        'facing',\n        'facsimile',\n        'faction',\n        'factoid',\n        'factor',\n        'factsheet',\n        'factual',\n        'faculty',\n        'fade',\n        'fading',\n        'failing',\n        'falcon',\n        'fall',\n        'false',\n        'falsify',\n        'fame',\n        'familiar',\n        'family',\n        'famine',\n        'famished',\n        'fanatic',\n        'fancied',\n        'fanciness',\n        'fancy',\n        'fanfare',\n        'fang',\n        'fanning',\n        'fantasize',\n        'fantastic',\n        'fantasy',\n        'fascism',\n        'fastball',\n        'faster',\n        'fasting',\n        'fastness',\n        'faucet',\n        'favorable',\n        'favorably',\n        'favored',\n        'favoring',\n        'favorite',\n        'fax',\n        'feast',\n        'federal',\n        'fedora',\n        'feeble',\n        'feed',\n        'feel',\n        'feisty',\n        'feline',\n        'felt-tip',\n        'feminine',\n        'feminism',\n        'feminist',\n        'feminize',\n        'femur',\n        'fence',\n        'fencing',\n        'fender',\n        'ferment',\n        'fernlike',\n        'ferocious',\n        'ferocity',\n        'ferret',\n        'ferris',\n        'ferry',\n        'fervor',\n        'fester',\n        'festival',\n        'festive',\n        'festivity',\n        'fetal',\n        'fetch',\n        'fever',\n        'fiber',\n        'fiction',\n        'fiddle',\n        'fiddling',\n        'fidelity',\n        'fidgeting',\n        'fidgety',\n        'fifteen',\n        'fifth',\n        'fiftieth',\n        'fifty',\n        'figment',\n        'figure',\n        'figurine',\n        'filing',\n        'filled',\n        'filler',\n        'filling',\n        'film',\n        'filter',\n        'filth',\n        'filtrate',\n        'finale',\n        'finalist',\n        'finalize',\n        'finally',\n        'finance',\n        'financial',\n        'finch',\n        'fineness',\n        'finer',\n        'finicky',\n        'finished',\n        'finisher',\n        'finishing',\n        'finite',\n        'finless',\n        'finlike',\n        'fiscally',\n        'fit',\n        'five',\n        'flaccid',\n        'flagman',\n        'flagpole',\n        'flagship',\n        'flagstick',\n        'flagstone',\n        'flail',\n        'flakily',\n        'flaky',\n        'flame',\n        'flammable',\n        'flanked',\n        'flanking',\n        'flannels',\n        'flap',\n        'flaring',\n        'flashback',\n        'flashbulb',\n        'flashcard',\n        'flashily',\n        'flashing',\n        'flashy',\n        'flask',\n        'flatbed',\n        'flatfoot',\n        'flatly',\n        'flatness',\n        'flatten',\n        'flattered',\n        'flatterer',\n        'flattery',\n        'flattop',\n        'flatware',\n        'flatworm',\n        'flavored',\n        'flavorful',\n        'flavoring',\n        'flaxseed',\n        'fled',\n        'fleshed',\n        'fleshy',\n        'flick',\n        'flier',\n        'flight',\n        'flinch',\n        'fling',\n        'flint',\n        'flip',\n        'flirt',\n        'float',\n        'flock',\n        'flogging',\n        'flop',\n        'floral',\n        'florist',\n        'floss',\n        'flounder',\n        'flyable',\n        'flyaway',\n        'flyer',\n        'flying',\n        'flyover',\n        'flypaper',\n        'foam',\n        'foe',\n        'fog',\n        'foil',\n        'folic',\n        'folk',\n        'follicle',\n        'follow',\n        'fondling',\n        'fondly',\n        'fondness',\n        'fondue',\n        'font',\n        'food',\n        'fool',\n        'footage',\n        'football',\n        'footbath',\n        'footboard',\n        'footer',\n        'footgear',\n        'foothill',\n        'foothold',\n        'footing',\n        'footless',\n        'footman',\n        'footnote',\n        'footpad',\n        'footpath',\n        'footprint',\n        'footrest',\n        'footsie',\n        'footsore',\n        'footwear',\n        'footwork',\n        'fossil',\n        'foster',\n        'founder',\n        'founding',\n        'fountain',\n        'fox',\n        'foyer',\n        'fraction',\n        'fracture',\n        'fragile',\n        'fragility',\n        'fragment',\n        'fragrance',\n        'fragrant',\n        'frail',\n        'frame',\n        'framing',\n        'frantic',\n        'fraternal',\n        'frayed',\n        'fraying',\n        'frays',\n        'freckled',\n        'freckles',\n        'freebase',\n        'freebee',\n        'freebie',\n        'freedom',\n        'freefall',\n        'freehand',\n        'freeing',\n        'freeload',\n        'freely',\n        'freemason',\n        'freeness',\n        'freestyle',\n        'freeware',\n        'freeway',\n        'freewill',\n        'freezable',\n        'freezing',\n        'freight',\n        'french',\n        'frenzied',\n        'frenzy',\n        'frequency',\n        'frequent',\n        'fresh',\n        'fretful',\n        'fretted',\n        'friction',\n        'friday',\n        'fridge',\n        'fried',\n        'friend',\n        'frighten',\n        'frightful',\n        'frigidity',\n        'frigidly',\n        'frill',\n        'fringe',\n        'frisbee',\n        'frisk',\n        'fritter',\n        'frivolous',\n        'frolic',\n        'from',\n        'front',\n        'frostbite',\n        'frosted',\n        'frostily',\n        'frosting',\n        'frostlike',\n        'frosty',\n        'froth',\n        'frown',\n        'frozen',\n        'fructose',\n        'frugality',\n        'frugally',\n        'fruit',\n        'frustrate',\n        'frying',\n        'gab',\n        'gaffe',\n        'gag',\n        'gainfully',\n        'gaining',\n        'gains',\n        'gala',\n        'gallantly',\n        'galleria',\n        'gallery',\n        'galley',\n        'gallon',\n        'gallows',\n        'gallstone',\n        'galore',\n        'galvanize',\n        'gambling',\n        'game',\n        'gaming',\n        'gamma',\n        'gander',\n        'gangly',\n        'gangrene',\n        'gangway',\n        'gap',\n        'garage',\n        'garbage',\n        'garden',\n        'gargle',\n        'garland',\n        'garlic',\n        'garment',\n        'garnet',\n        'garnish',\n        'garter',\n        'gas',\n        'gatherer',\n        'gathering',\n        'gating',\n        'gauging',\n        'gauntlet',\n        'gauze',\n        'gave',\n        'gawk',\n        'gazing',\n        'gear',\n        'gecko',\n        'geek',\n        'geiger',\n        'gem',\n        'gender',\n        'generic',\n        'generous',\n        'genetics',\n        'genre',\n        'gentile',\n        'gentleman',\n        'gently',\n        'gents',\n        'geography',\n        'geologic',\n        'geologist',\n        'geology',\n        'geometric',\n        'geometry',\n        'geranium',\n        'gerbil',\n        'geriatric',\n        'germicide',\n        'germinate',\n        'germless',\n        'germproof',\n        'gestate',\n        'gestation',\n        'gesture',\n        'getaway',\n        'getting',\n        'getup',\n        'giant',\n        'gibberish',\n        'giblet',\n        'giddily',\n        'giddiness',\n        'giddy',\n        'gift',\n        'gigabyte',\n        'gigahertz',\n        'gigantic',\n        'giggle',\n        'giggling',\n        'giggly',\n        'gigolo',\n        'gilled',\n        'gills',\n        'gimmick',\n        'girdle',\n        'giveaway',\n        'given',\n        'giver',\n        'giving',\n        'gizmo',\n        'gizzard',\n        'glacial',\n        'glacier',\n        'glade',\n        'gladiator',\n        'gladly',\n        'glamorous',\n        'glamour',\n        'glance',\n        'glancing',\n        'glandular',\n        'glare',\n        'glaring',\n        'glass',\n        'glaucoma',\n        'glazing',\n        'gleaming',\n        'gleeful',\n        'glider',\n        'gliding',\n        'glimmer',\n        'glimpse',\n        'glisten',\n        'glitch',\n        'glitter',\n        'glitzy',\n        'gloater',\n        'gloating',\n        'gloomily',\n        'gloomy',\n        'glorified',\n        'glorifier',\n        'glorify',\n        'glorious',\n        'glory',\n        'gloss',\n        'glove',\n        'glowing',\n        'glowworm',\n        'glucose',\n        'glue',\n        'gluten',\n        'glutinous',\n        'glutton',\n        'gnarly',\n        'gnat',\n        'goal',\n        'goatskin',\n        'goes',\n        'goggles',\n        'going',\n        'goldfish',\n        'goldmine',\n        'goldsmith',\n        'golf',\n        'goliath',\n        'gonad',\n        'gondola',\n        'gone',\n        'gong',\n        'good',\n        'gooey',\n        'goofball',\n        'goofiness',\n        'goofy',\n        'google',\n        'goon',\n        'gopher',\n        'gore',\n        'gorged',\n        'gorgeous',\n        'gory',\n        'gosling',\n        'gossip',\n        'gothic',\n        'gotten',\n        'gout',\n        'gown',\n        'grab',\n        'graceful',\n        'graceless',\n        'gracious',\n        'gradation',\n        'graded',\n        'grader',\n        'gradient',\n        'grading',\n        'gradually',\n        'graduate',\n        'graffiti',\n        'grafted',\n        'grafting',\n        'grain',\n        'granddad',\n        'grandkid',\n        'grandly',\n        'grandma',\n        'grandpa',\n        'grandson',\n        'granite',\n        'granny',\n        'granola',\n        'grant',\n        'granular',\n        'grape',\n        'graph',\n        'grapple',\n        'grappling',\n        'grasp',\n        'grass',\n        'gratified',\n        'gratify',\n        'grating',\n        'gratitude',\n        'gratuity',\n        'gravel',\n        'graveness',\n        'graves',\n        'graveyard',\n        'gravitate',\n        'gravity',\n        'gravy',\n        'gray',\n        'grazing',\n        'greasily',\n        'greedily',\n        'greedless',\n        'greedy',\n        'green',\n        'greeter',\n        'greeting',\n        'grew',\n        'greyhound',\n        'grid',\n        'grief',\n        'grievance',\n        'grieving',\n        'grievous',\n        'grill',\n        'grimace',\n        'grimacing',\n        'grime',\n        'griminess',\n        'grimy',\n        'grinch',\n        'grinning',\n        'grip',\n        'gristle',\n        'grit',\n        'groggily',\n        'groggy',\n        'groin',\n        'groom',\n        'groove',\n        'grooving',\n        'groovy',\n        'grope',\n        'ground',\n        'grouped',\n        'grout',\n        'grove',\n        'grower',\n        'growing',\n        'growl',\n        'grub',\n        'grudge',\n        'grudging',\n        'grueling',\n        'gruffly',\n        'grumble',\n        'grumbling',\n        'grumbly',\n        'grumpily',\n        'grunge',\n        'grunt',\n        'guacamole',\n        'guidable',\n        'guidance',\n        'guide',\n        'guiding',\n        'guileless',\n        'guise',\n        'gulf',\n        'gullible',\n        'gully',\n        'gulp',\n        'gumball',\n        'gumdrop',\n        'gumminess',\n        'gumming',\n        'gummy',\n        'gurgle',\n        'gurgling',\n        'guru',\n        'gush',\n        'gusto',\n        'gusty',\n        'gutless',\n        'guts',\n        'gutter',\n        'guy',\n        'guzzler',\n        'gyration',\n        'habitable',\n        'habitant',\n        'habitat',\n        'habitual',\n        'hacked',\n        'hacker',\n        'hacking',\n        'hacksaw',\n        'had',\n        'haggler',\n        'haiku',\n        'half',\n        'halogen',\n        'halt',\n        'halved',\n        'halves',\n        'hamburger',\n        'hamlet',\n        'hammock',\n        'hamper',\n        'hamster',\n        'hamstring',\n        'handbag',\n        'handball',\n        'handbook',\n        'handbrake',\n        'handcart',\n        'handclap',\n        'handclasp',\n        'handcraft',\n        'handcuff',\n        'handed',\n        'handful',\n        'handgrip',\n        'handgun',\n        'handheld',\n        'handiness',\n        'handiwork',\n        'handlebar',\n        'handled',\n        'handler',\n        'handling',\n        'handmade',\n        'handoff',\n        'handpick',\n        'handprint',\n        'handrail',\n        'handsaw',\n        'handset',\n        'handsfree',\n        'handshake',\n        'handstand',\n        'handwash',\n        'handwork',\n        'handwoven',\n        'handwrite',\n        'handyman',\n        'hangnail',\n        'hangout',\n        'hangover',\n        'hangup',\n        'hankering',\n        'hankie',\n        'hanky',\n        'haphazard',\n        'happening',\n        'happier',\n        'happiest',\n        'happily',\n        'happiness',\n        'happy',\n        'harbor',\n        'hardcopy',\n        'hardcore',\n        'hardcover',\n        'harddisk',\n        'hardened',\n        'hardener',\n        'hardening',\n        'hardhat',\n        'hardhead',\n        'hardiness',\n        'hardly',\n        'hardness',\n        'hardship',\n        'hardware',\n        'hardwired',\n        'hardwood',\n        'hardy',\n        'harmful',\n        'harmless',\n        'harmonica',\n        'harmonics',\n        'harmonize',\n        'harmony',\n        'harness',\n        'harpist',\n        'harsh',\n        'harvest',\n        'hash',\n        'hassle',\n        'haste',\n        'hastily',\n        'hastiness',\n        'hasty',\n        'hatbox',\n        'hatchback',\n        'hatchery',\n        'hatchet',\n        'hatching',\n        'hatchling',\n        'hate',\n        'hatless',\n        'hatred',\n        'haunt',\n        'haven',\n        'hazard',\n        'hazelnut',\n        'hazily',\n        'haziness',\n        'hazing',\n        'hazy',\n        'headache',\n        'headband',\n        'headboard',\n        'headcount',\n        'headdress',\n        'headed',\n        'header',\n        'headfirst',\n        'headgear',\n        'heading',\n        'headlamp',\n        'headless',\n        'headlock',\n        'headphone',\n        'headpiece',\n        'headrest',\n        'headroom',\n        'headscarf',\n        'headset',\n        'headsman',\n        'headstand',\n        'headstone',\n        'headway',\n        'headwear',\n        'heap',\n        'heat',\n        'heave',\n        'heavily',\n        'heaviness',\n        'heaving',\n        'hedge',\n        'hedging',\n        'heftiness',\n        'hefty',\n        'helium',\n        'helmet',\n        'helper',\n        'helpful',\n        'helping',\n        'helpless',\n        'helpline',\n        'hemlock',\n        'hemstitch',\n        'hence',\n        'henchman',\n        'henna',\n        'herald',\n        'herbal',\n        'herbicide',\n        'herbs',\n        'heritage',\n        'hermit',\n        'heroics',\n        'heroism',\n        'herring',\n        'herself',\n        'hertz',\n        'hesitancy',\n        'hesitant',\n        'hesitate',\n        'hexagon',\n        'hexagram',\n        'hubcap',\n        'huddle',\n        'huddling',\n        'huff',\n        'hug',\n        'hula',\n        'hulk',\n        'hull',\n        'human',\n        'humble',\n        'humbling',\n        'humbly',\n        'humid',\n        'humiliate',\n        'humility',\n        'humming',\n        'hummus',\n        'humongous',\n        'humorist',\n        'humorless',\n        'humorous',\n        'humpback',\n        'humped',\n        'humvee',\n        'hunchback',\n        'hundredth',\n        'hunger',\n        'hungrily',\n        'hungry',\n        'hunk',\n        'hunter',\n        'hunting',\n        'huntress',\n        'huntsman',\n        'hurdle',\n        'hurled',\n        'hurler',\n        'hurling',\n        'hurray',\n        'hurricane',\n        'hurried',\n        'hurry',\n        'hurt',\n        'husband',\n        'hush',\n        'husked',\n        'huskiness',\n        'hut',\n        'hybrid',\n        'hydrant',\n        'hydrated',\n        'hydration',\n        'hydrogen',\n        'hydroxide',\n        'hyperlink',\n        'hypertext',\n        'hyphen',\n        'hypnoses',\n        'hypnosis',\n        'hypnotic',\n        'hypnotism',\n        'hypnotist',\n        'hypnotize',\n        'hypocrisy',\n        'hypocrite',\n        'ibuprofen',\n        'ice',\n        'iciness',\n        'icing',\n        'icky',\n        'icon',\n        'icy',\n        'idealism',\n        'idealist',\n        'idealize',\n        'ideally',\n        'idealness',\n        'identical',\n        'identify',\n        'identity',\n        'ideology',\n        'idiocy',\n        'idiom',\n        'idly',\n        'igloo',\n        'ignition',\n        'ignore',\n        'iguana',\n        'illicitly',\n        'illusion',\n        'illusive',\n        'image',\n        'imaginary',\n        'imagines',\n        'imaging',\n        'imbecile',\n        'imitate',\n        'imitation',\n        'immature',\n        'immerse',\n        'immersion',\n        'imminent',\n        'immobile',\n        'immodest',\n        'immorally',\n        'immortal',\n        'immovable',\n        'immovably',\n        'immunity',\n        'immunize',\n        'impaired',\n        'impale',\n        'impart',\n        'impatient',\n        'impeach',\n        'impeding',\n        'impending',\n        'imperfect',\n        'imperial',\n        'impish',\n        'implant',\n        'implement',\n        'implicate',\n        'implicit',\n        'implode',\n        'implosion',\n        'implosive',\n        'imply',\n        'impolite',\n        'important',\n        'importer',\n        'impose',\n        'imposing',\n        'impotence',\n        'impotency',\n        'impotent',\n        'impound',\n        'imprecise',\n        'imprint',\n        'imprison',\n        'impromptu',\n        'improper',\n        'improve',\n        'improving',\n        'improvise',\n        'imprudent',\n        'impulse',\n        'impulsive',\n        'impure',\n        'impurity',\n        'iodine',\n        'iodize',\n        'ion',\n        'ipad',\n        'iphone',\n        'ipod',\n        'irate',\n        'irk',\n        'iron',\n        'irregular',\n        'irrigate',\n        'irritable',\n        'irritably',\n        'irritant',\n        'irritate',\n        'islamic',\n        'islamist',\n        'isolated',\n        'isolating',\n        'isolation',\n        'isotope',\n        'issue',\n        'issuing',\n        'italicize',\n        'italics',\n        'item',\n        'itinerary',\n        'itunes',\n        'ivory',\n        'ivy',\n        'jab',\n        'jackal',\n        'jacket',\n        'jackknife',\n        'jackpot',\n        'jailbird',\n        'jailbreak',\n        'jailer',\n        'jailhouse',\n        'jalapeno',\n        'jam',\n        'janitor',\n        'january',\n        'jargon',\n        'jarring',\n        'jasmine',\n        'jaundice',\n        'jaunt',\n        'java',\n        'jawed',\n        'jawless',\n        'jawline',\n        'jaws',\n        'jaybird',\n        'jaywalker',\n        'jazz',\n        'jeep',\n        'jeeringly',\n        'jellied',\n        'jelly',\n        'jersey',\n        'jester',\n        'jet',\n        'jiffy',\n        'jigsaw',\n        'jimmy',\n        'jingle',\n        'jingling',\n        'jinx',\n        'jitters',\n        'jittery',\n        'job',\n        'jockey',\n        'jockstrap',\n        'jogger',\n        'jogging',\n        'john',\n        'joining',\n        'jokester',\n        'jokingly',\n        'jolliness',\n        'jolly',\n        'jolt',\n        'jot',\n        'jovial',\n        'joyfully',\n        'joylessly',\n        'joyous',\n        'joyride',\n        'joystick',\n        'jubilance',\n        'jubilant',\n        'judge',\n        'judgingly',\n        'judicial',\n        'judiciary',\n        'judo',\n        'juggle',\n        'juggling',\n        'jugular',\n        'juice',\n        'juiciness',\n        'juicy',\n        'jujitsu',\n        'jukebox',\n        'july',\n        'jumble',\n        'jumbo',\n        'jump',\n        'junction',\n        'juncture',\n        'june',\n        'junior',\n        'juniper',\n        'junkie',\n        'junkman',\n        'junkyard',\n        'jurist',\n        'juror',\n        'jury',\n        'justice',\n        'justifier',\n        'justify',\n        'justly',\n        'justness',\n        'juvenile',\n        'kabob',\n        'kangaroo',\n        'karaoke',\n        'karate',\n        'karma',\n        'kebab',\n        'keenly',\n        'keenness',\n        'keep',\n        'keg',\n        'kelp',\n        'kennel',\n        'kept',\n        'kerchief',\n        'kerosene',\n        'kettle',\n        'kick',\n        'kiln',\n        'kilobyte',\n        'kilogram',\n        'kilometer',\n        'kilowatt',\n        'kilt',\n        'kimono',\n        'kindle',\n        'kindling',\n        'kindly',\n        'kindness',\n        'kindred',\n        'kinetic',\n        'kinfolk',\n        'king',\n        'kinship',\n        'kinsman',\n        'kinswoman',\n        'kissable',\n        'kisser',\n        'kissing',\n        'kitchen',\n        'kite',\n        'kitten',\n        'kitty',\n        'kiwi',\n        'kleenex',\n        'knapsack',\n        'knee',\n        'knelt',\n        'knickers',\n        'knoll',\n        'koala',\n        'kooky',\n        'kosher',\n        'krypton',\n        'kudos',\n        'kung',\n        'labored',\n        'laborer',\n        'laboring',\n        'laborious',\n        'labrador',\n        'ladder',\n        'ladies',\n        'ladle',\n        'ladybug',\n        'ladylike',\n        'lagged',\n        'lagging',\n        'lagoon',\n        'lair',\n        'lake',\n        'lance',\n        'landed',\n        'landfall',\n        'landfill',\n        'landing',\n        'landlady',\n        'landless',\n        'landline',\n        'landlord',\n        'landmark',\n        'landmass',\n        'landmine',\n        'landowner',\n        'landscape',\n        'landside',\n        'landslide',\n        'language',\n        'lankiness',\n        'lanky',\n        'lantern',\n        'lapdog',\n        'lapel',\n        'lapped',\n        'lapping',\n        'laptop',\n        'lard',\n        'large',\n        'lark',\n        'lash',\n        'lasso',\n        'last',\n        'latch',\n        'late',\n        'lather',\n        'latitude',\n        'latrine',\n        'latter',\n        'latticed',\n        'launch',\n        'launder',\n        'laundry',\n        'laurel',\n        'lavender',\n        'lavish',\n        'laxative',\n        'lazily',\n        'laziness',\n        'lazy',\n        'lecturer',\n        'left',\n        'legacy',\n        'legal',\n        'legend',\n        'legged',\n        'leggings',\n        'legible',\n        'legibly',\n        'legislate',\n        'lego',\n        'legroom',\n        'legume',\n        'legwarmer',\n        'legwork',\n        'lemon',\n        'lend',\n        'length',\n        'lens',\n        'lent',\n        'leotard',\n        'lesser',\n        'letdown',\n        'lethargic',\n        'lethargy',\n        'letter',\n        'lettuce',\n        'level',\n        'leverage',\n        'levers',\n        'levitate',\n        'levitator',\n        'liability',\n        'liable',\n        'liberty',\n        'librarian',\n        'library',\n        'licking',\n        'licorice',\n        'lid',\n        'life',\n        'lifter',\n        'lifting',\n        'liftoff',\n        'ligament',\n        'likely',\n        'likeness',\n        'likewise',\n        'liking',\n        'lilac',\n        'lilly',\n        'lily',\n        'limb',\n        'limeade',\n        'limelight',\n        'limes',\n        'limit',\n        'limping',\n        'limpness',\n        'line',\n        'lingo',\n        'linguini',\n        'linguist',\n        'lining',\n        'linked',\n        'linoleum',\n        'linseed',\n        'lint',\n        'lion',\n        'lip',\n        'liquefy',\n        'liqueur',\n        'liquid',\n        'lisp',\n        'list',\n        'litigate',\n        'litigator',\n        'litmus',\n        'litter',\n        'little',\n        'livable',\n        'lived',\n        'lively',\n        'liver',\n        'livestock',\n        'lividly',\n        'living',\n        'lizard',\n        'lubricant',\n        'lubricate',\n        'lucid',\n        'luckily',\n        'luckiness',\n        'luckless',\n        'lucrative',\n        'ludicrous',\n        'lugged',\n        'lukewarm',\n        'lullaby',\n        'lumber',\n        'luminance',\n        'luminous',\n        'lumpiness',\n        'lumping',\n        'lumpish',\n        'lunacy',\n        'lunar',\n        'lunchbox',\n        'luncheon',\n        'lunchroom',\n        'lunchtime',\n        'lung',\n        'lurch',\n        'lure',\n        'luridness',\n        'lurk',\n        'lushly',\n        'lushness',\n        'luster',\n        'lustfully',\n        'lustily',\n        'lustiness',\n        'lustrous',\n        'lusty',\n        'luxurious',\n        'luxury',\n        'lying',\n        'lyrically',\n        'lyricism',\n        'lyricist',\n        'lyrics',\n        'macarena',\n        'macaroni',\n        'macaw',\n        'mace',\n        'machine',\n        'machinist',\n        'magazine',\n        'magenta',\n        'maggot',\n        'magical',\n        'magician',\n        'magma',\n        'magnesium',\n        'magnetic',\n        'magnetism',\n        'magnetize',\n        'magnifier',\n        'magnify',\n        'magnitude',\n        'magnolia',\n        'mahogany',\n        'maimed',\n        'majestic',\n        'majesty',\n        'majorette',\n        'majority',\n        'makeover',\n        'maker',\n        'makeshift',\n        'making',\n        'malformed',\n        'malt',\n        'mama',\n        'mammal',\n        'mammary',\n        'mammogram',\n        'manager',\n        'managing',\n        'manatee',\n        'mandarin',\n        'mandate',\n        'mandatory',\n        'mandolin',\n        'manger',\n        'mangle',\n        'mango',\n        'mangy',\n        'manhandle',\n        'manhole',\n        'manhood',\n        'manhunt',\n        'manicotti',\n        'manicure',\n        'manifesto',\n        'manila',\n        'mankind',\n        'manlike',\n        'manliness',\n        'manly',\n        'manmade',\n        'manned',\n        'mannish',\n        'manor',\n        'manpower',\n        'mantis',\n        'mantra',\n        'manual',\n        'many',\n        'map',\n        'marathon',\n        'marauding',\n        'marbled',\n        'marbles',\n        'marbling',\n        'march',\n        'mardi',\n        'margarine',\n        'margarita',\n        'margin',\n        'marigold',\n        'marina',\n        'marine',\n        'marital',\n        'maritime',\n        'marlin',\n        'marmalade',\n        'maroon',\n        'married',\n        'marrow',\n        'marry',\n        'marshland',\n        'marshy',\n        'marsupial',\n        'marvelous',\n        'marxism',\n        'mascot',\n        'masculine',\n        'mashed',\n        'mashing',\n        'massager',\n        'masses',\n        'massive',\n        'mastiff',\n        'matador',\n        'matchbook',\n        'matchbox',\n        'matcher',\n        'matching',\n        'matchless',\n        'material',\n        'maternal',\n        'maternity',\n        'math',\n        'mating',\n        'matriarch',\n        'matrimony',\n        'matrix',\n        'matron',\n        'matted',\n        'matter',\n        'maturely',\n        'maturing',\n        'maturity',\n        'mauve',\n        'maverick',\n        'maximize',\n        'maximum',\n        'maybe',\n        'mayday',\n        'mayflower',\n        'moaner',\n        'moaning',\n        'mobile',\n        'mobility',\n        'mobilize',\n        'mobster',\n        'mocha',\n        'mocker',\n        'mockup',\n        'modified',\n        'modify',\n        'modular',\n        'modulator',\n        'module',\n        'moisten',\n        'moistness',\n        'moisture',\n        'molar',\n        'molasses',\n        'mold',\n        'molecular',\n        'molecule',\n        'molehill',\n        'mollusk',\n        'mom',\n        'monastery',\n        'monday',\n        'monetary',\n        'monetize',\n        'moneybags',\n        'moneyless',\n        'moneywise',\n        'mongoose',\n        'mongrel',\n        'monitor',\n        'monkhood',\n        'monogamy',\n        'monogram',\n        'monologue',\n        'monopoly',\n        'monorail',\n        'monotone',\n        'monotype',\n        'monoxide',\n        'monsieur',\n        'monsoon',\n        'monstrous',\n        'monthly',\n        'monument',\n        'moocher',\n        'moodiness',\n        'moody',\n        'mooing',\n        'moonbeam',\n        'mooned',\n        'moonlight',\n        'moonlike',\n        'moonlit',\n        'moonrise',\n        'moonscape',\n        'moonshine',\n        'moonstone',\n        'moonwalk',\n        'mop',\n        'morale',\n        'morality',\n        'morally',\n        'morbidity',\n        'morbidly',\n        'morphine',\n        'morphing',\n        'morse',\n        'mortality',\n        'mortally',\n        'mortician',\n        'mortified',\n        'mortify',\n        'mortuary',\n        'mosaic',\n        'mossy',\n        'most',\n        'mothball',\n        'mothproof',\n        'motion',\n        'motivate',\n        'motivator',\n        'motive',\n        'motocross',\n        'motor',\n        'motto',\n        'mountable',\n        'mountain',\n        'mounted',\n        'mounting',\n        'mourner',\n        'mournful',\n        'mouse',\n        'mousiness',\n        'moustache',\n        'mousy',\n        'mouth',\n        'movable',\n        'move',\n        'movie',\n        'moving',\n        'mower',\n        'mowing',\n        'much',\n        'muck',\n        'mud',\n        'mug',\n        'mulberry',\n        'mulch',\n        'mule',\n        'mulled',\n        'mullets',\n        'multiple',\n        'multiply',\n        'multitask',\n        'multitude',\n        'mumble',\n        'mumbling',\n        'mumbo',\n        'mummified',\n        'mummify',\n        'mummy',\n        'mumps',\n        'munchkin',\n        'mundane',\n        'municipal',\n        'muppet',\n        'mural',\n        'murkiness',\n        'murky',\n        'murmuring',\n        'muscular',\n        'museum',\n        'mushily',\n        'mushiness',\n        'mushroom',\n        'mushy',\n        'music',\n        'musket',\n        'muskiness',\n        'musky',\n        'mustang',\n        'mustard',\n        'muster',\n        'mustiness',\n        'musty',\n        'mutable',\n        'mutate',\n        'mutation',\n        'mute',\n        'mutilated',\n        'mutilator',\n        'mutiny',\n        'mutt',\n        'mutual',\n        'muzzle',\n        'myself',\n        'myspace',\n        'mystified',\n        'mystify',\n        'myth',\n        'nacho',\n        'nag',\n        'nail',\n        'name',\n        'naming',\n        'nanny',\n        'nanometer',\n        'nape',\n        'napkin',\n        'napped',\n        'napping',\n        'nappy',\n        'narrow',\n        'nastily',\n        'nastiness',\n        'national',\n        'native',\n        'nativity',\n        'natural',\n        'nature',\n        'naturist',\n        'nautical',\n        'navigate',\n        'navigator',\n        'navy',\n        'nearby',\n        'nearest',\n        'nearly',\n        'nearness',\n        'neatly',\n        'neatness',\n        'nebula',\n        'nebulizer',\n        'nectar',\n        'negate',\n        'negation',\n        'negative',\n        'neglector',\n        'negligee',\n        'negligent',\n        'negotiate',\n        'nemeses',\n        'nemesis',\n        'neon',\n        'nephew',\n        'nerd',\n        'nervous',\n        'nervy',\n        'nest',\n        'net',\n        'neurology',\n        'neuron',\n        'neurosis',\n        'neurotic',\n        'neuter',\n        'neutron',\n        'never',\n        'next',\n        'nibble',\n        'nickname',\n        'nicotine',\n        'niece',\n        'nifty',\n        'nimble',\n        'nimbly',\n        'nineteen',\n        'ninetieth',\n        'ninja',\n        'nintendo',\n        'ninth',\n        'nuclear',\n        'nuclei',\n        'nucleus',\n        'nugget',\n        'nullify',\n        'number',\n        'numbing',\n        'numbly',\n        'numbness',\n        'numeral',\n        'numerate',\n        'numerator',\n        'numeric',\n        'numerous',\n        'nuptials',\n        'nursery',\n        'nursing',\n        'nurture',\n        'nutcase',\n        'nutlike',\n        'nutmeg',\n        'nutrient',\n        'nutshell',\n        'nuttiness',\n        'nutty',\n        'nuzzle',\n        'nylon',\n        'oaf',\n        'oak',\n        'oasis',\n        'oat',\n        'obedience',\n        'obedient',\n        'obituary',\n        'object',\n        'obligate',\n        'obliged',\n        'oblivion',\n        'oblivious',\n        'oblong',\n        'obnoxious',\n        'oboe',\n        'obscure',\n        'obscurity',\n        'observant',\n        'observer',\n        'observing',\n        'obsessed',\n        'obsession',\n        'obsessive',\n        'obsolete',\n        'obstacle',\n        'obstinate',\n        'obstruct',\n        'obtain',\n        'obtrusive',\n        'obtuse',\n        'obvious',\n        'occultist',\n        'occupancy',\n        'occupant',\n        'occupier',\n        'occupy',\n        'ocean',\n        'ocelot',\n        'octagon',\n        'octane',\n        'october',\n        'octopus',\n        'ogle',\n        'oil',\n        'oink',\n        'ointment',\n        'okay',\n        'old',\n        'olive',\n        'olympics',\n        'omega',\n        'omen',\n        'ominous',\n        'omission',\n        'omit',\n        'omnivore',\n        'onboard',\n        'oncoming',\n        'ongoing',\n        'onion',\n        'online',\n        'onlooker',\n        'only',\n        'onscreen',\n        'onset',\n        'onshore',\n        'onslaught',\n        'onstage',\n        'onto',\n        'onward',\n        'onyx',\n        'oops',\n        'ooze',\n        'oozy',\n        'opacity',\n        'opal',\n        'open',\n        'operable',\n        'operate',\n        'operating',\n        'operation',\n        'operative',\n        'operator',\n        'opium',\n        'opossum',\n        'opponent',\n        'oppose',\n        'opposing',\n        'opposite',\n        'oppressed',\n        'oppressor',\n        'opt',\n        'opulently',\n        'osmosis',\n        'other',\n        'otter',\n        'ouch',\n        'ought',\n        'ounce',\n        'outage',\n        'outback',\n        'outbid',\n        'outboard',\n        'outbound',\n        'outbreak',\n        'outburst',\n        'outcast',\n        'outclass',\n        'outcome',\n        'outdated',\n        'outdoors',\n        'outer',\n        'outfield',\n        'outfit',\n        'outflank',\n        'outgoing',\n        'outgrow',\n        'outhouse',\n        'outing',\n        'outlast',\n        'outlet',\n        'outline',\n        'outlook',\n        'outlying',\n        'outmatch',\n        'outmost',\n        'outnumber',\n        'outplayed',\n        'outpost',\n        'outpour',\n        'output',\n        'outrage',\n        'outrank',\n        'outreach',\n        'outright',\n        'outscore',\n        'outsell',\n        'outshine',\n        'outshoot',\n        'outsider',\n        'outskirts',\n        'outsmart',\n        'outsource',\n        'outspoken',\n        'outtakes',\n        'outthink',\n        'outward',\n        'outweigh',\n        'outwit',\n        'oval',\n        'ovary',\n        'oven',\n        'overact',\n        'overall',\n        'overarch',\n        'overbid',\n        'overbill',\n        'overbite',\n        'overblown',\n        'overboard',\n        'overbook',\n        'overbuilt',\n        'overcast',\n        'overcoat',\n        'overcome',\n        'overcook',\n        'overcrowd',\n        'overdraft',\n        'overdrawn',\n        'overdress',\n        'overdrive',\n        'overdue',\n        'overeager',\n        'overeater',\n        'overexert',\n        'overfed',\n        'overfeed',\n        'overfill',\n        'overflow',\n        'overfull',\n        'overgrown',\n        'overhand',\n        'overhang',\n        'overhaul',\n        'overhead',\n        'overhear',\n        'overheat',\n        'overhung',\n        'overjoyed',\n        'overkill',\n        'overlabor',\n        'overlaid',\n        'overlap',\n        'overlay',\n        'overload',\n        'overlook',\n        'overlord',\n        'overlying',\n        'overnight',\n        'overpass',\n        'overpay',\n        'overplant',\n        'overplay',\n        'overpower',\n        'overprice',\n        'overrate',\n        'overreach',\n        'overreact',\n        'override',\n        'overripe',\n        'overrule',\n        'overrun',\n        'overshoot',\n        'overshot',\n        'oversight',\n        'oversized',\n        'oversleep',\n        'oversold',\n        'overspend',\n        'overstate',\n        'overstay',\n        'overstep',\n        'overstock',\n        'overstuff',\n        'oversweet',\n        'overtake',\n        'overthrow',\n        'overtime',\n        'overtly',\n        'overtone',\n        'overture',\n        'overturn',\n        'overuse',\n        'overvalue',\n        'overview',\n        'overwrite',\n        'owl',\n        'oxford',\n        'oxidant',\n        'oxidation',\n        'oxidize',\n        'oxidizing',\n        'oxygen',\n        'oxymoron',\n        'oyster',\n        'ozone',\n        'paced',\n        'pacemaker',\n        'pacific',\n        'pacifier',\n        'pacifism',\n        'pacifist',\n        'pacify',\n        'padded',\n        'padding',\n        'paddle',\n        'paddling',\n        'padlock',\n        'pagan',\n        'pager',\n        'paging',\n        'pajamas',\n        'palace',\n        'palatable',\n        'palm',\n        'palpable',\n        'palpitate',\n        'paltry',\n        'pampered',\n        'pamperer',\n        'pampers',\n        'pamphlet',\n        'panama',\n        'pancake',\n        'pancreas',\n        'panda',\n        'pandemic',\n        'pang',\n        'panhandle',\n        'panic',\n        'panning',\n        'panorama',\n        'panoramic',\n        'panther',\n        'pantomime',\n        'pantry',\n        'pants',\n        'pantyhose',\n        'paparazzi',\n        'papaya',\n        'paper',\n        'paprika',\n        'papyrus',\n        'parabola',\n        'parachute',\n        'parade',\n        'paradox',\n        'paragraph',\n        'parakeet',\n        'paralegal',\n        'paralyses',\n        'paralysis',\n        'paralyze',\n        'paramedic',\n        'parameter',\n        'paramount',\n        'parasail',\n        'parasite',\n        'parasitic',\n        'parcel',\n        'parched',\n        'parchment',\n        'pardon',\n        'parish',\n        'parka',\n        'parking',\n        'parkway',\n        'parlor',\n        'parmesan',\n        'parole',\n        'parrot',\n        'parsley',\n        'parsnip',\n        'partake',\n        'parted',\n        'parting',\n        'partition',\n        'partly',\n        'partner',\n        'partridge',\n        'party',\n        'passable',\n        'passably',\n        'passage',\n        'passcode',\n        'passenger',\n        'passerby',\n        'passing',\n        'passion',\n        'passive',\n        'passivism',\n        'passover',\n        'passport',\n        'password',\n        'pasta',\n        'pasted',\n        'pastel',\n        'pastime',\n        'pastor',\n        'pastrami',\n        'pasture',\n        'pasty',\n        'patchwork',\n        'patchy',\n        'paternal',\n        'paternity',\n        'path',\n        'patience',\n        'patient',\n        'patio',\n        'patriarch',\n        'patriot',\n        'patrol',\n        'patronage',\n        'patronize',\n        'pauper',\n        'pavement',\n        'paver',\n        'pavestone',\n        'pavilion',\n        'paving',\n        'pawing',\n        'payable',\n        'payback',\n        'paycheck',\n        'payday',\n        'payee',\n        'payer',\n        'paying',\n        'payment',\n        'payphone',\n        'payroll',\n        'pebble',\n        'pebbly',\n        'pecan',\n        'pectin',\n        'peculiar',\n        'peddling',\n        'pediatric',\n        'pedicure',\n        'pedigree',\n        'pedometer',\n        'pegboard',\n        'pelican',\n        'pellet',\n        'pelt',\n        'pelvis',\n        'penalize',\n        'penalty',\n        'pencil',\n        'pendant',\n        'pending',\n        'penholder',\n        'penknife',\n        'pennant',\n        'penniless',\n        'penny',\n        'penpal',\n        'pension',\n        'pentagon',\n        'pentagram',\n        'pep',\n        'perceive',\n        'percent',\n        'perch',\n        'percolate',\n        'perennial',\n        'perfected',\n        'perfectly',\n        'perfume',\n        'periscope',\n        'perish',\n        'perjurer',\n        'perjury',\n        'perkiness',\n        'perky',\n        'perm',\n        'peroxide',\n        'perpetual',\n        'perplexed',\n        'persecute',\n        'persevere',\n        'persuaded',\n        'persuader',\n        'pesky',\n        'peso',\n        'pessimism',\n        'pessimist',\n        'pester',\n        'pesticide',\n        'petal',\n        'petite',\n        'petition',\n        'petri',\n        'petroleum',\n        'petted',\n        'petticoat',\n        'pettiness',\n        'petty',\n        'petunia',\n        'phantom',\n        'phobia',\n        'phoenix',\n        'phonebook',\n        'phoney',\n        'phonics',\n        'phoniness',\n        'phony',\n        'phosphate',\n        'photo',\n        'phrase',\n        'phrasing',\n        'placard',\n        'placate',\n        'placidly',\n        'plank',\n        'planner',\n        'plant',\n        'plasma',\n        'plaster',\n        'plastic',\n        'plated',\n        'platform',\n        'plating',\n        'platinum',\n        'platonic',\n        'platter',\n        'platypus',\n        'plausible',\n        'plausibly',\n        'playable',\n        'playback',\n        'player',\n        'playful',\n        'playgroup',\n        'playhouse',\n        'playing',\n        'playlist',\n        'playmaker',\n        'playmate',\n        'playoff',\n        'playpen',\n        'playroom',\n        'playset',\n        'plaything',\n        'playtime',\n        'plaza',\n        'pleading',\n        'pleat',\n        'pledge',\n        'plentiful',\n        'plenty',\n        'plethora',\n        'plexiglas',\n        'pliable',\n        'plod',\n        'plop',\n        'plot',\n        'plow',\n        'ploy',\n        'pluck',\n        'plug',\n        'plunder',\n        'plunging',\n        'plural',\n        'plus',\n        'plutonium',\n        'plywood',\n        'poach',\n        'pod',\n        'poem',\n        'poet',\n        'pogo',\n        'pointed',\n        'pointer',\n        'pointing',\n        'pointless',\n        'pointy',\n        'poise',\n        'poison',\n        'poker',\n        'poking',\n        'polar',\n        'police',\n        'policy',\n        'polio',\n        'polish',\n        'politely',\n        'polka',\n        'polo',\n        'polyester',\n        'polygon',\n        'polygraph',\n        'polymer',\n        'poncho',\n        'pond',\n        'pony',\n        'popcorn',\n        'pope',\n        'poplar',\n        'popper',\n        'poppy',\n        'popsicle',\n        'populace',\n        'popular',\n        'populate',\n        'porcupine',\n        'pork',\n        'porous',\n        'porridge',\n        'portable',\n        'portal',\n        'portfolio',\n        'porthole',\n        'portion',\n        'portly',\n        'portside',\n        'poser',\n        'posh',\n        'posing',\n        'possible',\n        'possibly',\n        'possum',\n        'postage',\n        'postal',\n        'postbox',\n        'postcard',\n        'posted',\n        'poster',\n        'posting',\n        'postnasal',\n        'posture',\n        'postwar',\n        'pouch',\n        'pounce',\n        'pouncing',\n        'pound',\n        'pouring',\n        'pout',\n        'powdered',\n        'powdering',\n        'powdery',\n        'power',\n        'powwow',\n        'pox',\n        'praising',\n        'prance',\n        'prancing',\n        'pranker',\n        'prankish',\n        'prankster',\n        'prayer',\n        'praying',\n        'preacher',\n        'preaching',\n        'preachy',\n        'preamble',\n        'precinct',\n        'precise',\n        'precision',\n        'precook',\n        'precut',\n        'predator',\n        'predefine',\n        'predict',\n        'preface',\n        'prefix',\n        'preflight',\n        'preformed',\n        'pregame',\n        'pregnancy',\n        'pregnant',\n        'preheated',\n        'prelaunch',\n        'prelaw',\n        'prelude',\n        'premiere',\n        'premises',\n        'premium',\n        'prenatal',\n        'preoccupy',\n        'preorder',\n        'prepaid',\n        'prepay',\n        'preplan',\n        'preppy',\n        'preschool',\n        'prescribe',\n        'preseason',\n        'preset',\n        'preshow',\n        'president',\n        'presoak',\n        'press',\n        'presume',\n        'presuming',\n        'preteen',\n        'pretended',\n        'pretender',\n        'pretense',\n        'pretext',\n        'pretty',\n        'pretzel',\n        'prevail',\n        'prevalent',\n        'prevent',\n        'preview',\n        'previous',\n        'prewar',\n        'prewashed',\n        'prideful',\n        'pried',\n        'primal',\n        'primarily',\n        'primary',\n        'primate',\n        'primer',\n        'primp',\n        'princess',\n        'print',\n        'prior',\n        'prism',\n        'prison',\n        'prissy',\n        'pristine',\n        'privacy',\n        'private',\n        'privatize',\n        'prize',\n        'proactive',\n        'probable',\n        'probably',\n        'probation',\n        'probe',\n        'probing',\n        'probiotic',\n        'problem',\n        'procedure',\n        'process',\n        'proclaim',\n        'procreate',\n        'procurer',\n        'prodigal',\n        'prodigy',\n        'produce',\n        'product',\n        'profane',\n        'profanity',\n        'professed',\n        'professor',\n        'profile',\n        'profound',\n        'profusely',\n        'progeny',\n        'prognosis',\n        'program',\n        'progress',\n        'projector',\n        'prologue',\n        'prolonged',\n        'promenade',\n        'prominent',\n        'promoter',\n        'promotion',\n        'prompter',\n        'promptly',\n        'prone',\n        'prong',\n        'pronounce',\n        'pronto',\n        'proofing',\n        'proofread',\n        'proofs',\n        'propeller',\n        'properly',\n        'property',\n        'proponent',\n        'proposal',\n        'propose',\n        'props',\n        'prorate',\n        'protector',\n        'protegee',\n        'proton',\n        'prototype',\n        'protozoan',\n        'protract',\n        'protrude',\n        'proud',\n        'provable',\n        'proved',\n        'proven',\n        'provided',\n        'provider',\n        'providing',\n        'province',\n        'proving',\n        'provoke',\n        'provoking',\n        'provolone',\n        'prowess',\n        'prowler',\n        'prowling',\n        'proximity',\n        'proxy',\n        'prozac',\n        'prude',\n        'prudishly',\n        'prune',\n        'pruning',\n        'pry',\n        'psychic',\n        'public',\n        'publisher',\n        'pucker',\n        'pueblo',\n        'pug',\n        'pull',\n        'pulmonary',\n        'pulp',\n        'pulsate',\n        'pulse',\n        'pulverize',\n        'puma',\n        'pumice',\n        'pummel',\n        'punch',\n        'punctual',\n        'punctuate',\n        'punctured',\n        'pungent',\n        'punisher',\n        'punk',\n        'pupil',\n        'puppet',\n        'puppy',\n        'purchase',\n        'pureblood',\n        'purebred',\n        'purely',\n        'pureness',\n        'purgatory',\n        'purge',\n        'purging',\n        'purifier',\n        'purify',\n        'purist',\n        'puritan',\n        'purity',\n        'purple',\n        'purplish',\n        'purposely',\n        'purr',\n        'purse',\n        'pursuable',\n        'pursuant',\n        'pursuit',\n        'purveyor',\n        'pushcart',\n        'pushchair',\n        'pusher',\n        'pushiness',\n        'pushing',\n        'pushover',\n        'pushpin',\n        'pushup',\n        'pushy',\n        'putdown',\n        'putt',\n        'puzzle',\n        'puzzling',\n        'pyramid',\n        'pyromania',\n        'python',\n        'quack',\n        'quadrant',\n        'quail',\n        'quaintly',\n        'quake',\n        'quaking',\n        'qualified',\n        'qualifier',\n        'qualify',\n        'quality',\n        'qualm',\n        'quantum',\n        'quarrel',\n        'quarry',\n        'quartered',\n        'quarterly',\n        'quarters',\n        'quartet',\n        'quench',\n        'query',\n        'quicken',\n        'quickly',\n        'quickness',\n        'quicksand',\n        'quickstep',\n        'quiet',\n        'quill',\n        'quilt',\n        'quintet',\n        'quintuple',\n        'quirk',\n        'quit',\n        'quiver',\n        'quizzical',\n        'quotable',\n        'quotation',\n        'quote',\n        'rabid',\n        'race',\n        'racing',\n        'racism',\n        'rack',\n        'racoon',\n        'radar',\n        'radial',\n        'radiance',\n        'radiantly',\n        'radiated',\n        'radiation',\n        'radiator',\n        'radio',\n        'radish',\n        'raffle',\n        'raft',\n        'rage',\n        'ragged',\n        'raging',\n        'ragweed',\n        'raider',\n        'railcar',\n        'railing',\n        'railroad',\n        'railway',\n        'raisin',\n        'rake',\n        'raking',\n        'rally',\n        'ramble',\n        'rambling',\n        'ramp',\n        'ramrod',\n        'ranch',\n        'rancidity',\n        'random',\n        'ranged',\n        'ranger',\n        'ranging',\n        'ranked',\n        'ranking',\n        'ransack',\n        'ranting',\n        'rants',\n        'rare',\n        'rarity',\n        'rascal',\n        'rash',\n        'rasping',\n        'ravage',\n        'raven',\n        'ravine',\n        'raving',\n        'ravioli',\n        'ravishing',\n        'reabsorb',\n        'reach',\n        'reacquire',\n        'reaction',\n        'reactive',\n        'reactor',\n        'reaffirm',\n        'ream',\n        'reanalyze',\n        'reappear',\n        'reapply',\n        'reappoint',\n        'reapprove',\n        'rearrange',\n        'rearview',\n        'reason',\n        'reassign',\n        'reassure',\n        'reattach',\n        'reawake',\n        'rebalance',\n        'rebate',\n        'rebel',\n        'rebirth',\n        'reboot',\n        'reborn',\n        'rebound',\n        'rebuff',\n        'rebuild',\n        'rebuilt',\n        'reburial',\n        'rebuttal',\n        'recall',\n        'recant',\n        'recapture',\n        'recast',\n        'recede',\n        'recent',\n        'recess',\n        'recharger',\n        'recipient',\n        'recital',\n        'recite',\n        'reckless',\n        'reclaim',\n        'recliner',\n        'reclining',\n        'recluse',\n        'reclusive',\n        'recognize',\n        'recoil',\n        'recollect',\n        'recolor',\n        'reconcile',\n        'reconfirm',\n        'reconvene',\n        'recopy',\n        'record',\n        'recount',\n        'recoup',\n        'recovery',\n        'recreate',\n        'rectal',\n        'rectangle',\n        'rectified',\n        'rectify',\n        'recycled',\n        'recycler',\n        'recycling',\n        'reemerge',\n        'reenact',\n        'reenter',\n        'reentry',\n        'reexamine',\n        'referable',\n        'referee',\n        'reference',\n        'refill',\n        'refinance',\n        'refined',\n        'refinery',\n        'refining',\n        'refinish',\n        'reflected',\n        'reflector',\n        'reflex',\n        'reflux',\n        'refocus',\n        'refold',\n        'reforest',\n        'reformat',\n        'reformed',\n        'reformer',\n        'reformist',\n        'refract',\n        'refrain',\n        'refreeze',\n        'refresh',\n        'refried',\n        'refueling',\n        'refund',\n        'refurbish',\n        'refurnish',\n        'refusal',\n        'refuse',\n        'refusing',\n        'refutable',\n        'refute',\n        'regain',\n        'regalia',\n        'regally',\n        'reggae',\n        'regime',\n        'region',\n        'register',\n        'registrar',\n        'registry',\n        'regress',\n        'regretful',\n        'regroup',\n        'regular',\n        'regulate',\n        'regulator',\n        'rehab',\n        'reheat',\n        'rehire',\n        'rehydrate',\n        'reimburse',\n        'reissue',\n        'reiterate',\n        'rejoice',\n        'rejoicing',\n        'rejoin',\n        'rekindle',\n        'relapse',\n        'relapsing',\n        'relatable',\n        'related',\n        'relation',\n        'relative',\n        'relax',\n        'relay',\n        'relearn',\n        'release',\n        'relenting',\n        'reliable',\n        'reliably',\n        'reliance',\n        'reliant',\n        'relic',\n        'relieve',\n        'relieving',\n        'relight',\n        'relish',\n        'relive',\n        'reload',\n        'relocate',\n        'relock',\n        'reluctant',\n        'rely',\n        'remake',\n        'remark',\n        'remarry',\n        'rematch',\n        'remedial',\n        'remedy',\n        'remember',\n        'reminder',\n        'remindful',\n        'remission',\n        'remix',\n        'remnant',\n        'remodeler',\n        'remold',\n        'remorse',\n        'remote',\n        'removable',\n        'removal',\n        'removed',\n        'remover',\n        'removing',\n        'rename',\n        'renderer',\n        'rendering',\n        'rendition',\n        'renegade',\n        'renewable',\n        'renewably',\n        'renewal',\n        'renewed',\n        'renounce',\n        'renovate',\n        'renovator',\n        'rentable',\n        'rental',\n        'rented',\n        'renter',\n        'reoccupy',\n        'reoccur',\n        'reopen',\n        'reorder',\n        'repackage',\n        'repacking',\n        'repaint',\n        'repair',\n        'repave',\n        'repaying',\n        'repayment',\n        'repeal',\n        'repeated',\n        'repeater',\n        'repent',\n        'rephrase',\n        'replace',\n        'replay',\n        'replica',\n        'reply',\n        'reporter',\n        'repose',\n        'repossess',\n        'repost',\n        'repressed',\n        'reprimand',\n        'reprint',\n        'reprise',\n        'reproach',\n        'reprocess',\n        'reproduce',\n        'reprogram',\n        'reps',\n        'reptile',\n        'reptilian',\n        'repugnant',\n        'repulsion',\n        'repulsive',\n        'repurpose',\n        'reputable',\n        'reputably',\n        'request',\n        'require',\n        'requisite',\n        'reroute',\n        'rerun',\n        'resale',\n        'resample',\n        'rescuer',\n        'reseal',\n        'research',\n        'reselect',\n        'reseller',\n        'resemble',\n        'resend',\n        'resent',\n        'reset',\n        'reshape',\n        'reshoot',\n        'reshuffle',\n        'residence',\n        'residency',\n        'resident',\n        'residual',\n        'residue',\n        'resigned',\n        'resilient',\n        'resistant',\n        'resisting',\n        'resize',\n        'resolute',\n        'resolved',\n        'resonant',\n        'resonate',\n        'resort',\n        'resource',\n        'respect',\n        'resubmit',\n        'result',\n        'resume',\n        'resupply',\n        'resurface',\n        'resurrect',\n        'retail',\n        'retainer',\n        'retaining',\n        'retake',\n        'retaliate',\n        'retention',\n        'rethink',\n        'retinal',\n        'retired',\n        'retiree',\n        'retiring',\n        'retold',\n        'retool',\n        'retorted',\n        'retouch',\n        'retrace',\n        'retract',\n        'retrain',\n        'retread',\n        'retreat',\n        'retrial',\n        'retrieval',\n        'retriever',\n        'retry',\n        'return',\n        'retying',\n        'retype',\n        'reunion',\n        'reunite',\n        'reusable',\n        'reuse',\n        'reveal',\n        'reveler',\n        'revenge',\n        'revenue',\n        'reverb',\n        'revered',\n        'reverence',\n        'reverend',\n        'reversal',\n        'reverse',\n        'reversing',\n        'reversion',\n        'revert',\n        'revisable',\n        'revise',\n        'revision',\n        'revisit',\n        'revivable',\n        'revival',\n        'reviver',\n        'reviving',\n        'revocable',\n        'revoke',\n        'revolt',\n        'revolver',\n        'revolving',\n        'reward',\n        'rewash',\n        'rewind',\n        'rewire',\n        'reword',\n        'rework',\n        'rewrap',\n        'rewrite',\n        'rhyme',\n        'ribbon',\n        'ribcage',\n        'rice',\n        'riches',\n        'richly',\n        'richness',\n        'rickety',\n        'ricotta',\n        'riddance',\n        'ridden',\n        'ride',\n        'riding',\n        'rifling',\n        'rift',\n        'rigging',\n        'rigid',\n        'rigor',\n        'rimless',\n        'rimmed',\n        'rind',\n        'rink',\n        'rinse',\n        'rinsing',\n        'riot',\n        'ripcord',\n        'ripeness',\n        'ripening',\n        'ripping',\n        'ripple',\n        'rippling',\n        'riptide',\n        'rise',\n        'rising',\n        'risk',\n        'risotto',\n        'ritalin',\n        'ritzy',\n        'rival',\n        'riverbank',\n        'riverbed',\n        'riverboat',\n        'riverside',\n        'riveter',\n        'riveting',\n        'roamer',\n        'roaming',\n        'roast',\n        'robbing',\n        'robe',\n        'robin',\n        'robotics',\n        'robust',\n        'rockband',\n        'rocker',\n        'rocket',\n        'rockfish',\n        'rockiness',\n        'rocking',\n        'rocklike',\n        'rockslide',\n        'rockstar',\n        'rocky',\n        'rogue',\n        'roman',\n        'romp',\n        'rope',\n        'roping',\n        'roster',\n        'rosy',\n        'rotten',\n        'rotting',\n        'rotunda',\n        'roulette',\n        'rounding',\n        'roundish',\n        'roundness',\n        'roundup',\n        'roundworm',\n        'routine',\n        'routing',\n        'rover',\n        'roving',\n        'royal',\n        'rubbed',\n        'rubber',\n        'rubbing',\n        'rubble',\n        'rubdown',\n        'ruby',\n        'ruckus',\n        'rudder',\n        'rug',\n        'ruined',\n        'rule',\n        'rumble',\n        'rumbling',\n        'rummage',\n        'rumor',\n        'runaround',\n        'rundown',\n        'runner',\n        'running',\n        'runny',\n        'runt',\n        'runway',\n        'rupture',\n        'rural',\n        'ruse',\n        'rush',\n        'rust',\n        'rut',\n        'sabbath',\n        'sabotage',\n        'sacrament',\n        'sacred',\n        'sacrifice',\n        'sadden',\n        'saddlebag',\n        'saddled',\n        'saddling',\n        'sadly',\n        'sadness',\n        'safari',\n        'safeguard',\n        'safehouse',\n        'safely',\n        'safeness',\n        'saffron',\n        'saga',\n        'sage',\n        'sagging',\n        'saggy',\n        'said',\n        'saint',\n        'sake',\n        'salad',\n        'salami',\n        'salaried',\n        'salary',\n        'saline',\n        'salon',\n        'saloon',\n        'salsa',\n        'salt',\n        'salutary',\n        'salute',\n        'salvage',\n        'salvaging',\n        'salvation',\n        'same',\n        'sample',\n        'sampling',\n        'sanction',\n        'sanctity',\n        'sanctuary',\n        'sandal',\n        'sandbag',\n        'sandbank',\n        'sandbar',\n        'sandblast',\n        'sandbox',\n        'sanded',\n        'sandfish',\n        'sanding',\n        'sandlot',\n        'sandpaper',\n        'sandpit',\n        'sandstone',\n        'sandstorm',\n        'sandworm',\n        'sandy',\n        'sanitary',\n        'sanitizer',\n        'sank',\n        'santa',\n        'sapling',\n        'sappiness',\n        'sappy',\n        'sarcasm',\n        'sarcastic',\n        'sardine',\n        'sash',\n        'sasquatch',\n        'sassy',\n        'satchel',\n        'satiable',\n        'satin',\n        'satirical',\n        'satisfied',\n        'satisfy',\n        'saturate',\n        'saturday',\n        'sauciness',\n        'saucy',\n        'sauna',\n        'savage',\n        'savanna',\n        'saved',\n        'savings',\n        'savior',\n        'savor',\n        'saxophone',\n        'say',\n        'scabbed',\n        'scabby',\n        'scalded',\n        'scalding',\n        'scale',\n        'scaling',\n        'scallion',\n        'scallop',\n        'scalping',\n        'scam',\n        'scandal',\n        'scanner',\n        'scanning',\n        'scant',\n        'scapegoat',\n        'scarce',\n        'scarcity',\n        'scarecrow',\n        'scared',\n        'scarf',\n        'scarily',\n        'scariness',\n        'scarring',\n        'scary',\n        'scavenger',\n        'scenic',\n        'schedule',\n        'schematic',\n        'scheme',\n        'scheming',\n        'schilling',\n        'schnapps',\n        'scholar',\n        'science',\n        'scientist',\n        'scion',\n        'scoff',\n        'scolding',\n        'scone',\n        'scoop',\n        'scooter',\n        'scope',\n        'scorch',\n        'scorebook',\n        'scorecard',\n        'scored',\n        'scoreless',\n        'scorer',\n        'scoring',\n        'scorn',\n        'scorpion',\n        'scotch',\n        'scoundrel',\n        'scoured',\n        'scouring',\n        'scouting',\n        'scouts',\n        'scowling',\n        'scrabble',\n        'scraggly',\n        'scrambled',\n        'scrambler',\n        'scrap',\n        'scratch',\n        'scrawny',\n        'screen',\n        'scribble',\n        'scribe',\n        'scribing',\n        'scrimmage',\n        'script',\n        'scroll',\n        'scrooge',\n        'scrounger',\n        'scrubbed',\n        'scrubber',\n        'scruffy',\n        'scrunch',\n        'scrutiny',\n        'scuba',\n        'scuff',\n        'sculptor',\n        'sculpture',\n        'scurvy',\n        'scuttle',\n        'secluded',\n        'secluding',\n        'seclusion',\n        'second',\n        'secrecy',\n        'secret',\n        'sectional',\n        'sector',\n        'secular',\n        'securely',\n        'security',\n        'sedan',\n        'sedate',\n        'sedation',\n        'sedative',\n        'sediment',\n        'seduce',\n        'seducing',\n        'segment',\n        'seismic',\n        'seizing',\n        'seldom',\n        'selected',\n        'selection',\n        'selective',\n        'selector',\n        'self',\n        'seltzer',\n        'semantic',\n        'semester',\n        'semicolon',\n        'semifinal',\n        'seminar',\n        'semisoft',\n        'semisweet',\n        'senate',\n        'senator',\n        'send',\n        'senior',\n        'senorita',\n        'sensation',\n        'sensitive',\n        'sensitize',\n        'sensually',\n        'sensuous',\n        'sepia',\n        'september',\n        'septic',\n        'septum',\n        'sequel',\n        'sequence',\n        'sequester',\n        'series',\n        'sermon',\n        'serotonin',\n        'serpent',\n        'serrated',\n        'serve',\n        'service',\n        'serving',\n        'sesame',\n        'sessions',\n        'setback',\n        'setting',\n        'settle',\n        'settling',\n        'setup',\n        'sevenfold',\n        'seventeen',\n        'seventh',\n        'seventy',\n        'severity',\n        'shabby',\n        'shack',\n        'shaded',\n        'shadily',\n        'shadiness',\n        'shading',\n        'shadow',\n        'shady',\n        'shaft',\n        'shakable',\n        'shakily',\n        'shakiness',\n        'shaking',\n        'shaky',\n        'shale',\n        'shallot',\n        'shallow',\n        'shame',\n        'shampoo',\n        'shamrock',\n        'shank',\n        'shanty',\n        'shape',\n        'shaping',\n        'share',\n        'sharpener',\n        'sharper',\n        'sharpie',\n        'sharply',\n        'sharpness',\n        'shawl',\n        'sheath',\n        'shed',\n        'sheep',\n        'sheet',\n        'shelf',\n        'shell',\n        'shelter',\n        'shelve',\n        'shelving',\n        'sherry',\n        'shield',\n        'shifter',\n        'shifting',\n        'shiftless',\n        'shifty',\n        'shimmer',\n        'shimmy',\n        'shindig',\n        'shine',\n        'shingle',\n        'shininess',\n        'shining',\n        'shiny',\n        'ship',\n        'shirt',\n        'shivering',\n        'shock',\n        'shone',\n        'shoplift',\n        'shopper',\n        'shopping',\n        'shoptalk',\n        'shore',\n        'shortage',\n        'shortcake',\n        'shortcut',\n        'shorten',\n        'shorter',\n        'shorthand',\n        'shortlist',\n        'shortly',\n        'shortness',\n        'shorts',\n        'shortwave',\n        'shorty',\n        'shout',\n        'shove',\n        'showbiz',\n        'showcase',\n        'showdown',\n        'shower',\n        'showgirl',\n        'showing',\n        'showman',\n        'shown',\n        'showoff',\n        'showpiece',\n        'showplace',\n        'showroom',\n        'showy',\n        'shrank',\n        'shrapnel',\n        'shredder',\n        'shredding',\n        'shrewdly',\n        'shriek',\n        'shrill',\n        'shrimp',\n        'shrine',\n        'shrink',\n        'shrivel',\n        'shrouded',\n        'shrubbery',\n        'shrubs',\n        'shrug',\n        'shrunk',\n        'shucking',\n        'shudder',\n        'shuffle',\n        'shuffling',\n        'shun',\n        'shush',\n        'shut',\n        'shy',\n        'siamese',\n        'siberian',\n        'sibling',\n        'siding',\n        'sierra',\n        'siesta',\n        'sift',\n        'sighing',\n        'silenced',\n        'silencer',\n        'silent',\n        'silica',\n        'silicon',\n        'silk',\n        'silliness',\n        'silly',\n        'silo',\n        'silt',\n        'silver',\n        'similarly',\n        'simile',\n        'simmering',\n        'simple',\n        'simplify',\n        'simply',\n        'sincere',\n        'sincerity',\n        'singer',\n        'singing',\n        'single',\n        'singular',\n        'sinister',\n        'sinless',\n        'sinner',\n        'sinuous',\n        'sip',\n        'siren',\n        'sister',\n        'sitcom',\n        'sitter',\n        'sitting',\n        'situated',\n        'situation',\n        'sixfold',\n        'sixteen',\n        'sixth',\n        'sixties',\n        'sixtieth',\n        'sixtyfold',\n        'sizable',\n        'sizably',\n        'size',\n        'sizing',\n        'sizzle',\n        'sizzling',\n        'skater',\n        'skating',\n        'skedaddle',\n        'skeletal',\n        'skeleton',\n        'skeptic',\n        'sketch',\n        'skewed',\n        'skewer',\n        'skid',\n        'skied',\n        'skier',\n        'skies',\n        'skiing',\n        'skilled',\n        'skillet',\n        'skillful',\n        'skimmed',\n        'skimmer',\n        'skimming',\n        'skimpily',\n        'skincare',\n        'skinhead',\n        'skinless',\n        'skinning',\n        'skinny',\n        'skintight',\n        'skipper',\n        'skipping',\n        'skirmish',\n        'skirt',\n        'skittle',\n        'skydiver',\n        'skylight',\n        'skyline',\n        'skype',\n        'skyrocket',\n        'skyward',\n        'slab',\n        'slacked',\n        'slacker',\n        'slacking',\n        'slackness',\n        'slacks',\n        'slain',\n        'slam',\n        'slander',\n        'slang',\n        'slapping',\n        'slapstick',\n        'slashed',\n        'slashing',\n        'slate',\n        'slather',\n        'slaw',\n        'sled',\n        'sleek',\n        'sleep',\n        'sleet',\n        'sleeve',\n        'slept',\n        'sliceable',\n        'sliced',\n        'slicer',\n        'slicing',\n        'slick',\n        'slider',\n        'slideshow',\n        'sliding',\n        'slighted',\n        'slighting',\n        'slightly',\n        'slimness',\n        'slimy',\n        'slinging',\n        'slingshot',\n        'slinky',\n        'slip',\n        'slit',\n        'sliver',\n        'slobbery',\n        'slogan',\n        'sloped',\n        'sloping',\n        'sloppily',\n        'sloppy',\n        'slot',\n        'slouching',\n        'slouchy',\n        'sludge',\n        'slug',\n        'slum',\n        'slurp',\n        'slush',\n        'sly',\n        'small',\n        'smartly',\n        'smartness',\n        'smasher',\n        'smashing',\n        'smashup',\n        'smell',\n        'smelting',\n        'smile',\n        'smilingly',\n        'smirk',\n        'smite',\n        'smith',\n        'smitten',\n        'smock',\n        'smog',\n        'smoked',\n        'smokeless',\n        'smokiness',\n        'smoking',\n        'smoky',\n        'smolder',\n        'smooth',\n        'smother',\n        'smudge',\n        'smudgy',\n        'smuggler',\n        'smuggling',\n        'smugly',\n        'smugness',\n        'snack',\n        'snagged',\n        'snaking',\n        'snap',\n        'snare',\n        'snarl',\n        'snazzy',\n        'sneak',\n        'sneer',\n        'sneeze',\n        'sneezing',\n        'snide',\n        'sniff',\n        'snippet',\n        'snipping',\n        'snitch',\n        'snooper',\n        'snooze',\n        'snore',\n        'snoring',\n        'snorkel',\n        'snort',\n        'snout',\n        'snowbird',\n        'snowboard',\n        'snowbound',\n        'snowcap',\n        'snowdrift',\n        'snowdrop',\n        'snowfall',\n        'snowfield',\n        'snowflake',\n        'snowiness',\n        'snowless',\n        'snowman',\n        'snowplow',\n        'snowshoe',\n        'snowstorm',\n        'snowsuit',\n        'snowy',\n        'snub',\n        'snuff',\n        'snuggle',\n        'snugly',\n        'snugness',\n        'speak',\n        'spearfish',\n        'spearhead',\n        'spearman',\n        'spearmint',\n        'species',\n        'specimen',\n        'specked',\n        'speckled',\n        'specks',\n        'spectacle',\n        'spectator',\n        'spectrum',\n        'speculate',\n        'speech',\n        'speed',\n        'spellbind',\n        'speller',\n        'spelling',\n        'spendable',\n        'spender',\n        'spending',\n        'spent',\n        'spew',\n        'sphere',\n        'spherical',\n        'sphinx',\n        'spider',\n        'spied',\n        'spiffy',\n        'spill',\n        'spilt',\n        'spinach',\n        'spinal',\n        'spindle',\n        'spinner',\n        'spinning',\n        'spinout',\n        'spinster',\n        'spiny',\n        'spiral',\n        'spirited',\n        'spiritism',\n        'spirits',\n        'spiritual',\n        'splashed',\n        'splashing',\n        'splashy',\n        'splatter',\n        'spleen',\n        'splendid',\n        'splendor',\n        'splice',\n        'splicing',\n        'splinter',\n        'splotchy',\n        'splurge',\n        'spoilage',\n        'spoiled',\n        'spoiler',\n        'spoiling',\n        'spoils',\n        'spoken',\n        'spokesman',\n        'sponge',\n        'spongy',\n        'sponsor',\n        'spoof',\n        'spookily',\n        'spooky',\n        'spool',\n        'spoon',\n        'spore',\n        'sporting',\n        'sports',\n        'sporty',\n        'spotless',\n        'spotlight',\n        'spotted',\n        'spotter',\n        'spotting',\n        'spotty',\n        'spousal',\n        'spouse',\n        'spout',\n        'sprain',\n        'sprang',\n        'sprawl',\n        'spray',\n        'spree',\n        'sprig',\n        'spring',\n        'sprinkled',\n        'sprinkler',\n        'sprint',\n        'sprite',\n        'sprout',\n        'spruce',\n        'sprung',\n        'spry',\n        'spud',\n        'spur',\n        'sputter',\n        'spyglass',\n        'squabble',\n        'squad',\n        'squall',\n        'squander',\n        'squash',\n        'squatted',\n        'squatter',\n        'squatting',\n        'squeak',\n        'squealer',\n        'squealing',\n        'squeamish',\n        'squeegee',\n        'squeeze',\n        'squeezing',\n        'squid',\n        'squiggle',\n        'squiggly',\n        'squint',\n        'squire',\n        'squirt',\n        'squishier',\n        'squishy',\n        'stability',\n        'stabilize',\n        'stable',\n        'stack',\n        'stadium',\n        'staff',\n        'stage',\n        'staging',\n        'stagnant',\n        'stagnate',\n        'stainable',\n        'stained',\n        'staining',\n        'stainless',\n        'stalemate',\n        'staleness',\n        'stalling',\n        'stallion',\n        'stamina',\n        'stammer',\n        'stamp',\n        'stand',\n        'stank',\n        'staple',\n        'stapling',\n        'starboard',\n        'starch',\n        'stardom',\n        'stardust',\n        'starfish',\n        'stargazer',\n        'staring',\n        'stark',\n        'starless',\n        'starlet',\n        'starlight',\n        'starlit',\n        'starring',\n        'starry',\n        'starship',\n        'starter',\n        'starting',\n        'startle',\n        'startling',\n        'startup',\n        'starved',\n        'starving',\n        'stash',\n        'state',\n        'static',\n        'statistic',\n        'statue',\n        'stature',\n        'status',\n        'statute',\n        'statutory',\n        'staunch',\n        'stays',\n        'steadfast',\n        'steadier',\n        'steadily',\n        'steadying',\n        'steam',\n        'steed',\n        'steep',\n        'steerable',\n        'steering',\n        'steersman',\n        'stegosaur',\n        'stellar',\n        'stem',\n        'stench',\n        'stencil',\n        'step',\n        'stereo',\n        'sterile',\n        'sterility',\n        'sterilize',\n        'sterling',\n        'sternness',\n        'sternum',\n        'stew',\n        'stick',\n        'stiffen',\n        'stiffly',\n        'stiffness',\n        'stifle',\n        'stifling',\n        'stillness',\n        'stilt',\n        'stimulant',\n        'stimulate',\n        'stimuli',\n        'stimulus',\n        'stinger',\n        'stingily',\n        'stinging',\n        'stingray',\n        'stingy',\n        'stinking',\n        'stinky',\n        'stipend',\n        'stipulate',\n        'stir',\n        'stitch',\n        'stock',\n        'stoic',\n        'stoke',\n        'stole',\n        'stomp',\n        'stonewall',\n        'stoneware',\n        'stonework',\n        'stoning',\n        'stony',\n        'stood',\n        'stooge',\n        'stool',\n        'stoop',\n        'stoplight',\n        'stoppable',\n        'stoppage',\n        'stopped',\n        'stopper',\n        'stopping',\n        'stopwatch',\n        'storable',\n        'storage',\n        'storeroom',\n        'storewide',\n        'storm',\n        'stout',\n        'stove',\n        'stowaway',\n        'stowing',\n        'straddle',\n        'straggler',\n        'strained',\n        'strainer',\n        'straining',\n        'strangely',\n        'stranger',\n        'strangle',\n        'strategic',\n        'strategy',\n        'stratus',\n        'straw',\n        'stray',\n        'streak',\n        'stream',\n        'street',\n        'strength',\n        'strenuous',\n        'strep',\n        'stress',\n        'stretch',\n        'strewn',\n        'stricken',\n        'strict',\n        'stride',\n        'strife',\n        'strike',\n        'striking',\n        'strive',\n        'striving',\n        'strobe',\n        'strode',\n        'stroller',\n        'strongbox',\n        'strongly',\n        'strongman',\n        'struck',\n        'structure',\n        'strudel',\n        'struggle',\n        'strum',\n        'strung',\n        'strut',\n        'stubbed',\n        'stubble',\n        'stubbly',\n        'stubborn',\n        'stucco',\n        'stuck',\n        'student',\n        'studied',\n        'studio',\n        'study',\n        'stuffed',\n        'stuffing',\n        'stuffy',\n        'stumble',\n        'stumbling',\n        'stump',\n        'stung',\n        'stunned',\n        'stunner',\n        'stunning',\n        'stunt',\n        'stupor',\n        'sturdily',\n        'sturdy',\n        'styling',\n        'stylishly',\n        'stylist',\n        'stylized',\n        'stylus',\n        'suave',\n        'subarctic',\n        'subatomic',\n        'subdivide',\n        'subdued',\n        'subduing',\n        'subfloor',\n        'subgroup',\n        'subheader',\n        'subject',\n        'sublease',\n        'sublet',\n        'sublevel',\n        'sublime',\n        'submarine',\n        'submerge',\n        'submersed',\n        'submitter',\n        'subpanel',\n        'subpar',\n        'subplot',\n        'subprime',\n        'subscribe',\n        'subscript',\n        'subsector',\n        'subside',\n        'subsiding',\n        'subsidize',\n        'subsidy',\n        'subsoil',\n        'subsonic',\n        'substance',\n        'subsystem',\n        'subtext',\n        'subtitle',\n        'subtly',\n        'subtotal',\n        'subtract',\n        'subtype',\n        'suburb',\n        'subway',\n        'subwoofer',\n        'subzero',\n        'succulent',\n        'such',\n        'suction',\n        'sudden',\n        'sudoku',\n        'suds',\n        'sufferer',\n        'suffering',\n        'suffice',\n        'suffix',\n        'suffocate',\n        'suffrage',\n        'sugar',\n        'suggest',\n        'suing',\n        'suitable',\n        'suitably',\n        'suitcase',\n        'suitor',\n        'sulfate',\n        'sulfide',\n        'sulfite',\n        'sulfur',\n        'sulk',\n        'sullen',\n        'sulphate',\n        'sulphuric',\n        'sultry',\n        'superbowl',\n        'superglue',\n        'superhero',\n        'superior',\n        'superjet',\n        'superman',\n        'supermom',\n        'supernova',\n        'supervise',\n        'supper',\n        'supplier',\n        'supply',\n        'support',\n        'supremacy',\n        'supreme',\n        'surcharge',\n        'surely',\n        'sureness',\n        'surface',\n        'surfacing',\n        'surfboard',\n        'surfer',\n        'surgery',\n        'surgical',\n        'surging',\n        'surname',\n        'surpass',\n        'surplus',\n        'surprise',\n        'surreal',\n        'surrender',\n        'surrogate',\n        'surround',\n        'survey',\n        'survival',\n        'survive',\n        'surviving',\n        'survivor',\n        'sushi',\n        'suspect',\n        'suspend',\n        'suspense',\n        'sustained',\n        'sustainer',\n        'swab',\n        'swaddling',\n        'swagger',\n        'swampland',\n        'swan',\n        'swapping',\n        'swarm',\n        'sway',\n        'swear',\n        'sweat',\n        'sweep',\n        'swell',\n        'swept',\n        'swerve',\n        'swifter',\n        'swiftly',\n        'swiftness',\n        'swimmable',\n        'swimmer',\n        'swimming',\n        'swimsuit',\n        'swimwear',\n        'swinger',\n        'swinging',\n        'swipe',\n        'swirl',\n        'switch',\n        'swivel',\n        'swizzle',\n        'swooned',\n        'swoop',\n        'swoosh',\n        'swore',\n        'sworn',\n        'swung',\n        'sycamore',\n        'sympathy',\n        'symphonic',\n        'symphony',\n        'symptom',\n        'synapse',\n        'syndrome',\n        'synergy',\n        'synopses',\n        'synopsis',\n        'synthesis',\n        'synthetic',\n        'syrup',\n        'system',\n        't-shirt',\n        'tabasco',\n        'tabby',\n        'tableful',\n        'tables',\n        'tablet',\n        'tableware',\n        'tabloid',\n        'tackiness',\n        'tacking',\n        'tackle',\n        'tackling',\n        'tacky',\n        'taco',\n        'tactful',\n        'tactical',\n        'tactics',\n        'tactile',\n        'tactless',\n        'tadpole',\n        'taekwondo',\n        'tag',\n        'tainted',\n        'take',\n        'taking',\n        'talcum',\n        'talisman',\n        'tall',\n        'talon',\n        'tamale',\n        'tameness',\n        'tamer',\n        'tamper',\n        'tank',\n        'tanned',\n        'tannery',\n        'tanning',\n        'tantrum',\n        'tapeless',\n        'tapered',\n        'tapering',\n        'tapestry',\n        'tapioca',\n        'tapping',\n        'taps',\n        'tarantula',\n        'target',\n        'tarmac',\n        'tarnish',\n        'tarot',\n        'tartar',\n        'tartly',\n        'tartness',\n        'task',\n        'tassel',\n        'taste',\n        'tastiness',\n        'tasting',\n        'tasty',\n        'tattered',\n        'tattle',\n        'tattling',\n        'tattoo',\n        'taunt',\n        'tavern',\n        'thank',\n        'that',\n        'thaw',\n        'theater',\n        'theatrics',\n        'thee',\n        'theft',\n        'theme',\n        'theology',\n        'theorize',\n        'thermal',\n        'thermos',\n        'thesaurus',\n        'these',\n        'thesis',\n        'thespian',\n        'thicken',\n        'thicket',\n        'thickness',\n        'thieving',\n        'thievish',\n        'thigh',\n        'thimble',\n        'thing',\n        'think',\n        'thinly',\n        'thinner',\n        'thinness',\n        'thinning',\n        'thirstily',\n        'thirsting',\n        'thirsty',\n        'thirteen',\n        'thirty',\n        'thong',\n        'thorn',\n        'those',\n        'thousand',\n        'thrash',\n        'thread',\n        'threaten',\n        'threefold',\n        'thrift',\n        'thrill',\n        'thrive',\n        'thriving',\n        'throat',\n        'throbbing',\n        'throng',\n        'throttle',\n        'throwaway',\n        'throwback',\n        'thrower',\n        'throwing',\n        'thud',\n        'thumb',\n        'thumping',\n        'thursday',\n        'thus',\n        'thwarting',\n        'thyself',\n        'tiara',\n        'tibia',\n        'tidal',\n        'tidbit',\n        'tidiness',\n        'tidings',\n        'tidy',\n        'tiger',\n        'tighten',\n        'tightly',\n        'tightness',\n        'tightrope',\n        'tightwad',\n        'tigress',\n        'tile',\n        'tiling',\n        'till',\n        'tilt',\n        'timid',\n        'timing',\n        'timothy',\n        'tinderbox',\n        'tinfoil',\n        'tingle',\n        'tingling',\n        'tingly',\n        'tinker',\n        'tinkling',\n        'tinsel',\n        'tinsmith',\n        'tint',\n        'tinwork',\n        'tiny',\n        'tipoff',\n        'tipped',\n        'tipper',\n        'tipping',\n        'tiptoeing',\n        'tiptop',\n        'tiring',\n        'tissue',\n        'trace',\n        'tracing',\n        'track',\n        'traction',\n        'tractor',\n        'trade',\n        'trading',\n        'tradition',\n        'traffic',\n        'tragedy',\n        'trailing',\n        'trailside',\n        'train',\n        'traitor',\n        'trance',\n        'tranquil',\n        'transfer',\n        'transform',\n        'translate',\n        'transpire',\n        'transport',\n        'transpose',\n        'trapdoor',\n        'trapeze',\n        'trapezoid',\n        'trapped',\n        'trapper',\n        'trapping',\n        'traps',\n        'trash',\n        'travel',\n        'traverse',\n        'travesty',\n        'tray',\n        'treachery',\n        'treading',\n        'treadmill',\n        'treason',\n        'treat',\n        'treble',\n        'tree',\n        'trekker',\n        'tremble',\n        'trembling',\n        'tremor',\n        'trench',\n        'trend',\n        'trespass',\n        'triage',\n        'trial',\n        'triangle',\n        'tribesman',\n        'tribunal',\n        'tribune',\n        'tributary',\n        'tribute',\n        'triceps',\n        'trickery',\n        'trickily',\n        'tricking',\n        'trickle',\n        'trickster',\n        'tricky',\n        'tricolor',\n        'tricycle',\n        'trident',\n        'tried',\n        'trifle',\n        'trifocals',\n        'trillion',\n        'trilogy',\n        'trimester',\n        'trimmer',\n        'trimming',\n        'trimness',\n        'trinity',\n        'trio',\n        'tripod',\n        'tripping',\n        'triumph',\n        'trivial',\n        'trodden',\n        'trolling',\n        'trombone',\n        'trophy',\n        'tropical',\n        'tropics',\n        'trouble',\n        'troubling',\n        'trough',\n        'trousers',\n        'trout',\n        'trowel',\n        'truce',\n        'truck',\n        'truffle',\n        'trump',\n        'trunks',\n        'trustable',\n        'trustee',\n        'trustful',\n        'trusting',\n        'trustless',\n        'truth',\n        'try',\n        'tubby',\n        'tubeless',\n        'tubular',\n        'tucking',\n        'tuesday',\n        'tug',\n        'tuition',\n        'tulip',\n        'tumble',\n        'tumbling',\n        'tummy',\n        'turban',\n        'turbine',\n        'turbofan',\n        'turbojet',\n        'turbulent',\n        'turf',\n        'turkey',\n        'turmoil',\n        'turret',\n        'turtle',\n        'tusk',\n        'tutor',\n        'tutu',\n        'tux',\n        'tweak',\n        'tweed',\n        'tweet',\n        'tweezers',\n        'twelve',\n        'twentieth',\n        'twenty',\n        'twerp',\n        'twice',\n        'twiddle',\n        'twiddling',\n        'twig',\n        'twilight',\n        'twine',\n        'twins',\n        'twirl',\n        'twistable',\n        'twisted',\n        'twister',\n        'twisting',\n        'twisty',\n        'twitch',\n        'twitter',\n        'tycoon',\n        'tying',\n        'tyke',\n        'udder',\n        'ultimate',\n        'ultimatum',\n        'ultra',\n        'umbilical',\n        'umbrella',\n        'umpire',\n        'unabashed',\n        'unable',\n        'unadorned',\n        'unadvised',\n        'unafraid',\n        'unaired',\n        'unaligned',\n        'unaltered',\n        'unarmored',\n        'unashamed',\n        'unaudited',\n        'unawake',\n        'unaware',\n        'unbaked',\n        'unbalance',\n        'unbeaten',\n        'unbend',\n        'unbent',\n        'unbiased',\n        'unbitten',\n        'unblended',\n        'unblessed',\n        'unblock',\n        'unbolted',\n        'unbounded',\n        'unboxed',\n        'unbraided',\n        'unbridle',\n        'unbroken',\n        'unbuckled',\n        'unbundle',\n        'unburned',\n        'unbutton',\n        'uncanny',\n        'uncapped',\n        'uncaring',\n        'uncertain',\n        'unchain',\n        'unchanged',\n        'uncharted',\n        'uncheck',\n        'uncivil',\n        'unclad',\n        'unclaimed',\n        'unclamped',\n        'unclasp',\n        'uncle',\n        'unclip',\n        'uncloak',\n        'unclog',\n        'unclothed',\n        'uncoated',\n        'uncoiled',\n        'uncolored',\n        'uncombed',\n        'uncommon',\n        'uncooked',\n        'uncork',\n        'uncorrupt',\n        'uncounted',\n        'uncouple',\n        'uncouth',\n        'uncover',\n        'uncross',\n        'uncrown',\n        'uncrushed',\n        'uncured',\n        'uncurious',\n        'uncurled',\n        'uncut',\n        'undamaged',\n        'undated',\n        'undaunted',\n        'undead',\n        'undecided',\n        'undefined',\n        'underage',\n        'underarm',\n        'undercoat',\n        'undercook',\n        'undercut',\n        'underdog',\n        'underdone',\n        'underfed',\n        'underfeed',\n        'underfoot',\n        'undergo',\n        'undergrad',\n        'underhand',\n        'underline',\n        'underling',\n        'undermine',\n        'undermost',\n        'underpaid',\n        'underpass',\n        'underpay',\n        'underrate',\n        'undertake',\n        'undertone',\n        'undertook',\n        'undertow',\n        'underuse',\n        'underwear',\n        'underwent',\n        'underwire',\n        'undesired',\n        'undiluted',\n        'undivided',\n        'undocked',\n        'undoing',\n        'undone',\n        'undrafted',\n        'undress',\n        'undrilled',\n        'undusted',\n        'undying',\n        'unearned',\n        'unearth',\n        'unease',\n        'uneasily',\n        'uneasy',\n        'uneatable',\n        'uneaten',\n        'unedited',\n        'unelected',\n        'unending',\n        'unengaged',\n        'unenvied',\n        'unequal',\n        'unethical',\n        'uneven',\n        'unexpired',\n        'unexposed',\n        'unfailing',\n        'unfair',\n        'unfasten',\n        'unfazed',\n        'unfeeling',\n        'unfiled',\n        'unfilled',\n        'unfitted',\n        'unfitting',\n        'unfixable',\n        'unfixed',\n        'unflawed',\n        'unfocused',\n        'unfold',\n        'unfounded',\n        'unframed',\n        'unfreeze',\n        'unfrosted',\n        'unfrozen',\n        'unfunded',\n        'unglazed',\n        'ungloved',\n        'unglue',\n        'ungodly',\n        'ungraded',\n        'ungreased',\n        'unguarded',\n        'unguided',\n        'unhappily',\n        'unhappy',\n        'unharmed',\n        'unhealthy',\n        'unheard',\n        'unhearing',\n        'unheated',\n        'unhelpful',\n        'unhidden',\n        'unhinge',\n        'unhitched',\n        'unholy',\n        'unhook',\n        'unicorn',\n        'unicycle',\n        'unified',\n        'unifier',\n        'uniformed',\n        'uniformly',\n        'unify',\n        'unimpeded',\n        'uninjured',\n        'uninstall',\n        'uninsured',\n        'uninvited',\n        'union',\n        'uniquely',\n        'unisexual',\n        'unison',\n        'unissued',\n        'unit',\n        'universal',\n        'universe',\n        'unjustly',\n        'unkempt',\n        'unkind',\n        'unknotted',\n        'unknowing',\n        'unknown',\n        'unlaced',\n        'unlatch',\n        'unlawful',\n        'unleaded',\n        'unlearned',\n        'unleash',\n        'unless',\n        'unleveled',\n        'unlighted',\n        'unlikable',\n        'unlimited',\n        'unlined',\n        'unlinked',\n        'unlisted',\n        'unlit',\n        'unlivable',\n        'unloaded',\n        'unloader',\n        'unlocked',\n        'unlocking',\n        'unlovable',\n        'unloved',\n        'unlovely',\n        'unloving',\n        'unluckily',\n        'unlucky',\n        'unmade',\n        'unmanaged',\n        'unmanned',\n        'unmapped',\n        'unmarked',\n        'unmasked',\n        'unmasking',\n        'unmatched',\n        'unmindful',\n        'unmixable',\n        'unmixed',\n        'unmolded',\n        'unmoral',\n        'unmovable',\n        'unmoved',\n        'unmoving',\n        'unnamable',\n        'unnamed',\n        'unnatural',\n        'unneeded',\n        'unnerve',\n        'unnerving',\n        'unnoticed',\n        'unopened',\n        'unopposed',\n        'unpack',\n        'unpadded',\n        'unpaid',\n        'unpainted',\n        'unpaired',\n        'unpaved',\n        'unpeeled',\n        'unpicked',\n        'unpiloted',\n        'unpinned',\n        'unplanned',\n        'unplanted',\n        'unpleased',\n        'unpledged',\n        'unplowed',\n        'unplug',\n        'unpopular',\n        'unproven',\n        'unquote',\n        'unranked',\n        'unrated',\n        'unraveled',\n        'unreached',\n        'unread',\n        'unreal',\n        'unreeling',\n        'unrefined',\n        'unrelated',\n        'unrented',\n        'unrest',\n        'unretired',\n        'unrevised',\n        'unrigged',\n        'unripe',\n        'unrivaled',\n        'unroasted',\n        'unrobed',\n        'unroll',\n        'unruffled',\n        'unruly',\n        'unrushed',\n        'unsaddle',\n        'unsafe',\n        'unsaid',\n        'unsalted',\n        'unsaved',\n        'unsavory',\n        'unscathed',\n        'unscented',\n        'unscrew',\n        'unsealed',\n        'unseated',\n        'unsecured',\n        'unseeing',\n        'unseemly',\n        'unseen',\n        'unselect',\n        'unselfish',\n        'unsent',\n        'unsettled',\n        'unshackle',\n        'unshaken',\n        'unshaved',\n        'unshaven',\n        'unsheathe',\n        'unshipped',\n        'unsightly',\n        'unsigned',\n        'unskilled',\n        'unsliced',\n        'unsmooth',\n        'unsnap',\n        'unsocial',\n        'unsoiled',\n        'unsold',\n        'unsolved',\n        'unsorted',\n        'unspoiled',\n        'unspoken',\n        'unstable',\n        'unstaffed',\n        'unstamped',\n        'unsteady',\n        'unsterile',\n        'unstirred',\n        'unstitch',\n        'unstopped',\n        'unstuck',\n        'unstuffed',\n        'unstylish',\n        'unsubtle',\n        'unsubtly',\n        'unsuited',\n        'unsure',\n        'unsworn',\n        'untagged',\n        'untainted',\n        'untaken',\n        'untamed',\n        'untangled',\n        'untapped',\n        'untaxed',\n        'unthawed',\n        'unthread',\n        'untidy',\n        'untie',\n        'until',\n        'untimed',\n        'untimely',\n        'untitled',\n        'untoasted',\n        'untold',\n        'untouched',\n        'untracked',\n        'untrained',\n        'untreated',\n        'untried',\n        'untrimmed',\n        'untrue',\n        'untruth',\n        'unturned',\n        'untwist',\n        'untying',\n        'unusable',\n        'unused',\n        'unusual',\n        'unvalued',\n        'unvaried',\n        'unvarying',\n        'unveiled',\n        'unveiling',\n        'unvented',\n        'unviable',\n        'unvisited',\n        'unvocal',\n        'unwanted',\n        'unwarlike',\n        'unwary',\n        'unwashed',\n        'unwatched',\n        'unweave',\n        'unwed',\n        'unwelcome',\n        'unwell',\n        'unwieldy',\n        'unwilling',\n        'unwind',\n        'unwired',\n        'unwitting',\n        'unwomanly',\n        'unworldly',\n        'unworn',\n        'unworried',\n        'unworthy',\n        'unwound',\n        'unwoven',\n        'unwrapped',\n        'unwritten',\n        'unzip',\n        'upbeat',\n        'upchuck',\n        'upcoming',\n        'upcountry',\n        'update',\n        'upfront',\n        'upgrade',\n        'upheaval',\n        'upheld',\n        'uphill',\n        'uphold',\n        'uplifted',\n        'uplifting',\n        'upload',\n        'upon',\n        'upper',\n        'upright',\n        'uprising',\n        'upriver',\n        'uproar',\n        'uproot',\n        'upscale',\n        'upside',\n        'upstage',\n        'upstairs',\n        'upstart',\n        'upstate',\n        'upstream',\n        'upstroke',\n        'upswing',\n        'uptake',\n        'uptight',\n        'uptown',\n        'upturned',\n        'upward',\n        'upwind',\n        'uranium',\n        'urban',\n        'urchin',\n        'urethane',\n        'urgency',\n        'urgent',\n        'urging',\n        'urologist',\n        'urology',\n        'usable',\n        'usage',\n        'useable',\n        'used',\n        'uselessly',\n        'user',\n        'usher',\n        'usual',\n        'utensil',\n        'utility',\n        'utilize',\n        'utmost',\n        'utopia',\n        'utter',\n        'vacancy',\n        'vacant',\n        'vacate',\n        'vacation',\n        'vagabond',\n        'vagrancy',\n        'vagrantly',\n        'vaguely',\n        'vagueness',\n        'valiant',\n        'valid',\n        'valium',\n        'valley',\n        'valuables',\n        'value',\n        'vanilla',\n        'vanish',\n        'vanity',\n        'vanquish',\n        'vantage',\n        'vaporizer',\n        'variable',\n        'variably',\n        'varied',\n        'variety',\n        'various',\n        'varmint',\n        'varnish',\n        'varsity',\n        'varying',\n        'vascular',\n        'vaseline',\n        'vastly',\n        'vastness',\n        'veal',\n        'vegan',\n        'veggie',\n        'vehicular',\n        'velcro',\n        'velocity',\n        'velvet',\n        'vendetta',\n        'vending',\n        'vendor',\n        'veneering',\n        'vengeful',\n        'venomous',\n        'ventricle',\n        'venture',\n        'venue',\n        'venus',\n        'verbalize',\n        'verbally',\n        'verbose',\n        'verdict',\n        'verify',\n        'verse',\n        'version',\n        'versus',\n        'vertebrae',\n        'vertical',\n        'vertigo',\n        'very',\n        'vessel',\n        'vest',\n        'veteran',\n        'veto',\n        'vexingly',\n        'viability',\n        'viable',\n        'vibes',\n        'vice',\n        'vicinity',\n        'victory',\n        'video',\n        'viewable',\n        'viewer',\n        'viewing',\n        'viewless',\n        'viewpoint',\n        'vigorous',\n        'village',\n        'villain',\n        'vindicate',\n        'vineyard',\n        'vintage',\n        'violate',\n        'violation',\n        'violator',\n        'violet',\n        'violin',\n        'viper',\n        'viral',\n        'virtual',\n        'virtuous',\n        'virus',\n        'visa',\n        'viscosity',\n        'viscous',\n        'viselike',\n        'visible',\n        'visibly',\n        'vision',\n        'visiting',\n        'visitor',\n        'visor',\n        'vista',\n        'vitality',\n        'vitalize',\n        'vitally',\n        'vitamins',\n        'vivacious',\n        'vividly',\n        'vividness',\n        'vixen',\n        'vocalist',\n        'vocalize',\n        'vocally',\n        'vocation',\n        'voice',\n        'voicing',\n        'void',\n        'volatile',\n        'volley',\n        'voltage',\n        'volumes',\n        'voter',\n        'voting',\n        'voucher',\n        'vowed',\n        'vowel',\n        'voyage',\n        'wackiness',\n        'wad',\n        'wafer',\n        'waffle',\n        'waged',\n        'wager',\n        'wages',\n        'waggle',\n        'wagon',\n        'wake',\n        'waking',\n        'walk',\n        'walmart',\n        'walnut',\n        'walrus',\n        'waltz',\n        'wand',\n        'wannabe',\n        'wanted',\n        'wanting',\n        'wasabi',\n        'washable',\n        'washbasin',\n        'washboard',\n        'washbowl',\n        'washcloth',\n        'washday',\n        'washed',\n        'washer',\n        'washhouse',\n        'washing',\n        'washout',\n        'washroom',\n        'washstand',\n        'washtub',\n        'wasp',\n        'wasting',\n        'watch',\n        'water',\n        'waviness',\n        'waving',\n        'wavy',\n        'whacking',\n        'whacky',\n        'wham',\n        'wharf',\n        'wheat',\n        'whenever',\n        'whiff',\n        'whimsical',\n        'whinny',\n        'whiny',\n        'whisking',\n        'whoever',\n        'whole',\n        'whomever',\n        'whoopee',\n        'whooping',\n        'whoops',\n        'why',\n        'wick',\n        'widely',\n        'widen',\n        'widget',\n        'widow',\n        'width',\n        'wieldable',\n        'wielder',\n        'wife',\n        'wifi',\n        'wikipedia',\n        'wildcard',\n        'wildcat',\n        'wilder',\n        'wildfire',\n        'wildfowl',\n        'wildland',\n        'wildlife',\n        'wildly',\n        'wildness',\n        'willed',\n        'willfully',\n        'willing',\n        'willow',\n        'willpower',\n        'wilt',\n        'wimp',\n        'wince',\n        'wincing',\n        'wind',\n        'wing',\n        'winking',\n        'winner',\n        'winnings',\n        'winter',\n        'wipe',\n        'wired',\n        'wireless',\n        'wiring',\n        'wiry',\n        'wisdom',\n        'wise',\n        'wish',\n        'wisplike',\n        'wispy',\n        'wistful',\n        'wizard',\n        'wobble',\n        'wobbling',\n        'wobbly',\n        'wok',\n        'wolf',\n        'wolverine',\n        'womanhood',\n        'womankind',\n        'womanless',\n        'womanlike',\n        'womanly',\n        'womb',\n        'woof',\n        'wooing',\n        'wool',\n        'woozy',\n        'word',\n        'work',\n        'worried',\n        'worrier',\n        'worrisome',\n        'worry',\n        'worsening',\n        'worshiper',\n        'worst',\n        'wound',\n        'woven',\n        'wow',\n        'wrangle',\n        'wrath',\n        'wreath',\n        'wreckage',\n        'wrecker',\n        'wrecking',\n        'wrench',\n        'wriggle',\n        'wriggly',\n        'wrinkle',\n        'wrinkly',\n        'wrist',\n        'writing',\n        'written',\n        'wrongdoer',\n        'wronged',\n        'wrongful',\n        'wrongly',\n        'wrongness',\n        'wrought',\n        'xbox',\n        'xerox',\n        'yahoo',\n        'yam',\n        'yanking',\n        'yapping',\n        'yard',\n        'yarn',\n        'yeah',\n        'yearbook',\n        'yearling',\n        'yearly',\n        'yearning',\n        'yeast',\n        'yelling',\n        'yelp',\n        'yen',\n        'yesterday',\n        'yiddish',\n        'yield',\n        'yin',\n        'yippee',\n        'yo-yo',\n        'yodel',\n        'yoga',\n        'yogurt',\n        'yonder',\n        'yoyo',\n        'yummy',\n        'zap',\n        'zealous',\n        'zebra',\n        'zen',\n        'zeppelin',\n        'zero',\n        'zestfully',\n        'zesty',\n        'zigzagged',\n        'zipfile',\n        'zipping',\n        'zippy',\n        'zips',\n        'zit',\n        'zodiac',\n        'zombie',\n        'zone',\n        'zoning',\n        'zookeeper',\n        'zoologist',\n        'zoology',\n        'zoom',\n    ];\n\n    public function GeneratePassword(int $length) : string {\n        $password = '';\n\n        for($i = 0; $i < $length; $i ++) {\n            if($password !== '') {\n                $password = $password . ' ';\n            }\n            $password = $password . $this->words[random_int(0, 7775)];\n        }\n\n        return $password;\n    }\n}\n\n"
  },
  {
    "path": "php/src/Container/AioVariables.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nclass AioVariables {\n    /** @var string[] */\n    private array $variables = [];\n\n    public function AddVariable(string $variable) : void {\n        $this->variables[] = $variable;\n    }\n\n    /**\n     * @return string[]\n     */\n    public function GetVariables() : array {\n        return $this->variables;\n    }\n}\n"
  },
  {
    "path": "php/src/Container/Container.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nuse AIO\\Data\\ConfigurationManager;\nuse AIO\\Docker\\DockerActionManager;\nuse AIO\\ContainerDefinitionFetcher;\nuse JsonException;\n\nreadonly class Container {\n    public function __construct(\n        public string                        $identifier,\n        public string                        $displayName,\n        public string                        $containerName,\n        public string                        $restartPolicy,\n        public int                           $maxShutdownTime,\n        public ContainerPorts                $ports,\n        public string                        $internalPorts,\n        public ContainerVolumes              $volumes,\n        public ContainerEnvironmentVariables $containerEnvironmentVariables,\n        /** @var string[] */\n        public array                         $dependsOn,\n        private string                        $uiSecret,\n        /** @var string[] */\n        public array                         $devices,\n        public bool                          $enableNvidiaGpu,\n        /** @var string[] */\n        public array                         $capAdd,\n        public int                           $shmSize,\n        public bool                          $apparmorUnconfined,\n        /** @var string[] */\n        public array                         $backupVolumes,\n        public array                         $nextcloudExecCommands,\n        public bool                          $readOnlyRootFs,\n        public array                         $tmpfs,\n        public bool                          $init,\n        public string                        $imageTag,\n        public AioVariables                  $aioVariables,\n        public string                        $documentation,\n        public bool                          $hideFromList,\n        private DockerActionManager           $dockerActionManager\n    ) {\n    }\n\n    public function GetUiSecret() : string {\n        return $this->dockerActionManager->GetAndGenerateSecretWrapper($this->uiSecret);\n    }\n\n    /**\n     * @throws JsonException\n     */\n    public function GetRunningState() : ContainerState {\n        return $this->dockerActionManager->GetContainerRunningState($this);\n    }\n\n    /**\n     * @throws JsonException\n     */\n    public function GetRestartingState() : ContainerState {\n        return $this->dockerActionManager->GetContainerRestartingState($this);\n    }\n\n    public function GetUpdateState() : VersionState {\n        return $this->dockerActionManager->GetContainerUpdateState($this);\n    }\n\n    public function GetStartingState() : ContainerState {\n        return $this->dockerActionManager->GetContainerStartingState($this);\n    }\n}\n"
  },
  {
    "path": "php/src/Container/ContainerEnvironmentVariables.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nclass ContainerEnvironmentVariables {\n    /** @var string[] */\n    private array $variables = [];\n\n    public function AddVariable(string $variable) : void {\n        $this->variables[] = $variable;\n    }\n\n    /**\n     * @return string[]\n     */\n    public function GetVariables() : array {\n        return $this->variables;\n    }\n}\n"
  },
  {
    "path": "php/src/Container/ContainerPort.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nclass ContainerPort {\n    public function __construct(\n        public string $port,\n        public string $ipBinding,\n        public string $protocol\n    ) {\n    }\n}\n"
  },
  {
    "path": "php/src/Container/ContainerPorts.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nclass ContainerPorts {\n    /** @var ContainerPort[] */\n    private array $ports = [];\n\n    public function AddPort(ContainerPort $port) : void {\n        $this->ports[] = $port;\n    }\n\n    /**\n     * @return ContainerPort[]\n     */\n    public function GetPorts() : array {\n        return $this->ports;\n    }\n}"
  },
  {
    "path": "php/src/Container/ContainerState.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nenum ContainerState: string {\n    case ImageDoesNotExist = 'image_does_not_exist';\n    case NotRestarting = 'not_restarting';\n    case Restarting = 'restarting';\n    case Running = 'running';\n    case Starting = 'starting';\n    case Stopped = 'stopped';\n}\n"
  },
  {
    "path": "php/src/Container/ContainerVolume.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nclass ContainerVolume {\n    public function __construct(\n        public string $name,\n        public string $mountPoint,\n        public bool $isWritable\n    ) {\n    }\n}\n"
  },
  {
    "path": "php/src/Container/ContainerVolumes.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nclass ContainerVolumes {\n    /** @var ContainerVolume[] */\n    private array $volumes = [];\n\n    public function AddVolume(ContainerVolume $volume) : void {\n        $this->volumes[] = $volume;\n    }\n\n    /**\n     * @return ContainerVolume[]\n     */\n    public function GetVolumes() : array {\n        return $this->volumes;\n    }\n}\n"
  },
  {
    "path": "php/src/Container/VersionState.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Container;\n\nenum VersionState: string {\n    case Different = 'different';\n    case Equal = 'equal';\n}\n"
  },
  {
    "path": "php/src/ContainerDefinitionFetcher.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO;\n\nuse AIO\\Container\\AioVariables;\nuse AIO\\Container\\Container;\nuse AIO\\Container\\ContainerEnvironmentVariables;\nuse AIO\\Container\\ContainerPort;\nuse AIO\\Container\\ContainerPorts;\nuse AIO\\Container\\ContainerVolume;\nuse AIO\\Container\\ContainerVolumes;\nuse AIO\\Data\\ConfigurationManager;\nuse AIO\\Data\\DataConst;\nuse AIO\\Docker\\DockerActionManager;\n\nreadonly class ContainerDefinitionFetcher {\n    public function __construct(\n        private ConfigurationManager $configurationManager,\n        private \\DI\\Container $container\n    ) {\n    }\n\n    public function GetContainerById(string $id): Container\n    {\n        $containers = $this->FetchDefinition();\n\n        foreach ($containers as $container) {\n            if ($container->identifier === $id) {\n                return $container;\n            }\n        }\n\n        throw new \\Exception(\"The provided id \" . $id . \" was not found in the container definition.\");\n    }\n\n    /**\n     * @return array\n     */\n    private function GetDefinition(): array\n    {\n        $data = json_decode((string)file_get_contents(DataConst::GetContainersDefinitionPath()), true, 512, JSON_THROW_ON_ERROR);\n\n        $additionalContainerNames = [];\n        foreach ($this->configurationManager->aioCommunityContainers as $communityContainer) {\n            if ($communityContainer !== '') {\n                $path = DataConst::GetCommunityContainersDirectory() . '/' . $communityContainer . '/' . $communityContainer . '.json';\n                $additionalData = json_decode((string)file_get_contents($path), true, 512, JSON_THROW_ON_ERROR);\n                $data = array_merge_recursive($data, $additionalData);\n                if (isset($additionalData['aio_services_v1'][0]['display_name']) && $additionalData['aio_services_v1'][0]['display_name'] !== '') {\n                    // Store container_name of community containers in variable for later\n                    $additionalContainerNames[] = $additionalData['aio_services_v1'][0]['container_name'];\n                }\n            }\n        }\n\n        $containers = [];\n        foreach ($data['aio_services_v1'] as $entry) {\n            if ($entry['container_name'] === 'nextcloud-aio-clamav') {\n                if (!$this->configurationManager->isClamavEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-onlyoffice') {\n                if (!$this->configurationManager->isOnlyofficeEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-collabora') {\n                if (!$this->configurationManager->isCollaboraEnabled) {\n                    continue;\n                }\n                if ($this->configurationManager->isCollaboraSubscriptionEnabled()) {\n                    $entry['image'] = 'ghcr.io/nextcloud-releases/aio-collabora-online';\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-talk') {\n                if (!$this->configurationManager->isTalkEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-talk-recording') {\n                if (!$this->configurationManager->isTalkRecordingEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-imaginary') {\n                if (!$this->configurationManager->isImaginaryEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-fulltextsearch') {\n                if (!$this->configurationManager->isFulltextsearchEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-docker-socket-proxy') {\n                if (!$this->configurationManager->isDockerSocketProxyEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-harp') {\n                if (!$this->configurationManager->isHarpEnabled) {\n                    continue;\n                }\n            } elseif ($entry['container_name'] === 'nextcloud-aio-whiteboard') {\n                if (!$this->configurationManager->isWhiteboardEnabled) {\n                    continue;\n                }\n            }\n\n            $ports = new ContainerPorts();\n            if (isset($entry['ports'])) {\n                foreach ($entry['ports'] as $value) {\n                    $ports->AddPort(\n                        new ContainerPort(\n                            $value['port_number'],\n                            $value['ip_binding'],\n                            $value['protocol']\n                        )\n                    );\n                }\n            }\n\n            $volumes = new ContainerVolumes();\n            if (isset($entry['volumes'])) {\n                foreach ($entry['volumes'] as $value) {\n                    if($value['source'] === '%BORGBACKUP_HOST_LOCATION%') {\n                        $value['source'] = $this->configurationManager->borgBackupHostLocation;\n                        if($value['source'] === '') {\n                            continue;\n                        }\n                    }\n                    if($value['source'] === '%NEXTCLOUD_MOUNT%') {\n                        $value['source'] = $this->configurationManager->nextcloudMount;\n                        if($value['source'] === '') {\n                            continue;\n                        }\n                    } elseif ($value['source'] === '%NEXTCLOUD_DATADIR%') {\n                        $value['source'] = $this->configurationManager->nextcloudDatadirMount;\n                        if ($value['source'] === '') {\n                            continue;\n                        }\n                    } elseif ($value['source'] === '%WATCHTOWER_DOCKER_SOCKET_PATH%') {\n                        $value['source'] = $this->configurationManager->dockerSocketPath;\n                        if($value['source'] === '') {\n                            continue;\n                        }\n                    } elseif ($value['source'] === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') {\n                        $value['source'] = $this->configurationManager->trustedCacertsDir;\n                        if($value['source'] === '') {\n                            continue;\n                        }\n                    }\n                    if ($value['destination'] === '%NEXTCLOUD_MOUNT%') {\n                        $value['destination'] = $this->configurationManager->nextcloudMount;\n                        if($value['destination'] === '') {\n                            continue;\n                        }\n                    }\n                    $volumes->AddVolume(\n                        new ContainerVolume(\n                            $value['source'],\n                            $value['destination'],\n                            $value['writeable']\n                        )\n                    );\n                }\n            }\n\n            $dependsOn = [];\n            if (isset($entry['depends_on'])) {\n                $valueDependsOn = $entry['depends_on'];\n                if ($entry['container_name'] === 'nextcloud-aio-apache') {\n                    // Add community containers first and default ones last so that aio_variables works correctly\n                    $valueDependsOnTemp = [];\n                    foreach ($additionalContainerNames as $containerName) {\n                        $valueDependsOnTemp[] = $containerName;\n                    }\n                    $valueDependsOn = array_merge_recursive($valueDependsOnTemp, $valueDependsOn);\n                }\n                foreach ($valueDependsOn as $value) {\n                    if ($value === 'nextcloud-aio-clamav') {\n                        if (!$this->configurationManager->isClamavEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-onlyoffice') {\n                        if (!$this->configurationManager->isOnlyofficeEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-collabora') {\n                        if (!$this->configurationManager->isCollaboraEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-talk') {\n                        if (!$this->configurationManager->isTalkEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-talk-recording') {\n                        if (!$this->configurationManager->isTalkRecordingEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-imaginary') {\n                        if (!$this->configurationManager->isImaginaryEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-fulltextsearch') {\n                        if (!$this->configurationManager->isFulltextsearchEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-docker-socket-proxy') {\n                        if (!$this->configurationManager->isDockerSocketProxyEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-harp') {\n                        if (!$this->configurationManager->isHarpEnabled) {\n                            continue;\n                        }\n                    } elseif ($value === 'nextcloud-aio-whiteboard') {\n                        if (!$this->configurationManager->isWhiteboardEnabled) {\n                            continue;\n                        }\n                    }\n                    $dependsOn[] = $value;\n                }\n            }\n\n            $variables = new ContainerEnvironmentVariables();\n            if (isset($entry['environment'])) {\n                foreach ($entry['environment'] as $value) {\n                    $variables->AddVariable($value);\n                }\n            }\n\n            $aioVariables = new AioVariables();\n            if (isset($entry['aio_variables'])) {\n                foreach ($entry['aio_variables'] as $value) {\n                    $aioVariables->AddVariable($value);\n                }\n            }\n\n            $displayName = '';\n            if (isset($entry['display_name'])) {\n                $displayName = $entry['display_name'];\n            }\n\n            $restartPolicy = '';\n            if (isset($entry['restart'])) {\n                $restartPolicy = $entry['restart'];\n            }\n\n            $maxShutdownTime = 10;\n            if (isset($entry['stop_grace_period'])) {\n                $maxShutdownTime = $entry['stop_grace_period'];\n            }\n\n            $internalPort = '';\n            if (isset($entry['internal_port'])) {\n                $internalPort = $entry['internal_port'];\n            }\n\n            if (isset($entry['secrets'])) {\n                // All secrets are registered with the configuration when they \n                // are discovered so they can be later generated at time-of-use.\n                foreach ($entry['secrets'] as $secret) {\n                    $this->configurationManager->registerSecret($secret);\n                }\n            }\n\n            $uiSecret = '';\n            if (isset($entry['ui_secret'])) {\n                $uiSecret = $entry['ui_secret'];\n            }\n\n            $devices = [];\n            if (isset($entry['devices'])) {\n                $devices = $entry['devices'];\n            }\n\n            $enableNvidiaGpu = false;\n            if (isset($entry['enable_nvidia_gpu'])) {\n                $enableNvidiaGpu = $entry['enable_nvidia_gpu'];\n            }\n\n            $capAdd = [];\n            if (isset($entry['cap_add'])) {\n                $capAdd = $entry['cap_add'];\n            }\n\n            $shmSize = -1;\n            if (isset($entry['shm_size'])) {\n                $shmSize = $entry['shm_size'];\n            }\n\n            $apparmorUnconfined = false;\n            if (isset($entry['apparmor_unconfined'])) {\n                $apparmorUnconfined = $entry['apparmor_unconfined'];\n            }\n\n            $backupVolumes = [];\n            if (isset($entry['backup_volumes'])) {\n                $backupVolumes = $entry['backup_volumes'];\n            }\n\n            $nextcloudExecCommands = [];\n            if (isset($entry['nextcloud_exec_commands'])) {\n                $nextcloudExecCommands = $entry['nextcloud_exec_commands'];\n            }\n\n            $readOnlyRootFs = false;\n            if (isset($entry['read_only'])) {\n                $readOnlyRootFs = $entry['read_only'];\n            }\n\n            $tmpfs = [];\n            if (isset($entry['tmpfs'])) {\n                $tmpfs = $entry['tmpfs'];\n            }\n\n            $init = true;\n            if (isset($entry['init'])) {\n                $init = $entry['init'];\n            }\n\n            $imageTag = '%AIO_CHANNEL%';\n            if (isset($entry['image_tag'])) {\n                $imageTag = $entry['image_tag'];\n            }\n\n            $documentation = '';\n            if (isset($entry['documentation'])) {\n                $documentation = $entry['documentation'];\n            }\n\n            $hideFromList = $entry['hide_from_list'] ?? false;\n\n            $containers[] = new Container(\n                $entry['container_name'],\n                $displayName,\n                $entry['image'],\n                $restartPolicy,\n                $maxShutdownTime,\n                $ports,\n                $internalPort,\n                $volumes,\n                $variables,\n                $dependsOn,\n                $uiSecret,\n                $devices,\n                $enableNvidiaGpu,\n                $capAdd,\n                $shmSize,\n                $apparmorUnconfined,\n                $backupVolumes,\n                $nextcloudExecCommands,\n                $readOnlyRootFs,\n                $tmpfs,\n                $init,\n                $imageTag,\n                $aioVariables,\n                $documentation,\n                $hideFromList,\n                $this->container->get(DockerActionManager::class)\n            );\n        }\n\n        return $containers;\n    }\n\n    public function FetchDefinition(): array\n    {\n        return $this->GetDefinition();\n    }\n}\n"
  },
  {
    "path": "php/src/Controller/ConfigurationController.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Controller;\n\nuse AIO\\ContainerDefinitionFetcher;\nuse AIO\\Data\\ConfigurationManager;\nuse AIO\\Data\\InvalidSettingConfigurationException;\nuse AIO\\Docker\\DockerActionManager;\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\n\nreadonly class ConfigurationController {\n    public function __construct(\n        private ConfigurationManager $configurationManager\n    ) {\n    }\n\n    public function SetConfig(Request $request, Response $response, array $args): Response {\n        try {\n            $this->configurationManager->startTransaction();\n            if (isset($request->getParsedBody()['domain'])) {\n                $domain = $request->getParsedBody()['domain'] ?? '';\n                $skipDomainValidation = isset($request->getParsedBody()['skip_domain_validation']);\n                $this->configurationManager->setDomain($domain, $skipDomainValidation);\n            }\n\n            if (isset($request->getParsedBody()['current-master-password']) || isset($request->getParsedBody()['new-master-password'])) {\n                $currentMasterPassword = $request->getParsedBody()['current-master-password'] ?? '';\n                $newMasterPassword = $request->getParsedBody()['new-master-password'] ?? '';\n                $this->configurationManager->changeMasterPassword($currentMasterPassword, $newMasterPassword);\n            }\n\n            if (isset($request->getParsedBody()['borg_backup_host_location']) || isset($request->getParsedBody()['borg_remote_repo'])) {\n                $location = $request->getParsedBody()['borg_backup_host_location'] ?? '';\n                $borgRemoteRepo = $request->getParsedBody()['borg_remote_repo'] ?? '';\n                $this->configurationManager->setBorgLocationVars($location, $borgRemoteRepo);\n            }\n\n            if (isset($request->getParsedBody()['borg_restore_host_location']) || isset($request->getParsedBody()['borg_restore_remote_repo']) || isset($request->getParsedBody()['borg_restore_password'])) {\n                $restoreLocation = $request->getParsedBody()['borg_restore_host_location'] ?? '';\n                $borgRemoteRepo = $request->getParsedBody()['borg_restore_remote_repo'] ?? '';\n                $borgPassword = $request->getParsedBody()['borg_restore_password'] ?? '';\n                $this->configurationManager->setBorgRestoreLocationVarsAndPassword($restoreLocation, $borgRemoteRepo, $borgPassword);\n            }\n\n            if (isset($request->getParsedBody()['daily_backup_time'])) {\n                if (isset($request->getParsedBody()['automatic_updates'])) {\n                    $enableAutomaticUpdates = true;\n                } else {\n                    $enableAutomaticUpdates = false;\n                }\n                if (isset($request->getParsedBody()['success_notification'])) {\n                    $successNotification = true;\n                } else {\n                    $successNotification = false;\n                }\n                $dailyBackupTime = $request->getParsedBody()['daily_backup_time'] ?? '';\n                $this->configurationManager->setDailyBackupTime($dailyBackupTime, $enableAutomaticUpdates, $successNotification);\n            }\n\n            if (isset($request->getParsedBody()['delete_daily_backup_time'])) {\n                $this->configurationManager->deleteDailyBackupTime();\n            }\n\n            if (isset($request->getParsedBody()['additional_backup_directories'])) {\n                $additionalBackupDirectories = $request->getParsedBody()['additional_backup_directories'] ?? '';\n                $this->configurationManager->setAdditionalBackupDirectories($additionalBackupDirectories);\n            }\n\n            if (isset($request->getParsedBody()['delete_timezone'])) {\n                $this->configurationManager->deleteTimezone();\n            }\n\n            if (isset($request->getParsedBody()['timezone'])) {\n                $timezone = $request->getParsedBody()['timezone'] ?? '';\n                $this->configurationManager->timezone = $timezone;\n            }\n\n            if (isset($request->getParsedBody()['options-form'])) {\n                $officeSuiteChoice = $request->getParsedBody()['office_suite_choice'] ?? '';\n                \n                if ($officeSuiteChoice === 'collabora') {\n                    $this->configurationManager->isCollaboraEnabled = true;\n                    $this->configurationManager->isOnlyofficeEnabled = false;\n                } elseif ($officeSuiteChoice === 'onlyoffice') {\n                    $this->configurationManager->isCollaboraEnabled = false;\n                    $this->configurationManager->isOnlyofficeEnabled = true;\n                } else {\n                    $this->configurationManager->isCollaboraEnabled = false;\n                    $this->configurationManager->isOnlyofficeEnabled = false;\n                }\n                $this->configurationManager->isClamavEnabled = isset($request->getParsedBody()['clamav']);\n                $this->configurationManager->isTalkEnabled = isset($request->getParsedBody()['talk']);\n                $this->configurationManager->isTalkRecordingEnabled = isset($request->getParsedBody()['talk-recording']);\n                $this->configurationManager->isImaginaryEnabled = isset($request->getParsedBody()['imaginary']);\n                $this->configurationManager->isFulltextsearchEnabled = isset($request->getParsedBody()['fulltextsearch']);\n                $this->configurationManager->isDockerSocketProxyEnabled = isset($request->getParsedBody()['docker-socket-proxy']);\n                $this->configurationManager->isHarpEnabled = isset($request->getParsedBody()['harp']);\n                $this->configurationManager->isWhiteboardEnabled = isset($request->getParsedBody()['whiteboard']);\n            }\n\n            if (isset($request->getParsedBody()['community-form'])) {\n                $cc = $this->configurationManager->listAvailableCommunityContainers();\n                $enabledCC = [];\n                /**\n                 * @psalm-suppress PossiblyNullIterator\n                 */\n                foreach ($request->getParsedBody() as $item) {\n                    if (array_key_exists($item , $cc)) {\n                        $enabledCC[] = $item;\n                    }\n                }\n                $this->configurationManager->aioCommunityContainers = $enabledCC;\n            }\n\n            if (isset($request->getParsedBody()['delete_collabora_dictionaries'])) {\n                $this->configurationManager->deleteCollaboraDictionaries();\n            }\n\n            if (isset($request->getParsedBody()['collabora_dictionaries'])) {\n                $collaboraDictionaries = $request->getParsedBody()['collabora_dictionaries'] ?? '';\n                $this->configurationManager->collaboraDictionaries = $collaboraDictionaries;\n            }\n\n            if (isset($request->getParsedBody()['delete_collabora_additional_options'])) {\n                $this->configurationManager->deleteAdditionalCollaboraOptions();\n            }\n\n            if (isset($request->getParsedBody()['collabora_additional_options'])) {\n                $additionalCollaboraOptions = $request->getParsedBody()['collabora_additional_options'] ?? '';\n                $this->configurationManager->collaboraAdditionalOptions = $additionalCollaboraOptions;\n            }\n\n            if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) {\n                $this->configurationManager->deleteBorgBackupLocationItems();\n            }\n\n            return $response->withStatus(201)->withHeader('Location', '.');\n        } catch (InvalidSettingConfigurationException $ex) {\n            $response->getBody()->write($ex->getMessage());\n            return $response->withStatus(422);\n        } finally {\n            $this->configurationManager->commitTransaction();\n        }\n    }\n}\n"
  },
  {
    "path": "php/src/Controller/DockerController.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Controller;\n\nuse AIO\\Container\\Container;\nuse AIO\\Container\\ContainerState;\nuse AIO\\ContainerDefinitionFetcher;\nuse AIO\\Docker\\DockerActionManager;\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\nuse AIO\\Data\\ConfigurationManager;\nuse Slim\\Psr7\\NonBufferedBody;\n\nreadonly class DockerController {\n    private const string TOP_CONTAINER = 'nextcloud-aio-apache';\n\n    public function __construct(\n        private DockerActionManager           $dockerActionManager,\n        private ContainerDefinitionFetcher    $containerDefinitionFetcher,\n        private ConfigurationManager $configurationManager\n    ) {\n    }\n\n    private function PerformRecursiveContainerStart(string $id, bool $pullImage = true, ?\\Closure $addToStreamingResponseBody = null) : void {\n        $container = $this->containerDefinitionFetcher->GetContainerById($id);\n\n        // Start all dependencies first and then itself\n        foreach($container->dependsOn as $dependency) {\n            $this->PerformRecursiveContainerStart($dependency, $pullImage, $addToStreamingResponseBody);\n        }\n\n        // Don't start if container is already running\n        // This is expected to happen if a container is defined in depends_on of multiple containers\n        if ($container->GetRunningState() === ContainerState::Running) {\n            error_log('Not starting ' . $id . ' because it was already started.');\n            return;\n        }\n\n        $this->dockerActionManager->DeleteContainer($container);\n        $this->dockerActionManager->CreateVolumes($container);\n        $this->dockerActionManager->PullImage($container, $pullImage, $addToStreamingResponseBody);\n        $this->dockerActionManager->CreateContainer($container);\n        $this->dockerActionManager->StartContainer($container, $addToStreamingResponseBody);\n        $this->dockerActionManager->ConnectContainerToNetwork($container);\n    }\n\n    private function PerformRecursiveImagePull(string $id) : void {\n        $container = $this->containerDefinitionFetcher->GetContainerById($id);\n\n        // Pull all dependencies first and then itself\n        foreach($container->dependsOn as $dependency) {\n            $this->PerformRecursiveImagePull($dependency);\n        }\n\n        $this->dockerActionManager->PullImage($container, true);\n    }\n\n    public function PullAllContainerImages(): void {\n\n        $id = self::TOP_CONTAINER;\n\n        $this->PerformRecursiveImagePull($id);\n    }\n\n    public function GetLogs(Request $request, Response $response, array $args) : Response\n    {\n        $requestParams = $request->getQueryParams();\n        $id = '';\n        if (isset($requestParams['id']) && is_string($requestParams['id'])) {\n            $id = $requestParams['id'];\n        }\n        if (str_starts_with($id, 'nextcloud-aio-')) {\n            $since = $this->getTimestampForDockerLogsApiSince($requestParams['since'] ?? '');\n            $logs = $this->dockerActionManager->GetLogs($id, $since);\n        } else {\n            $logs = 'Container not found.';\n        }\n\n        $body = $response->getBody();\n        $body->write($logs);\n\n        return $response\n            ->withStatus(200)\n            ->withHeader('Content-Type', 'text/plain; charset=utf-8')\n            ->withHeader('Content-Disposition', 'inline');\n    }\n\n    public function StartBackupContainerBackup(Request $request, Response $response, array $args) : Response {\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $forceStopNextcloud = true;\n        $this->startBackup($forceStopNextcloud, $addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function startBackup(bool $forceStopNextcloud = false, ?\\Closure $addToStreamingResponseBody = null) : void {\n        $this->configurationManager->backupMode = 'backup';\n\n        $id = self::TOP_CONTAINER;\n        $this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody);\n\n        $id = 'nextcloud-aio-borgbackup';\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n    }\n\n    public function StartBackupContainerCheck(Request $request, Response $response, array $args) : Response {\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $this->checkBackup($addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function StartBackupContainerList(Request $request, Response $response, array $args) : Response {\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $this->listBackup($addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function checkBackup(?\\Closure $addToStreamingResponseBody = null) : void {\n        $this->configurationManager->backupMode = 'check';\n\n        $id = 'nextcloud-aio-borgbackup';\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n    }\n\n    private function listBackup(?\\Closure $addToStreamingResponseBody = null) : void {\n        $this->configurationManager->backupMode = 'list';\n\n        $id = 'nextcloud-aio-borgbackup';\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n    }\n\n    public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response {\n        $this->configurationManager->startTransaction();\n        $this->configurationManager->backupMode = 'restore';\n        $this->configurationManager->selectedRestoreTime = $request->getParsedBody()['selected_restore_time'] ?? '';\n        $this->configurationManager->restoreExcludePreviews = isset($request->getParsedBody()['restore-exclude-previews']);\n        $this->configurationManager->commitTransaction();\n\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $id = self::TOP_CONTAINER;\n        $forceStopNextcloud = true;\n        $this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody);\n\n        $id = 'nextcloud-aio-borgbackup';\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function StartBackupContainerCheckRepair(Request $request, Response $response, array $args) : Response {\n        $this->configurationManager->backupMode = 'check-repair';\n\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $id = 'nextcloud-aio-borgbackup';\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n\n        // Restore to backup check which is needed to make the UI logic work correctly\n        $this->configurationManager->backupMode = 'check';\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response {\n        $this->configurationManager->startTransaction();\n        $this->configurationManager->backupMode = 'test';\n        $this->configurationManager->instanceRestoreAttempt = false;\n        $this->configurationManager->commitTransaction();\n\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $id = self::TOP_CONTAINER;\n        $this->PerformRecursiveContainerStop($id, true, $addToStreamingResponseBody);\n\n        $id = 'nextcloud-aio-borgbackup';\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function StartContainer(Request $request, Response $response, array $args) : Response\n    {\n        $uri = $request->getUri();\n        $host = $uri->getHost();\n        $port = $uri->getPort();\n        $path = $request->getParsedBody()['base_path'] ?? '';\n        if ($port === 8000) {\n            error_log('The AIO_URL-port was discovered to be 8000 which is not expected. It is now set to 443.');\n            $port = 443;\n        }\n\n        if (isset($request->getParsedBody()['install_latest_major'])) {\n            $installLatestMajor = '33';\n        } else {\n            $installLatestMajor = '';\n        }\n        \n        $this->configurationManager->startTransaction();\n        $this->configurationManager->installLatestMajor = $installLatestMajor;\n        // set AIO_URL\n        $this->configurationManager->aioUrl = $host . ':' . (string)$port . $path;\n        // set wasStartButtonClicked\n        $this->configurationManager->wasStartButtonClicked = true;\n        $this->configurationManager->commitTransaction();\n        \n        // Do not pull container images in case 'bypass_container_update' is set via url params\n        // Needed for local testing\n        $pullImage = !isset($request->getParsedBody()['bypass_container_update']);\n        if ($pullImage === false) {\n            error_log('WARNING: Not pulling container images. Instead, using local ones.');\n        }\n        \n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n        \n        // Start container\n        $this->startTopContainer($pullImage, $addToStreamingResponseBody);\n\n        // Clear apcu cache in order to check if container updates are available\n        // Temporarily disabled as it leads much faster to docker rate limits\n        // apcu_clear_cache();\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function startTopContainer(bool $pullImage, ?\\Closure $addToStreamingResponseBody = null) : void {\n        $this->configurationManager->aioToken = bin2hex(random_bytes(24));\n\n        // Stop domaincheck since apache would not be able to start otherwise\n        $this->StopDomaincheckContainer();\n\n        $id = self::TOP_CONTAINER;\n\n        $this->PerformRecursiveContainerStart($id, $pullImage, $addToStreamingResponseBody);\n    }\n\n    public function StartWatchtowerContainer(Request $request, Response $response, array $args) : Response {\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $this->startWatchtower($addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function startWatchtower(?\\Closure $addToStreamingResponseBody = null) : void {\n        $id = 'nextcloud-aio-watchtower';\n\n        $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);\n    }\n\n    private function PerformRecursiveContainerStop(string $id, bool $forceStopNextcloud = false, ?\\Closure $addToStreamingResponseBody = null) : void\n    {\n        $container = $this->containerDefinitionFetcher->GetContainerById($id);\n\n        // This is a hack but no better solution was found for the meantime\n        // Stop Collabora first to make sure it force-saves\n        // See https://github.com/nextcloud/richdocuments/issues/3799\n        if ($id === self::TOP_CONTAINER && $this->configurationManager->isCollaboraEnabled) {\n            $this->PerformRecursiveContainerStop('nextcloud-aio-collabora', false, $addToStreamingResponseBody);\n        }\n\n        if ($addToStreamingResponseBody !== null) {\n            $addToStreamingResponseBody($container, \"Stopping container\");\n        }\n\n        // Stop itself first and then all the dependencies\n        if ($id !== 'nextcloud-aio-nextcloud') {\n            $this->dockerActionManager->StopContainer($container);\n        } else {\n            // We want to stop the Nextcloud container after 10s and not wait for the configured stop_grace_period\n            $this->dockerActionManager->StopContainer($container, $forceStopNextcloud);\n        }\n        foreach($container->dependsOn as $dependency) {\n            $this->PerformRecursiveContainerStop($dependency, $forceStopNextcloud, $addToStreamingResponseBody);\n        }\n    }\n\n    public function StopContainer(Request $request, Response $response, array $args) : Response\n    {\n        // Get streaming response start and closure\n        $nonbufResp = $this->startStreamingResponse($response);\n        $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);\n\n        $id = self::TOP_CONTAINER;\n        $forceStopNextcloud = true;\n        $this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody);\n\n        // End streaming response\n        $this->finalizeStreamingResponse($nonbufResp);\n        return $nonbufResp;\n    }\n\n    public function stopTopContainer() : void {\n        $id = self::TOP_CONTAINER;\n        $this->PerformRecursiveContainerStop($id);\n    }\n\n    public function StartDomaincheckContainer() : void\n    {\n        # Don't start if domain is already set\n        if ($this->configurationManager->domain !== '' || $this->configurationManager->wasStartButtonClicked) {\n            return;\n        }\n\n        $id = 'nextcloud-aio-domaincheck';\n\n        $cacheKey = 'domaincheckWasStarted';\n\n        $domaincheckContainer = $this->containerDefinitionFetcher->GetContainerById($id);\n        $apacheContainer = $this->containerDefinitionFetcher->GetContainerById(self::TOP_CONTAINER);\n        // Don't start if apache is already running\n        if ($apacheContainer->GetRunningState() === ContainerState::Running) {\n            return;\n        // Don't start if domaincheck is already running\n        } elseif ($domaincheckContainer->GetRunningState() === ContainerState::Running) {\n            $domaincheckWasStarted = apcu_fetch($cacheKey);\n            // Start domaincheck again when 10 minutes are over by not returning here\n            if($domaincheckWasStarted !== false && is_string($domaincheckWasStarted)) {\n                return;\n            }\n        }\n\n        $this->StopDomaincheckContainer();\n        try {\n            $this->PerformRecursiveContainerStart($id);\n        } catch (\\Exception $e) {\n            error_log('Could not start domaincheck container: ' . $e->getMessage());\n        }\n\n        // Cache the start for 10 minutes\n        apcu_add($cacheKey, '1', 600);\n    }\n\n    private function StopDomaincheckContainer() : void\n    {\n        $id = 'nextcloud-aio-domaincheck';\n        $this->PerformRecursiveContainerStop($id);\n    }\n\n    private function getStreamingResponseHtmlStart() : string {\n        return <<<END\n        <!DOCTYPE html>\n        <html lang=\"en\" class=\"overlay-iframe\">\n            <head>\n                <link rel=\"stylesheet\" href=\"../../style.css?v8\" media=\"all\" />\n                <script>\n                    const observer = new MutationObserver((records) => {\n                        const node = records[0]?.addedNodes[0];\n                        // Text nodes also appear here but can't be scrolled to, so we have to check for the\n                        // function being present.\n                        if (node && typeof(node.scrollIntoView) === 'function') {\n                            node.scrollIntoView();\n                        }\n                    });\n                    observer.observe(document, {childList: true, subtree: true});\n                </script>\n            </head>\n            <body>\n            \n        END;\n    }\n\n    private function startStreamingResponse(Response $response) : Response {\n        $nonbufResp = $response\n            ->withBody(new NonBufferedBody())\n            ->withHeader('Content-Type', 'text/html; charset=utf-8')\n            ->withHeader('X-Accel-Buffering', 'no')\n            ->withHeader('Content-Length', '-1')\n            ->withHeader('Cache-Control', 'no-cache');\n            \n        // Text written into this body is immediately sent to the client, without waiting for later content.\n        $streamingResponseBody = $nonbufResp->getBody();\n        \n        $streamingResponseBody->write($this->getStreamingResponseHtmlStart());\n\n        return $nonbufResp;\n    }\n\n    private function getAddToStreamingResponseBody(Response $nonbufResp) : ?\\Closure {\n        // Create a closure to pass around to the code, which should to the logging (because it e.g. decides\n        // if it'll actually pull an image), but which should not need to know anything about the\n        // wanted markup or formatting.\n        $addToStreamingResponseBody = function (Container $container, string $message) use ($nonbufResp) : void {\n            $nonbufResp->getBody()->write(\"<div>{$container->displayName}: {$message}</div>\");\n        };\n\n        return $addToStreamingResponseBody;\n    }\n\n    private function finalizeStreamingResponse(Response $nonbufResp) : void {\n        $nonbufResp->getBody()->write($this->getStreamingResponseHtmlEnd());\n    }\n\n    private function getStreamingResponseHtmlEnd() : string {\n        return \"\\n  </body>\\n</html>\";\n    }\n\n    private function getTimestampForDockerLogsApiSince(string $input) : string\n    {\n        if ($input === '') {\n            return '';\n        }\n\n        // We expect an RFC3339Nano string with Timezone UTC here, as docker will put out.\n        // Unfortunately PHP doesn't support this format with nanoseconds, so we have to help\n        // ourselves a little bit.\n        // First we split off the nanoseconds.\n        preg_match('/^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})\\.(\\d{9}).*/', $input, $match);\n        if (count($match) !== 3) {\n            // The input doesn't match our expectations, it might be manipulated, we ignore it.\n            return '';\n        }\n\n        $datetime = \\DateTimeImmutable::createFromFormat(\"Y-m-d\\\\TH:i:s\", $match[1]);\n        $nanoseconds = $match[2];\n\n        if ($datetime === false) {\n            // Input was not parseable, it might be manipulated, we ignore it.\n            return '';\n        }\n\n        // Format the datetime as unix timestamp.\n        $timestamp = $datetime->format('U');\n\n        // Increase the nanoseconds by 1, so we don't get the line with exactly the original datetime again.\n        $nanoseconds = strval(intval($nanoseconds) + 1);\n\n        // Now append the nanoseconds to the timestamp-string.\n        return \"{$timestamp}.{$nanoseconds}\";\n    }\n}\n"
  },
  {
    "path": "php/src/Controller/LoginController.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Controller;\n\nuse AIO\\Auth\\AuthManager;\nuse AIO\\Container\\Container;\nuse AIO\\ContainerDefinitionFetcher;\nuse AIO\\Docker\\DockerActionManager;\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\n\nreadonly class LoginController {\n    public function __construct(\n        private AuthManager $authManager,\n        private DockerActionManager $dockerActionManager,\n    ) {\n    }\n\n    public function TryLogin(Request $request, Response $response, array $args) : Response {\n        if (!$this->dockerActionManager->isLoginAllowed()) {\n            $response->getBody()->write(\"The login is blocked since Nextcloud is running.\");\n            return $response->withHeader('Location', '.')->withStatus(422);\n        }\n        $password = $request->getParsedBody()['password'] ?? '';\n        if($this->authManager->CheckCredentials($password)) {\n            $this->authManager->SetAuthState(true);\n            return $response->withHeader('Location', '.')->withStatus(201);\n        }\n\n        $response->getBody()->write(\"The password is incorrect.\");\n        return $response->withHeader('Location', '.')->withStatus(422);\n    }\n\n    public function GetTryLogin(Request $request, Response $response, array $args) : Response {\n        $token = $request->getQueryParams()['token'] ?? '';\n        if($this->authManager->CheckToken($token)) {\n            $this->authManager->SetAuthState(true);\n            return $response->withHeader('Location', '../..')->withStatus(302);\n        }\n\n        return $response->withHeader('Location', '../..')->withStatus(302);\n    }\n\n    public function Logout(Request $request, Response $response, array $args) : Response\n    {\n        $this->authManager->SetAuthState(false);\n        return $response\n            ->withHeader('Location', '../..')\n            ->withStatus(302);\n    }\n}\n"
  },
  {
    "path": "php/src/Cron/BackupNotification.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n// increase memory limit to 2GB\nini_set('memory_limit', '2048M');\n\nuse DI\\Container;\n\nrequire __DIR__ . '/../../vendor/autoload.php';\n\n$container = \\AIO\\DependencyInjection::GetContainer();\n\n/** @var \\AIO\\Docker\\DockerActionManager $dockerActionManager */\n$dockerActionManager = $container->get(\\AIO\\Docker\\DockerActionManager::class);\n/** @var \\AIO\\ContainerDefinitionFetcher $containerDefinitionFetcher */\n$containerDefinitionFetcher = $container->get(\\AIO\\ContainerDefinitionFetcher::class);\n\n$id = 'nextcloud-aio-nextcloud';\n$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);\n\n$backupExitCode = $dockerActionManager->GetBackupcontainerExitCode();\n\nif ($backupExitCode === 0) {\n    if (getenv('SEND_SUCCESS_NOTIFICATIONS') === \"0\") {\n        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.\");\n    } else {\n        $dockerActionManager->sendNotification($nextcloudContainer, 'Daily backup successful!', 'You can get further info by looking at the backup logs in the AIO interface.');\n    }\n}\n\nif ($backupExitCode > 0) {\n    $dockerActionManager->sendNotification($nextcloudContainer, 'Daily backup failed!', 'You can get further info by looking at the backup logs in the AIO interface.');\n}\n"
  },
  {
    "path": "php/src/Cron/CheckBackup.php",
    "content": "<?php\r\ndeclare(strict_types=1);\r\n\r\n// increase memory limit to 2GB\r\nini_set('memory_limit', '2048M');\r\n\r\nuse DI\\Container;\r\n\r\nrequire __DIR__ . '/../../vendor/autoload.php';\r\n\r\n$container = \\AIO\\DependencyInjection::GetContainer();\r\n\r\n/** @var \\AIO\\Controller\\DockerController $dockerController */\r\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\r\n\r\n// Stop container and start backup check\r\n$dockerController->checkBackup();\r\n"
  },
  {
    "path": "php/src/Cron/CheckFreeDiskSpace.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n// increase memory limit to 2GB\nini_set('memory_limit', '2048M');\n\nuse DI\\Container;\nuse AIO\\Data\\DataConst;\n\nrequire __DIR__ . '/../../vendor/autoload.php';\n\n$container = \\AIO\\DependencyInjection::GetContainer();\n\n/** @var \\AIO\\Docker\\DockerActionManager $dockerActionManager */\n$dockerActionManager = $container->get(\\AIO\\Docker\\DockerActionManager::class);\n/** @var \\AIO\\ContainerDefinitionFetcher $containerDefinitionFetcher */\n$containerDefinitionFetcher = $container->get(\\AIO\\ContainerDefinitionFetcher::class);\n\n$id = 'nextcloud-aio-nextcloud';\n$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);\n\n$df = disk_free_space(DataConst::GetDataDirectory());\nif ($df !== false && (int)$df < 1024 * 1024 * 1024 * 5) {\n    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!\");\n    $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!');\n}\n"
  },
  {
    "path": "php/src/Cron/CreateBackup.php",
    "content": "<?php\r\ndeclare(strict_types=1);\r\n\r\n// increase memory limit to 2GB\r\nini_set('memory_limit', '2048M');\r\n\r\nuse DI\\Container;\r\n\r\nrequire __DIR__ . '/../../vendor/autoload.php';\r\n\r\n$container = \\AIO\\DependencyInjection::GetContainer();\r\n\r\n/** @var \\AIO\\Controller\\DockerController $dockerController */\r\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\r\n\r\n// Stop container and start backup\r\n$dockerController->startBackup();\r\n"
  },
  {
    "path": "php/src/Cron/OutdatedNotification.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n// increase memory limit to 2GB\nini_set('memory_limit', '2048M');\n\nuse DI\\Container;\n\nrequire __DIR__ . '/../../vendor/autoload.php';\n\n$container = \\AIO\\DependencyInjection::GetContainer();\n\n/** @var \\AIO\\Docker\\DockerActionManager $dockerActionManager */\n$dockerActionManager = $container->get(\\AIO\\Docker\\DockerActionManager::class);\n/** @var \\AIO\\ContainerDefinitionFetcher $containerDefinitionFetcher */\n$containerDefinitionFetcher = $container->get(\\AIO\\ContainerDefinitionFetcher::class);\n\n$id = 'nextcloud-aio-nextcloud';\n$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);\n\n$isNextcloudImageOutdated = $dockerActionManager->isNextcloudImageOutdated();\n\nif ($isNextcloudImageOutdated === true) {\n    $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');\n}\n\n"
  },
  {
    "path": "php/src/Cron/PullContainerImages.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n// increase memory limit to 2GB\nini_set('memory_limit', '2048M');\n\n// Log whole log messages\nini_set('log_errors_max_len', '0');\n\nuse DI\\Container;\n\nrequire __DIR__ . '/../../vendor/autoload.php';\n\n$container = \\AIO\\DependencyInjection::GetContainer();\n\n/** @var \\AIO\\Controller\\DockerController $dockerController */\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\n\n// Pull all containers\n$dockerController->PullAllContainerImages();\n"
  },
  {
    "path": "php/src/Cron/StartAndUpdateContainers.php",
    "content": "<?php\r\ndeclare(strict_types=1);\r\n\r\n// increase memory limit to 2GB\r\nini_set('memory_limit', '2048M');\r\n\r\n// Log whole log messages\r\nini_set('log_errors_max_len', '0');\r\n\r\nuse DI\\Container;\r\n\r\nrequire __DIR__ . '/../../vendor/autoload.php';\r\n\r\n$container = \\AIO\\DependencyInjection::GetContainer();\r\n\r\n/** @var \\AIO\\Controller\\DockerController $dockerController */\r\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\r\n\r\n// Start apache\r\n$dockerController->startTopContainer(true);\r\n"
  },
  {
    "path": "php/src/Cron/StartContainers.php",
    "content": "<?php\r\ndeclare(strict_types=1);\r\n\r\n// increase memory limit to 2GB\r\nini_set('memory_limit', '2048M');\r\n\r\n// Log whole log messages\r\nini_set('log_errors_max_len', '0');\r\n\r\nuse DI\\Container;\r\n\r\nrequire __DIR__ . '/../../vendor/autoload.php';\r\n\r\n$container = \\AIO\\DependencyInjection::GetContainer();\r\n\r\n/** @var \\AIO\\Controller\\DockerController $dockerController */\r\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\r\n\r\n// Start apache\r\n$dockerController->startTopContainer(false);\r\n"
  },
  {
    "path": "php/src/Cron/StopContainers.php",
    "content": "<?php\r\ndeclare(strict_types=1);\r\n\r\n// increase memory limit to 2GB\r\nini_set('memory_limit', '2048M');\r\n\r\nuse DI\\Container;\r\n\r\nrequire __DIR__ . '/../../vendor/autoload.php';\r\n\r\n$container = \\AIO\\DependencyInjection::GetContainer();\r\n\r\n/** @var \\AIO\\Controller\\DockerController $dockerController */\r\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\r\n\r\n// Start apache\r\n$dockerController->stopTopContainer();\r\n"
  },
  {
    "path": "php/src/Cron/UpdateMastercontainer.php",
    "content": "<?php\r\ndeclare(strict_types=1);\r\n\r\n// increase memory limit to 2GB\r\nini_set('memory_limit', '2048M');\r\n\r\nuse DI\\Container;\r\n\r\nrequire __DIR__ . '/../../vendor/autoload.php';\r\n\r\n$container = \\AIO\\DependencyInjection::GetContainer();\r\n\r\n/** @var \\AIO\\Controller\\DockerController $dockerController */\r\n$dockerController = $container->get(\\AIO\\Controller\\DockerController::class);\r\n\r\n# Update the mastercontainer\r\n$dockerController->startWatchtower();\r\n"
  },
  {
    "path": "php/src/Cron/UpdateNotification.php",
    "content": "<?php\ndeclare(strict_types=1);\n\n// increase memory limit to 2GB\nini_set('memory_limit', '2048M');\n\nuse DI\\Container;\n\nrequire __DIR__ . '/../../vendor/autoload.php';\n\n$container = \\AIO\\DependencyInjection::GetContainer();\n\n/** @var \\AIO\\Docker\\DockerActionManager $dockerActionManager */\n$dockerActionManager = $container->get(\\AIO\\Docker\\DockerActionManager::class);\n/** @var \\AIO\\ContainerDefinitionFetcher $containerDefinitionFetcher */\n$containerDefinitionFetcher = $container->get(\\AIO\\ContainerDefinitionFetcher::class);\n\n$id = 'nextcloud-aio-nextcloud';\n$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);\n\n$isMastercontainerUpdateAvailable = $dockerActionManager->IsMastercontainerUpdateAvailable();\n$isAnyUpdateAvailable = $dockerActionManager->isAnyUpdateAvailable();\n\nif ($isMastercontainerUpdateAvailable === true) {\n    $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.');\n}\n\nif ($isAnyUpdateAvailable === true) {\n    $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.');\n}\n"
  },
  {
    "path": "php/src/Data/ConfigurationManager.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Data;\n\nuse AIO\\Auth\\PasswordGenerator;\nuse AIO\\Controller\\DockerController;\n\nclass ConfigurationManager\n{\n    private array $secrets = [];\n\n    private array $config = [];\n\n    private bool $noWrite = false;\n\n    public string $aioToken {\n        get => $this->get('AIO_TOKEN', '');\n        set { $this->set('AIO_TOKEN', $value); }\n    }\n\n    public string $password {\n        get => $this->get('password', '');\n        set { $this->set('password', $value); }\n    }\n\n    public bool $isDockerSocketProxyEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isDockerSocketProxyEnabled', false);\n        set { $this->set('isDockerSocketProxyEnabled', $value); }\n    }\n\n    public bool $isHarpEnabled {\n        get => $this->get('isHarpEnabled', false);\n        set { $this->set('isHarpEnabled', $value); }\n    }\n\n    public bool $isWhiteboardEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isWhiteboardEnabled', true);\n        set { $this->set('isWhiteboardEnabled', $value); }\n    }\n\n    public bool $restoreExcludePreviews {\n        // Type-cast because old configs could have '1'/'' for this key.\n        get => (bool) $this->get('restore-exclude-previews', false);\n        set { $this->set('restore-exclude-previews', $value); }\n    }\n\n    public string $selectedRestoreTime {\n        get => $this->get('selected-restore-time', '');\n        set { $this->set('selected-restore-time', $value); }\n    }\n\n    public string $backupMode {\n        get => $this->get('backup-mode', '');\n        set { $this->set('backup-mode', $value); }\n    }\n\n    public bool $instanceRestoreAttempt {\n        // Type-cast because old configs could have 1/'' for this key.\n        get => (bool) $this->get('instance_restore_attempt', false);\n        set { $this->set('instance_restore_attempt', $value); }\n    }\n\n    public string $aioUrl {\n        get => $this->get('AIO_URL', '');\n        set { $this->set('AIO_URL', $value); }\n    }\n\n    public bool $wasStartButtonClicked {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('wasStartButtonClicked', false);\n        set { $this->set('wasStartButtonClicked', $value); }\n    }\n\n    public string $installLatestMajor {\n        // Type-cast because old configs could have integers for this key.\n        get => (string) $this->get('install_latest_major', '');\n        set { $this->set('install_latest_major', $value); }\n    }\n\n    public bool $isClamavEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isClamavEnabled', false);\n        set { $this->set('isClamavEnabled', $value); }\n    }\n\n    public bool $isOnlyofficeEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isOnlyofficeEnabled', false);\n        set { $this->set('isOnlyofficeEnabled', $value); }\n    }\n\n    public bool $isCollaboraEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isCollaboraEnabled', true);\n        set { $this->set('isCollaboraEnabled', $value); }\n    }\n\n    public bool $isTalkEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isTalkEnabled', true);\n        set { $this->set('isTalkEnabled', $value); }\n    }\n\n    public bool $isTalkRecordingEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->isTalkEnabled && $this->get('isTalkRecordingEnabled', false);\n        set { $this->set('isTalkRecordingEnabled', $this->isTalkEnabled && $value); }\n    }\n\n    public bool $isImaginaryEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isImaginaryEnabled', true);\n        set { $this->set('isImaginaryEnabled', $value); }\n    }\n\n    public bool $isFulltextsearchEnabled {\n        // Type-cast because old configs could have 1/0 for this key.\n        get => (bool) $this->get('isFulltextsearchEnabled', false);\n        // Elasticsearch does not work on kernels without seccomp anymore. See https://github.com/nextcloud/all-in-one/discussions/5768\n        set { $this->set('isFulltextsearchEnabled', (!$this->collaboraSeccompDisabled && $value)); }\n    }\n\n    public string $domain {\n        get => $this->get('domain', '');\n        set { $this->setDomain($value); }\n    }\n\n    public string $borgBackupHostLocation {\n        get => $this->get('borg_backup_host_location', '');\n        set { $this->set('borg_backup_host_location', $value); }\n    }\n\n    public string $borgRemoteRepo {\n        get => $this->get('borg_remote_repo', '');\n        set { $this->set('borg_remote_repo', $value); }\n    }\n\n    public string $borgRestorePassword {\n        get => $this->get('borg_restore_password', '');\n        set { $this->set('borg_restore_password', $value); }\n    }\n\n    public string $apacheIpBinding {\n        get => $this->getEnvironmentalVariableOrConfig('APACHE_IP_BINDING', 'apache_ip_binding', '');\n        set { $this->set('apache_ip_binding', $value); }\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public string $timezone {\n        get => $this->get('timezone', '');\n        set {\n            // This throws an exception if the validation fails.\n            $this->validateTimezone($value);\n            $this->set('timezone', $value);\n        }\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public string $collaboraDictionaries {\n        get => $this->get('collabora_dictionaries', '');\n        set {\n            // This throws an exception if the validation fails.\n            $this->validateCollaboraDictionaries($value);\n            $this->set('collabora_dictionaries', $value);\n        }\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public string $collaboraAdditionalOptions {\n        get => $this->get('collabora_additional_options', '');\n        set {\n            // This throws an exception if the validation fails.\n            $this->validateCollaboraAdditionalOptions($value);\n            $this->set('collabora_additional_options', $value);\n        }\n    }\n\n    public array $aioCommunityContainers {\n        get => explode(' ', $this->get('aio_community_containers', ''));\n        set { $this->set('aio_community_containers', implode(' ', $value)); }\n    }\n\n    public string $turnDomain {\n        get => $this->get('turn_domain', '');\n        set { $this->set('turn_domain', $value); }\n    }\n\n    public string $apachePort {\n        get => $this->getEnvironmentalVariableOrConfig('APACHE_PORT', 'apache_port', '443');\n        set { $this->set('apache_port', $value); }\n    }\n\n    public string $talkPort {\n        get => $this->getEnvironmentalVariableOrConfig('TALK_PORT', 'talk_port', '3478');\n        set { $this->set('talk_port', $value); }\n    }\n\n    public string $nextcloudMount {\n        get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_MOUNT', 'nextcloud_mount', '');\n        set { $this->set('nextcloud_mount', $value); }\n    }\n\n    public string $nextcloudDatadirMount {\n        get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_DATADIR', 'nextcloud_datadir', 'nextcloud_aio_nextcloud_data');\n        set { $this->set('nextcloud_datadir_mount', $value); }\n    }\n\n    public string $nextcloudUploadLimit {\n        get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_UPLOAD_LIMIT', 'nextcloud_upload_limit', '16G');\n        set { $this->set('nextcloud_upload_limit', $value); }\n    }\n\n    public string $nextcloudMemoryLimit {\n        get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_MEMORY_LIMIT', 'nextcloud_memory_limit', '512M');\n        set { $this->set('nextcloud_memory_limit', $value); }\n    }\n\n    public function getApacheMaxSize() : int {\n        $uploadLimit = (int)rtrim($this->nextcloudUploadLimit, 'G');\n        return $uploadLimit * 1024 * 1024 * 1024;\n    }\n\n    public string $nextcloudMaxTime {\n        get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_MAX_TIME', 'nextcloud_max_time', '3600');\n        set { $this->set('nextcloud_max_time', $value); }\n    }\n\n    public string $borgRetentionPolicy {\n        get => $this->getEnvironmentalVariableOrConfig('BORG_RETENTION_POLICY', 'borg_retention_policy', '--keep-within=7d --keep-weekly=4 --keep-monthly=6');\n        set { $this->set('borg_retention_policy', $value); }\n    }\n\n    public string $fulltextsearchJavaOptions {\n        get => $this->getEnvironmentalVariableOrConfig('FULLTEXTSEARCH_JAVA_OPTIONS', 'fulltextsearch_java_options', '-Xms512M -Xmx512M');\n        set { $this->set('fulltextsearch_java_options', $value); }\n    }\n\n    public string $dockerSocketPath {\n        get => $this->getEnvironmentalVariableOrConfig('WATCHTOWER_DOCKER_SOCKET_PATH', 'docker_socket_path', '/var/run/docker.sock');\n        set { $this->set('docker_socket_path', $value); }\n    }\n\n    public string $trustedCacertsDir {\n        get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_TRUSTED_CACERTS_DIR', 'trusted_cacerts_dir', '');\n        set { $this->set('trusted_cacerts_dir', $value); }\n    }\n\n    public string $nextcloudAdditionalApks {\n        get => trim($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ADDITIONAL_APKS', 'nextcloud_additional_apks', 'imagemagick'));\n        set { $this->set('nextcloud_addtional_apks', $value); }\n    }\n\n    public string $nextcloudAdditionalPhpExtensions {\n        get => trim($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS', 'nextcloud_additional_php_extensions', 'imagick'));\n        set { $this->set('nextcloud_additional_php_extensions', $value); }\n    }\n\n    public bool $collaboraSeccompDisabled {\n        get => $this->booleanize($this->getEnvironmentalVariableOrConfig('COLLABORA_SECCOMP_DISABLED', 'collabora_seccomp_disabled', ''));\n        set { $this->set('collabora_seccomp_disabled', $value); }\n    }\n\n    public bool $disableBackupSection {\n        get => $this->booleanize($this->getEnvironmentalVariableOrConfig('AIO_DISABLE_BACKUP_SECTION', 'disable_backup_section', ''));\n        set { $this->set('disable_backup_section', $value); }\n    }\n\n    public bool $nextcloudEnableDriDevice{\n        get => $this->booleanize($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_DRI_DEVICE', 'nextcloud_enable_dri_device', ''));\n        set { $this->set('nextcloud_enable_dri_device', $value); }\n    }\n\n    public bool $enableNvidiaGpu {\n        get => $this->booleanize($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_NVIDIA_GPU', 'enable_nvidia_gpu', ''));\n        set { $this->set('enable_nvidia_gpu', $value); }\n    }\n\n    public bool $nextcloudKeepDisabledApps {\n        get => $this->booleanize($this->getEnvironmentalVariableOrConfig('NEXTCLOUD_KEEP_DISABLED_APPS', 'nextcloud_keep_disabled_apps', ''));\n        set { $this->set('nextcloud_keep_disabled_apps', $value); }\n    }\n\n    private function getConfig() : array\n    {\n        if ($this->config === [] && file_exists(DataConst::GetConfigFile()))\n        {\n            $configContent = (string)file_get_contents(DataConst::GetConfigFile());\n            $this->config = json_decode($configContent, true, 512, JSON_THROW_ON_ERROR);\n        }\n\n        return $this->config;\n    }\n\n    private function get(string $key, mixed $fallbackValue = null) : mixed {\n        return $this->getConfig()[$key] ?? $fallbackValue;\n    }\n\n    private function set(string $key, mixed $value) : void {\n        $this->getConfig();\n        $this->config[$key] = $value;\n        // Only write if this isn't called in between startTransaction() and commitTransaction().\n        if ($this->noWrite !== true) {\n            $this->writeConfig();\n        }\n    }\n\n    /**\n     * This allows to assign multiple attributes without saving the config to disk in between. It must be\n     * followed by a call to commitTransaction(), which then writes all changes to disk.\n     */\n    public function startTransaction() : void {\n        $this->getConfig();\n        $this->noWrite = true;\n    }\n\n    /**\n     * This allows to assign multiple attributes without saving the config to disk in between.\n     */\n    public function commitTransaction() : void {\n        try {\n            $this->writeConfig();\n        } finally {\n            $this->noWrite = false;\n        }\n    }\n\n    public function getAndGenerateSecret(string $secretId) : string {\n        if ($secretId === '') {\n            return '';\n        }\n\n        $secrets = $this->get('secrets', []);\n        if (!isset($secrets[$secretId])) {\n            $secrets[$secretId] = bin2hex(random_bytes(24));\n            $this->set('secrets', $secrets);\n        }\n\n        if ($secretId === 'BORGBACKUP_PASSWORD' && !file_exists(DataConst::GetBackupSecretFile())) {\n            $this->doubleSafeBackupSecret($secrets[$secretId]);\n        }\n\n        return $secrets[$secretId];\n    }\n\n    public function getRegisteredSecret(string $secretId) : string {\n        if ($this->secrets[$secretId]) {\n            return $this->getAndGenerateSecret($secretId);\n        }\n        throw new \\Exception(\"The secret \" . $secretId . \" was not registered. Please check if it is defined in secrets of containers.json.\");\n    }\n\n    public function registerSecret(string $secretId) : void {\n        $this->secrets[$secretId] = true;\n    }\n\n    private function doubleSafeBackupSecret(string $borgBackupPassword) : void {\n        file_put_contents(DataConst::GetBackupSecretFile(), $borgBackupPassword);\n    }\n\n    public function hasBackupRunOnce() : bool {\n        if (!file_exists(DataConst::GetBackupKeyFile())) {\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    public function getLastBackupTime() : string {\n        if (!file_exists(DataConst::GetBackupArchivesList())) {\n            return '';\n        }\n\n        $content = (string)file_get_contents(DataConst::GetBackupArchivesList());\n\n        $lastBackupLines = explode(\"\\n\", $content);\n        $lastBackupLine = \"\";\n        if (count($lastBackupLines) >= 2) {\n            $lastBackupLine = $lastBackupLines[sizeof($lastBackupLines) - 2];\n        }\n        if ($lastBackupLine === \"\") {\n            return '';\n        }\n\n        $lastBackupTimes = explode(\",\", $lastBackupLine);\n        $lastBackupTime = $lastBackupTimes[1];\n        if ($lastBackupTime === \"\") {\n            return '';\n        }\n\n        return $lastBackupTime;\n    }\n\n    public function getBackupTimes() : array {\n        if (!file_exists(DataConst::GetBackupArchivesList())) {\n            return [];\n        }\n\n        $content = (string)file_get_contents(DataConst::GetBackupArchivesList());\n\n        $backupLines = explode(\"\\n\", $content);\n        $backupTimes = [];\n        foreach($backupLines as $lines) {\n            if ($lines !== \"\") {\n                $backupTimesTemp = explode(',', $lines);\n                $backupTimes[] = $backupTimesTemp[1];\n            }\n        }\n\n        // Reverse the array to list newest backup first\n        $backupTimes = array_reverse($backupTimes);\n\n        return $backupTimes;\n    }\n\n    public function getAioVersion() : string {\n        $path = DataConst::GetAioVersionFile();\n        if ($path !== '' && file_exists($path)) {\n            return trim((string)file_get_contents($path));\n        }\n        return '';\n    }\n\n    private function isx64Platform() : bool {\n        if (php_uname('m') === 'x86_64') {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     *\n     * We can't turn this into a private validation method because of the second argument.\n     */\n    public function setDomain(string $domain, bool $skipDomainValidation) : void {\n        // Validate that at least one dot is contained\n        if (!str_contains($domain, '.')) {\n            throw new InvalidSettingConfigurationException(\"Domain must contain at least one dot!\");\n        }\n\n        // Validate that no slashes are contained\n        if (str_contains($domain, '/')) {\n            throw new InvalidSettingConfigurationException(\"Domain must not contain slashes!\");\n        }\n\n        // Validate that no colons are contained\n        if (str_contains($domain, ':')) {\n            throw new InvalidSettingConfigurationException(\"Domain must not contain colons!\");\n        }\n\n        // Validate domain\n        if (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {\n            throw new InvalidSettingConfigurationException(\"Domain is not a valid domain!\");\n        }\n\n        // Validate that it is not an IP-address\n        if(filter_var($domain, FILTER_VALIDATE_IP)) {\n            throw new InvalidSettingConfigurationException(\"Please enter a domain and not an IP-address!\");\n        }\n\n        // Skip domain validation if opted in to do so\n        if ($this->shouldDomainValidationBeSkipped($skipDomainValidation)) {\n            error_log('Skipping domain validation');\n        } else {\n            $dnsRecordIP = gethostbyname($domain);\n            if ($dnsRecordIP === $domain) {\n                $dnsRecordIP = '';\n            }\n\n            if (empty($dnsRecordIP)) {\n                $record = dns_get_record($domain, DNS_AAAA);\n                if (isset($record[0]['ipv6']) && !empty($record[0]['ipv6'])) {\n                    $dnsRecordIP = $record[0]['ipv6'];\n                }\n            }\n\n            // Validate IP\n            if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP)) {\n                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 . \"')\");\n            }\n\n            // Get the apache port\n            $port = $this->apachePort;\n\n            if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {\n                if ($port === '443') {\n                    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!\");\n                } else {\n                    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 . \"')\");\n                }\n            }\n\n            // Check if port 443 is open\n            $connection = @fsockopen($domain, 443, $errno, $errstr, 10);\n            if ($connection) {\n                fclose($connection);\n            } else {\n                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.\");\n            }\n\n            // Get Instance ID\n            $instanceID = $this->getAndGenerateSecret('INSTANCE_ID');\n\n            // set protocol\n            if ($port !== '443') {\n                $protocol = 'https://';\n            } else {\n                $protocol = 'http://';\n            }\n\n            // Check if response is correct\n            $ch = curl_init();\n            if ($ch === false) {\n                throw new InvalidSettingConfigurationException('Could not init curl! Please check the logs!');\n            }\n            $testUrl = $protocol . $domain . ':443';\n            curl_setopt($ch, CURLOPT_URL, $testUrl);\n            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n            curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n            $response = (string)curl_exec($ch);\n            # Get rid of trailing \\n\n            $response = str_replace(\"\\n\", \"\", $response);\n\n            if ($response !== $instanceID) {\n                error_log('The response of the connection attempt to \"' . $testUrl . '\" was: ' . $response);\n                error_log('Expected was: ' . $instanceID);\n                error_log('The error message was: ' . curl_error($ch));\n                $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')\";\n                if ($port === '443') {\n                    $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.\";\n                } else {\n                    error_log('Please follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#how-to-debug in order to debug things!');\n                }\n                throw new InvalidSettingConfigurationException($notice);\n            }\n        }\n\n        $this->startTransaction();\n        // Write domain\n        // Don't set the domain via the attribute, or we create a loop.\n        $this->set('domain', $domain);\n        // Reset the borg restore password when setting the domain\n        $this->borgRestorePassword = '';\n        $this->startTransaction();\n        $this->commitTransaction();\n    }\n\n    public function getBaseDN() : string {\n        $domain = $this->domain;\n        if ($domain === \"\") {\n            return \"\";\n        }\n        return 'dc=' . implode(',dc=', explode('.', $domain));\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function setBorgLocationVars(string $location, string $repo) : void {\n        $this->validateBorgLocationVars($location, $repo);\n        $this->startTransaction();\n        $this->borgBackupHostLocation = $location;\n        $this->borgRemoteRepo = $repo;\n        $this->commitTransaction();\n    }\n\n    private function validateBorgLocationVars(string $location, string $repo) : void {\n        if ($location === '' && $repo === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter a path or a remote repo url!\");\n        } elseif ($location !== '' && $repo !== '') {\n            throw new InvalidSettingConfigurationException(\"Location and remote repo url are mutually exclusive!\");\n        }\n\n        if ($location !== '') {\n            $isValidPath = false;\n            if (str_starts_with($location, '/') && !str_ends_with($location, '/')) {\n                $isValidPath = true;\n            } elseif ($location === 'nextcloud_aio_backupdir') {\n                $isValidPath = true;\n            }\n\n            if (!$isValidPath) {\n                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'.\");\n            }\n\n            // Prevent backup to be contained in Nextcloud Datadir as this will delete the backup archive upon restore\n            // See https://github.com/nextcloud/all-in-one/issues/6607\n            if (str_starts_with($location . '/', rtrim($this->nextcloudDatadirMount, '/') . '/')) {\n                throw new InvalidSettingConfigurationException(\"The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to \" . $this->nextcloudDatadirMount);\n            }\n\n        } else {\n            $this->validateBorgRemoteRepo($repo);\n        }\n    }\n\n    private function validateBorgRemoteRepo(string $repo) : void {\n        $commonMsg = \"For valid urls, see the remote examples at https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls\";\n        if ($repo === \"\") {\n            // Ok, remote repo is optional\n        } elseif (!str_contains($repo, \"@\")) {\n            throw new InvalidSettingConfigurationException(\"The remote repo must contain '@'. $commonMsg\");\n        } elseif (!str_contains($repo, \":\")) {\n            throw new InvalidSettingConfigurationException(\"The remote repo must contain ':'. $commonMsg\");\n        }\n    }\n\n    public function deleteBorgBackupLocationItems() : void {\n        // Delete the variables\n        $this->startTransaction();\n        $this->borgBackupHostLocation = '';\n        $this->borgRemoteRepo = '';\n        $this->commitTransaction();\n\n        // Also delete the borg config file to be able to start over\n        if (file_exists(DataConst::GetBackupKeyFile())) {\n            if (unlink(DataConst::GetBackupKeyFile())) {\n                error_log('borg.config file deleted to be able to start over.');\n            }\n        }\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function setBorgRestoreLocationVarsAndPassword(string $location, string $repo, string $password) : void {\n        $this->validateBorgLocationVars($location, $repo);\n\n        if ($password === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter the password!\");\n        }\n\n        $this->startTransaction();\n        $this->borgBackupHostLocation = $location;\n        $this->borgRemoteRepo = $repo;\n        $this->borgRestorePassword = $password;\n        $this->instanceRestoreAttempt = true;\n        $this->commitTransaction();\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function changeMasterPassword(string $currentPassword, string $newPassword) : void {\n        if ($currentPassword === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter your current password.\");\n        }\n\n        if ($currentPassword !== $this->password) {\n            throw new InvalidSettingConfigurationException(\"The entered current password is not correct.\");\n        }\n\n        if ($newPassword === '') {\n            throw new InvalidSettingConfigurationException(\"Please enter a new password.\");\n        }\n\n        if (strlen($newPassword) < 24) {\n            throw new InvalidSettingConfigurationException(\"New passwords must be >= 24 digits.\");\n        }\n\n        if (!preg_match(\"#^[a-zA-Z0-9 ]+$#\", $newPassword)) {\n            throw new InvalidSettingConfigurationException('Not allowed characters in the new password.');\n        }\n\n        // All checks pass so set the password\n        $this->set('password', $newPassword);\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    private function writeConfig() : void {\n        if(!is_dir(DataConst::GetDataDirectory())) {\n            throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . \" does not exist! Something was set up falsely!\");\n        }\n        // Shouldn't happen, but as a precaution we won't write an empty config to disk.\n        if ($this->config === []) {\n            return;\n        }\n        $df = disk_free_space(DataConst::GetDataDirectory());\n        $content = json_encode($this->config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR);\n        $size = strlen($content) + 10240;\n        if ($df !== false && (int)$df < $size) {\n            throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . \" does not have enough space for writing the config file! Not writing it back!\");\n        }\n        file_put_contents(DataConst::GetConfigFile(), $content);\n        $this->config = [];\n    }\n\n    private function getEnvironmentalVariableOrConfig(string $envVariableName, string $configName, string $defaultValue) : string {\n        $envVariableOutput = getenv($envVariableName);\n        $configValue = $this->get($configName, '');\n        if ($envVariableOutput === false) {\n            if ($configValue === '') {\n                return $defaultValue;\n            }\n            return $configValue;\n        }\n\n        if (file_exists(DataConst::GetConfigFile())) {\n            if ($envVariableOutput !== $configValue) {\n                $this->set($configName, $envVariableOutput);\n            }\n        }\n\n        return $envVariableOutput;\n    }\n\n    public function getBorgPublicKey() : string {\n        if (!file_exists(DataConst::GetBackupPublicKey())) {\n            return \"\";\n        }\n\n        return trim((string)file_get_contents(DataConst::GetBackupPublicKey()));\n    }\n\n    public function getCollaboraSeccompPolicy() : string {\n        $defaultString = '--o:security.seccomp=';\n        if (!$this->collaboraSeccompDisabled) {\n            return $defaultString . 'true';\n        }\n        return $defaultString . 'false';\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function setDailyBackupTime(string $time, bool $enableAutomaticUpdates, bool $successNotification) : void {\n        if ($time === \"\") {\n            throw new InvalidSettingConfigurationException(\"The daily backup time must not be empty!\");\n        }\n\n        if (!preg_match(\"#^[0-1][0-9]:[0-5][0-9]$#\", $time) && !preg_match(\"#^2[0-3]:[0-5][0-9]$#\", $time)) {\n            throw new InvalidSettingConfigurationException(\"You did not enter a correct time! One correct example is '04:00'!\");\n        }\n\n        if ($enableAutomaticUpdates === false) {\n            $time .= PHP_EOL . 'automaticUpdatesAreNotEnabled';\n        } else {\n            $time .= PHP_EOL;\n        }\n        if ($successNotification === false) {\n            $time .= PHP_EOL . 'successNotificationsAreNotEnabled';\n        } else {\n            $time .= PHP_EOL;\n        }\n        file_put_contents(DataConst::GetDailyBackupTimeFile(), $time);\n    }\n\n    public function getDailyBackupTime() : string {\n        if (!file_exists(DataConst::GetDailyBackupTimeFile())) {\n            return '';\n        }\n        $dailyBackupFile = (string)file_get_contents(DataConst::GetDailyBackupTimeFile());\n        $dailyBackupFileArray = explode(\"\\n\", $dailyBackupFile);\n        return $dailyBackupFileArray[0];\n    }\n\n    public function areAutomaticUpdatesEnabled() : bool {\n        if (!file_exists(DataConst::GetDailyBackupTimeFile())) {\n            return false;\n        }\n        $dailyBackupFile = (string)file_get_contents(DataConst::GetDailyBackupTimeFile());\n        $dailyBackupFileArray = explode(\"\\n\", $dailyBackupFile);\n        if (isset($dailyBackupFileArray[1]) && $dailyBackupFileArray[1] === 'automaticUpdatesAreNotEnabled') {\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    public function deleteDailyBackupTime() : void {\n        if (file_exists(DataConst::GetDailyBackupTimeFile())) {\n            unlink(DataConst::GetDailyBackupTimeFile());\n        }\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function setAdditionalBackupDirectories(string $additionalBackupDirectories) : void {\n        $additionalBackupDirectoriesArray = explode(\"\\n\", $additionalBackupDirectories);\n        $validDirectories = '';\n        foreach($additionalBackupDirectoriesArray as $entry) {\n            // Trim all unwanted chars on both sites\n            $entry = trim($entry);\n            if ($entry !== \"\") {\n                if (!preg_match(\"#^/[.0-9a-zA-Z/_-]+$#\", $entry) && !preg_match(\"#^[.0-9a-zA-Z_-]+$#\", $entry)) {\n                    throw new InvalidSettingConfigurationException(\"You entered unallowed characters! Problematic is \" . $entry);\n                }\n                $validDirectories .= rtrim($entry, '/') . PHP_EOL;\n            }\n        }\n\n        if ($validDirectories === '') {\n            unlink(DataConst::GetAdditionalBackupDirectoriesFile());\n        } else {\n            file_put_contents(DataConst::GetAdditionalBackupDirectoriesFile(), $validDirectories);\n        }\n    }\n\n    public function getAdditionalBackupDirectoriesString() : string {\n        if (!file_exists(DataConst::GetAdditionalBackupDirectoriesFile())) {\n            return '';\n        }\n        return (string)file_get_contents(DataConst::GetAdditionalBackupDirectoriesFile());\n    }\n\n    public function getAdditionalBackupDirectoriesArray() : array {\n        $additionalBackupDirectories = $this->getAdditionalBackupDirectoriesString();\n        $additionalBackupDirectoriesArray = explode(\"\\n\", $additionalBackupDirectories);\n        $additionalBackupDirectoriesArray = array_unique($additionalBackupDirectoriesArray, SORT_REGULAR);\n        return $additionalBackupDirectoriesArray;\n    }\n\n    public function isDailyBackupRunning() : bool {\n        return file_exists(DataConst::GetDailyBackupBlockFile());\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    private function validateTimezone(string $timezone) : void {\n        if ($timezone === \"\") {\n            throw new InvalidSettingConfigurationException(\"The timezone must not be empty!\");\n        }\n\n        if (!preg_match(\"#^[a-zA-Z0-9_\\-\\/\\+]+$#\", $timezone)) {\n            throw new InvalidSettingConfigurationException(\"The entered timezone does not seem to be a valid timezone!\");\n        }\n    }\n\n    /**\n     * Provide an extra method since our `timezone` attribute setter prevents setting an empty timezone.\n     */\n    public function deleteTimezone() : void {\n        $this->set('timezone', '');\n    }\n\n    public function shouldDomainValidationBeSkipped(bool $skipDomainValidation) : bool {\n        if ($skipDomainValidation || getenv('SKIP_DOMAIN_VALIDATION') === 'true') {\n            return true;\n        }\n        return false;\n    }\n\n    public function getApacheAdditionalNetwork() : string {\n        $network = getenv('APACHE_ADDITIONAL_NETWORK');\n        if (is_string($network)) {\n            return trim($network);\n        }\n        return '';\n    }\n\n    public function getNextcloudStartupApps() : string {\n        $apps = getenv('NEXTCLOUD_STARTUP_APPS');\n        if (is_string($apps)) {\n            return trim($apps);\n        }\n        return 'deck twofactor_totp tasks calendar contacts notes';\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    private function validateCollaboraDictionaries(string $CollaboraDictionaries) : void {\n        if ($CollaboraDictionaries === \"\") {\n            throw new InvalidSettingConfigurationException(\"The dictionaries must not be empty!\");\n        }\n\n        if (!preg_match(\"#^[a-zA-Z_ ]+$#\", $CollaboraDictionaries)) {\n            throw new InvalidSettingConfigurationException(\"The entered dictionaries do not seem to be a valid!\");\n        }\n    }\n\n    /**\n     * Provide an extra method since the corresponding attribute setter prevents setting an empty value.\n     */\n    public function deleteCollaboraDictionaries() : void {\n        $this->set('collabora_dictionaries', '');\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    private function validateCollaboraAdditionalOptions(string $additionalCollaboraOptions) : void {\n        if ($additionalCollaboraOptions === \"\") {\n            throw new InvalidSettingConfigurationException(\"The additional options must not be empty!\");\n        }\n\n        if (!preg_match(\"#^--o:#\", $additionalCollaboraOptions)) {\n            throw new InvalidSettingConfigurationException(\"The entered options must start with '--o:'. So the config does not seem to be a valid!\");\n        }\n    }\n\n    public function isCollaboraSubscriptionEnabled() : bool {\n        return str_contains($this->collaboraAdditionalOptions, '--o:support_key=');\n    }\n\n    /**\n     * Provide an extra method since the corresponding attribute setter prevents setting an empty value.\n     */\n    public function deleteAdditionalCollaboraOptions() : void {\n        $this->set('collabora_additional_options', '');\n    }\n\n    public function listAvailableCommunityContainers() : array {\n        $cc = [];\n        $dir = scandir(DataConst::GetCommunityContainersDirectory());\n        if ($dir === false) {\n            return $cc;\n        }\n        // Get rid of dots from the scandir command\n        $dir = array_diff($dir, array('..', '.', 'readme.md'));\n        foreach ($dir as $id) {\n            $filePath = DataConst::GetCommunityContainersDirectory() . '/' . $id . '/' . $id . '.json';\n            $fileContents = apcu_fetch($filePath);\n            if (!is_string($fileContents)) {\n                $fileContents = file_get_contents($filePath);\n                if (is_string($fileContents)) {\n                    apcu_add($filePath, $fileContents);\n                }\n            } \n            $json = is_string($fileContents) ? json_decode($fileContents, true, 512, JSON_THROW_ON_ERROR) : false;\n            if(is_array($json) && is_array($json['aio_services_v1'])) {\n                foreach ($json['aio_services_v1'] as $service) {\n                    $documentation = is_string($service['documentation']) ? $service['documentation'] : '';\n                    if (is_string($service['display_name'])) {\n                        $cc[$id] = [ \n                            'id' => $id,\n                            'name' => $service['display_name'],\n                            'documentation' => $documentation\n                        ];\n                    }\n                    break;\n                }\n            }\n        }\n        return $cc;\n    }\n\n    private function camelize(string $input, string $delimiter = '_') : string {\n        if ($input === '') {\n            throw new InvalidSettingConfigurationException('input cannot be empty!');\n        }\n        if ($delimiter === '') {\n            $delimiter = '_';\n        }\n        return lcfirst(implode(\"\", array_map('ucfirst', explode($delimiter, strtolower($input)))));\n\n    }\n\n    public function setAioVariables(array $input) : void {\n        if ($input === []) {\n            return;\n        }\n        $this->startTransaction();\n        foreach ($input as $variable) {\n            if (!is_string($variable) || !str_contains($variable, '=')) {\n                error_log(\"Invalid input: '$variable' is not a string or does not contain an equal sign ('=')\");\n                continue;\n            }\n            $keyWithValue = $this->replaceEnvPlaceholders($variable);\n            // Pad the result with nulls so psalm is happy (and we don't risk to run into warnings in case\n            // the check for an equal sign from above gets changed).\n            [$key, $value] = explode('=', $keyWithValue, 2) + [null, null];\n            $key = $this->camelize($key);\n            if ($value === null) {\n                error_log(\"Invalid input: '$keyWithValue' has no value after the equal sign\");\n            } else if (!property_exists($this, $key)) {\n                error_log(\"Error: '$key' is not a valid configuration key (in '$keyWithValue')\");\n            } else {\n                $this->$key = $value;\n            }\n        }\n        $this->commitTransaction();\n    }\n\n    //\n    // Replaces placeholders in $envValue with their values.\n    // E.g. \"%NC_DOMAIN%:%APACHE_PORT\" becomes \"my.nextcloud.com:11000\"\n    public function replaceEnvPlaceholders(string $envValue): string {\n        // $pattern breaks down as:\n        // % - matches a literal percent sign\n        // ([^%]+) - capture group that matches one or more characters that are NOT percent signs\n        // % - matches the closing percent sign\n        //\n        // Assumes literal percent signs are always matched and there is no\n        // escaping.\n        $pattern = '/%([^%]+)%/';\n        $matchCount = preg_match_all($pattern, $envValue, $matches);\n\n        if ($matchCount === 0) {\n            return $envValue;\n        }\n\n        $placeholders = $matches[0]; // [\"%PLACEHOLDER1%\", \"%PLACEHOLDER2%\", ...]\n        $placeholderNames = $matches[1]; // [\"PLACEHOLDER1\", \"PLACEHOLDER2\", ...]\n        $placeholderPatterns = array_map(static fn(string $p) => '/' . preg_quote($p) . '/', $placeholders); // [\"/%PLACEHOLDER1%/\", ...]\n        $placeholderValues = array_map($this->getPlaceholderValue(...), $placeholderNames); // [\"val1\", \"val2\"]\n        // Guaranteed to be non-null because we found the placeholders in the preg_match_all.\n        return (string) preg_replace($placeholderPatterns, $placeholderValues, $envValue);\n    }\n\n    private function getPlaceholderValue(string $placeholder) : string {\n        return match ($placeholder) {\n            'NC_DOMAIN' => $this->domain,\n            'NC_BASE_DN' => $this->getBaseDN(),\n            'AIO_TOKEN' => $this->aioToken,\n            'BORGBACKUP_REMOTE_REPO' => $this->borgRemoteRepo,\n            'BORGBACKUP_MODE' => $this->backupMode,\n            'AIO_URL' => $this->aioUrl,\n            'SELECTED_RESTORE_TIME' => $this->selectedRestoreTime,\n            'RESTORE_EXCLUDE_PREVIEWS' => $this->restoreExcludePreviews ? '1' : '',\n            'APACHE_PORT' => $this->apachePort,\n            'APACHE_IP_BINDING' => $this->apacheIpBinding,\n            'TALK_PORT' => $this->talkPort,\n            'TURN_DOMAIN' => $this->turnDomain,\n            'NEXTCLOUD_MOUNT' => $this->nextcloudMount,\n            'BACKUP_RESTORE_PASSWORD' => $this->borgRestorePassword,\n            'CLAMAV_ENABLED' => $this->isClamavEnabled ? 'yes' : '',\n            'TALK_RECORDING_ENABLED' => $this->isTalkRecordingEnabled ? 'yes' : '',\n            'ONLYOFFICE_ENABLED' => $this->isOnlyofficeEnabled ? 'yes' : '',\n            'COLLABORA_ENABLED' => $this->isCollaboraEnabled ? 'yes' : '',\n            'TALK_ENABLED' => $this->isTalkEnabled ? 'yes' : '',\n            'UPDATE_NEXTCLOUD_APPS' => ($this->isDailyBackupRunning() && $this->areAutomaticUpdatesEnabled()) ? 'yes' : '',\n            'TIMEZONE' => $this->timezone === '' ? 'Etc/UTC' : $this->timezone,\n            'COLLABORA_DICTIONARIES' => $this->collaboraDictionaries === '' ? 'de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru' : $this->collaboraDictionaries,\n            'IMAGINARY_ENABLED' => $this->isImaginaryEnabled ? 'yes' : '',\n            'FULLTEXTSEARCH_ENABLED' => $this->isFulltextsearchEnabled ? 'yes' : '',\n            'DOCKER_SOCKET_PROXY_ENABLED' => $this->isDockerSocketProxyEnabled ? 'yes' : '',\n            'HARP_ENABLED' => $this->isHarpEnabled ? 'yes' : '',\n            'NEXTCLOUD_UPLOAD_LIMIT' => $this->nextcloudUploadLimit,\n            'NEXTCLOUD_MEMORY_LIMIT' => $this->nextcloudMemoryLimit,\n            'NEXTCLOUD_MAX_TIME' => $this->nextcloudMaxTime,\n            'BORG_RETENTION_POLICY' => $this->borgRetentionPolicy,\n            'FULLTEXTSEARCH_JAVA_OPTIONS' => $this->fulltextsearchJavaOptions,\n            'NEXTCLOUD_TRUSTED_CACERTS_DIR' => $this->trustedCacertsDir,\n            'ADDITIONAL_DIRECTORIES_BACKUP' => $this->getAdditionalBackupDirectoriesString() !== '' ? 'yes' : '',\n            'BORGBACKUP_HOST_LOCATION' => $this->borgBackupHostLocation,\n            'APACHE_MAX_SIZE' => (string)($this->getApacheMaxSize()),\n            'COLLABORA_SECCOMP_POLICY' => $this->getCollaboraSeccompPolicy(),\n            'NEXTCLOUD_STARTUP_APPS' => $this->getNextcloudStartupApps(),\n            'NEXTCLOUD_ADDITIONAL_APKS' => $this->nextcloudAdditionalApks,\n            'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS' => $this->nextcloudAdditionalPhpExtensions,\n            'INSTALL_LATEST_MAJOR' => $this->installLatestMajor ? 'yes' : '',\n            'REMOVE_DISABLED_APPS' => $this->nextcloudKeepDisabledApps ? '' : 'yes',\n            // 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)\n            'AIO_DATABASE_HOST' => gethostbyname('nextcloud-aio-database'),\n            // Allow to get local ip-address of caddy container and add it to trusted proxies automatically\n            'CADDY_IP_ADDRESS' => in_array('caddy', $this->aioCommunityContainers, true) ? gethostbyname('nextcloud-aio-caddy') : '',\n            'WHITEBOARD_ENABLED' => $this->isWhiteboardEnabled ? 'yes' : '',\n            'AIO_VERSION' => $this->getAioVersion(),\n            default => $this->getRegisteredSecret($placeholder),\n        };\n    }\n    \n    private function booleanize(mixed $value) : bool {\n        return in_array($value, [true, 'true'], true);\n    }\n}\n"
  },
  {
    "path": "php/src/Data/DataConst.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Data;\n\nclass DataConst {\n    public static function GetDataDirectory() : string {\n        if(is_dir('/mnt/docker-aio-config/data/')) {\n            return '/mnt/docker-aio-config/data/';\n        }\n\n        return (string)realpath(__DIR__ . '/../../data/');\n    }\n\n    public static function GetSessionDirectory() : string {\n        if(is_dir('/mnt/docker-aio-config/session/')) {\n            return '/mnt/docker-aio-config/session/';\n        }\n\n        return (string)realpath(__DIR__ . '/../../session/');\n    }\n\n    public static function GetConfigFile() : string {\n        return self::GetDataDirectory() . '/configuration.json';\n    }\n\n    public static function GetBackupPublicKey() : string {\n        return self::GetDataDirectory() . '/id_borg.pub';\n    }\n\n    public static function GetBackupSecretFile() : string {\n        return self::GetDataDirectory() . '/backupsecret';\n    }\n\n    public static function GetDailyBackupTimeFile() : string {\n        return self::GetDataDirectory() . '/daily_backup_time';\n    }\n\n    public static function GetAdditionalBackupDirectoriesFile() : string {\n        return self::GetDataDirectory() . '/additional_backup_directories';\n    }\n\n    public static function GetDailyBackupBlockFile() : string {\n        return self::GetDataDirectory() . '/daily_backup_running';\n    }\n\n    public static function GetBackupKeyFile() : string {\n        return self::GetDataDirectory() . '/borg.config';\n    }\n\n    public static function GetBackupArchivesList() : string {\n        return self::GetDataDirectory() . '/backup_archives.list';\n    }\n\n    public static function GetSessionDateFile() : string {\n        return self::GetDataDirectory() . '/session_date_file';\n    }\n\n    public static function GetCommunityContainersDirectory() : string {\n        return (string)realpath(__DIR__ . '/../../../community-containers/');\n    }\n\n    public static function GetCollaboraSeccompProfilePath() : string {\n        return (string)realpath(__DIR__ . '/../../cool-seccomp-profile.json');\n    }\n\n    public static function GetContainersDefinitionPath() : string {\n        return (string)realpath(__DIR__ . '/../../containers.json');\n    }\n\n    public static function GetAioVersionFile() : string {\n        return (string)realpath(__DIR__ . '/../../templates/includes/aio-version.twig');\n    }\n}\n"
  },
  {
    "path": "php/src/Data/InvalidSettingConfigurationException.php",
    "content": "<?php\n\ndeclare(strict_types=1);\nnamespace AIO\\Data;\n\nclass InvalidSettingConfigurationException extends \\Exception {}\n"
  },
  {
    "path": "php/src/Data/Setup.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Data;\n\nuse AIO\\Auth\\PasswordGenerator;\n\nreadonly class Setup {\n    public function __construct(\n        private PasswordGenerator $passwordGenerator,\n        private ConfigurationManager $configurationManager,\n    ) {\n    }\n\n    public function Setup() : string {\n        if(!$this->CanBeInstalled()) {\n            return '';\n        }\n\n        $password = $this->passwordGenerator->GeneratePassword(8);\n        $this->configurationManager->password = $password;\n        return $password;\n    }\n\n    public function CanBeInstalled() : bool {\n        return !file_exists(DataConst::GetConfigFile());\n    }\n}\n"
  },
  {
    "path": "php/src/DependencyInjection.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO;\n\nuse AIO\\Docker\\DockerHubManager;\nuse DI\\Container;\nuse AIO\\Docker\\GitHubContainerRegistryManager;\n\nclass DependencyInjection\n{\n    public static function GetContainer() : Container {\n        $container = new Container();\n\n        $container->set(\n            DockerHubManager::class,\n            new DockerHubManager()\n        );\n\n        $container->set(\n            GitHubContainerRegistryManager::class,\n            new GitHubContainerRegistryManager()\n        );\n\n        $container->set(\n            \\AIO\\Data\\ConfigurationManager::class,\n            new \\AIO\\Data\\ConfigurationManager()\n        );\n        $container->set(\n            \\AIO\\Docker\\DockerActionManager::class,\n            new \\AIO\\Docker\\DockerActionManager(\n                $container->get(\\AIO\\Data\\ConfigurationManager::class),\n                $container->get(\\AIO\\ContainerDefinitionFetcher::class),\n                $container->get(DockerHubManager::class),\n                $container->get(GitHubContainerRegistryManager::class)\n            )\n        );\n        $container->set(\n            \\AIO\\Auth\\PasswordGenerator::class,\n            new \\AIO\\Auth\\PasswordGenerator()\n        );\n        $container->set(\n            \\AIO\\Auth\\AuthManager::class,\n            new \\AIO\\Auth\\AuthManager($container->get(\\AIO\\Data\\ConfigurationManager::class))\n        );\n        $container->set(\n            \\AIO\\Data\\Setup::class,\n            new \\AIO\\Data\\Setup(\n                $container->get(\\AIO\\Auth\\PasswordGenerator::class),\n                $container->get(\\AIO\\Data\\ConfigurationManager::class)\n            )\n        );\n\n        return $container;\n    }\n}"
  },
  {
    "path": "php/src/Docker/DockerActionManager.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Docker;\n\nuse AIO\\Container\\Container;\nuse AIO\\Container\\ContainerState;\nuse AIO\\Container\\VersionState;\nuse AIO\\ContainerDefinitionFetcher;\nuse AIO\\Data\\ConfigurationManager;\nuse AIO\\Data\\DataConst;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Exception\\RequestException;\nuse http\\Env\\Response;\n\nreadonly class DockerActionManager {\n    private const string API_VERSION = 'v1.44';\n    private Client $guzzleClient;\n\n    public function __construct(\n        private ConfigurationManager           $configurationManager,\n        private ContainerDefinitionFetcher     $containerDefinitionFetcher,\n        private DockerHubManager               $dockerHubManager,\n        private GitHubContainerRegistryManager $gitHubContainerRegistryManager\n    ) {\n        $this->guzzleClient = new Client(['curl' => [CURLOPT_UNIX_SOCKET_PATH => '/var/run/docker.sock']]);\n    }\n\n    private function BuildApiUrl(string $url): string {\n        $apiVersion = getenv('DOCKER_API_VERSION');\n        if ($apiVersion === false || empty($apiVersion)) {\n            $apiVersion = self::API_VERSION;\n        } else {\n            $apiVersion = 'v'. $apiVersion;\n        }\n        return sprintf('http://127.0.0.1/%s/%s', $apiVersion, $url);\n    }\n\n    private function BuildImageName(Container $container): string {\n        $tag = $container->imageTag;\n        if ($tag === '%AIO_CHANNEL%') {\n            $tag = $this->GetCurrentChannel();\n        }\n        return $container->containerName . ':' . $tag;\n    }\n\n    public function GetContainerRunningState(Container $container): ContainerState {\n        $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($container->identifier)));\n        try {\n            $response = $this->guzzleClient->get($url);\n        } catch (RequestException $e) {\n            if ($e->getCode() === 404) {\n                return ContainerState::ImageDoesNotExist;\n            }\n            throw $e;\n        }\n\n        $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR);\n\n        if ($responseBody['State']['Running'] === true) {\n            return ContainerState::Running;\n        } else {\n            return ContainerState::Stopped;\n        }\n    }\n\n    public function GetContainerRestartingState(Container $container): ContainerState {\n        $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($container->identifier)));\n        try {\n            $response = $this->guzzleClient->get($url);\n        } catch (RequestException $e) {\n            if ($e->getCode() === 404) {\n                return ContainerState::ImageDoesNotExist;\n            }\n            throw $e;\n        }\n\n        $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR);\n\n        if ($responseBody['State']['Restarting'] === true) {\n            return ContainerState::Restarting;\n        } else {\n            return ContainerState::NotRestarting;\n        }\n    }\n\n    public function GetContainerUpdateState(Container $container): VersionState {\n        $tag = $container->imageTag;\n        if ($tag === '%AIO_CHANNEL%') {\n            $tag = $this->GetCurrentChannel();\n        }\n\n        $runningDigests = $this->GetRepoDigestsOfContainer($container->identifier);\n        if ($runningDigests === null) {\n            return VersionState::Different;\n        }\n        $remoteDigest = $this->GetLatestDigestOfTag($container->containerName, $tag);\n        if ($remoteDigest === null) {\n            return VersionState::Equal;\n        }\n\n        foreach ($runningDigests as $runningDigest) {\n            if ($runningDigest === $remoteDigest) {\n                return VersionState::Equal;\n            }\n        }\n        return VersionState::Different;\n    }\n\n    public function GetContainerStartingState(Container $container): ContainerState {\n        $runningState = $this->GetContainerRunningState($container);\n        if ($runningState === ContainerState::Stopped || $runningState === ContainerState::ImageDoesNotExist) {\n            return $runningState;\n        }\n\n        $containerName = $container->identifier;\n        $internalPort = $container->internalPorts;\n        if ($internalPort === '%APACHE_PORT%') {\n            $internalPort = $this->configurationManager->apachePort;\n        } elseif ($internalPort === '%TALK_PORT%') {\n            $internalPort = $this->configurationManager->talkPort;\n        }\n\n        if ($internalPort !== \"\" && $internalPort !== 'host') {\n            $connection = @fsockopen($containerName, (int)$internalPort, $errno, $errstr, 0.2);\n            if ($connection) {\n                fclose($connection);\n                return ContainerState::Running;\n            } else {\n                return ContainerState::Starting;\n            }\n        } else {\n            return ContainerState::Running;\n        }\n    }\n\n    public function DeleteContainer(Container $container): void {\n        $url = $this->BuildApiUrl(sprintf('containers/%s?v=true', urlencode($container->identifier)));\n        try {\n            $this->guzzleClient->delete($url);\n        } catch (RequestException $e) {\n            if ($e->getCode() !== 404) {\n                throw $e;\n            }\n        }\n    }\n\n    public function GetLogs(string $id, string $since = ''): string {\n        $url = $this->BuildApiUrl(\n            sprintf(\n                'containers/%s/logs?stdout=true&stderr=true&timestamps=true&since=%s',\n                urlencode($id),\n                $since\n            ));\n        $responseBody = (string)$this->guzzleClient->get($url)->getBody();\n\n        $response = \"\";\n        $separator = \"\\r\\n\";\n        $line = strtok($responseBody, $separator);\n        $response = substr((string)$line, 8) . $separator;\n\n        while ($line !== false) {\n            $line = strtok($separator);\n            $response .= substr((string)$line, 8) . $separator;\n        }\n\n        return $response;\n    }\n\n    public function StartContainer(Container $container, ?\\Closure $addToStreamingResponseBody = null): void {\n        $url = $this->BuildApiUrl(sprintf('containers/%s/start', urlencode($container->identifier)));\n        try {\n            if ($addToStreamingResponseBody !== null) {\n                $addToStreamingResponseBody($container, \"Starting container\");\n            }\n            $this->guzzleClient->post($url);\n        } catch (RequestException $e) {\n            throw new \\Exception(\"Could not start container \" . $container->identifier . \": \" . $e->getResponse()?->getBody()->getContents());\n        }\n    }\n\n    public function CreateVolumes(Container $container): void {\n        $url = $this->BuildApiUrl('volumes/create');\n        foreach ($container->volumes->GetVolumes() as $volume) {\n            $forbiddenChars = [\n                '/',\n            ];\n\n            if ($volume->name === 'nextcloud_aio_nextcloud_datadir' || $volume->name === 'nextcloud_aio_backupdir') {\n                return;\n            }\n\n            $firstChar = substr($volume->name, 0, 1);\n            if (!in_array($firstChar, $forbiddenChars)) {\n                $this->guzzleClient->request(\n                    'POST',\n                    $url,\n                    [\n                        'json' => [\n                            'name' => $volume->name,\n                        ],\n                    ]\n                );\n            }\n        }\n    }\n\n    public function CreateContainer(Container $container): void {\n        $volumes = [];\n        foreach ($container->volumes->GetVolumes() as $volume) {\n            // // NEXTCLOUD_MOUNT gets added via bind-mount later on\n            // if ($container->identifier === 'nextcloud-aio-nextcloud') {\n            //     if ($volume->name === $this->configurationManager->nextcloudMount) {\n            //         continue;\n            //     }\n            // }\n\n            $volumeEntry = $volume->name . ':' . $volume->mountPoint;\n            if ($volume->isWritable) {\n                $volumeEntry = $volumeEntry . ':' . 'rw';\n            } else {\n                $volumeEntry = $volumeEntry . ':' . 'ro';\n            }\n\n            $volumes[] = $volumeEntry;\n        }\n\n        $requestBody = [\n            'Image' => $this->BuildImageName($container),\n        ];\n\n        if (count($volumes) > 0) {\n            $requestBody['HostConfig']['Binds'] = $volumes;\n        }\n\n        $this->configurationManager->setAioVariables($container->aioVariables->GetVariables());\n\n        $envs = $container->containerEnvironmentVariables->GetVariables();\n        // Special thing for the nextcloud container\n        if ($container->identifier === 'nextcloud-aio-nextcloud') {\n            $envs[] = $this->GetAllNextcloudExecCommands();\n        }\n        foreach ($envs as $key => $env) {\n            $envs[$key] = $this->configurationManager->replaceEnvPlaceholders($env);\n        }\n\n        if (count($envs) > 0) {\n            $requestBody['Env'] = $envs;\n        }\n\n        $requestBody['HostConfig']['RestartPolicy']['Name'] = $container->restartPolicy;\n\n        $requestBody['HostConfig']['ReadonlyRootfs'] = $container->readOnlyRootFs;\n\n        $exposedPorts = [];\n        if ($container->internalPorts !== 'host') {\n            foreach ($container->ports->GetPorts() as $value) {\n                $port = $value->port;\n                $protocol = $value->protocol;\n                if ($port === '%APACHE_PORT%') {\n                    $port = $this->configurationManager->apachePort;\n                    // Do not expose udp if AIO is in reverse proxy mode\n                    if ($port !== '443' && $protocol === 'udp') {\n                        continue;\n                    }\n                } else if ($port === '%TALK_PORT%') {\n                    $port = $this->configurationManager->talkPort;\n                }\n                $portWithProtocol = $port . '/' . $protocol;\n                $exposedPorts[$portWithProtocol] = null;\n            }\n            $requestBody['HostConfig']['NetworkMode'] = 'nextcloud-aio';\n        } else {\n            $requestBody['HostConfig']['NetworkMode'] = 'host';\n        }\n\n        if (count($exposedPorts) > 0) {\n            $requestBody['ExposedPorts'] = $exposedPorts;\n            foreach ($container->ports->GetPorts() as $value) {\n                $port = $value->port;\n                $protocol = $value->protocol;\n                if ($port === '%APACHE_PORT%') {\n                    $port = $this->configurationManager->apachePort;\n                    // Do not expose udp if AIO is in reverse proxy mode\n                    if ($port !== '443' && $protocol === 'udp') {\n                        continue;\n                    }\n                } else if ($port === '%TALK_PORT%') {\n                    $port = $this->configurationManager->talkPort;\n                    // Skip publishing talk tcp port if it is set to 443\n                    if ($port === '443' && $protocol === 'tcp') {\n                        continue;\n                    }\n                }\n                $ipBinding = $value->ipBinding;\n                if ($ipBinding === '%APACHE_IP_BINDING%') {\n                    $ipBinding = $this->configurationManager->apacheIpBinding;\n                    // Do not expose if AIO is in internal network mode\n                    if ($ipBinding === '@INTERNAL') {\n                        continue;\n                    }\n                }\n                $portWithProtocol = $port . '/' . $protocol;\n                $requestBody['HostConfig']['PortBindings'][$portWithProtocol] = [\n                    [\n                        'HostPort' => $port,\n                        'HostIp' => $ipBinding,\n                    ]\n                ];\n            }\n        }\n\n        $devices = [];\n        foreach ($container->devices as $device) {\n            if ($device === '/dev/dri' && !$this->configurationManager->nextcloudEnableDriDevice) {\n                continue;\n            }\n            $devices[] = [\"PathOnHost\" => $device, \"PathInContainer\" => $device, \"CgroupPermissions\" => \"rwm\"];\n        }\n\n        if (count($devices) > 0) {\n            $requestBody['HostConfig']['Devices'] = $devices;\n        }\n\n        if ($container->enableNvidiaGpu && $this->configurationManager->enableNvidiaGpu) {\n            $requestBody['HostConfig']['Runtime'] = 'nvidia';\n            $requestBody['HostConfig']['DeviceRequests'] = [\n                [\n                    \"Driver\" => \"nvidia\",\n                    \"Count\" => 1,\n                    \"Capabilities\" => [[\"gpu\"]],\n                ]\n            ];\n        }\n\n        $shmSize = $container->shmSize;\n        if ($shmSize > 0) {\n            $requestBody['HostConfig']['ShmSize'] = $shmSize;\n        }\n\n        $tmpfs = [];\n        foreach ($container->tmpfs as $tmp) {\n            $mode = \"\";\n            if (str_contains($tmp, ':')) {\n                $mode = explode(':', $tmp)[1];\n                $tmp = explode(':', $tmp)[0];\n            }\n            $tmpfs[$tmp] = $mode;\n        }\n        if (count($tmpfs) > 0) {\n            $requestBody['HostConfig']['Tmpfs'] = $tmpfs;\n        }\n\n        $requestBody['HostConfig']['Init'] = $container->init;\n\n        $maxShutDownTime = $container->maxShutdownTime;\n        if ($maxShutDownTime > 0) {\n            $requestBody['StopTimeout'] = $maxShutDownTime;\n        }\n\n        $capAdds = $container->capAdd;\n        if (count($capAdds) > 0) {\n            $requestBody['HostConfig']['CapAdd'] = $capAdds;\n        }\n\n        // Disable arp spoofing\n        if (!in_array('NET_RAW', $capAdds, true)) {\n            $requestBody['HostConfig']['CapDrop'] = ['NET_RAW'];\n        }\n\n        // Disable SELinux for AIO containers so that it does not break them\n        $requestBody['HostConfig']['SecurityOpt'] = [\"label:disable\"];\n        if ($container->apparmorUnconfined) {\n            $requestBody['HostConfig']['SecurityOpt'] = [\"apparmor:unconfined\", \"label:disable\"];\n        }\n\n        $mounts = [];\n\n        // Special things for the backup container which should not be exposed in the containers.json\n        if (str_starts_with($container->identifier, 'nextcloud-aio-borgbackup')) {\n            // Additional backup directories\n            foreach ($this->getAllBackupVolumes() as $additionalBackupVolumes) {\n                if ($additionalBackupVolumes !== '') {\n                    $mounts[] = [\"Type\" => \"volume\", \"Source\" => $additionalBackupVolumes, \"Target\" => \"/nextcloud_aio_volumes/\" . $additionalBackupVolumes, \"ReadOnly\" => false];\n                }\n            }\n\n            // Make volumes read only in case of borgbackup container. The viewer makes them writeable\n            $isReadOnly = $container->identifier === 'nextcloud-aio-borgbackup';\n\n            foreach ($this->configurationManager->getAdditionalBackupDirectoriesArray() as $additionalBackupDirectories) {\n                if ($additionalBackupDirectories !== '') {\n                    if (!str_starts_with($additionalBackupDirectories, '/')) {\n                        $mounts[] = [\"Type\" => \"volume\", \"Source\" => $additionalBackupDirectories, \"Target\" => \"/docker_volumes/\" . $additionalBackupDirectories, \"ReadOnly\" => $isReadOnly];\n                    } else {\n                        $mounts[] = [\"Type\" => \"bind\", \"Source\" => $additionalBackupDirectories, \"Target\" => \"/host_mounts\" . $additionalBackupDirectories, \"ReadOnly\" => $isReadOnly, \"BindOptions\" => [\"NonRecursive\" => true]];\n                    }\n                }\n            }\n\n        // Special things for the talk container which should not be exposed in the containers.json\n        } elseif ($container->identifier === 'nextcloud-aio-talk') {\n            // This is needed due to a bug in libwebsockets used in Janus which cannot handle unlimited ulimits\n            $requestBody['HostConfig']['Ulimits'] = [[\"Name\" => \"nofile\", \"Hard\" => 200000, \"Soft\" => 200000]];\n            // // Special things for the nextcloud container which should not be exposed in the containers.json\n            // } elseif ($container->identifier === 'nextcloud-aio-nextcloud') {\n            //     foreach ($container->volumes->GetVolumes() as $volume) {\n            //         if ($volume->name !== $this->configurationManager->nextcloudMount) {\n            //             continue;\n            //         }\n            //         $mounts[] = [\"Type\" => \"bind\", \"Source\" => $volume->name, \"Target\" => $volume->mountPoint, \"ReadOnly\" => !$volume->isWritable, \"BindOptions\" => [ \"Propagation\" => \"rshared\"]];\n            //     }\n\n        // Special things for the caddy community container\n        } elseif ($container->identifier === 'nextcloud-aio-caddy') {\n            $requestBody['HostConfig']['ExtraHosts'] = ['host.docker.internal:host-gateway'];\n\n        // Special things for the collabora container which should not be exposed in the containers.json\n        } elseif ($container->identifier === 'nextcloud-aio-collabora') {\n            if (!$this->configurationManager->collaboraSeccompDisabled) {\n                // Load reference seccomp profile for collabora\n                $seccompProfile = (string)file_get_contents(DataConst::GetCollaboraSeccompProfilePath());\n                $requestBody['HostConfig']['SecurityOpt'] = [\"label:disable\", \"seccomp=$seccompProfile\"];\n            }\n\n            // Additional Collabora options\n            if ($this->configurationManager->collaboraAdditionalOptions !== '') {\n                // Split the list of Collabora options, which are stored as a string but must be assigned as an array.\n                // To avoid problems with whitespace or dashes in option arguments we use a regular expression\n                // that splits the string at every position where a whitespace is followed by '--o:'.\n                // The leading whitespace is removed in the split but the following characters are not.\n                // Example: \"--o:example_config1='some thing' --o:example_config2=something-else\" -> [\"--o:example_config1='some thing'\", \"--o:example_config2=something-else\"] \n                $regEx = '/\\s+(?=--o:)/';\n                $requestBody['Cmd'] = preg_split($regEx, rtrim($this->configurationManager->collaboraAdditionalOptions));\n            }\n        }\n\n        if (count($mounts) > 0) {\n            $requestBody['HostConfig']['Mounts'] = $mounts;\n        }\n\n        // All AIO-managed containers should not be updated externally via watchtower but gracefully by AIO's backup and update feature.\n        // Also DIUN should not send update notifications. See https://crazymax.dev/diun/providers/docker/#docker-labels \n        // Additionally set a default org.label-schema.vendor and com.docker.compose.project\n        $requestBody['Labels'] = [\"com.centurylinklabs.watchtower.enable\" => \"false\", \"wud.watch\" => \"false\", \"diun.enable\" => \"false\", \"org.label-schema.vendor\" => \"Nextcloud\", \"com.docker.compose.project\" => \"nextcloud-aio\"];\n\n        // Containers should have a fixed host name. See https://github.com/nextcloud/all-in-one/discussions/6589\n        $requestBody['Hostname'] = $container->identifier;\n\n        $url = $this->BuildApiUrl('containers/create?name=' . $container->identifier);\n        try {\n            $this->guzzleClient->request(\n                'POST',\n                $url,\n                [\n                    'json' => $requestBody\n                ]\n            );\n        } catch (RequestException $e) {\n            throw new \\Exception(\"Could not create container \" . $container->identifier . \": \" . $e->getResponse()?->getBody()->getContents());\n        }\n\n    }\n\n    public function isRegistryReachable(Container $container): bool {\n        $tag = $container->imageTag;\n        if ($tag === '%AIO_CHANNEL%') {\n            $tag = $this->GetCurrentChannel();\n        }\n\n        $remoteDigest = $this->GetLatestDigestOfTag($container->containerName, $tag);\n\n        if ($remoteDigest === null) {\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    public function PullImage(Container $container, bool $pullImage = true, ?\\Closure $addToStreamingResponseBody = null): void {\n        // Skip database image pull if the last shutdown was not clean\n        if ($container->identifier === 'nextcloud-aio-database') {\n            if ($this->GetDatabasecontainerExitCode() > 0) {\n                $pullImage = false;\n                error_log('Not pulling the latest database image because the container was not correctly shut down.');\n            }\n        }\n\n        // Check if registry is reachable in order to make sure that we do not try to pull an image if it is down\n        // and try to mitigate issues that are arising due to that\n        if ($pullImage) {\n            if (!$this->isRegistryReachable($container)) {\n                $pullImage = false;\n                error_log('Not pulling the ' . $container->containerName . ' image for the ' . $container->identifier . ' container because the registry does not seem to be reachable.');\n            }\n        }\n\n        // Do not continue if $pullImage is false\n        if (!$pullImage) {\n            return;\n        }\n\n        $imageName = $this->BuildImageName($container);\n        $encodedImageName = urlencode($imageName);\n        $url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', $encodedImageName));\n        $imageIsThere = true;\n        try {\n            if ($addToStreamingResponseBody) {\n                $addToStreamingResponseBody($container, \"Pulling image\");\n            }\n            $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $encodedImageName));\n            $this->guzzleClient->get($imageUrl)->getBody()->getContents();\n        } catch (\\Throwable $e) {\n            $imageIsThere = false;\n        }\n\n        $maxRetries = 3;\n        for ($attempt = 1; $attempt <= $maxRetries; $attempt++) {\n            try {\n                $this->guzzleClient->post($url);\n                break;\n            } catch (RequestException $e) {\n                $message = \"Could not pull image \" . $imageName . \" (attempt $attempt/$maxRetries): \" . $e->getResponse()?->getBody()->getContents();\n                if ($attempt === $maxRetries) {\n                    if ($imageIsThere === false) {\n                        throw new \\Exception($message);\n                    } else {\n                        error_log($message);\n                    }\n                } else {\n                    error_log($message . ' Retrying...');\n                    sleep(1);\n                }\n            }\n        }\n    }\n\n    private function isContainerUpdateAvailable(string $id): string {\n        $container = $this->containerDefinitionFetcher->GetContainerById($id);\n\n        $updateAvailable = \"\";\n        if ($container->GetUpdateState() === VersionState::Different) {\n            $updateAvailable = '1';\n        }\n        foreach ($container->dependsOn as $dependency) {\n            $updateAvailable .= $this->isContainerUpdateAvailable($dependency);\n        }\n        return $updateAvailable;\n    }\n\n    public function isAnyUpdateAvailable(): bool {\n        // return early if instance is not installed\n        if (!$this->configurationManager->wasStartButtonClicked) {\n            return false;\n        }\n        $id = 'nextcloud-aio-apache';\n\n        if ($this->isContainerUpdateAvailable($id) !== \"\") {\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    private function getBackupVolumes(string $id): string {\n        $container = $this->containerDefinitionFetcher->GetContainerById($id);\n\n        $backupVolumes = '';\n        foreach ($container->backupVolumes as $backupVolume) {\n            $backupVolumes .= $backupVolume . ' ';\n        }\n        foreach ($container->dependsOn as $dependency) {\n            $backupVolumes .= $this->getBackupVolumes($dependency);\n        }\n        return $backupVolumes;\n    }\n\n    private function getAllBackupVolumes(): array {\n        $id = 'nextcloud-aio-apache';\n        $backupVolumesArray = explode(' ', $this->getBackupVolumes($id));\n        return array_unique($backupVolumesArray);\n    }\n\n    private function GetNextcloudExecCommands(string $id): string {\n        $container = $this->containerDefinitionFetcher->GetContainerById($id);\n\n        $nextcloudExecCommands = '';\n        foreach ($container->nextcloudExecCommands as $execCommand) {\n            $nextcloudExecCommands .= $execCommand . PHP_EOL;\n        }\n        foreach ($container->dependsOn as $dependency) {\n            $nextcloudExecCommands .= $this->GetNextcloudExecCommands($dependency);\n        }\n        return $nextcloudExecCommands;\n    }\n\n    private function GetAllNextcloudExecCommands(): string {\n        $id = 'nextcloud-aio-apache';\n        return 'NEXTCLOUD_EXEC_COMMANDS=' . $this->GetNextcloudExecCommands($id);\n    }\n\n    private function GetRepoDigestsOfContainer(string $containerName): ?array {\n        try {\n            $containerUrl = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName));\n            $containerOutput = json_decode($this->guzzleClient->get($containerUrl)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);\n            $imageName = $containerOutput['Image'];\n\n            $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName));\n            $imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);\n\n            if (!isset($imageOutput['RepoDigests'])) {\n                error_log('RepoDigests is not set of container ' . $containerName);\n                return null;\n            }\n\n            if (!is_array($imageOutput['RepoDigests'])) {\n                error_log('RepoDigests of ' . $containerName . ' is not an array which is not allowed!');\n                return null;\n            }\n\n            $repoDigestArray = [];\n            $oneDigestGiven = false;\n            foreach ($imageOutput['RepoDigests'] as $repoDigest) {\n                $digestPosition = strpos($repoDigest, '@');\n                if ($digestPosition === false) {\n                    error_log('Somehow the RepoDigest of ' . $containerName . ' does not contain a @.');\n                    return null;\n                }\n                $repoDigestArray[] = substr($repoDigest, $digestPosition + 1);\n                $oneDigestGiven = true;\n            }\n\n            if ($oneDigestGiven) {\n                return $repoDigestArray;\n            }\n\n            return null;\n        } catch (\\Exception $e) {\n            return null;\n        }\n    }\n\n    private function GetCurrentImageName(): string {\n        $cacheKey = 'aio-image-name';\n        $imageName = apcu_fetch($cacheKey);\n        if ($imageName !== false && is_string($imageName)) {\n            return $imageName;\n        }\n\n        $containerName = 'nextcloud-aio-mastercontainer';\n        $url = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName));\n        try {\n            $output = json_decode($this->guzzleClient->get($url)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);\n            $imageNameArray = explode(':', $output['Config']['Image']);\n            if (count($imageNameArray) === 2) {\n                $imageName = $imageNameArray[0];\n            } else {\n                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'.\");\n                $imageName = 'ghcr.io/nextcloud-releases/all-in-one';\n            }\n            apcu_add($cacheKey, $imageName);\n            return $imageName;\n        } catch (\\Exception $e) {\n            error_log('Could not get current imageName ' . $e->getMessage());\n        }\n\n        return 'nextcloud/all-in-one';\n    }\n\n    public function GetCurrentChannel(): string {\n        $cacheKey = 'aio-ChannelName';\n        $channelName = apcu_fetch($cacheKey);\n        if ($channelName !== false && is_string($channelName)) {\n            return $channelName;\n        }\n\n        $containerName = 'nextcloud-aio-mastercontainer';\n        $url = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName));\n        try {\n            $output = json_decode($this->guzzleClient->get($url)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);\n            $tagArray = explode(':', $output['Config']['Image']);\n            if (count($tagArray) === 2) {\n                $tag = $tagArray[1];\n            } else {\n                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'.\");\n                $tag = 'latest';\n            }\n            apcu_add($cacheKey, $tag);\n            return $tag;\n        } catch (\\Exception $e) {\n            error_log('Could not get current channel ' . $e->getMessage());\n        }\n\n        return 'latest';\n    }\n\n    public function IsMastercontainerUpdateAvailable(): bool {\n        $imageName = $this->GetCurrentImageName();\n        $containerName = 'nextcloud-aio-mastercontainer';\n\n        $tag = $this->GetCurrentChannel();\n\n        $runningDigests = $this->GetRepoDigestsOfContainer($containerName);\n        if ($runningDigests === null) {\n            return true;\n        }\n        $remoteDigest = $this->GetLatestDigestOfTag($imageName, $tag);\n        if ($remoteDigest === null) {\n            return false;\n        }\n\n        foreach ($runningDigests as $runningDigest) {\n            if ($remoteDigest === $runningDigest) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    public function sendNotification(Container $container, string $subject, string $message, string $file = '/notify.sh'): void {\n        if ($this->GetContainerStartingState($container) === ContainerState::Running) {\n\n            $containerName = $container->identifier;\n\n            // schedule the exec\n            $url = $this->BuildApiUrl(sprintf('containers/%s/exec', urlencode($containerName)));\n            $response = json_decode(\n                $this->guzzleClient->request(\n                    'POST',\n                    $url,\n                    [\n                        'json' => [\n                            'AttachStdout' => true,\n                            'Tty' => true,\n                            'Cmd' => [\n                                'bash',\n                                $file,\n                                $subject,\n                                $message\n                            ],\n                        ],\n                    ]\n                )->getBody()->getContents(),\n                true,\n                512, \n                JSON_THROW_ON_ERROR,\n            );\n\n            $id = $response['Id'];\n\n            // start the exec\n            $url = $this->BuildApiUrl(sprintf('exec/%s/start', $id));\n            $this->guzzleClient->request(\n                'POST',\n                $url,\n                [\n                    'json' => [\n                        'Detach' => false,\n                        'Tty' => true,\n                    ],\n                ]\n            );\n        }\n    }\n\n    private function DisconnectContainerFromBridgeNetwork(string $id): void {\n\n        $url = $this->BuildApiUrl(\n            sprintf('networks/%s/disconnect', 'bridge')\n        );\n\n        try {\n            $this->guzzleClient->request(\n                'POST',\n                $url,\n                [\n                    'json' => [\n                        'container' => $id,\n                    ],\n                ]\n            );\n        } catch (RequestException $e) {\n        }\n    }\n\n    private function ConnectContainerIdToNetwork(string $id, string $internalPort, string $network = 'nextcloud-aio', bool $createNetwork = true, string $alias = ''): void {\n        if ($internalPort === 'host') {\n            return;\n        }\n\n        if ($createNetwork) {\n            $url = $this->BuildApiUrl('networks/create');\n            try {\n                $this->guzzleClient->request(\n                    'POST',\n                    $url,\n                    [\n                        'json' => [\n                            'Name' => $network,\n                            'CheckDuplicate' => true,\n                            'Driver' => 'bridge',\n                            'Internal' => false,\n                        ]\n                    ]\n                );\n            } catch (RequestException $e) {\n                // 409 is undocumented and gets thrown if the network already exists.\n                if ($e->getCode() !== 409) {\n                    throw new \\Exception(\"Could not create the nextcloud-aio network: \" . $e->getResponse()?->getBody()->getContents());\n                }\n            }\n        }\n\n        $url = $this->BuildApiUrl(\n            sprintf('networks/%s/connect', $network)\n        );\n        $jsonPayload = ['Container' => $id];\n        if ($alias !== '') {\n            $jsonPayload['EndpointConfig'] = ['Aliases' => [$alias]];\n        }\n\n        try {\n            $this->guzzleClient->request(\n                'POST',\n                $url,\n                [\n                    'json' => $jsonPayload\n                ]\n            );\n        } catch (RequestException $e) {\n            // 403 is undocumented and gets thrown if a specific container is already part of a network\n            if ($e->getCode() !== 403) {\n                throw $e;\n            }\n        }\n    }\n\n    public function ConnectMasterContainerToNetwork(): void {\n        $this->ConnectContainerIdToNetwork('nextcloud-aio-mastercontainer', '');\n        // Don't disconnect here since it slows down the initial login by a lot. Is getting done during cron.sh instead.\n        // $this->DisconnectContainerFromBridgeNetwork('nextcloud-aio-mastercontainer');\n    }\n\n    public function ConnectContainerToNetwork(Container $container): void {\n        // Add a secondary alias for domaincheck container, to keep it as similar to actual apache controller as possible.\n        // If a reverse-proxy is relying on container name as hostname this allows it to operate as usual and still validate the domain\n        // 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.\n        $alias = ($container->identifier === 'nextcloud-aio-domaincheck') ? 'nextcloud-aio-apache' : '';\n\n        $this->ConnectContainerIdToNetwork($container->identifier, $container->internalPorts, alias: $alias);\n\n        if ($container->identifier === 'nextcloud-aio-apache' || $container->identifier === 'nextcloud-aio-domaincheck') {\n            $apacheAdditionalNetwork = $this->configurationManager->getApacheAdditionalNetwork();\n            if ($apacheAdditionalNetwork !== '') {\n                $this->ConnectContainerIdToNetwork($container->identifier, $container->internalPorts, $apacheAdditionalNetwork, false, $alias);\n            }\n        }\n    }\n\n    public function StopContainer(Container $container, bool $forceStopContainer = false): void {\n        if ($forceStopContainer) {\n            $maxShutDownTime = 10;\n        } else {\n            $maxShutDownTime = $container->maxShutdownTime;\n        }\n        $url = $this->BuildApiUrl(sprintf('containers/%s/stop?t=%s', urlencode($container->identifier), $maxShutDownTime));\n        try {\n            $this->guzzleClient->post($url);\n        } catch (RequestException $e) {\n            if ($e->getCode() !== 404 && $e->getCode() !== 304) {\n                throw $e;\n            }\n        }\n    }\n\n    public function GetBackupcontainerExitCode(): int {\n        $containerName = 'nextcloud-aio-borgbackup';\n        $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($containerName)));\n        try {\n            $response = $this->guzzleClient->get($url);\n        } catch (RequestException $e) {\n            if ($e->getCode() === 404) {\n                return -1;\n            }\n            throw $e;\n        }\n\n        $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR);\n\n        $exitCode = $responseBody['State']['ExitCode'];\n        if (is_int($exitCode)) {\n            return $exitCode;\n        } else {\n            return -1;\n        }\n    }\n\n    public function GetDatabasecontainerExitCode(): int {\n        $containerName = 'nextcloud-aio-database';\n        $url = $this->BuildApiUrl(sprintf('containers/%s/json', urlencode($containerName)));\n        try {\n            $response = $this->guzzleClient->get($url);\n        } catch (RequestException $e) {\n            if ($e->getCode() === 404) {\n                return -1;\n            }\n            throw $e;\n        }\n\n        $responseBody = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR);\n\n        $exitCode = $responseBody['State']['ExitCode'];\n        if (is_int($exitCode)) {\n            return $exitCode;\n        } else {\n            return -1;\n        }\n    }\n\n    public function isLoginAllowed(): bool {\n        $id = 'nextcloud-aio-apache';\n        $apacheContainer = $this->containerDefinitionFetcher->GetContainerById($id);\n        if ($this->GetContainerStartingState($apacheContainer) === ContainerState::Running) {\n            return false;\n        }\n        return true;\n    }\n\n    public function isBackupContainerRunning(): bool {\n        $id = 'nextcloud-aio-borgbackup';\n        $backupContainer = $this->containerDefinitionFetcher->GetContainerById($id);\n        if ($this->GetContainerRunningState($backupContainer) === ContainerState::Running) {\n            return true;\n        }\n        return false;\n    }\n\n    private function GetCreatedTimeOfNextcloudImage(string $imageName): ?string {\n        $imageName = $imageName . ':' . $this->GetCurrentChannel();\n        try {\n            $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName));\n            $imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);\n\n            if (!isset($imageOutput['Created'])) {\n                error_log('Created is not set of image ' . $imageName);\n                return null;\n            }\n\n            return str_replace('T', ' ', (string)$imageOutput['Created']);\n        } catch (\\Exception $e) {\n            return null;\n        }\n    }\n\n    public function GetAndGenerateSecretWrapper(string $secretId): string {\n        return $this->configurationManager->getAndGenerateSecret($secretId);\n    }\n\n    public function isNextcloudImageOutdated(): bool {\n        $createdTime = $this->GetCreatedTimeOfNextcloudImage('ghcr.io/nextcloud-releases/aio-nextcloud');\n\n        if ($createdTime === null) {\n            $createdTime = $this->GetCreatedTimeOfNextcloudImage('nextcloud/aio-nextcloud');\n        }\n\n        if ($createdTime === null) {\n            return false;\n        }\n\n        // If the image is older than 90 days, it is outdated.\n        if ((time() - (60 * 60 * 24 * 90)) > strtotime($createdTime)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    public function GetLatestDigestOfTag(string $imageName, string $tag): ?string {\n        $prefix = 'ghcr.io/';\n        if (str_starts_with($imageName, $prefix)) {\n            return $this->gitHubContainerRegistryManager->GetLatestDigestOfTag(str_replace($prefix, '', $imageName), $tag);\n        } else {\n            return $this->dockerHubManager->GetLatestDigestOfTag($imageName, $tag);\n        }\n    }\n}\n"
  },
  {
    "path": "php/src/Docker/DockerHubManager.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Docker;\n\nuse AIO\\ContainerDefinitionFetcher;\nuse AIO\\Data\\ConfigurationManager;\nuse GuzzleHttp\\Client;\n\nreadonly class DockerHubManager {\n    private Client $guzzleClient;\n\n    public function __construct(\n    ) {\n        $this->guzzleClient = new Client();\n    }\n\n    public function GetLatestDigestOfTag(string $name, string $tag) : ?string {\n        $cacheKey = 'dockerhub-manifest-' . $name . $tag;\n\n        $cachedVersion = apcu_fetch($cacheKey);\n        if($cachedVersion !== false && is_string($cachedVersion)) {\n            return $cachedVersion;\n        }\n\n        // 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'\n\n        try {\n            $authTokenRequest = $this->guzzleClient->request(\n                'GET',\n                'https://auth.docker.io/token?service=registry.docker.io&scope=repository:' . $name . ':pull'\n            );\n            $body = $authTokenRequest->getBody()->getContents();\n            $decodedBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR);\n            if(isset($decodedBody['token'])) {\n                $authToken = $decodedBody['token'];\n                $manifestRequest = $this->guzzleClient->request(\n                    'HEAD',\n                    'https://registry-1.docker.io/v2/'.$name.'/manifests/' . $tag,\n                    [\n                        'headers' => [\n                            'Accept' => 'application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json',\n                            'Authorization' => 'Bearer ' . $authToken,\n                        ],\n                    ]\n                );\n                $responseHeaders = $manifestRequest->getHeader('docker-content-digest');\n                if(count($responseHeaders) === 1) {\n                    $latestVersion = $responseHeaders[0];\n                    apcu_add($cacheKey, $latestVersion, 600);\n                    return $latestVersion;\n                }\n            }\n\n            error_log('Could not get digest of container ' . $name . ':' . $tag);\n            return null;\n        } catch (\\Exception $e) {\n            error_log('Could not get digest of container ' . $name . ':' . $tag . ' ' . $e->getMessage());\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "php/src/Docker/GitHubContainerRegistryManager.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Docker;\n\nuse GuzzleHttp\\Client;\n\nreadonly class GitHubContainerRegistryManager\n{\n    private Client $guzzleClient;\n\n    public function __construct()\n    {\n        $this->guzzleClient = new Client();\n    }\n\n    public function GetLatestDigestOfTag(string $name, string $tag): ?string\n    {\n        $cacheKey = 'ghcr-manifest-' . $name . $tag;\n\n        $cachedVersion = apcu_fetch($cacheKey);\n        if ($cachedVersion !== false && is_string($cachedVersion)) {\n            return $cachedVersion;\n        }\n\n        // 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'\n\n        try {\n            $authTokenRequest = $this->guzzleClient->request(\n                'GET',\n                'https://ghcr.io/token?scope=repository:' . $name . ':pull'\n            );\n            $body = $authTokenRequest->getBody()->getContents();\n            $decodedBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR);\n            if (isset($decodedBody['token'])) {\n                $authToken = $decodedBody['token'];\n                $manifestRequest = $this->guzzleClient->request(\n                    'HEAD',\n                    'https://ghcr.io/v2/' . $name . '/manifests/' . $tag,\n                    [\n                        'headers' => [\n                            'Accept' => 'application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json',\n                            'Authorization' => 'Bearer ' . $authToken,\n                        ],\n                    ]\n                );\n                $responseHeaders = $manifestRequest->getHeader('docker-content-digest');\n                if (count($responseHeaders) === 1) {\n                    $latestVersion = $responseHeaders[0];\n                    apcu_add($cacheKey, $latestVersion, 600);\n                    return $latestVersion;\n                }\n            }\n\n            error_log('Could not get digest of container ' . $name . ':' . $tag);\n            return null;\n        } catch (\\Exception $e) {\n            error_log('Could not get digest of container ' . $name . ':' . $tag . ' ' . $e->getMessage());\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "php/src/Middleware/AuthMiddleware.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Middleware;\n\nuse AIO\\Auth\\AuthManager;\nuse GuzzleHttp\\Psr7\\Response;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Http\\Message\\ServerRequestInterface;\nuse Psr\\Http\\Server\\RequestHandlerInterface;\n\nreadonly class AuthMiddleware {\n    public function __construct(\n        private AuthManager $authManager\n    ) {\n    }\n\n    public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n    {\n        $publicRoutes = [\n            '/api/auth/login',\n            '/api/auth/getlogin',\n            '/login',\n            '/setup',\n            '/',\n        ];\n\n        if(!in_array($request->getUri()->getPath(), $publicRoutes)) {\n            if(!$this->authManager->IsAuthenticated()) {\n                $status = 302;\n\n                // Check the url of the request: split the string by '/' and count the number of elements\n                // 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'\n                if (count(explode('/', $request->getUri()->getPath())) < 2) {\n                    // 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)\n                    $location = '.';\n                } else {\n                    // If there are 2 or more elements it means we are in a subfolder, so we need to go back to the root folder\n                    // In the best case we need to go back by 1 level only\n                    $location = '..';\n                    // 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 '..')\n                    for ($i = 1; $i < count(explode('/', $request->getUri()->getPath())) - 2; $i++) {\n                        // For each extra level we need to go back by another level\n                        $location = $location . '/..';\n                    }\n                }\n\n                $headers = ['Location' => $location];\n                $response = new Response($status, $headers);\n                return $response;\n            }\n        }\n\n        $response = $handler->handle($request);\n        return $response;\n    }\n}\n"
  },
  {
    "path": "php/src/Twig/ClassExtension.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Twig;\n\nuse Slim\\Views\\TwigExtension;\nuse Twig\\TwigFunction;\n\nclass ClassExtension extends TwigExtension\n{\n    #[\\Override]\n    public function getFunctions() : array\n    {\n        return array(\n            new TwigFunction('class', array($this, 'getClassName')),\n        );\n    }\n\n    public function getClassName(mixed $object) : ?string\n    {\n        if (!is_object($object)) {\n            return null;\n        }\n\n        return get_class($object);\n    }\n}"
  },
  {
    "path": "php/src/Twig/CsrfExtension.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace AIO\\Twig;\n\nuse Slim\\Csrf\\Guard;\nuse Twig\\Extension\\AbstractExtension;\nuse Twig\\Extension\\GlobalsInterface;\n\nclass CsrfExtension extends AbstractExtension implements GlobalsInterface {\n    public function __construct(\n        protected Guard $csrf\n    ) {\n    }\n\n    #[\\Override]\n    public function getGlobals() : array\n    {\n        // CSRF token name and value\n        $csrfNameKey = $this->csrf->getTokenNameKey();\n        $csrfValueKey = $this->csrf->getTokenValueKey();\n        $csrfName = $this->csrf->getTokenName();\n        $csrfValue = $this->csrf->getTokenValue();\n\n        return [\n            'csrf'   => [\n                'keys' => [\n                    'name'  => $csrfNameKey,\n                    'value' => $csrfValueKey\n                ],\n                'name'  => $csrfName,\n                'value' => $csrfValue\n            ]\n        ];\n    }\n}\n"
  },
  {
    "path": "php/templates/already-installed.twig",
    "content": "{% extends \"layout.twig\" %}\n\n{% block body %}\n    <div class=\"login\">\n        <svg class=\"nextcloud-logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 142 100\" width=\"142\" height=\"100\">\n            <use href=\"img/nextcloud-logo.svg#logo\"></use>\n            <use href=\"img/nextcloud-logo.svg#Nextcloud\"></use>\n            <text x=\"10\" y=\"50\" fill=\"var(--color-nextcloud-logo)\" class=\"fallback-text\">Nextcloud Logo</text>\n        </svg>\n        <h2>Nextcloud All-In-One is already installed</h2>\n        <a href=\".\" class=\"button\">Open Nextcloud AIO</a>\n    </div>\n{% endblock %}\n"
  },
  {
    "path": "php/templates/components/container-state.twig",
    "content": "{# @var c \\App\\Containers\\Container #}\n<li>\n  <span>\n    {% if c.GetStartingState().value == 'starting' %}\n      <span class=\"status running\"></span>\n      {{ c.displayName }}\n      (<a href=\"log?id={{ c.identifier }}\" target=\"_blank\">Starting</a>)\n    {% elseif c.GetRunningState().value == 'running' %}\n      <span class=\"status success\"></span>\n      {{ c.displayName }}\n      (<a href=\"log?id={{ c.identifier }}\" target=\"_blank\">Running</a>)\n    {% else %}\n      <span class=\"status error\"></span>\n      {{ c.displayName }}\n      (<a href=\"log?id={{ c.identifier }}\" target=\"_blank\">Stopped</a>)\n    {% endif %}\n    {% if c.documentation != '' %}\n      (<a target=\"_blank\" href=\"{{ c.documentation }}\">docs</a>)\n    {% endif %}\n    {% if c.GetUpdateState().value == 'different' %}\n      ⚠️&nbsp;Update&nbsp;available\n    {% endif %}\n  </span>\n  {% if c.GetUiSecret() != '' %}\n    <details>\n      <summary>Show password for {{ c.displayName }}</summary>\n      <input type=\"text\" value=\"{{ c.GetUiSecret() }}\" readonly>\n    </details>\n  {% endif %}\n</li>\n"
  },
  {
    "path": "php/templates/containers.twig",
    "content": "{% extends \"layout.twig\" %}\n\n{% block body %}\n    <head>\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n    </head>\n    <header>\n        <svg class=\"logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 142 71\" width=\"62\" height=\"50\">\n            <use href=\"img/nextcloud-logo.svg#logo\"></use>\n        </svg>\n        <form method=\"POST\" action=\"api/auth/logout\">\n            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n            <input type=\"submit\" value=\"Log out\" />\n        </form>\n    </header>\n\n    <div class=\"container\">\n        <main>\n            {% set aio_version = include('includes/aio-version.twig') %}\n            <h1>Nextcloud AIO v{{ aio_version }}</h1>\n\n            {# Add 2nd tab warning #}\n            <script type=\"text/javascript\" src=\"second-tab-warning.js\"></script>\n\n            {# timezone-prefill #}\n            <script type=\"text/javascript\" src=\"timezone.js\"></script>\n\n            {# js for optional containers and additional containers forms #}\n            <script type=\"text/javascript\" src=\"containers-form-submit.js?v6\"></script>\n\n            {% set hasBackupLocation = borg_backup_host_location or borg_remote_repo %}\n            {% set isAnyRunning = false %}\n            {% set isAnyRestarting = false %}\n            {% set isWatchtowerRunning = false %}\n            {% set isDomaincheckRunning = false %}\n            {% set isBackupOrRestoreRunning = false %}\n            {% set isApacheStarting = false %}\n            {# 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 #}\n            {% set newMajorVersionString = '26 Winter' %}\n            {% set oldMajorVersionString = '25 Autumn' %}\n\n            {% if is_backup_container_running == true %}\n                {% if borg_backup_mode == 'backup' or borg_backup_mode == 'restore' %}\n                    {% set isBackupOrRestoreRunning = true %}\n                {% endif %}\n            {% endif %}\n\n            {% for container in containers %}\n                {% if container.hideFromList != true and container.GetRunningState().value == 'running' %}\n                    {% set isAnyRunning = true %}\n                {% endif %}\n                {% if container.hideFromList != true and container.GetRestartingState().value == 'restarting' %}\n                    {% set isAnyRestarting = true %}\n                {% endif %}\n                {% if container.identifier == 'nextcloud-aio-watchtower' and container.GetRunningState().value == 'running' %}\n                    {% set isWatchtowerRunning = true %}\n                {% endif %}\n                {% if container.identifier == 'nextcloud-aio-domaincheck' and container.GetRunningState().value == 'running' %}\n                    {% set isDomaincheckRunning = true %}\n                {% endif %}\n                {% if container.identifier == 'nextcloud-aio-apache' and container.GetStartingState().value == 'starting' %}\n                    {% set isApacheStarting = true %}\n                {% endif %}\n            {% endfor %}\n\n            {% if is_daily_backup_running == true %}\n                <p><span class=\"status running\"></span> Daily backup currently running. (<a href=\"log?id=nextcloud-aio-mastercontainer\" target=\"_blank\">Mastercontainer logs</a>) (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Borg backup container logs</a>)</p>\n                {% if automatic_updates == true %}\n                    <p>This will update your containers, the mastercontainer and, on Saturdays, your Nextcloud apps if the backup is successful.</p>\n                    {% if is_mastercontainer_update_available == true %}\n                        <p>When the mastercontainer is updated it will restart, making it unavailable for a moment. (<a href=\"log?id=nextcloud-aio-watchtower\" target=\"_blank\">Logs</a>)</p>\n                    {% endif %}\n                {% endif %}\n                {% if has_update_available == false %}\n                    <p>The whole process should not take more than a few minutes.</p>\n                {% elseif automatic_updates == true %}\n                    <p>The whole process can take a while as your containers will be updated.</p>\n                {% endif %}\n                <p><a href=\"\" class=\"button reload\">Reload ↻</a></p>\n                <p>If the daily backup is stuck somehow, you can unstick it by running <strong>sudo docker exec nextcloud-aio-mastercontainer rm /mnt/docker-aio-config/data/daily_backup_running</strong> and afterwards reloading this interface.</p>\n            {% elseif isWatchtowerRunning == true %}\n                <p><span class=\"status running\"></span> 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. (<a href=\"log?id=nextcloud-aio-watchtower\" target=\"_blank\">Logs</a>)</p>\n                <p><a href=\"\" class=\"button reload\">Reload ↻</a></p>\n            {% else %}\n                {% if is_backup_container_running == false and domain == \"\" %}\n                    {% if isDomaincheckRunning == false %}\n                        <h2>Domaincheck container is not running</h2>\n                        <p>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 <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md\">reverse proxy documentation</a></strong>. Advice: have a detailed look at the changed docker run command for AIO.</p>\n                    {% elseif is_mastercontainer_update_available == true %}\n                        <h2>Mastercontainer update</h2>\n                        <p>⚠️ A mastercontainer update is available. Please click on the button below to update it. Afterwards, you will be able to proceed with the setup.</p>\n                        <form method=\"POST\" action=\"api/docker/watchtower\" target=\"overlay-log\">\n                            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                            <input type=\"submit\" value=\"Update mastercontainer\" />\n                        </form>\n                    {% else %}\n                        {% if not hasBackupLocation %}\n                            <p>The official Nextcloud installation method. Nextcloud All-in-One provides easy deployment and maintenance with most features included in this one Nextcloud instance.</p>\n                            <p>You can either create a new AIO instance or restore a former AIO instance from backup. See the two sections below.</p>\n                            {{ include('includes/aio-config.twig') }}\n                            <h2>New AIO instance</h2>\n                            {% if apache_port == '443' %}\n                                <p>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 <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md\">reverse proxy documentation</a></strong>. Advice: have a detailed look at the changed docker run command for AIO.</p>\n                            {% else %}\n                                <p>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.</p>\n                            {% endif %}\n                            <p>Please type in the domain that will be used for Nextcloud and submit it.</p>\n                            {% if skip_domain_validation == true %}\n                                <p><strong>Please note:</strong> 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!</p>\n                            {% endif %}\n                            <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                <input type=\"text\" id=\"domain\" name=\"domain\" value=\"{{ domain }}\" placeholder=\"nextcloud.yourdomain.com\"/>\n                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                {% if skip_domain_validation == true %}\n                                    <input type=\"hidden\" name=\"skip_domain_validation\" value=\"{{skip_domain_validation}}\">\n                                {% endif %}\n                                <input type=\"submit\" value=\"Submit domain\" />\n                            </form>\n                            {% if skip_domain_validation == false %}\n                                <p>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.</p>\n                                <details>\n                                    <summary>Click here for further hints</summary>\n                                    <p>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 <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/discussions/6817\">Tailscale</a></p>\n                                    <p>If you have a dynamic public IP-address, you can use e.g. <a target=\"_blank\" href=\"https://ddclient.net/\">DDclient</a> with a compatible domain provider for DNS updates.</p>\n                                    <p>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 <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/blob/main/local-instance.md\">this documentation</a>.</p>\n                                    <p>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.</p>\n                                    {% if apache_port != '443' %}\n                                        <p>If you run into issues with your domain being accepted, see <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#how-to-debug\">these steps</a> for how to debug things.</p>\n                                    {% endif %}\n                                    <p><strong>Hint:</strong> If the domain validation fails but you are completely sure that you've configured everything correctly, you may skip the domain validation by following <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation\">this documentation</a>.</p>\n                                </details>\n                            {% endif %}\n\n                            <h2>Restore former AIO instance from backup</h2>\n                            <p>You can alternatively restore a former AIO instance from backup.</p>\n                        {% endif %}\n\n                        {% if is_instance_restore_attempt == false %}\n                            {% if hasBackupLocation %}\n                                {% if borg_backup_mode in ['test', 'check'] %}\n                                    {% if backup_exit_code > 0 %}\n                                        <p><span class=\"status error\"></span> Last {{ borg_backup_mode }} failed! (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                                        {% if borg_backup_mode == 'test' %}\n                                            <p>Please adjust the path and/or the encryption password in order to make it work!</p>\n                                        {% elseif borg_backup_mode == 'check' %}\n                                            <p>The backup archive seems to be corrupt. Please try to use a different intact backup archive or try to fix it by following <a target=\"_blank\" href=\"https://borgbackup.readthedocs.io/en/stable/faq.html#i-get-an-integrityerror-or-similar-what-now\"><strong>this documentation</strong></a></p>\n                                            <details>\n                                                <summary>Reveal repair option</summary>\n                                                <p>Below is the option to repair the integrity of your backup. <strong>Please note:</strong> Please only use this after you have read the documentation above! (It will run the command 'borg check --repair' for you.)</p>\n                                                <form method=\"POST\" action=\"api/docker/backup-check-repair\" target=\"overlay-log\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                    <input type=\"submit\" value=\"Check and repair backup integrity\" onclick=\"return confirm('Check and repair backup integrity? Are you sure that you want to check and repair the backup integrity? This should only be done after reading the mentioned documentation.')\"/>\n                                                </form>\n                                            </details>\n                                        {% endif %}\n                                    {% elseif backup_exit_code == 0 %}\n                                        <p><span class=\"status success\"></span> Last {{ borg_backup_mode }} successful! (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                                        {% if borg_backup_mode == 'test' %}\n                                            <p>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.</p>\n                                            <form method=\"POST\" action=\"api/docker/backup-check\" target=\"overlay-log\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                <input type=\"submit\" value=\"Check backup integrity\"/>\n                                            </form>\n                                        {% endif %}\n                                        <p>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!</p>\n                                        <p><strong>Important:</strong> If the backup that you want to restore contained any <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers\">community container</a>, you need to restore the same backup a second time after this attempt so that the community container data is also correctly restored.</p>\n                                        <form method=\"POST\" action=\"api/docker/restore\" target=\"overlay-log\" id=\"restore_selection\">\n                                            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                            <select id=\"selected_restore_time\" name=\"selected_restore_time\" form=\"restore_selection\">\n                                                {% for restore_time in backup_times %}\n                                                    <option value=\"{{ restore_time }}\">{{ restore_time }} UTC</option>\n                                                {% endfor %}\n                                            </select><br>\n                                            <input type=\"checkbox\" id=\"restore-exclude-previews\" name=\"restore-exclude-previews\"><label for=\"restore-exclude-previews\">Exclude previews from restore which will speed up the restore process but will trigger a scan of the preview folder as soon as the Nextcloud container starts the next time</label><br>\n                                            <input type=\"submit\" value=\"Restore selected backup\" onclick=\"return confirm('⚠️ 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.')\"/>\n                                        </form>\n                                    {% endif %}\n                                {% elseif borg_backup_mode == 'restore' %}\n                                    {% if backup_exit_code > 0 %}\n                                        <p><span class=\"status error\"></span> Last restore failed! (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                                        <p>The restore process has unexpectedly failed! Please adjust the path and encryption password, test it and try to restore again!</p>\n                                    {% endif %}\n                                {% endif %}\n                            {% endif %}\n\n                            {% if not hasBackupLocation or borg_backup_mode not in ['test', 'check', ''] or backup_exit_code > 0 %}\n                                {% if borg_remote_repo and backup_exit_code > 0 %}\n                                <p>\n                                You may still need to authorize this pubkey on your borg remote:<br><strong>{{ borg_public_key }}</strong><br>\n                                To try again, resubmit your location and rerun the test.\n                                </p>\n                                {% endif %}\n\n                                <p>\n                                Please enter the location of the backup archive on your host or a\n                                <a target=\"_blank\" href=\"https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls\">remote borg repo url</a>\n                                if stored remotely; and the encryption password of the backup archive below and submit all values:\n                                </p>\n                                <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                    <label>Local backup location</label> <input type=\"text\" id=\"borg_restore_host_location\" name=\"borg_restore_host_location\" value=\"{{borg_backup_host_location}}\" placeholder=\"/mnt/backup\"/><br>\n                                    <label>Remote borg repo</label> <input type=\"text\" name=\"borg_restore_remote_repo\" value=\"{{borg_remote_repo}}\" placeholder=\"ssh://user@host:port/path/to/repo\"/><br>\n                                    <label>Borg passphrase</label> <input type=\"text\" id=\"borg_restore_password\" name=\"borg_restore_password\" value=\"{{borg_restore_password}}\" placeholder=\"encryption password\"/><br>\n                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                    <input type=\"submit\" value=\"Submit location and encryption password\" />\n                                </form>\n                                {{ include('includes/backup-dirs.twig') }}\n                                <p>⚠️ 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!</p>\n                            {% endif %}\n                        {% else %}\n                            <p><strong>Everything set!</strong> Click on the button below to test the path and encryption password:</p>\n                            <form method=\"POST\" action=\"api/docker/backup-test\" target=\"overlay-log\">\n                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                <input type=\"submit\" value=\"Test path and encryption password\"/>\n                            </form>\n                        {% endif %}\n                    {% endif %}\n                    <h2>How to reset the AIO instance?</h2>\n                    <p>If something should be going wrong, for example during the initial installation, you can reset the instance by following <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance\">this documentation</a>.</p>\n                {% endif %}\n\n                {% if was_start_button_clicked == true %}\n                    {% if current_channel starts with 'latest' or current_channel starts with 'beta' or current_channel starts with 'develop' %}\n                        <p>You are running the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-switch-the-channel\"><strong>{{ current_channel }}</strong></a> channel. (<a href=\"log?id=nextcloud-aio-mastercontainer\" target=\"_blank\">Logs</a>)</p>\n                    {% else %}\n                        <p>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.</p>\n                    {% endif %}\n                {% endif %}\n\n                {% if is_backup_container_running == true %}\n                    <p><span class=\"status running\"></span> Backup container is currently running: {{ borg_backup_mode }} (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                    <p><a href=\"\" class=\"button reload\">Reload ↻</a></p>\n                {% endif %}\n\n                {% if domain != \"\" %}\n                    {% if isAnyRunning == true %}\n                        {% if isApacheStarting != true %}\n                            {% if hasBackupLocation %}\n                                <details>\n                                <summary>Click here to reveal the initial Nextcloud credentials</summary>\n                            {% endif %}\n                                    <p>Initial Nextcloud username: <strong>admin</strong></p>\n                            {% if hasBackupLocation %}\n                                {# nextcloud_password needs to be duplicated due to a bug in Firefox. See https://github.com/nextcloud/all-in-one/issues/638. #}\n                                <p>Initial Nextcloud password: <strong id=\"initial-nextcloud-password\">{{ nextcloud_password }}</strong></p></details>\n                            {% else %}\n                                <p>Initial Nextcloud password: <strong id=\"initial-nextcloud-password\">{{ nextcloud_password }}</strong></p>\n                            {% endif %}\n                            <p><a href=\"https://{{ domain }}\" class=\"button\" target=\"_blank\">Open your Nextcloud ↗</a></p>\n                            {% if not hasBackupLocation %}\n                                <p>If your Nextcloud does not open when clicking the button above, see <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/discussions/2105\">this documentation</a></strong></p>\n                            {% endif %}\n                        {% else %}\n                            {% if isAnyRestarting == false %}\n                                <p><span class=\"status running\"></span> Containers are currently starting. You might inspect the container logs by clicking on <strong>Starting</strong> next to each container for further details.</p>\n                                <p><a href=\"\" class=\"button reload\">Reload ↻</a></p>\n                            {% else %}\n                                <p>It seems at least one container was not able to start correctly and is currently restarting.</p>\n                                <p>To break this endless loop, you can stop the containers below and investigate the issue in the container logs before starting the containers again.</p>\n                                <form method=\"POST\" action=\"api/docker/stop\" target=\"overlay-log\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                    <input type=\"submit\" value=\"Stop containers\" />\n                                </form>\n                            {% endif %}\n                        {% endif %}\n                    {% endif %}\n\n                    {% if isApacheStarting == false and is_backup_container_running == false %}\n                        {{ include('includes/aio-config.twig') }}\n                    {% endif %}\n\n                    {% if was_start_button_clicked == true %}\n                        <h2>Containers</h2>\n                        <ul>\n                            {# @var containers \\AIO\\Container\\Container[] #}\n                            {% for container in containers %}\n                                {% if container.hideFromList != true %}\n                                    {% include 'components/container-state.twig'  with {'c': container} only %}\n                                {% endif %}\n                            {% endfor %}\n                        </ul>\n\n                        {% if has_update_available == true %}\n                            {% if is_mastercontainer_update_available == false %}\n                                <p>⚠️ Container updates are available. Click on <strong>Stop containers</strong> and <strong>Start and update containers</strong> to update them. You should consider creating a backup first.</p>\n                            {% endif %}\n                        {% else %}\n                            {% if is_mastercontainer_update_available == false %}\n                                <p>Your containers are up-to-date.</p>\n                                {% if newMajorVersionString != '' and isAnyRunning == true and isApacheStarting != true %}\n                                    <details>\n                                    <summary>Note about <strong>Nextcloud Hub {{ newMajorVersionString }}</strong></summary>\n                                        <p>If you haven't upgraded to Nextcloud Hub {{ newMajorVersionString }} yet and want to do that now, feel free to follow <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/discussions/7523\">this documentation</a></strong></p>\n                                    </details>\n                                {% endif %}\n                            {% endif %}\n                        {% endif %}\n                    {% endif %}\n\n                    {% if isAnyRunning == true %}\n                        {% if isApacheStarting != true %}\n                            {% if is_mastercontainer_update_available == true %}\n                                <p>⚠️ A mastercontainer update is available. Please click on the button below to stop your containers in order to update the mastercontainer.</p>\n                                {% if current_channel starts with 'latest' %}\n                                    <p>You can find the changelog <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/releases/latest\"><strong>here</strong></a></p>\n                                {% elseif current_channel starts with 'beta' %}\n                                    <p>You can find the changelog <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/releases\"><strong>here</strong></a></p>\n                                {% elseif current_channel starts with 'develop' %}\n                                    <p>You can find all changes <a target=\"_blank\" href=\"https://github.com/nextcloud-releases/all-in-one/commits/main\"><strong>here</strong></a></p>\n                                {% endif %}\n                            {% endif %}\n                            <form method=\"POST\" action=\"api/docker/stop\" target=\"overlay-log\">\n                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                <input type=\"submit\" value=\"Stop containers\" />\n                            </form>\n                        {% endif %}\n                    {% else %}\n                        {% if isBackupOrRestoreRunning == true %}\n                            <p>Restore or Backup currently running. Cannot start the containers until Restore or Backup is complete.</p>\n                        {% else %}\n                            {% if was_start_button_clicked == false %}\n                                <p>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!</p>\n                            {% endif %}\n                            {% if is_mastercontainer_update_available == true %}\n                                <p>⚠️ A mastercontainer update is available. Please click on the button below to update it.</p>\n                                <form method=\"POST\" action=\"api/docker/watchtower\" target=\"overlay-log\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                    <input type=\"submit\" value=\"Update mastercontainer\" />\n                                </form>\n                            {% else %}\n                                {% if was_start_button_clicked == false %}\n                                    <form method=\"POST\" action=\"api/docker/start\" target=\"overlay-log\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                        <input id=\"base_path\" type=\"hidden\" name=\"base_path\" value=\"\">\n                                        {% if newMajorVersionString != '' %}\n                                            <input type=\"checkbox\" id=\"install_latest_major\" name=\"install_latest_major\"><label for=\"install_latest_major\">Install Nextcloud Hub {{ newMajorVersionString }} (if unchecked, Nextcloud Hub {{ oldMajorVersionString }} will get installed)</label><br>\n                                        {% endif %}\n                                        <input type=\"submit\" value=\"Download and start containers\" />\n                                    </form>\n                                {% elseif has_update_available == false %}\n                                    <form method=\"POST\" action=\"api/docker/start\" target=\"overlay-log\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                        <input id=\"base_path\" type=\"hidden\" name=\"base_path\" value=\"\">\n                                        {% if bypass_container_update == true %}\n                                            <input type=\"hidden\" name=\"bypass_container_update\" value=\"true\">\n                                        {% endif %}\n                                        <input type=\"submit\" value=\"Start containers\" />\n                                    </form>\n                                {% else %}\n                                    <form method=\"POST\" action=\"api/docker/start\" target=\"overlay-log\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                        <input id=\"base_path\" type=\"hidden\" name=\"base_path\" value=\"\">\n                                        {% if bypass_container_update == true %}\n                                            <input type=\"hidden\" name=\"bypass_container_update\" value=\"true\">\n                                        {% endif %}\n                                        <input class=\"button \" type=\"submit\" value=\"Start and update containers\" onclick=\"return confirm('Start and update containers? You should consider creating a backup first.')\" />\n                                    </form>\n                                {% endif %}\n                            {% endif %}\n                        {% endif %}\n                    {% endif %}\n\n                    {% if was_start_button_clicked == true %}\n\n                        {% if is_backup_section_enabled == false %}\n                            <h2>Backup and restore</h2>\n                            <p>The backup section is disabled via environmental variable.</p>\n                        {% else %}\n                            {% if is_backup_container_running == false and not hasBackupLocation and isApacheStarting != true %}\n                                <h2>Backup and restore</h2>\n                                <p>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.</p>\n                                <p>\n                                To store backups remotely instead, fill in the\n                                <a target=\"_blank\" href=\"https://borgbackup.readthedocs.io/en/stable/usage/general.html#repository-urls\">remote borg repo url and submit it</a>.\n                                You will be provided with an SSH public key for authorization at the remote afterwards.\n                                </p>\n                                <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                    <label>Local backup location</label> <input type=\"text\" id=\"borg_backup_host_location\" name=\"borg_backup_host_location\" placeholder=\"/mnt/backup\"/><br>\n                                    <label>Remote borg repo</label> <input type=\"text\" name=\"borg_remote_repo\" placeholder=\"ssh://user@host:port/path/to/repo\"/><br>\n                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                    <input type=\"submit\" value=\"Submit backup location\" />\n                                </form>\n                                {{ include('includes/backup-dirs.twig') }}\n                            {% endif %}\n                        {% endif %}\n\n                        {% if is_backup_section_enabled == true %}\n\n                            {% if hasBackupLocation %}\n                                {% if is_backup_container_running == false %}\n                                    <h2>Backup and restore</h2>\n                                    {% if backup_exit_code > 0 %}\n                                        <p><span class=\"status error\"></span> Last {{ borg_backup_mode }} failed! (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                                        {% if borg_backup_mode == \"check\" %}\n                                            <p>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 <a target=\"_blank\" href=\"https://borgbackup.readthedocs.io/en/stable/faq.html#i-get-an-integrityerror-or-similar-what-now\"><strong>this documentation</strong></a></p>\n                                            <details>\n                                                <summary>Reveal repair option</summary>\n                                                <p>Below is the option to repair the integrity of your backup. <strong>Please note:</strong> Please only use this after you have read the documentation above! (It will run the command 'borg check --repair' for you.)</p>\n                                                <form method=\"POST\" action=\"api/docker/backup-check-repair\" target=\"overlay-log\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                    <input type=\"submit\" value=\"Check and repair backup integrity\" onclick=\"return confirm('Check and repair backup integrity? Are you sure that you want to check and repair the backup integrity? This should only be done after reading the mentioned documentation.')\"/>\n                                                </form>\n                                            </details>\n                                        {% endif %}\n                                        {% if has_backup_run_once == false %}\n                                            <p>The initial backup was not successful.</p>\n\n                                            {% if borg_remote_repo %}\n                                            <p>\n                                            You may still need to authorize this pubkey on your borg remote:<br><strong>{{ borg_public_key }}</strong><br>\n                                            To try again, click <strong>Create backup</strong>.\n                                            </p>\n                                            {% endif %}\n\n                                            <p>You may change the backup path again since the initial backup was not successful. After submitting the new value, you need to click on <strong>Create Backup</strong> to test the new value.</p>\n                                            <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                                <label>Local backup location</label> <input type=\"text\" name=\"borg_backup_host_location\" placeholder=\"/mnt/backup\"/><br>\n                                                <label>Remote borg repo</label> <input type=\"text\" name=\"borg_remote_repo\" placeholder=\"ssh://user@host:port/path/to/repo\"/><br>\n                                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                <input type=\"submit\" value=\"Set backup location again\" />\n                                            </form>\n                                        {% endif %}\n                                    {% elseif backup_exit_code == 0 %}\n                                        {% if borg_backup_mode == \"backup\" %}\n                                            <p><span class=\"status success\"></span> Last {{ borg_backup_mode }} successful on {{ last_backup_time }} UTC! (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                                        {% else %}\n                                            <p><span class=\"status success\"></span> Last {{ borg_backup_mode }} successful! (<a href=\"log?id=nextcloud-aio-borgbackup\" target=\"_blank\">Logs</a>)</p>\n                                        {% endif %}\n                                    {% endif %}\n                                {% endif %}\n\n                                {% if is_backup_container_running == false and isApacheStarting == false %}\n                                    {% if has_backup_run_once == true %}\n                                        <details>\n                                        <summary>Click here to reveal all backup options (including an option for automatic updates)</summary>\n                                    {% endif %}\n                                    <h3>Backup information</h3>\n                                    <p>This is your encryption password for backups: <strong id=\"borg-backup-password\">{{ borgbackup_password }}</strong></p>\n                                    <p>Please save this password in a safe place. You won't be able to restore from backup if you lose this password!</p>\n                                    <p>All important data from your Nextcloud AIO instance such as the database, your files and the mastercontainer's configuration files, will be backed up.</p>\n                                    <p>The backup uses a tool called <a target=\"_blank\" href=\"https://github.com/borgbackup/borg#what-is-borgbackup\"><strong>BorgBackup</strong></a>, a well-known server backup tool that efficiently backs up your files and encrypts them on the fly.</p>\n                                    <p>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.</p>\n                                    {% if borg_remote_repo != '' %}\n                                        <p>\n                                        Backups get created remotely at:<br>\n                                        <strong>{{ borg_remote_repo }}</strong>\n                                        {% if has_backup_run_once == true %}\n                                        <br/>Your borg ssh public key is:<br><strong>{{ borg_public_key }}</strong>\n                                        {% endif %}\n                                        </p>\n                                    {% else %}\n                                        <p>Backups will be created in the following directory on the host: <strong>{{ borg_backup_host_location }}/borg</strong></p>\n                                    {% endif %}\n                                    <p>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.</p>\n                                    <p>For information about backup retention, see <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-adjust-borgs-retention-policy\">this</a></strong>.</p>\n                                    <p>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.</p>\n                                    <p>For further documentation and options on this backup solution refer to <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#backup\">this section</a></strong> and below.</p>\n\n                                    {% if isApacheStarting != true %}\n                                        <h3>Backup creation</h3>\n                                        <p>Clicking on the button below will create a backup.</p>\n                                        <form method=\"POST\" action=\"api/docker/backup\" target=\"overlay-log\">\n                                            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                            <input type=\"submit\" value=\"Create backup\" onclick=\"return confirm('Create backup? Are you sure that you want to create a backup? This will stop all running containers and create the backup.')\" />\n                                        </form>\n\n                                        {% if has_backup_run_once == true %}\n                                            <h3>Backup Viewer</h3>\n                                            <p>There is now a community container that allows to access your backups in a web session. See <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/tree/main/community-containers/borgbackup-viewer\"><strong>this documentation</strong></a>.</p>\n\n                                            <h3>Backup check</h3>\n                                            <p>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.</p>\n                                            <form method=\"POST\" action=\"api/docker/backup-check\" target=\"overlay-log\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                <input type=\"submit\" value=\"Check backup integrity\" onclick=\"return confirm('Check backup integrity? Are you sure that you want to check the backup? This can take a long time depending on the size of your backup.')\" />\n                                            </form>\n\n                                            <h3>Backup restore</h3>\n                                            <p>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.</p>\n                                            <form method=\"POST\" action=\"api/docker/restore\" target=\"overlay-log\" id=\"restore_selection\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                <select id=\"selected_restore_time\" name=\"selected_restore_time\" form=\"restore_selection\">\n                                                    {% for restore_time in backup_times %}\n                                                        <option value=\"{{ restore_time }}\">{{ restore_time }} UTC</option>\n                                                    {% endfor %}\n                                                </select>\n                                                <input type=\"submit\" value=\"Restore selected backup\" onclick=\"return confirm('Restore the selected backup? Are you sure that you want to restore the selected backup? This will stop all running containers and restore the selected backup. It is recommended to create a backup first. You might also want to check the backup integrity.')\" />\n                                            </form>\n\n                                            <h3>Update backup list</h3>\n                                            <details>\n                                                <summary>Click here to reveal this option</summary>\n                                                <p>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.</p>\n                                                <form method=\"POST\" action=\"api/docker/backup-list\" target=\"overlay-log\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                    <input type=\"submit\" value=\"Update backup list\" />\n                                                </form>\n                                            </details>\n\n                                            <h3>Daily backup and automatic updates</h3>\n                                            {% if daily_backup_time == \"\" %}\n                                                <p>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. <strong>04:00</strong> will create backups at 4 am UTC and <strong>16:00</strong> at 4 pm UTC. When creating the backup, containers will be stopped and restarted after the backup is complete.</p>\n                                                <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                                    <input type=\"text\" name=\"daily_backup_time\" placeholder=\"04:00\"/>\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                    <input type=\"submit\" value=\"Submit daily backup time and settings\" /><br>\n                                                    <input type=\"checkbox\" id=\"automatic_updates\" name=\"automatic_updates\" checked=\"checked\"><label for=\"automatic_updates\">Automatically update all containers, the mastercontainer and on saturdays your Nextcloud apps</label><br>\n                                                    <input type=\"checkbox\" id=\"success_notification\" name=\"success_notification\" checked=\"checked\"><label for=\"success_notification\">Send notifications about successful backups (notifications about unsuccessful backups will always be sent)</label>\n                                                </form>\n                                            {% else %}\n                                                <p>Daily backups will be created at <strong>{{ daily_backup_time }} UTC</strong>. A notification about the result of the backup will be sent.</p>\n                                                {% if automatic_updates == true %}\n                                                    Also your containers, the mastercontainer and, on Saturdays, your Nextcloud apps will be automatically updated.\n                                                {% endif %}\n                                                <p>To change your backup time first disable Daily Backups, then enter your new backup time, and then re-enable them.</p>\n                                                <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                                    <input type=\"hidden\" name=\"delete_daily_backup_time\" value=\"yes\"/>\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                    <input type=\"submit\" value=\"Disable or change daily backup settings\" />\n                                                </form>\n                                            {% endif %}\n\n                                            <h3>Back up additional directories and docker volumes of your host</h3>\n                                            <p>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.</p>\n                                            <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                                <textarea id=\"additional_backup_directories\" name=\"additional_backup_directories\" rows=\"4\" cols=\"50\" placeholder=\"/directory/on/the/host&#10;my_custom_docker_volume\">{{ additional_backup_directories }}</textarea>\n                                                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                                <input type=\"submit\" value=\"Submit additional backup locations\" />\n                                            </form>\n                                            <p>Each line and entry needs to start with a slash or letter/digit. Only <strong>a-z</strong>, <strong>A-Z</strong>, <strong>.</strong>, <strong>0-9</strong>, <strong>_</strong>, <strong>-</strong>, and <strong>/</strong> are allowed. If the entry begins with a letter/digit slashes are not supported. Two valid entries are <strong>/directory/on/the/host</strong> and <strong>my_custom_docker_volume</strong>. You need to make sure that all given directories exist or the backup container will fail to start!</p>\n                                            <p>Be sure to individually specify all storage that you want to back up as storage will not be mounted recursively. E.g. providing <strong>/</strong> 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 <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-stopstartupdate-containers-or-trigger-the-daily-backup-from-a-script-externally\">this documentation</a></p>\n                                            <p>Please note that the chosen directories/volumes will not be restored when you restore your instance, so this would need to be done manually.</p>\n                                            {% if additional_backup_directories != \"\" %}\n                                                <p>This option is currently set. You can disable it again by clearing the field and submitting your changes.</p>\n                                            {% endif %}\n                                        {% endif %}\n\n                                        <h3>Reset backup location</h3>\n                                        <p>\n                                        If the configured backup host location <strong>{{ borg_backup_host_location }}</strong>\n                                        {% if borg_remote_repo %}\n                                            or the remote repo <strong>{{ borg_remote_repo }}</strong>\n                                        {% endif %}\n                                        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.\n                                        </p>\n                                        <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                            <input type=\"hidden\" name=\"delete_borg_backup_location_vars\" value=\"yes\"/>\n                                            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                            <input type=\"submit\" value=\"Reset backup location\" onclick=\"return confirm('Are you sure that you want to reset the backup location?')\" />\n                                        </form>\n                                    {% endif %}\n                                    {% if has_backup_run_once == true %}\n                                        </details>\n                                    {% endif %}\n                                {% endif %}\n                            {% endif %}\n                        {% endif %}\n\n                        {% if is_backup_container_running == false %}\n                            {% if isApacheStarting == false %}\n                                <h2>AIO passphrase change</h2>\n                                <details>\n                                    <summary>Click here to change your AIO passphrase</summary>\n                                    <p>You can change your AIO passphrase below:</p>\n                                    <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                        <input type=\"password\" autocomplete=\"current-password\" name=\"current-master-password\" placeholder=\"Your current AIO passphrase\" id=\"current-master-password\" oninput=\"showPassword('current-master-password')\">\n                                        <input type=\"password\" autocomplete=\"new-password\" name=\"new-master-password\" placeholder=\"Your new AIO passphrase\" id=\"new-master-password\" oninput=\"showPassword('new-master-password')\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                        <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                        <input type=\"submit\" value=\"Submit passphrase change\" />\n                                    </form>\n                                    <p>The new passphrase needs to be at least 24 characters long. Allowed characters are the <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Latin_alphabet#/media/File:Abecedarium.png\"><strong>latin characters</strong></a> <strong>a-z</strong>, <strong>A-Z</strong>, <strong>0-9</strong> and <strong>spaces</strong>.</p>\n                                </details>\n                            {% endif %}\n                        {% endif %}\n                    {% endif %}\n                    {% if is_backup_container_running == false %}\n\n                        {{ include('includes/optional-containers.twig') }}\n\n                        <h2>Timezone change</h2>\n                        {% if isAnyRunning == true %}\n                            {% if timezone != \"\" %}\n                                <p>The timezone for Nextcloud is currently set to <strong>{{ timezone }}</strong>.</p>\n                            {% endif %}\n                            <p><strong>Please note:</strong> You can change the timezone when your containers are stopped.</p>\n                        {% else %}\n                            {% if timezone == \"\" %}\n                                <p>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.</p>\n                                <p>You can configure the timezone for Nextcloud below (Do not forget to submit the value!):</p>\n                                <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                    <input type=\"text\" id=\"timezone\" name=\"timezone\" placeholder=\"Europe/Berlin\" />\n                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                    <input type=\"submit\" value=\"Submit timezone\" onclick=\"return confirm('Are you sure that this is a valid timezone? Please double check by following the wikipedia article and checking the correct column. If the timezone is not valid, it will break the startup since the database will not be correctly initialized and you will end up in a startup loop.')\" />\n                                </form>\n                                <p>You need to make sure that the timezone that you enter is valid. An example is <strong>Europe/Berlin</strong>. You can get valid values by looking at the 'TZ identifier' column of this list: <a target=\"_blank\" href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List\"><strong>click here</strong></a>. The default is <strong>Etc/UTC</strong> if nothing is entered.</p>\n                            {% else %}\n                                <p>The timezone for Nextcloud is currently set to <strong>{{ timezone }}</strong>. You can change the timezone by clicking on the button below.</p>\n                                <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n                                    <input type=\"hidden\" name=\"delete_timezone\" value=\"yes\"/>\n                                    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                                    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                                    <input type=\"submit\" value=\"Reset the timezone\" />\n                                </form>\n                            {% endif %}\n                        {% endif %}\n                        {{ include('includes/community-containers.twig') }}\n                    {% endif %}\n                {% endif %}\n            {% endif %}\n\n        {% if isApacheStarting == true or is_backup_container_running == true or isWatchtowerRunning == true or is_daily_backup_running == true %}\n            <script type=\"text/javascript\" src=\"automatic_reload.js\"></script>\n        {% else %}\n            <script type=\"text/javascript\" src=\"before-unload.js\"></script>\n        {% endif %}\n\n        <script type=\"text/javascript\" src=\"base_path.js\"></script>\n\n        </main>\n    </div>\n{% endblock %}\n"
  },
  {
    "path": "php/templates/includes/aio-config.twig",
    "content": "<details>\n    <summary>Click here to view the current AIO config and documentation links</summary>\n    {% if was_start_button_clicked == true %}\n        <p>Nextcloud's config.php file is stored in the nextcloud_aio_nextcloud Docker volume and can be edited by following the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-edit-nextclouds-configphp-file-with-a-texteditor\">config.php documentation</a>.</p>\n        <p>You can run Nextcloud's usual occ commands by following the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-run-occ-commands\">occ documentation</a></strong>.</p>\n    {% endif %}\n\n    <p>\n        {% if nextcloud_datadir starts with '/' %}\n            Nextcloud's datadir is getting stored in the {{ nextcloud_datadir }} directory.\n        {% else %}\n            Nextcloud's datadir is getting stored in the {{ nextcloud_datadir }} Docker volume.\n        {% endif %}\n        See the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir\">NEXTCLOUD_DATADIR documentation</a> on how to change this.\n    </p>\n\n    <p>\n        {% if nextcloud_mount == '' %}\n            The Nextcloud container is confined and local external storage in Nextcloud is disabled.\n        {% else %}\n            The Nextcloud container is getting access to the {{ nextcloud_mount }} directory and local external storage in Nextcloud is enabled.\n        {% endif %}\n        See the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host\">NEXTCLOUD_MOUNT documentation</a> on how to change this.</p>\n\n    <p>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 <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud\">NEXTCLOUD_UPLOAD_LIMIT documentation</a> on how to change this.</p>\n\n    <p>For Nextcloud, a memory limit of {{ nextcloud_memory_limit }} per PHP process is configured. See the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud\">NEXTCLOUD_MEMORY_LIMIT documentation</a> on how to change this.</p>\n\n    <p>Nextcloud has a timeout of {{ nextcloud_max_time }} seconds configured (important for big file uploads). See the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud\">NEXTCLOUD_MAX_TIME documentation</a> on how to change this.</p>\n\n    <p>\n        {% if is_dri_device_enabled == true and is_nvidia_gpu_enabled == true %}\n            Hardware acceleration is enabled with the /dev/dri device and the Nvidia runtime.\n        {% elseif is_dri_device_enabled == true %}\n            Hardware acceleration is enabled with the /dev/dri device.\n        {% elseif is_nvidia_gpu_enabled == true %}\n            Hardware acceleration is enabled with the Nvidia runtime.\n        {% else %}\n            Hardware acceleration is not enabled. It's recommended to enable hardware transcoding for better performance.\n        {% endif %}\n        See the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-enable-hardware-acceleration-for-nextcloud\">hardware acceleration documentation</a> on how to change this.</p>\n\n    <p>For further documentation on AIO, refer to <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#nextcloud-all-in-one\">this page</a></strong>. You can use the browser search [CTRL]+[F] to search through the documentation. Additional documentation can be found <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/discussions/categories/wiki\">here</a></strong>.</p>\n</details>\n"
  },
  {
    "path": "php/templates/includes/aio-version.twig",
    "content": "12.9.0\n"
  },
  {
    "path": "php/templates/includes/backup-dirs.twig",
    "content": "<p>The folder path that you enter must start with <strong>/</strong> and must <strong>not</strong> end with <strong>/</strong>.</p>\n<p>An example for Linux is <strong>/mnt/backup</strong>.</p>\n<p>On Synology it could be <strong>/volume1/docker/nextcloud/backup</strong>.</p>\n<p>For macOS it may be <strong>/var/backup</strong>.</p>\n<p>On Windows it might be <strong>/run/desktop/mnt/host/c/backup</strong>. (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'.) ⚠️ <strong>Please note</strong>: This does not work with external drives like USB or network drives and only with internal drives like SATA or NVME drives.</p>\n<p>Another option is to enter a specific volume name here: <strong>nextcloud_aio_backupdir</strong>. This volume needs to be created beforehand manually by you in order to be able to use it. See <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-create-the-backup-volume-on-windows\">this documentation</a> for an example.</p>\n"
  },
  {
    "path": "php/templates/includes/community-containers.twig",
    "content": "<h2>Community Containers</h2>\n<p>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.</p>\n<p><strong>⚠️ Caution: </strong>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!</p>\n{% if isAnyRunning == true %}\n    <p><strong>Please note:</strong> You can enable or disable the options below only when your containers are stopped.</p>\n{% else %}\n    <p><strong>Please note:</strong> Make sure to save your changes by clicking <strong>Save changes</strong> below the list of Community Containers. The changes will not be auto-saved.</p>\n{% endif %}\n<details>\n    <summary>Show/Hide available Community Containers</summary>\n    <form id=\"community-form\" method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n        <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n        <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n        <input type=\"hidden\" name=\"community-form\" value=\"community-form\">\n        {% for cc in community_containers %}\n            <p>\n                <input\n                    type=\"checkbox\"\n                    id=\"{{ cc.id }}\"\n                    value=\"{{ cc.id }}\"\n                    name=\"{{ cc.id }}\"\n                    {% if cc.id in community_containers_enabled %}\n                        checked=\"checked\"\n                        data-initial-state=\"true\"\n                    {% else %}\n                        data-initial-state=\"false\"\n                    {% endif %}\n                    {% if isAnyRunning == true %}\n                        disabled=\"disabled\"\n                    {% endif %}\n                >\n                <label for=\"{{ cc.id }}\">{{ cc.name }} \n                    {% if cc.documentation != '' %}\n                        <a href=\"{{ cc.documentation }}\" target=\"_blank\">(Documentation)</a>\n                    {% endif %}\n                </label>\n            </p>\n        {% endfor %}\n\n        <input id=\"community-form-submit\" type=\"submit\" value=\"Save changes\" onclick=\"return confirm('Are you sure that you read the documentation of all community containers that you enabled? If no, please do not continue as this might break your instance!')\" />\n    </form>\n</details>\n"
  },
  {
    "path": "php/templates/includes/optional-containers.twig",
    "content": "<h2>Optional containers</h2>\n<p>In this section you can enable or disable optional containers.</p>\n{% if isAnyRunning == true %}\n    <p><strong>Please note:</strong> You can enable or disable the options below only when your containers are stopped.</p>\n{% else %}\n    <p><strong>Please note:</strong> Make sure to save your changes by clicking <strong>Save changes</strong> below the list of optional containers. The changes will not be auto-saved.</p>\n{% endif %}\n<form id=\"options-form\" method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n    <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n    <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n    <input type=\"hidden\" name=\"options-form\" value=\"options-form\">\n    <h3>Office Suite</h3>\n    {% if isAnyRunning == false %}\n        <p>Choose your preferred office suite. Only one can be enabled at a time.</p>\n    {% endif %}\n    <div class=\"office-suite-cards\">\n        <input\n            type=\"radio\"\n            id=\"office-collabora\"\n            name=\"office_suite_choice\"\n            value=\"collabora\"\n            class=\"office-radio\"\n            {% if is_collabora_enabled == true %}\n                checked=\"checked\"\n            {% endif %}\n        >\n        <label class=\"office-card{{ isAnyRunning ? ' office-card-disabled' : '' }}\" for=\"office-collabora\">\n            <div class=\"office-card-header\">\n                <h4>Nextcloud Office</h4>\n                <svg class=\"office-checkmark\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                    <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"var(--color-nextcloud-blue)\"/>\n                    <path d=\"M7 12L10.5 15.5L17 9\" stroke=\"white\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                </svg>\n            </div>\n            <ul class=\"office-features\">\n                <li>Best Nextcloud integration</li>\n                <li>Open source</li>\n                <li>Good performance</li>\n                <li>Best security: documents never leave your server</li>\n                <li>Best ODF compatibility</li>\n                <li>Best support for legacy files</li>\n            </ul>\n            {% if isAnyRunning == false %}\n                <a href=\"https://www.collaboraoffice.com/code/\" target=\"_blank\" class=\"office-learn-more\" onclick=\"event.stopPropagation();\">\n                    Learn more\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"vertical-align: middle; margin-left: 4px;\">\n                        <path d=\"M6 12L10 8L6 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                    </svg>\n                </a>\n            {% endif %}\n        </label>\n        <input type=\"hidden\" id=\"collabora\" name=\"collabora\" value=\"\" data-initial-state=\"{% if is_collabora_enabled == true %}true{% else %}false{% endif %}\">\n        <input\n            type=\"radio\"\n            id=\"office-onlyoffice\"\n            name=\"office_suite_choice\"\n            value=\"onlyoffice\"\n            class=\"office-radio\"\n            {% if is_onlyoffice_enabled == true %}\n                checked=\"checked\"\n            {% endif %}\n        >\n        <label class=\"office-card{{ isAnyRunning ? ' office-card-disabled' : '' }}\" for=\"office-onlyoffice\">\n            <div class=\"office-card-header\">\n                <h4>OnlyOffice</h4>\n                <svg class=\"office-checkmark\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                    <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"var(--color-nextcloud-blue)\"/>\n                    <path d=\"M7 12L10.5 15.5L17 9\" stroke=\"white\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                </svg>\n            </div>\n            <ul class=\"office-features\">\n                <li>Good Nextcloud integration</li>\n                <li>Open core</li>\n                <li>Best performance</li>\n                <li>Best Microsoft compatibility</li>\n                <li>Limited ODF compatibility</li>\n            </ul>\n            {% if isAnyRunning == false %}\n                <a href=\"https://www.onlyoffice.com/\" target=\"_blank\" class=\"office-learn-more\" onclick=\"event.stopPropagation();\">\n                    Learn more\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"vertical-align: middle; margin-left: 4px;\">\n                        <path d=\"M6 12L10 8L6 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                    </svg>\n                </a>\n            {% endif %}\n        </label>\n        <input type=\"hidden\" id=\"onlyoffice\" name=\"onlyoffice\" value=\"\" data-initial-state=\"{% if is_onlyoffice_enabled == true %}true{% else %}false{% endif %}\">\n    </div>\n    {% if isAnyRunning == false %}\n        <div class=\"office-none-card\">\n            <input\n                type=\"radio\"\n                id=\"office-none\"\n                name=\"office_suite_choice\"\n                value=\"\"\n                class=\"office-radio\"\n                {% if is_collabora_enabled == false and is_onlyoffice_enabled == false %}\n                    checked=\"checked\"\n                {% endif %}\n            >\n            <label class=\"office-none-label\" for=\"office-none\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"vertical-align: middle; margin-right: 6px;\">\n                    <path d=\"M2 2L14 14M2 14L14 2\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n                </svg>\n                Disable office suite\n            </label>\n        </div>\n    {% endif %}\n    <input class=\"options-form-submit\" type=\"submit\" value=\"Save changes\" />\n    <h3>Additional Optional Containers</h3>\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"clamav\"\n            name=\"clamav\"\n            {% if is_clamav_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"clamav\">ClamAV (Antivirus backend for Nextcloud, needs ~1GB additional RAM)</label>\n    </p>\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"fulltextsearch\"\n            name=\"fulltextsearch\"\n            {% if is_fulltextsearch_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"fulltextsearch\">\n            Fulltextsearch (needs ~1GB additional RAM, <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/discussions/5768\">does not work on Kernels without Seccomp</a>)\n            {% if is_fulltextsearch_enabled == false %}\n                . <strong>Please note:</strong> the initial indexing can take a long time during which Nextcloud will be unavailable\n            {% endif %}\n        </label>\n    </p>\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"imaginary\"\n            name=\"imaginary\"\n            {% if is_imaginary_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"imaginary\">Imaginary (for previews of heic, heif, illustrator, pdf, svg, tiff and webp. Imaginary is currently <a target=\"_blank\" href=\"https://github.com/nextcloud/server/issues/34262\">incompatible with server-side-encryption</a>)</label>\n    </p>\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"talk\"\n            name=\"talk\"\n            {% if is_talk_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"talk\">Nextcloud Talk (needs ports {{ talk_port }}/TCP and {{ talk_port }}/UDP open/forwarded in your firewall/router)</label>\n    </p>\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"talk-recording\"\n            name=\"talk-recording\"\n            {% if is_talk_recording_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"talk-recording\">Nextcloud Talk Recording-server (needs Nextcloud Talk being enabled and ~1GB additional RAM and ~2 additional vCPUs)</label>\n    </p>\n\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"docker-socket-proxy\"\n            name=\"docker-socket-proxy\"\n            {% if is_docker_socket_proxy_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"docker-socket-proxy\">Docker Socket Proxy (needed for <a target=\"_blank\" href=\"https://github.com/cloud-py-api/app_api#nextcloud-appapi\">Nextcloud App API</a>) ⚠️ The docker socket proxy container is deprecated. Please use the HaRP (High-availability Reverse Proxy for Nextcloud ExApps) instead!</label>\n    </p>\n{#\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"harp\"\n            name=\"harp\"\n            {% if is_harp_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"harp\">HaRP (<a target=\"_blank\" href=\"https://github.com/nextcloud/HaRP\">High-availability Reverse Proxy</a> for Nextcloud ExApps)</label>\n    </p>\n#}\n    <p>\n        <input\n            type=\"checkbox\"\n            id=\"whiteboard\"\n            name=\"whiteboard\"\n            {% if is_whiteboard_enabled == true %}\n                checked=\"checked\"\n                data-initial-state=\"true\"\n            {% else %}\n                data-initial-state=\"false\"\n            {% endif %}\n        >\n        <label for=\"whiteboard\">Whiteboard</label>\n    </p>\n    <input class=\"options-form-submit\" type=\"submit\" value=\"Save changes\" />\n</form>\n<p><strong>Minimal system requirements:</strong> 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 <strong><a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one/discussions/1335\">this documentation</a></strong></p>\n{% if isAnyRunning == true %}\n    <script type=\"text/javascript\" src=\"disable-clamav.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-docker-socket-proxy.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-harp.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-talk.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-collabora.js?v2\"></script>\n    <script type=\"text/javascript\" src=\"disable-onlyoffice.js?v2\"></script>\n    <script type=\"text/javascript\" src=\"disable-imaginary.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-fulltextsearch.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-talk-recording.js\"></script>\n    <script type=\"text/javascript\" src=\"disable-whiteboard.js\"></script>\n{% endif %}\n\n{% if is_collabora_enabled == true and isAnyRunning == false and was_start_button_clicked == true %}\n    <h3>Nextcloud Office dictionaries</h3>\n\n    {% if collabora_dictionaries == \"\" %}\n        <p>In order to get the correct dictionaries in Nextcloud Office, you may configure the dictionaries below:</p>\n        <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n            <input type=\"text\" name=\"collabora_dictionaries\" placeholder=\"de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru\" />\n            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n            <input type=\"submit\" value=\"Submit Nextcloud Office dictionaries\" />\n        </form>\n        <p>You need to make sure that the dictionaries that you enter are valid. An example is <strong>de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru</strong>.</p>\n    {% else %}\n        <p>The dictionaries for Nextcloud Office are currently set to <strong>{{ collabora_dictionaries }}</strong>. You can reset them again by clicking on the button below.</p>\n        <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n            <input type=\"hidden\" name=\"delete_collabora_dictionaries\" value=\"yes\"/>\n            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n            <input type=\"submit\" value=\"Reset Nextcloud Office dictionaries\" />\n        </form>\n    {% endif %}\n\n    <h3>Additional Nextcloud Office options</h3>\n\n    {% if collabora_additional_options == \"\" %}\n        <p>You can configure additional options for Nextcloud Office below.</p>\n        <p>(This can be used for configuring the net.content_security_policy and more. Make sure to submit the value!)</p>\n        <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n            <input type=\"text\" name=\"collabora_additional_options\" />\n            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n            <input type=\"submit\" value=\"Submit additional Nextcloud Office options\" />\n        </form>\n        <p>You need to make sure that the options that you enter are valid. An example is <strong>--o:net.content_security_policy=frame-ancestors *.example.com:*;</strong>.</p>\n    {% else %}\n        <p>The additioinal options for Nextcloud Office are currently set to <strong>{{ collabora_additional_options }}</strong>. You can reset them again by clicking on the button below.</p>\n        <form method=\"POST\" action=\"api/configuration\" class=\"xhr\">\n            <input type=\"hidden\" name=\"delete_collabora_additional_options\" value=\"yes\"/>\n            <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n            <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n            <input type=\"submit\" value=\"Reset additional Nextcloud Office options\" />\n        </form>\n    {% endif %}\n{% endif %}\n"
  },
  {
    "path": "php/templates/layout.twig",
    "content": "<html>\n    <head>\n        <title>AIO</title>\n        <link rel=\"stylesheet\" href=\"style.css?v9\" media=\"all\" />\n        <link rel=\"icon\" href=\"img/favicon.png\">\n        <script type=\"text/javascript\" src=\"forms.js?v1\"></script>\n        <script type=\"text/javascript\" src=\"toggle-dark-mode.js?v1\"></script>\n    </head>\n\n    <body>\n        <div class=\"wrapper\">\n            {% block body %}{% endblock %}\n        </div>\n        <div id=\"overlay\">\n            <div class=\"loader\"></div>\n            <iframe name=\"overlay-log\" id=\"overlay-log\"></iframe>\n        </div>\n        <button id=\"theme-toggle\" onclick=\"toggleTheme()\">\n            <span id=\"theme-icon\"></span>\n        </button>\n    </body>\n</html>\n"
  },
  {
    "path": "php/templates/log.twig",
    "content": "<html lang=\"en\">\n    <head>\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n        <link rel=\"stylesheet\" href=\"style.css\">\n        <style>\n            body {\n                padding: 1rem;\n            }\n            #floating-box {\n                position: sticky;\n                top: 1rem;\n                float: right;\n                right: 1rem;\n                width: 20rem;\n                display: flex;\n                justify-content: end;\n                align-items: center;\n            }\n            #autoloading-box {\n                display: grid;\n                gap: 0.5rem;\n                font-size: large;\n                border: solid thin gray;\n                background-color: #f9f9f9;\n                width: 10rem;\n                padding: 0.5rem 1rem;\n                margin: 0 0 0 1rem;\n            }\n            .loader {\n                opacity: 1;\n                width: 40px;\n                height: 40px;\n                align-self: inherit;\n            }\n            @starting-style {\n              .loader {\n                opacity: 0;\n              }\n            }\n            .loader.hidden {\n                display: none;\n                opacity: 0;\n                transition: opacity 1s, display 1s allow-discrete;\n            }\n        </style>\n        <script src=\"log-view.js\"></script>\n    </head>\n    <body data-container-id=\"{{ id }}\">\n        <div id=\"floating-box\">\n            <div class=\"loader\"></div>\n            <div id=\"autoloading-box\">\n                <div>\n                    Automatic loading of new log data is\n                    <span id=\"autoloading-status\">enabled</span>.\n                </div>\n                <button id=\"autoloading-control\">Disable</button>\n            </div>\n        </div>\n        <pre>{{ logContent }}</pre>\n    </body>\n</html>\n"
  },
  {
    "path": "php/templates/login.twig",
    "content": "{% extends \"layout.twig\" %}\n\n{% block body %}\n    <div class=\"login\">\n        <svg class=\"nextcloud-logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 142 100\" width=\"142\" height=\"100\">\n            <use href=\"img/nextcloud-logo.svg#logo\"></use>\n            <use href=\"img/nextcloud-logo.svg#Nextcloud\"></use>\n            <text x=\"10\" y=\"50\" fill=\"var(--color-nextcloud-logo)\" class=\"fallback-text\">Nextcloud Logo</text>\n        </svg>\n        <h1>Nextcloud AIO Login</h1>\n        {% if is_login_allowed == true %}\n            <p>Log in using your Nextcloud AIO passphrase:</p>\n            <form method=\"POST\" action=\"api/auth/login\" class=\"xhr\">\n                <input type=\"password\" autocomplete=\"current-password\" name=\"password\" placeholder=\"Password\" id=\"master-password\" oninput=\"showPassword('master-password')\">\n                <input type=\"hidden\" name=\"{{csrf.keys.name}}\" value=\"{{csrf.name}}\">\n                <input type=\"hidden\" name=\"{{csrf.keys.value}}\" value=\"{{csrf.value}}\">\n                <input type=\"submit\" class=\"button\" value=\"Log in\" />\n            </form>\n        {% else %}\n            <p>The login is blocked since Nextcloud is running.<br>Please use the <a target=\"_blank\" href=\"https://github.com/nextcloud/all-in-one#how-to-easily-log-in-to-the-aio-interface\"><strong>automatic login</strong></a> from your Nextcloud.<br><br>\n            If that is not possible, you can unblock the login by running<br><strong>sudo docker stop nextcloud-aio-apache</strong></p>\n        {% endif %}\n    </div>\n    <script type=\"text/javascript\" src=\"before-unload.js\"></script>\n{% endblock %}\n"
  },
  {
    "path": "php/templates/setup.twig",
    "content": "{% extends \"layout.twig\" %}\n\n{% block body %}\n    <div class=\"login\">\n        <svg class=\"nextcloud-logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 142 100\" width=\"142\" height=\"100\">\n            <use href=\"img/nextcloud-logo.svg#logo\"></use>\n            <use href=\"img/nextcloud-logo.svg#Nextcloud\"></use>\n            <text x=\"10\" y=\"50\" fill=\"var(--color-nextcloud-logo)\" class=\"fallback-text\">Nextcloud Logo</text>\n        </svg>\n        <h1>All-in-One setup</h1>\n        <p>The official Nextcloud installation method. Nextcloud All-in-One provides easy deployment and maintenance with most features included in this one Nextcloud instance.</p>\n        <p>⚠️ <strong>Please note down the passphrase to access the AIO interface and don't lose it!</strong></p>\n        <strong>Passphrase</strong><br/><span id=\"initial-password\" class=\"monospace\">{{ password }}</span><br>\n        <a href=\".\" class=\"button\" target=\"_blank\">Open Nextcloud AIO login ↗</a>\n    </div>\n{% endblock %}\n"
  },
  {
    "path": "php/tests/.gitignore",
    "content": "\n# Playwright\nnode_modules/\n/test-results/\n/playwright-report/\n/blob-report/\n/playwright/.cache/\n"
  },
  {
    "path": "php/tests/package.json",
    "content": "{\n  \"name\": \"nextcloud-aio-mastercontainer-tests\",\n  \"version\": \"1.0.0\",\n  \"license\": \"AGPL-3.0-or-later\",\n  \"devDependencies\": {\n    \"@playwright/test\": \"^1.56.1\"\n  }\n}\n"
  },
  {
    "path": "php/tests/playwright.config.js",
    "content": "import { defineConfig, devices } from '@playwright/test'\n\n/**\n * @see https://playwright.dev/docs/test-configuration\n */\nexport default defineConfig({\n  testDir: './tests',\n  fullyParallel: false,\n  forbidOnly: !!process.env.CI,\n  retries: 0,\n  workers: 1,\n  reporter: [\n    ['list'],\n    ['html'],\n  ],\n  use: {\n    baseURL: process.env.BASE_URL ?? 'http://localhost:8080',\n    trace: 'on',\n  },\n  projects: [\n    {\n      name: 'chromium',\n      use: {\n        ...devices['Desktop Chrome'],\n        ignoreHTTPSErrors: true,\n      },\n    },\n  ],\n})\n"
  },
  {
    "path": "php/tests/tests/initial-setup.spec.js",
    "content": "import { test, expect } from '@playwright/test';\nimport { writeFileSync } from 'node:fs'\n\ntest('Initial setup', async ({ page: setupPage }) => {\n  test.setTimeout(10 * 60 * 1000)\n\n  // Extract initial password\n  await setupPage.goto('./setup');\n  const password = await setupPage.locator('#initial-password').innerText()\n  const containersPagePromise = setupPage.waitForEvent('popup');\n  await setupPage.getByRole('link', { name: 'Open Nextcloud AIO login ↗' }).click();\n  const containersPage = await containersPagePromise;\n\n  // Log in and wait for redirect\n  await containersPage.locator('#master-password').click();\n  await containersPage.locator('#master-password').fill(password);\n  await containersPage.getByRole('button', { name: 'Log in' }).click();\n  await containersPage.waitForURL('./containers');\n\n  // Reject IP addresses\n  await containersPage.locator('#domain').click();\n  await containersPage.locator('#domain').fill('1.1.1.1');\n  await containersPage.getByRole('button', { name: 'Submit domain' }).click();\n  await expect(containersPage.locator('body')).toContainText('Please enter a domain and not an IP-address!');\n\n  // Accept example.com (requires disabled domain validation)\n  await containersPage.locator('#domain').click();\n  await containersPage.locator('#domain').fill('example.com');\n  await containersPage.getByRole('button', { name: 'Submit domain' }).click();\n\n  // Disable all additional containers\n  await containersPage.locator('#talk').uncheck();\n  await containersPage.getByRole('checkbox', { name: 'Whiteboard' }).uncheck();\n  await containersPage.getByRole('checkbox', { name: 'Imaginary' }).uncheck();\n  await containersPage.getByText('Disable office suite').click();\n  await containersPage.getByRole('button', { name: 'Save changes' }).last().click();\n  await expect(containersPage.locator('#talk')).not.toBeChecked()\n  await expect(containersPage.getByRole('checkbox', { name: 'Whiteboard' })).not.toBeChecked()\n  await expect(containersPage.getByRole('checkbox', { name: 'Imaginary' })).not.toBeChecked()\n  await expect(containersPage.locator('#office-none')).toBeChecked()\n\n  // Reject invalid time zones\n  await containersPage.locator('#timezone').click();\n  await containersPage.locator('#timezone').fill('Invalid time zone');\n  containersPage.once('dialog', dialog => {\n    console.log(`Dialog message: ${dialog.message()}`)\n    dialog.accept()\n  });\n  await containersPage.getByRole('button', { name: 'Submit timezone' }).click();\n  await expect(containersPage.locator('body')).toContainText('The entered timezone does not seem to be a valid timezone!')\n\n  // Accept valid time zone\n  await containersPage.locator('#timezone').click();\n  await containersPage.locator('#timezone').fill('Europe/Berlin');\n  containersPage.once('dialog', dialog => {\n    console.log(`Dialog message: ${dialog.message()}`)\n    dialog.accept()\n  });\n  await containersPage.getByRole('button', { name: 'Submit timezone' }).click();\n\n  // Start containers and wait for starting message\n  await containersPage.getByRole('button', { name: 'Download and start containers' }).click();\n  await expect(containersPage.getByRole('main')).toContainText('Containers are currently starting.', { timeout: 5 * 60 * 1000 });\n  await expect(containersPage.getByRole('link', { name: 'Open your Nextcloud ↗' })).toBeVisible({ timeout: 3 * 60 * 1000 });\n  await expect(containersPage.getByRole('link', { name: 'Open your Nextcloud ↗' })).toHaveAttribute('href', 'https://example.com');\n\n  // Extract initial nextcloud password\n  await expect(containersPage.getByRole('main')).toContainText('Initial Nextcloud password:')\n  const initialNextcloudPassword = await containersPage.locator('#initial-nextcloud-password').innerText();\n\n  // Set backup location and create backup\n  const borgBackupLocation = `/mnt/test/aio-${Math.floor(Math.random() * 2147483647)}`\n  await containersPage.locator('#borg_backup_host_location').click();\n  await containersPage.locator('#borg_backup_host_location').fill(borgBackupLocation);\n  await containersPage.getByRole('button', { name: 'Submit backup location' }).click();\n  containersPage.once('dialog', dialog => {\n    console.log(`Dialog message: ${dialog.message()}`)\n    dialog.accept()\n  });\n  await containersPage.getByRole('button', { name: 'Create backup' }).click();\n  await expect(containersPage.getByRole('main')).toContainText('Backup container is currently running:', { timeout: 3 * 60 * 1000 });\n  await expect(containersPage.getByRole('main')).toContainText('Last backup successful on', { timeout: 3 * 60 * 1000 });\n  await containersPage.getByText('Click here to reveal all backup options').click();\n  await expect(containersPage.locator('#borg-backup-password')).toBeVisible();\n  const borgBackupPassword = await containersPage.locator('#borg-backup-password').innerText();\n\n  // Assert that all containers are stopped\n  await expect(containersPage.getByRole('button', { name: 'Start containers' })).toBeVisible();\n\n  // Save passwords for restore backup test\n  writeFileSync('test_data.json', JSON.stringify({\n    initialNextcloudPassword,\n    borgBackupLocation,\n    borgBackupPassword,\n  }))\n});\n"
  },
  {
    "path": "php/tests/tests/restore-instance.spec.js",
    "content": "import { test, expect } from '@playwright/test';\nimport { readFileSync } from 'node:fs';\n\ntest('Restore instance', async ({ page: setupPage }) => {\n  test.setTimeout(10 * 60 * 1000)\n\n  // Load passwords from previous test\n  const {\n    initialNextcloudPassword,\n    borgBackupLocation,\n    borgBackupPassword,\n  } = JSON.parse(readFileSync('test_data.json'))\n\n  // Extract initial password\n  await setupPage.goto('./setup');\n  const password = await setupPage.locator('#initial-password').innerText()\n  const containersPagePromise = setupPage.waitForEvent('popup');\n  await setupPage.getByRole('link', { name: 'Open Nextcloud AIO login ↗' }).click();\n  const containersPage = await containersPagePromise;\n\n  // Log in and wait for redirect\n  await containersPage.locator('#master-password').click();\n  await containersPage.locator('#master-password').fill(password);\n  await containersPage.getByRole('button', { name: 'Log in' }).click();\n  await containersPage.waitForURL('./containers');\n\n  // Reject example.com (requires enabled domain validation)\n  await containersPage.locator('#domain').click();\n  await containersPage.locator('#domain').fill('example.com');\n  await containersPage.getByRole('button', { name: 'Submit domain' }).click();\n  await expect(containersPage.locator('body')).toContainText('Domain does not point to this server or the reverse proxy is not configured correctly.', { timeout: 15 * 1000 });\n\n  // Reject invalid backup location\n  await containersPage.locator('#borg_restore_host_location').click();\n  await containersPage.locator('#borg_restore_host_location').fill('/mnt/test/aio-incorrect-path');\n  await containersPage.locator('#borg_restore_password').click();\n  await containersPage.locator('#borg_restore_password').fill(borgBackupPassword);\n  await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click()\n  await containersPage.getByRole('button', { name: 'Test path and encryption' }).click();\n  await expect(containersPage.getByRole('main')).toContainText('Last test failed!', { timeout: 60 * 1000 });\n\n  // Reject invalid backup password\n  await containersPage.locator('#borg_restore_host_location').click();\n  await containersPage.locator('#borg_restore_host_location').fill(borgBackupLocation);\n  await containersPage.locator('#borg_restore_password').click();\n  await containersPage.locator('#borg_restore_password').fill('foobar');\n  await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click()\n  await containersPage.getByRole('button', { name: 'Test path and encryption' }).click();\n  await expect(containersPage.getByRole('main')).toContainText('Last test failed!', { timeout: 60 * 1000 });\n\n  // Accept correct backup location and password\n  await containersPage.locator('#borg_restore_host_location').click();\n  await containersPage.locator('#borg_restore_host_location').fill(borgBackupLocation);\n  await containersPage.locator('#borg_restore_password').click();\n  await containersPage.locator('#borg_restore_password').fill(borgBackupPassword);\n  await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click()\n  await containersPage.getByRole('button', { name: 'Test path and encryption' }).click();\n\n  // Check integrity and restore backup\n  await containersPage.getByRole('button', { name: 'Check backup integrity' }).click();\n  await expect(containersPage.getByRole('main')).toContainText('Last check successful!', { timeout: 5 * 60 * 1000 });\n  containersPage.once('dialog', dialog => {\n    console.log(`Dialog message: ${dialog.message()}`)\n    dialog.accept()\n  });\n  await containersPage.getByRole('button', { name: 'Restore selected backup' }).click();\n  await expect(containersPage.getByRole('main')).toContainText('Backup container is currently running:', { timeout: 1 * 60 * 1000 });\n\n  // Verify a successful backup restore\n  await expect(containersPage.getByRole('main')).toContainText('Last restore successful!', { timeout: 3 * 60 * 1000 });\n  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.');\n  containersPage.once('dialog', dialog => {\n    console.log(`Dialog message: ${dialog.message()}`)\n    dialog.accept()\n  });\n  await containersPage.getByRole('button', { name: 'Start and update containers' }).click();\n  await expect(containersPage.getByRole('link', { name: 'Open your Nextcloud ↗' })).toBeVisible({ timeout: 8 * 60 * 1000 });\n  await expect(containersPage.getByRole('main')).toContainText(initialNextcloudPassword);\n\n  // Verify that containers are all stopped\n  await containersPage.getByRole('button', { name: 'Stop containers' }).click();\n  await expect(containersPage.getByRole('button', { name: 'Start containers' })).toBeVisible({ timeout: 60 * 1000 });\n});"
  },
  {
    "path": "readme.md",
    "content": "# Nextcloud All-in-One\n\n> [!NOTE]\n> Nextcloud AIO is actively looking for contributors. See [the forum post](https://help.nextcloud.com/t/nextcloud-aio-is-looking-for-contributors/205234).\n\nThe official Nextcloud installation method. Nextcloud AIO provides easy deployment and maintenance with most features included in this one Nextcloud instance. \n\nIncluded are:\n- Nextcloud\n- High performance backend for Nextcloud Files (Client Push)\n- Redis & APCU for performant caching\n- PostgreSQL as database\n- Nextcloud Office (optional)\n- High performance backend for Nextcloud Talk and TURN-server (optional)\n- Nextcloud Talk Recording-server (optional)\n- Backup solution (optional, based on [BorgBackup](https://github.com/borgbackup/borg#what-is-borgbackup))\n- Imaginary (optional, for previews of heic, heif, illustrator, pdf, svg, tiff and webp)\n- ClamAV (optional, Antivirus backend for Nextcloud)\n- Fulltextsearch (optional)\n- Whiteboard (optional)\n- Docker Socket Proxy (optional, needed for [Nextcloud App API](https://github.com/cloud-py-api/app_api#nextcloud-appapi))\n- [Community containers](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers)\n<details><summary>And much more:</summary>\n\n- Simple web interface included that enables easy installation and maintenance\n- [Easy updates included](https://github.com/nextcloud/all-in-one#how-to-update-the-containers)\n- Update and backup notifications included\n- Daily backups can be enabled from the AIO interface which also allows updating all containers, Nextcloud and its apps afterwards automatically\n- 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)\n- APCu as local cache\n- Redis as distributed cache and for file locking\n- Postgresql as database\n- PHP-FPM with performance-optimized config (e.g. Opcache and JIT enabled by default)\n- A+ security in Nextcloud security scan\n- Ready to be used behind existing [Reverse proxies](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md)\n- Can be used behind [Cloudflare Tunnel](https://github.com/nextcloud/all-in-one#how-to-run-nextcloud-behind-a-cloudflare-tunnel)\n- Can be used via [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817)\n- 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)\n- 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)\n- 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)\n- Automatic TLS included (by using Let's Encrypt)\n- Brotli compression enabled by default for javascript, css and svg files which reduces Nextcloud load times\n- HTTP/2 and HTTP/3 enabled\n- \"Pretty URLs\" for Nextcloud are enabled by default (removes the index.php from all links)\n- Video previews work out of the box and when Imaginary is enabled, many recent image formats as well!\n- 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)\n- [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)\n- 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\n- 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)\n- 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)\n- `ffmpeg`, `smbclient` and `nodejs` are included by default\n- 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\n- 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\n- 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\n- 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)\n- [LDAP can be used as user backend for Nextcloud](https://github.com/nextcloud/all-in-one/tree/main#ldap)\n- Migration from any former Nextcloud installation to AIO is possible. See [this documentation](https://github.com/nextcloud/all-in-one/blob/main/migration.md). \n- Migration in the other direction (e.g. from AIO to a VM-based installation) is also possible.\n- [Fail2Ban can be added](https://github.com/nextcloud/all-in-one#fail2ban)\n- [phpMyAdmin, Adminer or pgAdmin can be added](https://github.com/nextcloud/all-in-one#phpmyadmin-adminer-or-pgadmin)\n- [Mail server can be added](https://github.com/nextcloud/all-in-one#mail-server)\n- Nextcloud can be [accessed locally via the domain](https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally)\n- 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)\n- [IPv6-ready](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md)\n- Can be used with [Docker rootless](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md) (good for additional security)\n- Runs on all platforms Docker supports (e.g. also on Windows and Macos)\n- Included containers easy to debug by having the possibility to check their logs directly from the AIO interface\n- [Docker-compose ready](./compose.yaml)\n- Can be installed [without a container having access to the docker socket](https://github.com/nextcloud/all-in-one/tree/main/manual-install)\n- Can be installed with [Docker Swarm](https://github.com/nextcloud/all-in-one#can-i-run-this-with-docker-swarm)\n- Can be installed with [Kubernetes](https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart)\n- Almost all included containers Alpine Linux based (good for security and size)\n- Many of the included containers run as non-root user (good for security)\n- Many of the included containers have a read-only root-FS (good for security)\n- Included containers run in its own docker network (good for security) and only really necessary ports are exposed on the host\n- [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\n- 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)\n- Possibility included to also back up external Docker Volumes or Host paths (can be used for host backups)\n- Borg backup can be completely managed from the AIO interface, including backup creation, backup restore, backup integrity check and integrity-repair\n- Other forms of [remote backup](https://github.com/nextcloud/all-in-one#are-remote-borg-backups-supported) are indirectly possible\n- 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.\n\n</details>\n\n## Screenshots\n| First setup | After installation |\n|---|---|\n| ![image](https://github.com/user-attachments/assets/6ef5d7b5-86f2-402c-bc6c-b633af2ca7dd) | ![image](https://github.com/user-attachments/assets/939d0fdf-436f-433d-82d3-27548263a040) |\n\n## How to use this?\n\nThe steps below are written for Linux. For platform-specific guidance see:\n- macOS: [How to run AIO on macOS?](#how-to-run-aio-on-macos)\n- Windows: [How to run AIO on Windows?](#how-to-run-aio-on-windows)\n- Unraid: [How to run AIO on Unraid?](#how-to-run-aio-on-unraid)\n- Synology DSM: [How to run AIO on Synology DSM?](#how-to-run-aio-on-synology-dsm)\n- TrueNAS SCALE: [Can I run AIO on TrueNAS SCALE?](#can-i-run-aio-on-truenas-scale)\n\n> [!IMPORTANT]  \n> 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)\n\nYou'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.\n\n> [!TIP]  \n> Don't worry about getting everything perfect on the first try — test deployments are cheap and disposable.\n\n1. Install Docker on your Linux host by following the official documentation: [Docker install — supported platforms](https://docs.docker.com/engine/install/#supported-platforms)\n\n> [!WARNING]  \n> 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:\n> ```sh\n> sudo docker info | grep \"Docker Root Dir\" | grep \"/var/snap/docker/\"\n> ```\n> If you see the following output:\n> ```\n> /var/snap/docker/\n> ```\n> 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/).\n>\n> ⚠️ 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.\n>\n> 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:\n> ```sh\n> sudo snap remove docker\n> ```\n\n2. 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)\n\n3. AIO uses a special `mastercontainer` to orchestrate the various pieces of the Nextcloud stack. To start AIO, launch the `mastercontainer` with the command below:\n\n```sh\n# For Linux and without a web server or reverse proxy already in place:\nsudo docker run \\\n  --init \\\n  --sig-proxy=false \\\n  --name nextcloud-aio-mastercontainer \\\n  --restart always \\\n  --publish 80:80 \\\n  --publish 8080:8080 \\\n  --publish 8443:8443 \\\n  --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n  --volume /var/run/docker.sock:/var/run/docker.sock:ro \\\n  ghcr.io/nextcloud-releases/all-in-one:latest\n```\n\n<details>\n  <summary>Explanation of the command</summary>\n\n  - `sudo docker run` — starts a new Docker container. Omit `sudo` if your user is in the `docker` group.  \n  - `--init` — runs an init process inside the container to handle zombie processes.  \n  - `--sig-proxy=false` — prevents Ctrl+C in the attached terminal from stopping the container.  \n  - `--name nextcloud-aio-mastercontainer` — the container name. Do not change this name; mastercontainer updates rely on it.  \n  - `--restart always` — ensures the container restarts automatically with the Docker daemon.  \n  - `--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.  \n  - `--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`).  \n  - `--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.  \n  - `--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.  \n  - `--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)  \n  - `ghcr.io/nextcloud-releases/all-in-one:latest` — the mastercontainer image.\n\n  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.\n</details>\n\n> [!TIP]\n> 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)\n\n> [!NOTE]\n> 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`.\n\n4. After the initial startup, open the Nextcloud AIO interface on port 8080 of this server **by IP address**, for example:\n```txt\nhttps://192.168.5.5:8080\n```\n\n> [!CAUTION]\n> 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.\n\nPort 8080 uses a self-signed certificate that you must accept in your browser.\n\nIt 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:\n```txt\nhttps://your-domain-that-points-to-this-server.tld:8443\n```\n\n5. If you enable Nextcloud Talk, open port `3478/TCP` and `3478/UDP` in your firewall/router for the Talk (TURN) container.\n\n# FAQ\n- [TOC](#faq)\n    - [Where can I find additional documentation?](#where-can-i-find-additional-documentation)\n    - [How does it work?](#how-does-it-work)\n    - [How to contribute?](#how-to-contribute)\n    - [How many users are possible?](#how-many-users-are-possible)\n- [Network](#network)\n    - [Are reverse proxies supported?](#are-reverse-proxies-supported)\n    - [Which ports are mandatory to be open in your firewall/router?](#which-ports-are-mandatory-to-be-open-in-your-firewallrouter)\n    - [Explanation of used ports](#explanation-of-used-ports)\n    - [Notes on Cloudflare (proxy/tunnel)](#notes-on-cloudflare-proxytunnel)\n    - [How to run Nextcloud behind a Cloudflare Tunnel?](#how-to-run-nextcloud-behind-a-cloudflare-tunnel)\n    - [How to run Nextcloud via Tailscale?](#how-to-run-nextcloud-via-tailscale)\n    - [How to get Nextcloud running using the ACME DNS-challenge?](#how-to-get-nextcloud-running-using-the-acme-dns-challenge)\n    - [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)\n    - [Can I use an ip-address for Nextcloud instead of a domain?](#can-i-use-an-ip-address-for-nextcloud-instead-of-a-domain)\n    - [Can I run AIO offline or in an airgapped system?](#can-i-run-aio-offline-or-in-an-airgapped-system)\n    - [Are self-signed certificates supported for Nextcloud?](#are-self-signed-certificates-supported-for-nextcloud)\n    - [Can I use AIO with multiple domains?](#can-i-use-aio-with-multiple-domains)\n    - [Are other ports than the default 443 for Nextcloud supported?](#are-other-ports-than-the-default-443-for-nextcloud-supported)\n    - [Can I run Nextcloud in a subdirectory on my domain?](#can-i-run-nextcloud-in-a-subdirectory-on-my-domain)\n    - [How can I access Nextcloud locally?](#how-can-i-access-nextcloud-locally)\n    - [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)\n    - [How to skip the domain validation?](#how-to-skip-the-domain-validation)\n    - [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)\n    - [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)\n    - [How to adjust the MTU size of the docker network](#how-to-adjust-the-mtu-size-of-the-docker-network)\n- [Infrastructure](#infrastructure)\n    - [Which CPU architectures are supported?](#which-cpu-architectures-are-supported)\n    - [Disrecommended VPS providers](#disrecommended-vps-providers)\n    - [Recommended VPS](#recommended-vps)\n    - [Note on storage options](#note-on-storage-options)\n    - [Are there known problems when SELinux is enabled?](#are-there-known-problems-when-selinux-is-enabled)\n- [Customization](#customization)\n    - [How to adjust the internally used docker api version?](#how-to-adjust-the-internally-used-docker-api-version)\n    - [How to change the default location of Nextcloud's Datadir?](#how-to-change-the-default-location-of-nextclouds-datadir)\n    - [How to configure custom UID/GID?](#how-to-configure-custom-uidgid)\n    - [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)\n    - [How to store the files/installation on a separate drive?](#how-to-store-the-filesinstallation-on-a-separate-drive)\n    - [How to limit the resource usage of AIO?](#how-to-limit-the-resource-usage-of-aio)\n    - [How to allow the Nextcloud container to access directories on the host?](#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host)\n    - [How to adjust the Talk port?](#how-to-adjust-the-talk-port)\n    - [How to adjust the upload limit for Nextcloud?](#how-to-adjust-the-upload-limit-for-nextcloud)\n    - [How to adjust the max execution time for Nextcloud?](#how-to-adjust-the-max-execution-time-for-nextcloud)\n    - [How to adjust the PHP memory limit for Nextcloud?](#how-to-adjust-the-php-memory-limit-for-nextcloud)\n    - [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)\n    - [How to add OS packages permanently to the Nextcloud container?](#how-to-add-os-packages-permanently-to-the-nextcloud-container)\n    - [How to add PHP extensions permanently to the Nextcloud container?](#how-to-add-php-extensions-permanently-to-the-nextcloud-container)\n    - [What about the pdlib PHP extension for the facerecognition app?](#what-about-the-pdlib-php-extension-for-the-facerecognition-app)\n    - [How to enable hardware acceleration for Nextcloud?](#how-to-enable-hardware-acceleration-for-nextcloud)\n        - [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)\n        - [With proprietary drivers for Nvidia :warning: BETA](#with-proprietary-drivers-for-nvidia-warning-beta)\n    - [How to keep disabled apps?](#how-to-keep-disabled-apps)\n    - [How to trust user-defined Certification Authorities (CA)?](#how-to-trust-user-defined-certification-authorities-ca)\n    - [How to disable Collabora's Seccomp feature?](#how-to-disable-collaboras-seccomp-feature)\n    - [How to adjust the Fulltextsearch Java options?](#how-to-adjust-the-fulltextsearch-java-options)\n- [Guides](#guides)\n    - [How to run AIO on macOS?](#how-to-run-aio-on-macos)\n    - [How to run AIO on Windows?](#how-to-run-aio-on-windows)\n    - [How to run AIO on Unraid?](#how-to-run-aio-on-unraid)\n    - [How to run AIO on Synology DSM](#how-to-run-aio-on-synology-dsm)\n    - [How to run AIO with Portainer?](#how-to-run-aio-with-portainer)\n    - [Can I run AIO on TrueNAS SCALE?](#can-i-run-aio-on-truenas-scale)\n    - [How to run `occ` commands?](#how-to-run-occ-commands)\n    - [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)\n    - [How to run multiple AIO instances on one server?](#how-to-run-multiple-aio-instances-on-one-server)\n    - [Bruteforce protection FAQ](#bruteforce-protection-faq)\n    - [How to switch the channel?](#how-to-switch-the-channel)\n    - [How to update the containers?](#how-to-update-the-containers)\n    - [How to easily log in to the AIO interface?](#how-to-easily-log-in-to-the-aio-interface)\n    - [How to change the domain?](#how-to-change-the-domain)\n    - [How to properly reset the instance?](#how-to-properly-reset-the-instance)\n    - [Can I use a CIFS/SMB share as Nextcloud's datadir?](#can-i-use-a-cifssmb-share-as-nextclouds-datadir)\n    - [Can I run this with Docker swarm?](#can-i-run-this-with-docker-swarm)\n    - [Can I run this with Kubernetes?](#can-i-run-this-with-kubernetes)\n    - [How to run this with Docker rootless?](#can-i-run-this-with-podman-instead-of-docker)\n    - [Can I run this with Podman instead of Docker?](#can-i-run-this-with-podman-instead-of-docker)\n    - [Access/Edit Nextcloud files/folders manually](#accessedit-nextcloud-filesfolders-manually)\n    - [How to edit Nextclouds config.php file with a texteditor?](#how-to-edit-nextclouds-configphp-file-with-a-texteditor)\n    - [How to change default files by creating a custom skeleton directory?](#how-to-change-default-files-by-creating-a-custom-skeleton-directory)\n    - [How to adjust the version retention policy and trashbin retention policy?](#how-to-adjust-the-version-retention-policy-and-trashbin-retention-policy)\n    - [How to enable automatic updates without creating a backup beforehand?](#how-to-enable-automatic-updates-without-creating-a-backup-beforehand)\n    - [Securing the AIO interface from unauthorized ACME challenges](#securing-the-aio-interface-from-unauthorized-acme-challenges)\n    - [How to migrate from an already existing Nextcloud installation to Nextcloud AIO?](#how-to-migrate-from-an-already-existing-nextcloud-installation-to-nextcloud-aio)\n- [Backup](#backup)\n    - [What is getting backed up by AIO's backup solution?](#what-is-getting-backed-up-by-aios-backup-solution)\n    - [How to adjust borgs retention policy?](#how-to-adjust-borgs-retention-policy)\n    - [How to migrate from AIO to AIO?](#how-to-migrate-from-aio-to-aio)\n    - [Are remote borg backups supported?](#are-remote-borg-backups-supported)\n    - [Failure of the backup container in LXC containers](#failure-of-the-backup-container-in-lxc-containers)\n    - [How to create the backup volume on Windows?](#how-to-create-the-backup-volume-on-windows)\n    - [Pro-tip: Backup archives access](#pro-tip-backup-archives-access)\n    - [Delete backup archives manually](#delete-backup-archives-manually)\n    - [Sync local backups regularly to another drive](#sync-local-backups-regularly-to-another-drive)\n    - [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)\n    - [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)\n    - [How to disable the backup section?](#how-to-disable-the-backup-section)\n- [Addons](#addons)\n    - [Fail2ban](#fail2ban)\n    - [LDAP](#ldap)\n    - [Netdata](#netdata)\n    - [USER_SQL](#user_sql)\n    - [phpMyAdmin, Adminer or pgAdmin](#phpmyadmin-adminer-or-pgadmin)\n    - [Mail server](#mail-server)\n- [Miscellaneous](#miscellaneous)\n    - [Requirements for integrating new containers](#requirements-for-integrating-new-containers)\n    - [Update policy](#update-policy)\n    - [How often are update notifications sent?](#how-often-are-update-notifications-sent)\n    - [Huge docker logs](#huge-docker-logs)\n\n### Where can I find additional documentation?\nSome of the documentation is available on [GitHub Discussions](https://github.com/nextcloud/all-in-one/discussions/categories/wiki).\n\n### How does it work?\nNextcloud 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.\n\n### How to contribute?\nSee [this issue](https://github.com/nextcloud/all-in-one/issues/5251) for a list of feature requests that need help by contributors.\n\n### How many users are possible?\nUp to 100 users are free, more are possible with [Nextcloud Enterprise](https://nextcloud.com/all-in-one/)\n\n## Network\n\n### Are reverse proxies supported?\nYes. Please refer to the following documentation on this: [reverse-proxy.md](https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md)\n\n### Which ports are mandatory to be open in your firewall/router?\nOnly those (if you access the Mastercontainer Interface internally via port 8080):\n- `443/TCP` for the Apache container\n- `443/UDP` if you want to enable http3 for the Apache container\n- `3478/TCP` and `3478/UDP` for the Talk container\n\n### Explanation of used ports\n- `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)\n- `80/TCP`: redirects to Nextcloud (is used for getting the certificate via ACME http-challenge for the Mastercontainer)\n- `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.)\n- `443/TCP`: will be used by the Apache container later on and needs to be open/forwarded in your firewall/router\n- `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\n- `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\n\n### Notes on Cloudflare (proxy/tunnel)\nSince 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.\n- 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.\n- 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.\n- 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\n- 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.\n- 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.\n- If using Cloudflare Tunnel and the Nextcloud Desktop Client [Set Chunking on Nextcloud Desktop Client](https://github.com/nextcloud/desktop/issues/4271#issuecomment-1159578065)\n- 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.\n- 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`\n- 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\n- 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`.\n- 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.\n- 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.\n\n### How to run Nextcloud behind a Cloudflare Tunnel?\nAlthough 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.\n\n### How to run Nextcloud via Tailscale?\nFor 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\n\n### How to get Nextcloud running using the ACME DNS-challenge?\nYou 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.\n\n### How to run Nextcloud locally? No domain wanted, or wanting intranet access within your LAN.\nIf 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.\n\n### Can I use an ip-address for Nextcloud instead of a domain?\nNo 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).\n\n### Can I run AIO offline or in an airgapped system?\nNo. 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.\n\n### Are self-signed certificates supported for Nextcloud?\nNo 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).\n\n### Can I use AIO with multiple domains?\nNo 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.\n\n### Are other ports than the default 443 for Nextcloud supported?\nNo 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.\n\n### Can I run Nextcloud in a subdirectory on my domain?\nNo 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.\n\n### How can I access Nextcloud locally?\nPlease 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.\n\nPlease 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.\n\nNow 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:\n- https://www.howtogeek.com/devops/how-to-run-your-own-dns-server-on-your-local-network/\n- https://help.nextcloud.com/t/need-help-to-configure-internal-access/156075/6\n- https://howchoo.com/pi/pi-hole-setup together with https://web.archive.org/web/20221203223505/https://docs.callitkarma.me/posts/PiHole-Local-DNS/\n- https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html\nApart 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\n\n### How to overwrite the local DNS resolution for some domains or add extra hosts to the containers?\n\nFor 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.\n\nAnother 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.\n\n### How to skip the domain validation?\nIf 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).\n\nAlternatively, 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`.\n\n### How to resolve firewall problems with Fedora Linux, RHEL OS, CentOS, SUSE Linux and others?\nIt 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:\n```\nsudo sed -i 's/FirewallBackend=nftables/FirewallBackend=iptables/g' /etc/firewalld/firewalld.conf\nsudo systemctl restart firewalld docker\n```\nAfterwards it should work.<br>\n\nSee 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\n\n### What can I do to fix the internal or reserved ip-address error?\nIf 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:<public-ip-address>` 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.\n\n### How to adjust the MTU size of the docker network\nYou can adjust the MTU size of the docker network by creating it beforehand with the custom MTU:\n```\ndocker network create --driver bridge --opt com.docker.network.driver.mtu=1440 nextcloud-aio\n```\nWhen 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.\n\nIf you want to use docker compose, you can check out the comments in the `compose.yaml` file for more details.\n\n## Infrastructure\n\n### Which CPU architectures are supported?\nYou can check this on Linux by running: `uname -m`\n- x86_64/x64/amd64\n- aarch64/arm64/armv8\n\n### Disrecommended VPS providers\n- *Older* Strato VPS using Virtuozzo caused problems though ones from Q3 2023 and later should work.\n  If your VPS has a `/proc/user_beancounters` file and a low `numproc` limit set in it\n  your server will likely misbehave once it reaches this limit\n  which is very quickly reached by AIO, see [here](https://github.com/nextcloud/all-in-one/discussions/1747#discussioncomment-4716164).\n- 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).\n\n### Recommended VPS\nIn general recommended VPS are those that are KVM/non-virtualized as Docker should work best on them.\n\n### Note on storage options\n- 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\n- SSD storage is recommended\n- HDD storage should work as well but is of course much slower than SSD storage\n\n### Are there known problems when SELinux is enabled?\nYes. 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\n\n## Customization\n\n### How to adjust the internally used docker api version?\nIf 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.\n\n### How to change the default location of Nextcloud's Datadir?\n> [!WARNING]  \n> 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.\n\nYou 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.\n\n- 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.\n- On macOS it might be `--env NEXTCLOUD_DATADIR=\"/var/nextcloud-data\"`\n- For Synology it may be `--env NEXTCLOUD_DATADIR=\"/volume1/docker/nextcloud/data\"`. \n- 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.\n- 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:\n    ```\n    docker volume create ^\n    --driver local ^\n    --name nextcloud_aio_nextcloud_datadir ^\n    -o device=\"/host_mnt/e/your/data/path\" ^\n    -o type=\"none\" ^\n    -o o=\"bind\"\n    ```\n    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.\n\n### How to configure custom UID/GID?\nThere are two ways to configure custom UIDs or GIDs that will be used inside the installation. \n\nThe 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\n\nAnother 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:\n```\n/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\n```\n\nThen use `sudo mount /target/path/where/the/source/directory/will/be/mounted/on/the/server` to mount it directly.\n\nYou can afterwards use `--env NEXTCLOUD_DATADIR=\"/target/path/where/the/source/directory/will/be/mounted/on/the/server\"` as described in the section above.\n\n### How to move the appdata folder from the datadir to an ssd to improve the performance?\nIf 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.\n\n> [!NOTE]  \n> 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). \n> In this example here, we assume that you used `NEXTCLOUD_DATADIR=\"/target/path/`.\n\nAfter 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`:\n```\n/source/path/on/ssd  /target/path/<appdata-path>  fuse.bindfs  force-user=33,force-group=33,allow_other  0  0\n```\nDo not forget to adjust `<appdata-path>` to the correct `appdata_*` name that your installation initially created automatically.\n\nThen use `sudo mount /target/path/<appdata-path>` to mount it directly.\n\nAfterwards things should be speed up.\n\n### How to store the files/installation on a separate drive?\nYou 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/<br>\n(Of course docker needs to be installed first for this to work.)\n\n⚠️ 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:\n\n1. Stop all the containers from the AIO Interface.\n2. Go to your terminal and delete the Collabora container (`docker rm nextcloud-aio-collabora`) AND the Collabora image (`docker image rm nextcloud/aio-collabora`).\n3. You might also want to prune your Docker (`docker system prune -a`) (no data will be lost).\n4. Restart your containers from the AIO Interface.\n\nThis should solve the problem.\n\n### How to limit the resource usage of AIO?\nIn 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/).\n\n### How to allow the Nextcloud container to access directories on the host?\nBy 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 `/`.\n\n- Two examples for Linux are `--env NEXTCLOUD_MOUNT=\"/mnt/\"` and `--env NEXTCLOUD_MOUNT=\"/media/\"`.\n- On macOS it might be `--env NEXTCLOUD_MOUNT=\"/Volumes/your_drive/\"`\n- For Synology it may be `--env NEXTCLOUD_MOUNT=\"/volume1/\"`.\n- 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.\n\nAfter 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/`.\n\nYou 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. \n\nBe 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.\n\n> [!NOTE]  \n> 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.\n\n### How to adjust the Talk port?\nBy 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\n\n### How to adjust the upload limit for Nextcloud?\nBy 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`.\n\n### How to adjust the max execution time for Nextcloud?\nBy 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`.\n\n### How to adjust the PHP memory limit for Nextcloud?\nBy 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`.\n\n### How to change the Nextcloud apps that are installed on the first startup?\nYou 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`.\n\n### How to add OS packages permanently to the Nextcloud container?\nSome 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. \n\nYou 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.\n\n### How to add PHP extensions permanently to the Nextcloud container?\nSome 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. \n\nYou 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.\n\n### What about the pdlib PHP extension for the facerecognition app?\nThe [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.\n\n### How to enable hardware acceleration for Nextcloud?\nSome container can use GPU acceleration to increase performance like [memories app](https://apps.nextcloud.com/apps/memories) allows to enable hardware transcoding for videos.\n\n#### With open source drivers MESA for AMD, Intel and **new** drivers `Nouveau` for Nvidia\n\n> [!WARNING]  \n> 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.\n\nA list of supported device can be fond in [MESA 3D documentation](https://docs.mesa3d.org/systems.html).\n\nThis method use the [Direct Rendering Infrastructure](https://dri.freedesktop.org/wiki/) with the access to the `/dev/dri` device.\n\nIn 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.\n\n\n#### With proprietary drivers for Nvidia :warning: BETA\n\n> [!WARNING]\n> 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.\n> \n> 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.\n\nThis method use the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html) with the nvidia runtime.\n\nIn 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.\n\nIf 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).\n\n### How to keep disabled apps?\nIn 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). \n> [!WARNING]  \n> 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.\n\n### How to trust user-defined Certification Authorities (CA)?\n> [!NOTE]\n> 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.\n\nFor 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.\n\nYou 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.\n\nWhen using `docker run`, the environmental variable can be set with `--env NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts`.\n\nIn 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.\n\n### How to disable Collabora's Seccomp feature?\nThe 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. \n\n### How to adjust the Fulltextsearch Java options?\nThe 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.\n\n## Guides\n\n### How to run AIO on macOS?\n\n> [!NOTE]\n> 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/\n\nGenerally, 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.\n\nAlso, 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.\n\n### How to run AIO on Windows?\nOn 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:\n\n```\ndocker run ^\n--init ^\n--sig-proxy=false ^\n--name nextcloud-aio-mastercontainer ^\n--restart always ^\n--publish 80:80 ^\n--publish 8080:8080 ^\n--publish 8443:8443 ^\n--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^\n--volume //var/run/docker.sock:/var/run/docker.sock:ro ^\nghcr.io/nextcloud-releases/all-in-one:latest\n```\n\nAlso, 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.\n\n> [!NOTE]  \n> 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.  \n\n### How to run AIO on Unraid?\n\nGenerally 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\n\nAdditionally, 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.\n```bash\n#!/bin/bash\n\n# Wait 120 seconds for other server components to start correctly\nsleep 120\n\n# Execute the actual command\ndocker exec --env START_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh\n```\n\nApart from that, the installation of AIO should work like on \"normal\" Linux. So refer to the Linux instructions for installation.\n\n### How to run AIO on Synology DSM\nOn 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.\n\n> [!NOTE]  \n> 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.` \n\nAlso, 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.\n\nYou'll also need to adjust Synology's firewall, see below:\n\n<details>\n<summary>Click here to expand</summary>\n\nThe 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:\n\n![Screenshot 2023-01-19 at 14 13 48](https://user-images.githubusercontent.com/70434961/213677995-71a9f364-e5d2-49e5-831e-4579f217c95c.png)\n\nIf 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:\n \n![Screenshot 2023-01-20 at 12 13 44](https://user-images.githubusercontent.com/70434961/213683295-0b39a2bd-7a26-414c-a408-127dd4f07826.png)\n</details>\n\n### How to run AIO with Portainer?\nThe 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. \n\n### Can I run AIO on TrueNAS SCALE?\nWith 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.\n\nFor a more complete guide, see this guide by @zybster: https://github.com/nextcloud/all-in-one/discussions/5506\n\nOn 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.\n\nAnother 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.\n\n### How to run `occ` commands?\nSimply 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\n\n### How to resolve `Security & setup warnings displays the \"missing default phone region\" after initial install`?\nSimply 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\n\n### How to run multiple AIO instances on one server?\nSee [multiple-instances.md](./multiple-instances.md) for some documentation on this.\n\n### Bruteforce protection FAQ\nNextcloud 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 <ip-address>` and enable a disabled user by running `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ user:enable <name of user>`. 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\n\n### How to switch the channel?\nYou 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.\n\n### How to update the containers?\nIf 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. \n\nIf 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.\n\nAdditionally, 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.\n\n### How to easily log in to the AIO interface?\nIf 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. \n\n> [!Note]\n> 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`.\n\n### How to change the domain?\n> [!NOTE]  \n> Editing the configuration.json manually and making a mistake may break your instance so please create a backup first!\n\nIf 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.<br>\nIf 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.\n\nAdditionally, 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:\n- `https://your-nc-domain.com/settings/admin/talk` for Turn/Stun server and Signaling Server if you enabled Talk via the AIO interface\n- `https://your-nc-domain.com/settings/admin/theming` for the theming URL\n- `https://your-nc-domain.com/settings/admin/app_api` for the deploy daemon if you enabled the App API via the AIO interface\n\n### How to properly reset the instance?\nIf something goes unexpected routes during the initial installation, you might want to reset the AIO installation to be able to start from scratch.\n\n> [!NOTE]  \n> 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.\n\nHere is how to reset the AIO instance properly:\n1. Stop all containers if they are running from the AIO interface\n1. Stop the mastercontainer with `sudo docker stop nextcloud-aio-mastercontainer`\n1. If the domaincheck container is still running, stop it with `sudo docker stop nextcloud-aio-domaincheck`\n1. 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 <container_name>` until no one is listed anymore.\n1. Check which containers are stopped: `sudo docker ps --filter \"status=exited\"`\n1. Now remove all these stopped containers with `sudo docker container prune`\n1. Delete the docker network with `sudo docker network rm nextcloud-aio`\n1. Check which volumes are dangling with `sudo docker volume ls --filter \"dangling=true\"`\n1. 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`). \n1. 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).\n1. 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 <volume_name>` until no one is listed anymore.\n1. Optional: You can remove all docker images with `sudo docker image prune -a`.\n1. And you are done! Now feel free to start over with the recommended docker run command!\n\n### Can I use a CIFS/SMB share as Nextcloud's datadir?\nSure. Add this to the `/etc/fstab` file on the host system: <br>\n`<your-storage-host-and-subpath> <your-mount-dir> cifs rw,mfsymlinks,seal,credentials=<your-credentials-file>,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0`<br>\n(Of course you need to modify `<your-storage-host-and-subpath>`, `<your-mount-dir>` and `<your-credentials-file>` for your specific case.)\n\nOne example could look like this:<br>\n`//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`<br>\nand add into `/etc/storage-credentials`:\n```\nusername=<smb/cifs username>\npassword=<password>\n```\n(Of course you need to modify `<smb/cifs username>` and `<password>` for your specific case.)\n\nNow you can use `/mnt/storagebox` as Nextcloud's datadir like described in the section [here](#how-to-change-the-default-location-of-nextclouds-datadir).\n\n> [!NOTE]  \n> 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)\n\n### Can I run this with Docker swarm?\nYes. For that to work, you need to use and follow the [manual-install documentation](./manual-install/).\n\n### Can I run this with Kubernetes?\nYes. For that to work, you need to use and follow the [helm-chart documentation](./nextcloud-aio-helm-chart/).\n\n### How to run this with Docker rootless?\nYou 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)\n\n### Can I run this with Podman instead of Docker?\nSince 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\n\n### Access/Edit Nextcloud files/folders manually\nThe 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.\n\nAfter 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\n\n### How to edit Nextclouds config.php file with a texteditor?\nYou 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\n\n### How to change default files by creating a custom skeleton directory?\nAll 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).\n\n### How to adjust the version retention policy and trashbin retention policy?\nBy 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.\n\n### How to enable automatic updates without creating a backup beforehand?\nIf 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. \n\nBut anyhow, is here a guide that helps you automate the whole procedure:\n\n<details>\n<summary>Click here to expand</summary>\n\n```bash\n#!/bin/bash\n\n# Stop the containers\ndocker exec --env STOP_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh\n\n# Below is optional if you run AIO in a VM which will shut down the VM afterwards\n# poweroff\n\n```\n\n</details>\n\nYou can simply copy and paste the script into a file e.g. named `shutdown-script.sh` e.g. here: `/root/shutdown-script.sh`. \n\nAfterwards 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: \n1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano). \n1. 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. \n1. 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`).\n\n\n**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.**\n\n**Afterwards, you can create a second script that automatically updates the containers:**\n\n<details>\n<summary>Click here to expand</summary>\n\n```bash\n#!/bin/bash\n\n# Run container update once\nif ! docker exec --env AUTOMATIC_UPDATES=1 nextcloud-aio-mastercontainer /daily-backup.sh; then\n    while docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-watchtower$\"; do\n        echo \"Waiting for watchtower to stop\"\n        sleep 30\n    done\n\n    while ! docker ps --format \"{{.Names}}\" | grep -q \"^nextcloud-aio-mastercontainer$\"; do\n        echo \"Waiting for Mastercontainer to start\"\n        sleep 30\n    done\n\n    # Run container update another time to make sure that all containers are updated correctly.\n    docker exec --env AUTOMATIC_UPDATES=1 nextcloud-aio-mastercontainer /daily-backup.sh\nfi\n\n```\n\n</details>\n\nYou can simply copy and paste the script into a file e.g. named `automatic-updates.sh` e.g. here: `/root/automatic-updates.sh`.\n\nAfterwards 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: \n1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano). \n1. 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. \n1. 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`).\n\n### Securing the AIO interface from unauthorized ACME challenges\n[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.\n\n### How to migrate from an already existing Nextcloud installation to Nextcloud AIO?\nPlease see the following documentation on this: [migration.md](https://github.com/nextcloud/all-in-one/blob/main/migration.md)\n\n## Backup\nNextcloud 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.\n\nIt 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. \n\nFor 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.\n\nIf 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. \n\n<details>\n<summary>How to do the above step for step</summary>\n\n1. 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`.\n2. If not already done, fire up the docker container and set up Nextcloud as per the guide.\n3. Now open the AIO interface.\n4. Under backup section, add your external disk mountpoint as backup directory, e.g. `/mnt/backup`.\n5. Click on `Create Backup` which should create the first backup on the external disk.\n\n</details>\n\nIf you want to back up directly to a remote borg repository:\n\n<details>\n<summary>How to do the above step for step</summary>\n\n1. Create your borg repository at the remote. Note down the repository URL for later.\n2. Open the AIO interface\n3. Under backup section, leave the local path blank and fill in the url to your borg repository that you noted down earlier.\n4. 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.\n5. Try again to create a backup, this time it should succeed.\n\n</details>\n\nBackups 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. \n\nThe 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.\n\nDaily 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.\n\nBe 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.\n\n---\n\n### What is getting backed up by AIO's backup solution?\nBacked 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).\n\n### How to adjust borgs retention policy?\nThe 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\n\n### How to migrate from AIO to AIO?\nIf 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.\n\n1. Set the DNS entry to 60 seconds TTL if applicable\n1. On your current installation, use the AIO interface to:\n    1. Update AIO and all containers\n    1. Stop all containers (from now on, your cloud is down)\n    1. Create a current borg backup\n    1. Note the path where the backups are stored and the encryption password\n1. Navigate to the backup folder\n1. Create archive of the backup so it's easier to copy: `tar -czvf borg.tar.gz borg`\n1. 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.\n1. Switch to the new host\n1. Go to the folder you put the backup archive and extract it with `tar -xf borg.tar.gz`\n1. 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)\n1. Change the DNS entry to the new host's IP\n1. Configure your reverse proxy if you use one\n1. Start the AIO container and open the new AIO interface in your browser\n1. Make sure to save the newly generated passphrase and enter it in the next step\n1. 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`\n1. Choose the latest backup in the dropdown and hit `Restore selected backup`\n1. Wait until the backup is restored\n1. Start the containers in the AIO interface\n\n### Are remote borg backups supported?\nBacking 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.\n\nSome alternatives, which do not have all the above benefits:\n\n- Mount a network FS like SSHFS, SMB or NFS in the directory that you enter in AIO as backup directory\n- 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)\n- 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\n- Here is another one that utilizes borgmatic and BorgBase for remote backups: https://github.com/nextcloud/all-in-one/discussions/4391\n- 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)\n\n---\n\n### Failure of the backup container in LXC containers\nIf 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.\n\n---\n\n### How to create the backup volume on Windows?\nAs 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:\n```\ndocker volume create ^\n--driver local ^\n--name nextcloud_aio_backupdir ^\n-o device=\"/host_mnt/e/your/backup/path\" ^\n-o type=\"none\" ^\n-o o=\"bind\"\n```\nIn 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.\n\n---\n\n### Pro-tip: Backup archives access\nYou can open the BorgBackup archives on your host by following these steps:<br>\n(instructions for Ubuntu Desktop)\n\nAlternatively, 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.\n\n```bash\n# Install borgbackup on the host\nsudo apt update && sudo apt install borgbackup\n\n# In any shell where you use borg, you must first export this variable\n# If you are using the default backup location /mnt/backup/borg\nexport BORG_REPO='/mnt/backup/borg'\n# or if you are using a remote repository\nexport BORG_REPO='user@host:/path/to/repo'\n\n# Mount the archives to /tmp/borg\nsudo mkdir -p /tmp/borg && sudo borg mount \"$BORG_REPO\" /tmp/borg\n\n# After entering your repository key successfully, you should be able to access all archives in /tmp/borg\n# You can now do whatever you want by syncing them to a different place using rsync or doing other things\n# E.g. you can open the file manager on that location by running:\nxhost +si:localuser:root && sudo nautilus /tmp/borg\n\n# When you are done, simply close the file manager and run the following command to unmount the backup archives:\nsudo umount /tmp/borg\n```\n\n---\n\n### Delete backup archives manually\nYou can delete BorgBackup archives on your host manually by following these steps:<br>\n(instructions for Debian based OS' like Ubuntu)\n\nAlternatively, 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.\n\n```bash\n# Install borgbackup on the host\nsudo apt update && sudo apt install borgbackup\n\n# In any shell where you use borg, you must first export this variable\n# If you are using the default backup location /mnt/backup/borg\nexport BORG_REPO='/mnt/backup/borg'\n# or if you are using a remote repository\nexport BORG_REPO='user@host:/path/to/repo'\n\n# List all archives (if you are using the default backup location /mnt/backup/borg)\nsudo borg list\n\n# After entering your repository key successfully, you should now see a list of all backup archives\n# An example backup archive might be called 20220223_174237-nextcloud-aio\n# Then you can simply delete the archive with:\nsudo borg delete --stats --progress \"::20220223_174237-nextcloud-aio\"\n\n# If borg 1.2.0 or higher is installed, you then need to run borg compact in order to clean up the freed space\nsudo borg --version\n# If version number of the command above is higher than 1.2.0 you need to run the command below:\nsudo borg compact\n\n```\n\nAfter doing so, make sure to update the backup archives list in the AIO interface!<br>\nYou can do so by clicking on the `Update backup list` button in the `Update backup list` section inside the `Backup and restore` section.\n\n---\n\n### Sync local backups regularly to another drive\nFor increased backup security, you might consider syncing the local backup repository regularly to another drive.\n\nTo 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:\n\n<details>\n<summary>Click here to expand</summary>\n\n```bash\n#!/bin/bash\n\n# Please modify all variables below to your needings:\nSOURCE_DIRECTORY=\"/mnt/backup/borg\"\nDRIVE_MOUNTPOINT=\"/mnt/backup-drive\"\nTARGET_DIRECTORY=\"/mnt/backup-drive/borg\"\n\n########################################\n# Please do NOT modify anything below! #\n########################################\n\nif [ \"$EUID\" -ne 0 ]; then \n    echo \"Please run as root\"\n    exit 1\nfi\n\nif ! [ -d \"$SOURCE_DIRECTORY\" ]; then\n    echo \"The source directory does not exist.\"\n    exit 1\nfi\n\nif [ -z \"$(ls -A \"$SOURCE_DIRECTORY/\")\" ]; then\n    echo \"The source directory is empty which is not allowed.\"\n    exit 1\nfi\n\nif ! [ -d \"$DRIVE_MOUNTPOINT\" ]; then\n    echo \"The drive mountpoint must be an existing directory\"\n    exit 1\nfi\n\nif ! grep -q \"$DRIVE_MOUNTPOINT\" /etc/fstab; then\n    echo \"Could not find the drive mountpoint in the fstab file. Did you add it there?\"\n    exit 1\nfi\n\nif ! mountpoint -q \"$DRIVE_MOUNTPOINT\"; then\n    mount \"$DRIVE_MOUNTPOINT\"\n    if ! mountpoint -q \"$DRIVE_MOUNTPOINT\"; then\n        echo \"Could not mount the drive. Is it connected?\"\n        exit 1\n    fi\nfi\n\nif [ -f \"$SOURCE_DIRECTORY/lock.roster\" ]; then\n    echo \"Cannot run the script as the backup archive is currently changed. Please try again later.\"\n    exit 1\nfi\n\nmkdir -p \"$TARGET_DIRECTORY\"\nif ! [ -d \"$TARGET_DIRECTORY\" ]; then\n    echo \"Could not create target directory\"\n    exit 1\nfi\n\nif [ -f \"$SOURCE_DIRECTORY/aio-lockfile\" ]; then\n    echo \"Not continuing because aio-lockfile already exists.\"\n    exit 1\nfi\n\ntouch \"$SOURCE_DIRECTORY/aio-lockfile\"\n\nif ! rsync --stats --archive --human-readable --delete \"$SOURCE_DIRECTORY/\" \"$TARGET_DIRECTORY\"; then\n    echo \"Failed to sync the backup repository to the target directory.\"\n    exit 1\nfi\n\nrm \"$SOURCE_DIRECTORY/aio-lockfile\"\nrm \"$TARGET_DIRECTORY/aio-lockfile\"\n\numount \"$DRIVE_MOUNTPOINT\"\n\nif docker ps --format \"{{.Names}}\" | grep \"^nextcloud-aio-nextcloud$\"; then\n    docker exec nextcloud-aio-nextcloud bash /notify.sh \"Rsync backup successful!\" \"Synced the backup repository successfully.\"\nelse\n    echo \"Synced the backup repository successfully.\"\nfi\n\n```\n\n</details>\n\nYou 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!\n\nAfterwards 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: \n1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano). \n1. 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. \n1. save and close the crontab (when using nano are the shortcuts for this `Ctrl + o` -> `Enter` and close the editor with `Ctrl + x`).\n\n### How to exclude Nextcloud's data directory or the preview folder from backup?\nIn 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. \n\n> [!WARNING]\n> 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.\n\n> [!TIP]\n> 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.\n\nIf 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.\n\nAfter 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.\n\n### How to stop/start/update containers or trigger the daily backup from a script externally?\n> [!WARNING]  \n> 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.\n\nYou can do so by running the `/daily-backup.sh` script that is stored in the mastercontainer. It accepts the following environment variables:\n- `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.\n- `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.\n- `STOP_CONTAINERS` if set to `1`, it will automatically stop the containers at the start of the script. Implied by `DAILY_BACKUP=1`.\n- `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`.\n- `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`.\n\nOne 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.\n\nLikewise 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`.\n\n> [!NOTE]  \n> None of the option returns error codes. So you need to check for the correct result yourself.\n\n### How to disable the backup section?\nIf 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).\n\n## Addons\n\n### Fail2ban\nYou 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\n\n### LDAP\nIt 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\n\n### Netdata\nNetdata 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\n\n### USER_SQL\nIf 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.\n\n### phpMyAdmin, Adminer or pgAdmin\nIt 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\n\n### Mail server\nYou 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\n\n## Miscellaneous\n\n### Requirements for integrating new containers\nFor 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\n\nWhat are the requirements?\n1. New containers must be related to Nextcloud. Related means that there must be a feature in Nextcloud that gets added by adding this container.\n2. It must be optionally installable. Disabling and enabling the container from the AIO interface must work and must not produce any unexpected side-effects.\n3. The feature that gets added into Nextcloud by adding the container must be maintained by the Nextcloud GmbH. \n4. 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. \n5. The container should not mount directories from the host into the container: only docker volumes should be used.\n6. The container must be usable by more than 90% of the users (e.g. not too high system requirements and such)\n7. No additional setup should be needed after adding the container - it should work completely out of the box.\n8. 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.\n\n### Update policy\nThis 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.\n\n### How often are update notifications sent?\nAIO 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.\n\n### Huge docker logs\nIf 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.\n\n<details>\n\n<summary>Badges</summary>\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/nextcloud/all-in-one)\n\n</details>\n"
  },
  {
    "path": "reverse-proxy.md",
    "content": "# Using a reverse proxy or secure tunnel to access Nextcloud AIO\n\n## Introduction\n\nThis 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:\n\n- **Integrated**: AIO's built-in reverse proxy with automatic HTTPS\n- **External**: An external reverse proxy (such as Caddy or Nginx or Cloudflare Proxy)\n- **Secure tunnel**: Tunneling services for private network access or public access without port forwarding (such as Tailscale Serve or Cloudflare Tunnel)\n\n## Choosing Your Approach\n\n> [!TIP]\n> 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.\n\n> [!NOTE]\n> 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.\n\n### When to use each approach\n\n| Approach | Best for | Requirements | Inbound Ports Required |\n|----------|----------|--------------|---------------|\n| **Integrated** | Simple setups, single service on port 443 | Public IP, dedicated port 443 | Yes (443) |\n| **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) |\n| **Cloudflare Tunnel** | No port forwarding possible/desired, public access | Cloudflare account | No |\n| **Tailscale Serve** | Private access (tailnet only) | Tailscale account | No |\n| **Tailscale Funnel** | Public access via Tailscale | Tailscale account | No |\n\n## Implementation Details\n\n### Integrated: Using AIO's internal reverse proxy with built-in HTTPS support\n\nNextcloud 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.\n\nRequirements:\n- 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).\n- 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]\n\n**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).**\n\n### External: Using AIO with an external reverse proxy (e.g., *Caddy, Nginx, Cloudflare Proxy*)\n\n**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:\n- Port 443 is already in use by another service\n- You want to run multiple web services on the same IP address\n- You already have an existing reverse proxy infrastructure\n\nA 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.\n\n**Types of external reverse proxies:**\n- **Self-hosted** (Caddy, Nginx, Apache, Traefik, HAProxy, etc.) - You manage the reverse proxy on your own server or separate server\n- **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.\n\nMost notably, an external reverse proxy allows you to:\n- share one external IP address among multiple hostnames/web applications, and\n- use a different internal port than the externally used port.\n\nUsing 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).\n\n> [!NOTE]\n> Cloudflare **Tunnel** and Cloudflare **Proxy** are different approaches:\n> - **Cloudflare Tunnel** doesn't require opening any inbound ports on your firewall.\n> - **Cloudflare Proxy** still requires port 443 exposed on your server.\n\n> [!TIP]\n> 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.\n\n> [!NOTE]\n> 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]\n\n### Secure tunnel: Using AIO with a secure tunneling service (*Tailscale, Cloudflare*)\n\nCloudflare and Tailscale offer secure tunneling services that let you access your Nextcloud without opening ports on your firewall. \n\n#### Private network access\n\nFor Nextcloud AIO, you can use:\n- **Cloudflare Tunnel (`cloudflared`)** - Secure outbound-only tunnels that don't require exposing ports\n- **Tailscale Serve** - Expose services privately on your Tailscale network (tailnet only)\n\nBoth options provide private network access to your Nextcloud AIO instance.\n\n#### Public Internet access (without port forwarding)\n\nTo make your Nextcloud AIO instance accessible from the public Internet (not just your private network), you can use:\n- **Cloudflare Tunnel** with public routes enabled (which combines Cloudflare Tunnel with Cloudflare's proxy features)\n- **Tailscale Funnel** - Expose services to the public Internet via Tailscale's infrastructure\n\n**Comparison of Cloudflare and Tailscale options:**\n\n| Feature | Access Scope | Inbound Ports Required | Use Case |\n|---------|--------------|----------------|----------|\n| **Cloudflare Tunnel** | Public Internet | None | Public access without port forwarding |\n| **Tailscale Serve** | Your Tailscale network only | None | Private access for you and invited users |\n| **Tailscale Funnel** | Public Internet | None | Public access through Tailscale |\n\n> [!TIP]\n> 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.\n>\n> **For private/personal use**: [Tailscale Serve](https://tailscale.com/kb/1312/serve) is ideal - it keeps your Nextcloud completely private to your tailnet.\n>\n> **For public access without port forwarding**: Use [Tailscale Funnel](https://tailscale.com/kb/1223/funnel).\n\n## Configuration and Deployment\n\n> [!NOTE]\n> 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.\n\n### Quick overview\n\nTo 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:\n\n1. Configure your web server or reverse proxy with the specific settings for AIO.\n2. Specify the port that AIO's integrated Apache container will use.\n3. Open the AIO interface and validate your domain.\n\nThe sections below provide detailed instructions for each step.\n\n> [!TIP]\n> 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).\n\n### Step-by-Step Instructions\n\nThe process to run Nextcloud AIO behind a reverse proxy has three required steps and three optional steps:\n\n**Required steps:**\n1. **Configure** your web server or reverse proxy with the specific settings for AIO. See [\"Configuring your reverse proxy\"](#1-configure-the-reverse-proxy) below.\n2. **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.\n   - *Optional*: Limit the access to the Apache container. See [\"Limit the access to the Apache container\"](#3-limit-the-access-to-the-apache-container).\n3. **Open** the AIO interface at port `8080`, enter your domain, and validate it. See [\"Open the AIO interface\"](#4-open-the-aio-interface) below.\n\n**Optional steps:**\n\n4. 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).\n5. 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).\n6. Debug things if needed. See [\"How to debug things\"](#7-how-to-debug-things).\n\n> [!NOTE] \n> If you run into troubles, see [the debug section](#7-how-to-debug-things).\n\n> [!IMPORTANT] \n> If you need HTTPS between Nextcloud and the reverse proxy (because the reverse proxy runs on a different server), you have two options:\n> \n> 1. **Add a local reverse proxy**: Install another reverse proxy on the same server as AIO to handle HTTPS (typically with self-signed certificates)\n> 2. **Use a VPN**: Create a VPN tunnel between the AIO server and the reverse proxy server to encrypt the connection\n\n> [!NOTE]\n> 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!\n\n### 1. Configure the reverse proxy\n\n#### Adapting the sample web server configurations below\n\n1. Replace `<your-nc-domain>` with the domain on which you want to run Nextcloud.\n1. Adjust the port `11000` to match your chosen `APACHE_PORT`.\n1. 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.\n\n    <details>\n\n    <summary>On the same server without a container</summary>\n\n    For this setup, the default sample configurations with `localhost:$APACHE_PORT` should work.\n\n    </details>\n\n    <details>\n\n    <summary>On the same server in a Docker container</summary>\n\n    The reverse-proxy container needs to be connected to the nextcloud containers. This can be achieved one of these 3 ways:\n    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.\n    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.\n    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` .\n\n    </details>\n\n    <details>\n\n    <summary>On a different server (in container or not)</summary>\n\n    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`.\n    \n    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).\n\n    </details>\n\n##### Apache\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\nAdd this as a new Apache site config:\n\n(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.)\n\n```\n<VirtualHost *:80>\n    ServerName <your-nc-domain>\n\n    RewriteEngine On\n    RewriteCond %{HTTPS} off\n    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n    RewriteCond %{SERVER_NAME} =<your-nc-domain>\n    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]\n</VirtualHost>\n\n<VirtualHost *:443>\n    ServerName <your-nc-domain>\n\n    # Reverse proxy based on https://httpd.apache.org/docs/current/mod/mod_proxy_wstunnel.html\n    RewriteEngine On\n    ProxyPreserveHost On\n    RequestHeader set X-Real-IP %{REMOTE_ADDR}s\n    AllowEncodedSlashes NoDecode\n    \n    # 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\n    ProxyPass / http://localhost:11000/ nocanon\n    ProxyPassReverse / http://localhost:11000/\n    \n    RewriteCond %{HTTP:Upgrade} websocket [NC]\n    RewriteCond %{HTTP:Connection} upgrade [NC]\n    RewriteCond %{THE_REQUEST} \"^[a-zA-Z]+ /(.*) HTTP/\\d+(\\.\\d+)?$\"\n    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\n\n    # Enable h2, h2c and http1.1\n    Protocols h2 h2c http/1.1\n    \n    # Solves slow upload speeds caused by http2\n    H2WindowSize 5242880\n\n    # TLS\n    SSLEngine               on\n    SSLProtocol             -all +TLSv1.2 +TLSv1.3\n    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\n    SSLHonorCipherOrder     off\n    SSLSessionTickets       off\n\n    # 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, \n    # the <your-nc-domain> in the below lines should be replaced with just the domain (eg. example.com), not the subdomain. \n    # In this case the subdomain should already be secured without additional actions\n    SSLCertificateFile /etc/letsencrypt/live/<your-nc-domain>/fullchain.pem\n    SSLCertificateKeyFile /etc/letsencrypt/live/<your-nc-domain>/privkey.pem\n\n    # Disable HTTP TRACE method.\n    TraceEnable off\n    <Files \".ht*\">\n        Require all denied\n    </Files>\n\n    # Support big file uploads\n    LimitRequestBody 0\n    Timeout 86400\n    ProxyTimeout 86400\n</VirtualHost>\n```\n\n⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\nTo make the config work you can run the following command:\n`sudo a2enmod rewrite proxy proxy_http proxy_wstunnel ssl headers http2`\n\n</details>\n\n##### Caddy (recommended)\n\n<details>\n\n<summary>click here to expand</summary>\n\n**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.\n\nAdd this to your Caddyfile:\n\n```\nhttps://<your-nc-domain>:443 {\n    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\n}\n```\nThe 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.\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n**Advice:** You may have a look at [this](https://github.com/nextcloud/all-in-one/discussions/575#discussion-4055615) for a more complete example.\n\n</details>\n\n##### Caddy with ACME DNS-challenge\n\n<details>\n\n<summary>click here to expand</summary>\n\nYou can get AIO running using the ACME DNS-challenge. Here is how to do it.\n\n1. 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.\n1. Add this to your Caddyfile:\n    ```\n    https://<your-nc-domain>:443 {\n        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\n        tls {\n            dns <provider> <key>\n        }\n    }\n    ```\n    ⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n    You also need to adjust `<provider>` and `<key>` to match your case.\n\n1. 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).\n\n**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.\n\n</details>\n\n##### OpenLiteSpeed\n\n<details>\n\n<summary>click here to expand</summary>\n\nYou can find the OpenLiteSpeed reverse proxy guide by @MorrowShore here: https://github.com/nextcloud/all-in-one/discussions/6370\n\n</details>\n\n##### Citrix ADC VPX / Citrix Netscaler\n\n<details>\n\n<summary>click here to expand</summary>\n\nFor 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\n\n</details>\n\n##### Cloudflare Tunnel\n\n<details>\n\n<summary>click here to expand</summary>\n\n\n**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.\n\nAlthough 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:\n\n1. 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`.<br>\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n1. 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).\n\n**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.\n\n</details>\n\n##### HAProxy\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\nHere is an example HaProxy config:\n\n```\nglobal\n    chroot                      /var/haproxy\n    log                         /var/run/log audit debug\n    lua-prepend-path            /tmp/haproxy/lua/?.lua\n    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\n    ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256\n    ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets\n\n    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\n    ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256\n    ssl-default-server-options ssl-min-ver TLSv1.2 no-tls-tickets\n\ndefaults\n    log     global\n    option redispatch -1\n    retries 3\n    default-server init-addr last,libc\n\n# Frontend: LetsEncrypt_443 ()\nfrontend LetsEncrypt_443\n    bind 0.0.0.0:443 name 0.0.0.0:443 ssl crt-list /tmp/haproxy/ssl/605f6609f106d1.17683543.certlist \n    mode http\n    option http-keep-alive\n    default_backend acme_challenge_backend\n    option forwardfor\n    # tuning options\n    timeout client 30s\n\n    # logging options\n    # ACL: find_acme_challenge\n    acl acl_605f6d4b6453d2.03059920 path_beg -i /.well-known/acme-challenge/\n    # ACL: Nextcloud\n    acl acl_60604e669c3ca4.13013327 hdr(host) -i <your-nc-domain>\n\n    # ACTION: redirect_acme_challenges\n    use_backend acme_challenge_backend if acl_605f6d4b6453d2.03059920\n    # ACTION: Nextcloud\n    use_backend Nextcloud if acl_60604e669c3ca4.13013327\n\n\n# Frontend: LetsEncrypt_80 ()\nfrontend LetsEncrypt_80\n    bind 0.0.0.0:80 name 0.0.0.0:80 \n    mode tcp\n    default_backend acme_challenge_backend\n    # tuning options\n    timeout client 30s\n\n    # logging options\n    # ACL: find_acme_challenge\n    acl acl_605f6d4b6453d2.03059920 path_beg -i /.well-known/acme-challenge/\n\n    # ACTION: redirect_acme_challenges\n    use_backend acme_challenge_backend if acl_605f6d4b6453d2.03059920\n\n# Frontend (DISABLED): 1_HTTP_frontend ()\n\n# Frontend (DISABLED): 1_HTTPS_frontend ()\n\n# Frontend (DISABLED): 0_SNI_frontend ()\n\n# Backend: acme_challenge_backend (Added by Let's Encrypt plugin)\nbackend acme_challenge_backend\n    # health checking is DISABLED\n    mode http\n    balance source\n    # stickiness\n    stick-table type ip size 50k expire 30m  \n    stick on src\n    # tuning options\n    timeout connect 30s\n    timeout server 30s\n    http-reuse safe\n    server acme_challenge_host 127.0.0.1:43580 \n\n# Backend: Nextcloud ()\nbackend Nextcloud\n    mode http\n    balance source\n    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\n```\n\n⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### Nginx, Freenginx, Openresty, Angie\n\n<details>\n\n<summary>click here to expand</summary>\n\n**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.\n\n**Disclaimer:** This config was tested and should normally work on all modern Nginx versions. Improvements to the config are very welcome!\n\nAdd the below template to your Nginx config.\n\n**Note:** please check your Nginx version by running: `nginx -v` and adjust the lines marked with version notes to fit your version.\n\n```\nmap $http_upgrade $connection_upgrade {\n    default upgrade;\n    '' close;\n}\n\nserver {\n    listen 80;\n    listen [::]:80;            # comment to disable IPv6\n\n    if ($scheme = \"http\") {\n        return 301 https://$host$request_uri;\n    }\n    if ($http_x_forwarded_proto = \"http\") {\n        return 301 https://$host$request_uri;\n    }\n\n    listen 443 ssl http2;      # for nginx versions below v1.25.1\n    listen [::]:443 ssl http2; # for nginx versions below v1.25.1 - comment to disable IPv6\n\n    # listen 443 ssl;      # for nginx v1.25.1+\n    # listen [::]:443 ssl; # for nginx v1.25.1+ - keep comment to disable IPv6\n    # http2 on;            # uncomment to enable HTTP/2 - supported on nginx v1.25.1+\n\n    # 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\n    # 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\n    # http3 on;                                 # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+\n    # quic_gso on;                              # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+\n    # quic_retry on;                            # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+\n    # 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\n    # add_header Alt-Svc 'h3=\":443\"; ma=86400'; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+\n\n    proxy_buffering off;\n    proxy_request_buffering off;\n\n    client_max_body_size 0;\n    client_body_buffer_size 512k;\n    # http3_stream_buffer_size 512k; # uncomment to enable HTTP/3 / QUIC - supported on nginx v1.25.0+\n    proxy_read_timeout 86400s;\n\n    server_name <your-nc-domain>;\n\n    location / {\n        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\n\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Port $server_port;\n        proxy_set_header X-Forwarded-Scheme $scheme;\n        proxy_set_header X-Forwarded-Proto $scheme;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header Host $host;\n        proxy_set_header Early-Data $ssl_early_data;\n\n        # Websocket\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection $connection_upgrade;\n    }\n\n    # 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, \n    # the <your-nc-domain> in the below lines should be replaced with just the domain (eg. example.com), not the subdomain. \n    # In this case the subdomain should already be secured without additional actions\n    ssl_certificate /etc/letsencrypt/live/<your-nc-domain>/fullchain.pem;   # managed by certbot on host machine\n    ssl_certificate_key /etc/letsencrypt/live/<your-nc-domain>/privkey.pem; # managed by certbot on host machine\n\n    ssl_dhparam /etc/dhparam; # curl -L https://ssl-config.mozilla.org/ffdhe2048.txt -o /etc/dhparam\n\n    ssl_early_data on;\n    ssl_session_timeout 1d;\n    ssl_session_cache shared:SSL:10m;\n\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_ecdh_curve x25519:x448:secp521r1:secp384r1:secp256r1;\n\n    ssl_prefer_server_ciphers on;\n    ssl_conf_command Options PrioritizeChaCha;\n    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;\n}\n\n```\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### NPMplus (Fork of Nginx-Proxy-Manager - NPM)\n\n<details>\n\n<summary>click here to expand</summary>\n\n⚠️ **Please note:** This is not needed when running NPMplus as a community container.\n\nFirst, make sure the environmental variables `PUID` and `PGID` in the `compose.yaml` file for NPM are either unset or set to `0`. <br>\nIf you need to change the GID/PID then please add `net.ipv4.ip_unprivileged_port_start=0` at the end of `/etc/sysctl.conf`. <br>\nNote: this will cause that a non root user can bind privileged ports.\n\nSecond, see these screenshots for a working config:\n\n<img width=\"675\" height=\"695\" alt=\"image\" src=\"https://github.com/user-attachments/assets/196f53f9-ff86-4da2-960e-f7b7a2ceac0c\" />\n\n<img width=\"675\" height=\"355\" alt=\"image\" src=\"https://github.com/user-attachments/assets/8a45a6d8-fbaf-4519-86f7-c7424ed780da\" />\n\n<img width=\"675\" height=\"542\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7e880d02-0f4f-459a-a3f6-216bcb1b04ca\" />\n\n<img width=\"675\" height=\"570\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2812ecc1-ecf0-44bd-9249-b76b30f8c25e\" />\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### Nginx-Proxy-Manager - NPM\n\n<details>\n\n<summary>click here to expand</summary>\n\n**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.\n\nFirst, make sure the environmental variables `PUID` and `PGID` in the `compose.yaml` file for NPM are either unset or set to `0`. <br>\nIf you need to change the GID/PID then please add `net.ipv4.ip_unprivileged_port_start=0` at the end of `/etc/sysctl.conf`. <br>\nNote: this will cause that a non root user can bind privileged ports.\n\nSecond, see these screenshots for a working config:\n\n![grafik](https://user-images.githubusercontent.com/75573284/213889707-b7841ca0-3ea7-4321-acf6-50e1c1649442.png)\n\n![grafik](https://user-images.githubusercontent.com/75573284/213889724-1ab32264-3e0c-4d83-b067-9fe9d1672fb2.png)\n\n![grafik](https://github.com/nextcloud/all-in-one/assets/24786786/fecbb5ef-d2f4-4e0f-bc4b-82207e2c2809)\n\n![grafik](https://user-images.githubusercontent.com/75573284/213889746-87dbe8c5-4d1f-492f-b251-bbf82f1510d0.png)\n\n```\nclient_body_buffer_size 512k;\nproxy_read_timeout 86400s;\nclient_max_body_size 0;\n```\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\nAlso change `<you>@<your-mail-provider-domain>` to a mail address of yours.\n\n</details>\n\n##### Nginx-Proxy\n\n<details>\n\n<summary>click here to expand</summary>\n\nThis 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.\n\nUnfortunately, 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.\n\nIf you really want to use AIO, we recommend you to switch to caddy. It is simply amazing!<br>\n\nApart from that, there is a [manual-install](https://github.com/nextcloud/all-in-one/tree/main/manual-install).\n\n</details>\n\n##### Node.js with Express\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\nFor Node.js, we will use the npm package `http-proxy`. WebSockets must be handled separately.\n\nThis example only uses `http`, but if your Express server already uses a `https` server, then follow the same instructions for `https`.\n\n```js\nconst HttpProxy = require('http-proxy');\nconst express = require('express');\nconst http = require('http');\n\nconst app = express();\nconst proxy = HttpProxy.createProxyServer({\n\ttarget: '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\n\t// Timeout can be changed to your liking.\n\ttimeout: 1000 * 60 * 3,\n\tproxyTimeout: 1000 * 60 * 3,\n\t// Not 100% certain whether autoRewrite is necessary, but enabling it SEEMS to make it behave more stably.\n\tautoRewrite: true,\n\t// Do not enable followRedirects.\n\tfollowRedirects: false,\n});\n\n// Handle errors with proxy.web and proxy.ws\nfunction onProxyError(err, req, res, target) {\n\t// Handle errors however you like. Here's an example:\n\tif (err.code === 'ECONNREFUSED') {\n\t\treturn res.status(503).send('Nextcloud server is currently not running. It may be down for temporary maintenance.');\n\t}\n\t// other errors\n\telse {\n\t\tconsole.error(err);\n\t\treturn res.status(500).send(String(err));\n\t}\n}\n\napp.use((req, res) => {\n\tproxy.web(req, res, {}, onProxyError);\n});\n\nconst httpServer = http.createServer(app);\nhttpServer.listen('80');\n\n// Listen for an upgrade to a WebSocket connection.\nhttpServer.on('upgrade', (req, socket, head) => {\n\tproxy.ws(req, socket, head, {}, onProxyError);\n});\n```\n\nIf 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.\n\n```js\nconst HttpProxy = require('http-proxy');\nconst express = require('express');\nconst http = require('http');\n\nconst myNextcloudApp = express();\nconst myOtherApp = express();\nconst vhost = express();\n\n// Definitions for proxy and onProxyError unchanged. (see above)\n\nmyNextcloudApp.use((req, res) => {\n\tproxy.web(req, res, {}, onProxyError);\n});\n\nvhost.use(vhostFunc('<your-nc-domain>', myNextcloudApp));\n\nconst httpServer = http.createServer(app);\nhttpServer.listen('80');\n\n// Listen for an upgrade to a WebSocket connection.\nhttpServer.on('upgrade', (req, socket, head) => {\n\tproxy.ws(req, socket, head, {}, onProxyError);\n});\n```\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### Synology Reverse Proxy\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\nSee these screenshots for a working config:\n\n![image](https://user-images.githubusercontent.com/89748315/192525606-48cab54b-866e-4964-90a8-15e71bd362fb.png)\n\n![image](https://user-images.githubusercontent.com/70434961/213193789-fa936edc-e307-4e6a-9a53-ae26d1bf2f42.jpg)\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### Tailscale (Serve)\n\n<details>\n\n<summary>Click here to expand</summary>\n\nTailscale 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.\n\nFor 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\n\nThe guide covers:\n- Setting up system-wide (non-containerized) Tailscale as a reverse proxy\n- Configuring Nextcloud AIO to work with Tailscale Serve\n- Using Tailscale's MagicDNS to provide automatic HTTPS certificates\n- Private access via your tailnet (e.g., `yourserver.tail0a12b3.ts.net`)\n\n⚠️ **Please note:** This guide covers **Tailscale Serve** for private tailnet access. If you need public Internet access, consider using **Tailscale Funnel**.\n\n</details>\n\n##### Traefik 2\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Hint:** You may have a look at [this video](https://www.youtube.com/watch?v=VLPSRrLMDmA) for a more complete but possibly outdated example.\n\n**Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\nTraefik'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.\n\nThe examples below define the dynamic configuration in YAML files. If you rather prefer TOML, use a YAML to TOML converter.\n\n1. In Traefik's static configuration define a [file provider](https://doc.traefik.io/traefik/providers/file/) for dynamic providers:\n\n    ```yml\n    # STATIC CONFIGURATION\n   \n    entryPoints:\n      https:\n        address: \":443\" # Create an entrypoint called \"https\" that uses port 443\n        transport:\n          respondingTimeouts:\n            readTimeout: 24h # Allows uploads > 100MB; prevents connection reset due to chunking (public upload-only links)\n        # If you want to enable HTTP/3 support, uncomment the line below\n        # http3: {}\n    \n    certificatesResolvers:\n      # Define \"letsencrypt\" certificate resolver\n      letsencrypt:\n        acme:\n          storage: /letsencrypt/acme.json # Defines the path where certificates should be stored\n          email: <your-email-address> # Where LE sends notification about certificates expiring\n          tlschallenge: true\n   \n    providers:\n      file:\n        directory: \"/path/to/dynamic/conf\" # Adjust the path according your needs.\n        watch: true\n\n    # Enable HTTP/3 feature by uncommenting the lines below. Don't forget to route 443 UDP to Traefik (Firewall\\NAT\\Traefik Container)\n    # experimental:\n      # http3: true\n    ```\n\n1. Declare the router, service and middlewares for Nextcloud in `/path/to/dynamic/conf/nextcloud.yml`:\n\n    ```yml\n    http:\n      routers:\n        nextcloud:\n          rule: \"Host(`<your-nc-domain>`)\"\n          entrypoints:\n            - \"https\"\n          service: nextcloud\n          middlewares:\n            - nextcloud-chain\n          tls:\n            certresolver: \"letsencrypt\"\n\n      services:\n        nextcloud:\n          loadBalancer:\n            servers:\n              - 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\n\n      middlewares:\n        nextcloud-secure-headers:\n          headers:\n            hostsProxyHeaders:\n              - \"X-Forwarded-Host\"\n            referrerPolicy: \"same-origin\"\n\n        https-redirect:\n          redirectscheme:\n            scheme: https \n\n        nextcloud-chain:\n          chain:\n            middlewares:\n              # - ... (e.g. rate limiting middleware)\n              - https-redirect\n              - nextcloud-secure-headers\n    ```\n\n---\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### Traefik 3\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Disclaimer:** it might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\nTraefik'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.\n\nThe examples below define the dynamic configuration in YAML files. If you rather prefer TOML, use a YAML to TOML converter.\n\n1. In Traefik's static configuration define a [file provider](https://doc.traefik.io/traefik/providers/file/) for dynamic providers:\n\n    ```yml\n    # STATIC CONFIGURATION\n   \n    entryPoints:\n      https:\n        address: \":443\" # Create an entrypoint called \"https\" that uses port 443\n        transport:\n          respondingTimeouts:\n            readTimeout: 24h # Allows uploads > 100MB; prevents connection reset due to chunking (public upload-only links)\n        http:\n          # Required for Nextcloud to correctly handle encoded URL characters (%2F, %3F and %25 in this case) in newer Traefik versions (v3.6.4+).\n          encodedCharacters:  \n            allowEncodedSlash: true\n            allowEncodedQuestionMark: true\n            allowEncodedPercent: true\n        # If you want to enable HTTP/3 support, uncomment the line below\n        # http3: {}\n    \n    certificatesResolvers:\n      # Define \"letsencrypt\" certificate resolver\n      letsencrypt:\n        acme:\n          storage: /letsencrypt/acme.json # Defines the path where certificates should be stored\n          email: <your-email-address> # Where LE sends notification about certificates expiring\n          tlschallenge: true\n   \n    providers:\n      file:\n        directory: \"/path/to/dynamic/conf\" # Adjust the path according your needs.\n        watch: true\n    ```\n\n2. Declare the router, service and middlewares for Nextcloud in `/path/to/dynamic/conf/nextcloud.yml`:\n\n    ```yml\n    http:\n      routers:\n        nextcloud:\n          rule: \"Host(`<your-nc-domain>`)\"\n          entrypoints:\n            - \"https\"\n          service: nextcloud\n          middlewares:\n            - nextcloud-chain\n          tls:\n            certresolver: \"letsencrypt\"\n\n      services:\n        nextcloud:\n          loadBalancer:\n            servers:\n              - 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\n\n      middlewares:\n        nextcloud-secure-headers:\n          headers:\n            hostsProxyHeaders:\n              - \"X-Forwarded-Host\"\n            referrerPolicy: \"same-origin\"\n\n        https-redirect:\n          redirectscheme:\n            scheme: https \n\n        nextcloud-chain:\n          chain:\n            middlewares:\n              # - ... (e.g. rate limiting middleware)\n              - https-redirect\n              - nextcloud-secure-headers\n    ```\n\n---\n\n⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### IIS with ARR and URL Rewrite\n\n<details>\n\n<summary>click here to expand</summary>\n\n**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!\n\n**Please note:** Using IIS as a reverse proxy comes with some limitations:\n- A maximum upload size of 4GiB, in the example configuration below the limit is set to 2GiB.\n\n\n#### Prerequisites\n1. **Windows Server** with IIS installed.\n2. [**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.\n3. [**WebSocket Protocol**](https://learn.microsoft.com/en-us/iis/configuration/system.webserver/websocket) feature enabled.\n\nFor 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).\nThere are also information on how to use the IIS Manager [here](https://learn.microsoft.com/en-us/iis/).\n\nThe following configuration example assumes the following:\n* A site has been created that is configured with HTTPS support and the desired host name.\n* A server farm named `nc-server-farm` has been created and is pointing to the Nextcloud server.\n* No global Rewrite Rules has been created for the `nc-server-farm` server farm.\n\nAdd the following `web.config` file to the root of the site you created as the reverse proxy.\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n  <system.web>\n    <!-- Allow all urls -->\n    <httpRuntime requestValidationMode=\"2.0\" requestPathInvalidCharacters=\"\" />\n  </system.web>\n  <system.webServer>\n    <rewrite>\n      <!-- useOriginalURLEncoding needs to be set to false, otherwise IIS will double encode urls causing all files with spaces or special characters to be inaccessible -->\n      <rules useOriginalURLEncoding=\"false\">\n        <!-- Force https -->\n        <rule name=\"Https\" stopProcessing=\"true\">\n          <match url=\"(.*)\" />\n          <conditions>\n            <add input=\"{HTTPS}\" pattern=\"^OFF$\" />\n          </conditions>\n          <action type=\"Redirect\" url=\"https://{HTTP_HOST}/{REQUEST_URI}\" appendQueryString=\"false\" />\n        </rule>\n        <!-- Redirect to internal nextcloud server -->\n        <rule name=\"To nextcloud\" stopProcessing=\"true\">\n          <match url=\"(.*)\" />\n          <conditions>\n            <add input=\"{HTTPS}\" pattern=\"^ON$\" />\n          </conditions>\n          <!-- Note that {UNENCODED_URL} already contains starting slash, so we must add it directly after the port number without additional slash -->\n          <action type=\"Rewrite\" url=\"http://nc-server-farm:11000{UNENCODED_URL}\" appendQueryString=\"false\" />\n        </rule>\n      </rules>\n    </rewrite>\n    <security>\n      <!-- Increase upload limit to 2GiB -->\n      <requestFiltering allowDoubleEscaping=\"true\">\n        <requestLimits maxAllowedContentLength=\"2147483648\" />\n      </requestFiltering>\n    </security>\n  </system.webServer>\n</configuration>\n\n```\n⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\n</details>\n\n##### Others\n\n<details>\n\n<summary>click here to expand</summary>\n\nConfig examples for other reverse proxies are currently not documented. Pull requests are welcome!\n\n</details>\n\n### 2. Use this startup command\n\nAfter adjusting your reverse proxy config, use the following command to start AIO:<br>\n\n(For a `compose.yaml` example, see the example further [below](#inspiration-for-a-docker-compose-file).)\n\n```\n# For Linux:\nsudo docker run \\\n--init \\\n--sig-proxy=false \\\n--name nextcloud-aio-mastercontainer \\\n--restart always \\\n--publish 8080:8080 \\\n--env APACHE_PORT=11000 \\\n--env APACHE_IP_BINDING=0.0.0.0 \\\n--env APACHE_ADDITIONAL_NETWORK=\"\" \\\n--env SKIP_DOMAIN_VALIDATION=false \\\n--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \\\n--volume /var/run/docker.sock:/var/run/docker.sock:ro \\\nghcr.io/nextcloud-releases/all-in-one:latest\n```\n\n<details>\n\n<summary>Explanation of the command</summary>\n\n- `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).\n- `--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).\n- `--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.\n- `--name nextcloud-aio-mastercontainer` This is the name of the container. This line is not allowed to be changed, since mastercontainer updates would fail.\n- `--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/\n- `--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).\n- `--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.\n- `--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)\n- `--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)\n- `--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).\n- `--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.\n- `--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.\n- `ghcr.io/nextcloud-releases/all-in-one:latest` This is the docker container image that is used.\n- 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\n\n</details>\n\nNote: 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.\n\nYou 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).\n\nOn macOS see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-macos.\n\n<details>\n\n<summary>Command for Windows</summary>\n\nOn 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:\n\n```\ndocker run ^\n--init ^\n--sig-proxy=false ^\n--name nextcloud-aio-mastercontainer ^\n--restart always ^\n--publish 8080:8080 ^\n--env APACHE_PORT=11000 ^\n--env APACHE_IP_BINDING=0.0.0.0 ^\n--env APACHE_ADDITIONAL_NETWORK=\"\" ^\n--env SKIP_DOMAIN_VALIDATION=false ^\n--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config ^\n--volume //var/run/docker.sock:/var/run/docker.sock:ro ^\nghcr.io/nextcloud-releases/all-in-one:latest\n```\n\nAlso, 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.\n\n</details>\n\nOn Synology DSM see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-synology-dsm\n\n### Inspiration for a docker-compose file\n\nSimply 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\n\n### 3. Limit the access to the Apache container\n\nUse 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`.\n\n### 4. Open the AIO interface\n\nAfter 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.<br>\n⚠️ **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)<br>\nEnter 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!\n\n### 5. Optional: Configure AIO for reverse proxies that connect to nextcloud not using localhost nor 127.0.0.1\nIf 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:\n\nAdd the IP it uses connect to AIO to the Nextcloud trusted_proxies like this:\n\n```\nsudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:system:set trusted_proxies 2 --value=ip.address.of.proxy\n```\n\n#### Collabora WOPI allow list\nIf your reverse proxy connects to Nextcloud with an IP address that is different from the one for your domain<sup>*</sup> 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`.\n\n<small>*: 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.)</small>\n\n#### External reverse proxies connecting via VPN (e.g. Tailscale)\n\nIf 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.\n\n### 6. Optional: get a valid certificate for the AIO interface\n\nIf you want to also access your AIO interface publicly with a valid certificate, you can add e.g. the following config to your Caddyfile:\n\n```\nhttps://<your-nc-domain>:8443 {\n    reverse_proxy https://localhost:8080 {\n        header_up Host {host}\n        transport http {\n            tls_insecure_skip_verify\n        }\n    }\n}\n```\n⚠️ **Please note:** Look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the above example configuration.\n\nAfterwards 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://<your-alternative-domain>:443` instead of `https://<your-nc-domain>:8443` in the Caddyfile and use that to access the AIO interface.\n\n### 7. How to debug things?\n\n<a id=\"how-to-debug\"></a> <!-- for external linking -->\n<a id=\"6-how-to-debug-things\"></a> <!-- For backwards compatibility-->\n\nIf something does not work, follow the steps below:\n1. Make sure to exactly follow the whole reverse proxy documentation step-for-step from top to bottom!\n1. 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!\n1. Make sure to set the `APACHE_IP_BINDING` variable correctly. If in doubt, set it to `--env APACHE_IP_BINDING=0.0.0.0`\n1. Make sure that all ports to which your reverse proxy is pointing match the chosen `APACHE_PORT`.\n1. Make sure to follow [this](#adapting-the-sample-web-server-configurations-below) to adapt the example configurations to your specific setup!\n1. 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.\n1. 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.\n1. 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!\n1. 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!\n1. 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)!\n1. 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)!\n1. [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\n1. 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.\n1. 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).\n\n### 8. Removing the reverse proxy\n\nIf you, at some point, want to remove the reverse proxy, here are some general steps:\n1. Stop all running containers in the AIO Interface.\n2. Stop and remove the mastercontainer.\n    ```\n    sudo docker stop nextcloud-aio-mastercontainer\n    sudo docker rm nextcloud-aio-mastercontainer  \n    ```\n3. Remove the software and configuration file that you used for the reverse proxy (see section 1).\n4. 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:\n   ```\n   --env APACHE_IP_BINDING=0.0.0.0 \\\n   --env APACHE_PORT=443 \\   \n    ```\n    Do this *before* the last line of the run command!  \n\n    *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.*\n5. Restart all other containers in the AIO interface. \n\n---\n\n## Footnotes:\n\n[^talkPort]: Ports 3478/TCP and 3478/UDP are also required if using Nextcloud Talk (but they're less likely to conflict with existing services).\n[^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.\n"
  },
  {
    "path": "tests/QA/001-initial-setup.md",
    "content": "# Initial setup\r\n\r\n- [ ] Verify that after starting the test container, you can access the AIO interface using https://internal.ip.address:8080\r\n- [ ] 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\r\n- [ ] After copying the passphrase and clicking on this button, it should open a new tab with the login page\r\n- [ ] The login page should show an input field that allows to enter the AIO passphrase and a `Log in` button\r\n- [ ] After pasting the passphrase into the input field and clicking on this button, you should be logged in\r\n- [ ] 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.\r\n\r\nYou can now continue with [002-new-instance.md](./002-new-instance.md) or [010-restore-instance.md](./010-restore-instance.md).\r\n"
  },
  {
    "path": "tests/QA/002-new-instance.md",
    "content": "# New instance\r\n\r\nFor 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.\r\n\r\n- [ ] 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\r\n- [ ] Now test a few examples in the input box:\r\n    - [ ] Entering `djfslkklk` should report that DNS config is not set or the domain is not in a valid format\r\n    - [ ] Entering `https://sdjflkjk.cpm` should report that this is not a valid domain\r\n    - [ ] Entering `10.0.0.1` should report that ip-addresses are not supported\r\n    - [ ] Entering `nextcloud.com` should report that the domain does not point to this server\r\n    - [ ] 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)\r\n- [ ] 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.\r\n- [ ] Below that you should see a section `Optional addons` which shows a checkbox list with addons that can be enabled or disabled.\r\n    - [ ] Collabora, Imaginary, Talk and Whiteboard should be enabled, the rest disabled\r\n    - [ ] Unchecking/Checking any of these should insert a button that allows to save the set config\r\n    - [ ] Checking OnlyOffice and Collabora at the same time should show a warning that this is not supported and should  not saving the new config\r\n    - [ ] Recommended is to uncheck all options now\r\n    - [ ] Clicking on the save button should reload the page and activate the new config\r\n- [ ] Clickig on the `Start containers` button should finally reveal a big spinning wheel that should block all elements on the side of being clicked.\r\n- [ ] After waiting a few minutes, it should reload and show a new page\r\n    - [ ] On top of the page should be shown which channel you are running\r\n    - [ ] Below that, it should show that containers are currently starting\r\n    - [ ] Below that it should show a section with Containers: Apache, Database, Nextcloud and Redis and that your containers are up-to-date\r\n    - [ ] On the bottom should be the Optional addons section shown but with disabled checkboxes (not clickable)\r\n    - [ ] A automatic reload every 5s should happen until all Containers are started (as long as this window is focused)\r\n- [ ] 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\r\n- [ ] 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\r\n- [ ] Below the Containers section it should show a `Stop containers` button\r\n- [ ] Below the Containers section and above the Optional Addons section, you should see a Backup and restore section and an AIO password change section\r\n\r\nYou can now continue with [003-automatic-login.md](./003-automatic-login.md)."
  },
  {
    "path": "tests/QA/003-automatic-login.md",
    "content": "# Automatic login\r\n\r\n- [ ] After you log in to Nextcloud using the provided initial credentials, open https://yourdomain.com/settings/admin/overview\r\n- [ ] There you should see a Nextcloud AIO section and a button that allows to log into the AIO interface.\r\n- [ ] Clicking on this button should open the AIO interface in a new tab and should automatically log you in\r\n- [ ] All sessions in other tabs that are currently open should be closed (you can verify by reloading all other AIO tabs)\r\n\r\nYou can now continue with [004-initial-backup.md](./004-initial-backup.md)."
  },
  {
    "path": "tests/QA/004-initial-backup.md",
    "content": "# Initial backup\r\n\r\n- [ ] 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\r\n- [ ] First, check a local backup:\r\n    - [ ] Enter `/` which should send an error\r\n    - [ ] Enter `/mnt/` or  `/media/` or `/host_mnt/` or `/var/backups/` should send an error as well\r\n    - [ ] Accepted should be `/mnt/backup`, `/media/backup`, `/host_mnt/c/backup` and `/var/backups`.\r\n    - [ ] The side should now reload\r\n    - [ ] 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.\r\n    - [ ] Also you should see a Backup creation section that contains a `Create backup` button.\r\n    - [ ] Clicking on the `Create backup` button should open a window prompt that allows to cancel the operation.\r\n    - [ ] Canceling should return to the website, confirming should reveal the big spinner again which should block the website again.\r\n    - [ ] After a while you should see the information that Backup container is currently running\r\n- [ ] another option are remote backups via SSH using borgbackup. The remote borg repo URL must contain both `@` and `:`. The process works as follows:\r\n    1. You enter a remote borg repo URL (e.g. `ssh://user@host:port/path/to/repo` or `user@host:/path/to/repo`).\r\n    2. On the first connection attempt, a SSH key pair is generated automatically and the public key is displayed.\r\n    3. You add the public key to the `~/.ssh/authorized_keys` file on the remote server so that AIO can connect to it.\r\n    4. Once authorized, AIO can create and restore backups on the remote server.\r\n    - [ ] Enter `user` (no `@` and no `:`) which should send an error\r\n    - [ ] Enter `user@host` (no `:`) which should send an error\r\n    - [ ] Enter `userhost:/path` (no `@`) which should send an error\r\n    - [ ] Accepted should be `ssh://user@host:22/path/to/repo` or `user@host:/path/to/repo`\r\n    - [ ] Both a local backup location and a remote repo URL should not be accepted at the same time\r\n    - [ ] The page should now reload\r\n    - [ ] Now click on `Create backup`\r\n    - [ ] 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\r\n    - [ ] After authorizing the server on the remote, scroll down and click on `Create backup` again to create another backup. This time it should succeed.\r\n- [ ] 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\r\n- [ ] 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.\r\n- [ ] Below that you should see a details tag that allows to reveal all backup options\r\n\r\nYou can now continue with [020-backup-and-restore.md](.//020-backup-and-restore.md)"
  },
  {
    "path": "tests/QA/010-restore-instance.md",
    "content": "# Restore instance\r\n\r\nFor 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/)\r\n\r\n- [ ] 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\r\n- [ ] First, check restoring from a local backup location:\r\n    - [ ] Entering an incorrect path and/or password should let you continue and test your settings in the next step\r\n        - [ ] 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.\r\n        - [ ] 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.\r\n    - [ ] Entering the correct path to the backup archive and the correct password here should:\r\n        - [ ] Should reload and should hide all options except the option to test the path and password\r\n        - [ ] 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\r\n        - [ ] Clicking on either option should show a window prompt that lets you cancel the operation\r\n        - [ ] 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\r\n        - [ ] Choosing the restore option should finally restore your files.\r\n        - [ ] 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.\r\n- [ ] 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:\r\n    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.\r\n    2. On the first connection attempt, a SSH key pair is generated automatically and the public key is displayed.\r\n    3. You add the public key to the `~/.ssh/authorized_keys` file on the remote server so that AIO can connect to it.\r\n    4. Once authorized, AIO can list and restore backups from the remote server.\r\n    - [ ] Enter an invalid remote repo URL (e.g. `user` without `@` and `:`) which should send an error\r\n    - [ ] Enter a valid remote borg repo URL and the correct backup password:\r\n        - [ ] Should reload and should hide all options except the option to test the path and password\r\n        - [ ] After the first failed connection attempt, the SSH public key for borg should be shown so it can be authorized on the remote server\r\n        - [ ] 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\r\n        - [ ] 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\r\n        - [ ] Clicking on either option should show a window prompt that lets you cancel the operation\r\n        - [ ] 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\r\n        - [ ] Choosing the restore option should finally restore your files.\r\n        - [ ] 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.\r\n\r\n- [ ] 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.\r\n- [ ] After waiting a bit, all containers should be green and your instance should be fully functional again\r\n\r\nYou can now continue with [020-backup-and-restore.md](./020-backup-and-restore.md)"
  },
  {
    "path": "tests/QA/020-backup-and-restore.md",
    "content": "# Backup and restore\r\n\r\n- [ ] 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\r\n- [ ] The backup restore section should list all available backup archives and list them from most recent to least recent.\r\n- [ ] 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.\r\n- [ ] Daily backup creatio should allow to enter a time in 24h format e.g. `04:00` should be accepted, `24:00` or `dfjlk` not.\r\n- [ ] Submitting a time here should reload the page and reveal at the same place the option to delete the setting again.\r\n- [ ] 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.\r\n- [ ] 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\r\n- [ ] 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.\r\n\r\nYou can now continue with [030-aio-password-change.md](./030-aio-password-change.md)"
  },
  {
    "path": "tests/QA/030-aio-password-change.md",
    "content": "# AIO passphrase change\r\n\r\n- [ ] In the AIO passphrase change section you should see two input fields. And below the requirements for a new passphrase\r\n- [ ] When entering nothing it should report that you need to enter your current AIO passphrase\r\n- [ ] When entering a false passphrase, it should report that to you\r\n- [ ] After entering your current passphrase and leaving the new passphrase empty it should report that you need to enter a new passphrase\r\n- [ ] After entering a new passphrase shorter than 24 characters or not allowed characters, it should report that the passphrase requirements are not met.\r\n- [ ] `sdfjlksj` should not be accepted\r\n- [ ] `jdsfklöjiroewoäsadjkfölk` should not be accepted\r\n- [ ] `sdjlfj SDJFLK 32489 sdjklf` should be accepted, which should reload the page\r\n\r\nYou can now continue with [040-login-behavior.md](./040-login-behavior.md)"
  },
  {
    "path": "tests/QA/040-login-behavior.md",
    "content": "# Login behavior\r\n\r\n- [ ] 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\r\n- [ ] 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\r\n- [ ] 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))\r\n\r\nYou can now continue with [050-optional-addons.md](./050-optional-addons.md)"
  },
  {
    "path": "tests/QA/050-optional-addons.md",
    "content": "# Optional addons\r\n\r\n- [ ] Close to the bottom of the page in the AIO interface, you should see the optional addons section\r\n- [ ] You should be able to change optional addons when containers are stopped and not change them when containers are running\r\n- [ ] 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\r\n- [ ] After all containers are started with the new config active, you should verify that the options were automatically activated/deactivated.\r\n    - [ ] ClamAV by trying to upload a testvirus to Nextcloud https://www.eicar.org/?page_id=3950\r\n    - [ ] Collabora by trying to open a .docx or .odt file in Nextcloud\r\n    - [ ] 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.\r\n    - [ ] Imaginary by having a look if when uploading a new picture in Nextcloud, it adds some log entries to the container\r\n    - [ ] Fulltextsearch by trying to search for a heading inside a file in Nextcloud\r\n    - [ ] Talk-recording by starting a call and trying to record something\r\n- [ ] When Collabora is enabled\r\n    - [ ] 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.\r\n    - [ ] 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.\r\n\r\nYou can now continue with [055-community-containers.md](./055-community-containers.md)"
  },
  {
    "path": "tests/QA/055-community-containers.md",
    "content": "# Community Containers\n\n- [ ] At the very bottom of the page, there should be a Community Containers section\n- [ ] The section should show a details element that allows to reveal the list of available community containers\n- [ ] 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\n- [ ] When containers are stopped, checkboxes should be enabled\n    - [ ] Enabling a community container and clicking `Save changes` should show a confirmation dialog\n    - [ ] Canceling the confirmation dialog should not save the changes\n    - [ ] Confirming should save the changes and reload the page\n    - [ ] After saving, the enabled community container should appear in the containers section and start along with the other containers when `Start containers` is clicked\n    - [ ] Disabling a previously enabled community container and saving should remove it from the containers section after stopping and starting containers\n\nYou can now continue with [060-environmental-variables.md](./060-environmental-variables.md)"
  },
  {
    "path": "tests/QA/060-environmental-variables.md",
    "content": "# Environmental variables\r\n\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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)\r\n- [ ] 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.\r\n- [ ] When starting the mastercontainer with `--env DOCKER_API_VERSION=1.44` it should use the mentioned docker API version internally for all requests\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\n- [ ] 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.\r\nSee https://github.com/nextcloud/all-in-one#how-to-trust-user-defined-certification-authorities-ca\r\n- [ ] When starting the mastercontainer with `--env COLLABORA_SECCOMP_DISABLED=true`, the resulting collabora container should have `--o:security.seccomp=false` applied to it.\r\n- [ ] 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`.\r\n- [ ] When starting the mastercontainer with `--env NEXTCLOUD_ADDITIONAL_APKS=zip`, the resulting Nextcloud container should have the zip package installed and not imagemagick.\r\n- [ ] 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.\r\n- [ ] 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)\r\n- [ ] 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)\r\n- [ ] 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.\r\n\r\nYou can now continue with [070-timezone-change.md](./070-timezone-change.md)\r\n"
  },
  {
    "path": "tests/QA/070-timezone-change.md",
    "content": "# Timezone change\r\n\r\n- [ ] At the very bottom of the page you should see the timezone change section\r\n- [ ] When the containers are stopped, you should be able to change it and set/reset it\r\n- [ ] If not already set, it should show an input field where you can enter a timezone\r\n- [ ] `Europe/Berlin` should be accepted, e.g. `Europe Berlin` not\r\n- [ ] 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\r\n- [ ] When it is set, running `date` inside Nextcloud related containers should return the correct timezone\r\n\r\nYou can now continue with [080-daily-backup-script.md](./080-daily-backup-script.md)"
  },
  {
    "path": "tests/QA/080-daily-backup-script.md",
    "content": "# Daily backup script\r\n\r\nThe script is delivered within the mastercontainer and allows to run a few things like daily backup and container updates from an external script.\r\n\r\nYou 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\r\n"
  },
  {
    "path": "tests/QA/assets/backup-archive/readme.md",
    "content": "# Backup archive\r\n\r\nThe backup archive was moved here because of Git LFS limitations:\r\nhttps://cloud.nextcloud.com/s/m5DF3AjRs72kWKY\r\n"
  },
  {
    "path": "tests/QA/readme.md",
    "content": "# QA test plans\r\n\r\nIn 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.\r\n\r\nFor 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.\r\n\r\nBest is to start testing with [001-initial-setup.md](./001-initial-setup.md).\r\n"
  },
  {
    "path": "zizmor.yml",
    "content": "rules:\n  excessive-permissions:\n    disable: true\n  dangerous-triggers:\n    ignore:\n      - build_images.yml\n  artipacked:\n    disable: true\n  secrets-outside-env:\n    ignore:\n      - promote-to-beta.yml\n      - promote-to-latest.yml\n      - publish-to-aws.yml\n      - publish-to-digitalocean.yml\n"
  }
]