├── .github ├── CODEOWNERS └── workflows │ ├── appstore-build-publish.yml │ ├── lint-info-xml.yml │ ├── lint-php-cs.yml │ ├── lint-php.yml │ ├── phpunit-mysql.yml │ ├── phpunit-oci.yml │ ├── phpunit-pgsql.yml │ ├── phpunit-sqlite.yml │ ├── pr-feedback.yml │ ├── psalm-matrix.yml │ ├── reuse.yml │ └── update-nextcloud-ocp.yml ├── .gitignore ├── .nextcloudignore ├── .php-cs-fixer.dist.php ├── AUTHORS.md ├── CHANGELOG.md ├── LICENSE ├── LICENSES ├── AGPL-3.0-or-later.txt ├── CC0-1.0.txt └── MIT.txt ├── README.md ├── REUSE.toml ├── appinfo └── info.xml ├── composer.json ├── composer.lock ├── krankerl.toml ├── lib ├── Command │ ├── BrokenConfig.php │ ├── ConfigManager.php │ ├── Enable.php │ ├── S3Config.php │ └── Status.php └── Versions │ ├── AbstractS3VersionBackend.php │ ├── ExternalS3VersionsBackend.php │ ├── PrimaryS3VersionsBackend.php │ ├── S3PreviewFile.php │ └── S3VersionProvider.php ├── psalm.xml ├── tests ├── Command │ └── S3ConfigTest.php ├── TestCase.php ├── Versions │ └── S3VersionProviderTest.php ├── bootstrap.php ├── phpunit.xml └── stubs │ └── stub.phpstub └── vendor-bin ├── cs-fixer ├── composer.json └── composer.lock ├── phpunit ├── composer.json └── composer.lock └── psalm ├── composer.json └── composer.lock /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | /appinfo/info.xml @icewind1991 @artonge 4 | 5 | -------------------------------------------------------------------------------- /.github/workflows/appstore-build-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Build and publish app release 10 | 11 | on: 12 | release: 13 | types: [published] 14 | 15 | jobs: 16 | build_and_publish: 17 | runs-on: ubuntu-latest 18 | 19 | # Only allowed to be run on nextcloud-releases repositories 20 | if: ${{ github.repository_owner == 'nextcloud-releases' }} 21 | 22 | steps: 23 | - name: Check actor permission 24 | uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 25 | with: 26 | require: write 27 | 28 | - name: Set app env 29 | run: | 30 | # Split and keep last 31 | echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV 32 | echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV 33 | 34 | - name: Checkout 35 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 36 | with: 37 | path: ${{ env.APP_NAME }} 38 | 39 | - name: Get appinfo data 40 | id: appinfo 41 | uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master 42 | with: 43 | filename: ${{ env.APP_NAME }}/appinfo/info.xml 44 | expression: "//info//dependencies//nextcloud/@min-version" 45 | 46 | - name: Read package.json node and npm engines version 47 | uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 48 | id: versions 49 | # Continue if no package.json 50 | continue-on-error: true 51 | with: 52 | path: ${{ env.APP_NAME }} 53 | fallbackNode: '^20' 54 | fallbackNpm: '^10' 55 | 56 | - name: Set up node ${{ steps.versions.outputs.nodeVersion }} 57 | # Skip if no package.json 58 | if: ${{ steps.versions.outputs.nodeVersion }} 59 | uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 60 | with: 61 | node-version: ${{ steps.versions.outputs.nodeVersion }} 62 | 63 | - name: Set up npm ${{ steps.versions.outputs.npmVersion }} 64 | # Skip if no package.json 65 | if: ${{ steps.versions.outputs.npmVersion }} 66 | run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' 67 | 68 | - name: Get php version 69 | id: php-versions 70 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 71 | with: 72 | filename: ${{ env.APP_NAME }}/appinfo/info.xml 73 | 74 | - name: Set up php ${{ steps.php-versions.outputs.php-min }} 75 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 76 | with: 77 | php-version: ${{ steps.php-versions.outputs.php-min }} 78 | coverage: none 79 | env: 80 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 81 | 82 | - name: Check composer.json 83 | id: check_composer 84 | uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 85 | with: 86 | files: "${{ env.APP_NAME }}/composer.json" 87 | 88 | - name: Install composer dependencies 89 | if: steps.check_composer.outputs.files_exists == 'true' 90 | run: | 91 | cd ${{ env.APP_NAME }} 92 | composer install --no-dev 93 | 94 | - name: Build ${{ env.APP_NAME }} 95 | # Skip if no package.json 96 | if: ${{ steps.versions.outputs.nodeVersion }} 97 | env: 98 | CYPRESS_INSTALL_BINARY: 0 99 | run: | 100 | cd ${{ env.APP_NAME }} 101 | npm ci 102 | npm run build --if-present 103 | 104 | - name: Check Krankerl config 105 | id: krankerl 106 | uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 107 | with: 108 | files: ${{ env.APP_NAME }}/krankerl.toml 109 | 110 | - name: Install Krankerl 111 | if: steps.krankerl.outputs.files_exists == 'true' 112 | run: | 113 | wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb 114 | sudo dpkg -i krankerl_0.14.0_amd64.deb 115 | 116 | - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl 117 | if: steps.krankerl.outputs.files_exists == 'true' 118 | run: | 119 | cd ${{ env.APP_NAME }} 120 | krankerl package 121 | 122 | - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile 123 | if: steps.krankerl.outputs.files_exists != 'true' 124 | run: | 125 | cd ${{ env.APP_NAME }} 126 | make appstore 127 | 128 | - name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} 129 | continue-on-error: true 130 | id: server-checkout 131 | run: | 132 | NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}' 133 | wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip 134 | unzip latest-$NCVERSION.zip 135 | 136 | - name: Checkout server master fallback 137 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 138 | if: ${{ steps.server-checkout.outcome != 'success' }} 139 | with: 140 | submodules: true 141 | repository: nextcloud/server 142 | path: nextcloud 143 | 144 | - name: Sign app 145 | run: | 146 | # Extracting release 147 | cd ${{ env.APP_NAME }}/build/artifacts 148 | tar -xvf ${{ env.APP_NAME }}.tar.gz 149 | cd ../../../ 150 | # Setting up keys 151 | echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key 152 | wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt" 153 | # Signing 154 | php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }} 155 | # Rebuilding archive 156 | cd ${{ env.APP_NAME }}/build/artifacts 157 | tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }} 158 | 159 | - name: Attach tarball to github release 160 | uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 161 | id: attach_to_release 162 | with: 163 | repo_token: ${{ secrets.GITHUB_TOKEN }} 164 | file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz 165 | asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz 166 | tag: ${{ github.ref }} 167 | overwrite: true 168 | 169 | - name: Upload app to Nextcloud appstore 170 | uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1 171 | with: 172 | app_name: ${{ env.APP_NAME }} 173 | appstore_token: ${{ secrets.APPSTORE_TOKEN }} 174 | download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} 175 | app_private_key: ${{ secrets.APP_PRIVATE_KEY }} -------------------------------------------------------------------------------- /.github/workflows/lint-info-xml.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint info.xml 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-info-xml-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | xml-linters: 22 | runs-on: ubuntu-latest-low 23 | 24 | name: info.xml lint 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 28 | 29 | - name: Download schema 30 | run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd 31 | 32 | - name: Lint info.xml 33 | uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 34 | with: 35 | xml-file: ./appinfo/info.xml 36 | xml-schema-file: ./info.xsd -------------------------------------------------------------------------------- /.github/workflows/lint-php-cs.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint php-cs 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-php-cs-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | lint: 22 | runs-on: ubuntu-latest 23 | 24 | name: php-cs 25 | 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 29 | 30 | - name: Get php version 31 | id: versions 32 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 33 | 34 | - name: Set up php${{ steps.versions.outputs.php-available }} 35 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 36 | with: 37 | php-version: ${{ steps.versions.outputs.php-available }} 38 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 39 | coverage: none 40 | ini-file: development 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | 44 | - name: Install dependencies 45 | run: composer i 46 | 47 | - name: Lint 48 | run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) -------------------------------------------------------------------------------- /.github/workflows/lint-php.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint php 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-php-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | matrix: 22 | runs-on: ubuntu-latest-low 23 | outputs: 24 | php-versions: ${{ steps.versions.outputs.php-versions }} 25 | steps: 26 | - name: Checkout app 27 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 28 | - name: Get version matrix 29 | id: versions 30 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0 31 | 32 | php-lint: 33 | runs-on: ubuntu-latest 34 | needs: matrix 35 | strategy: 36 | matrix: 37 | php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}} 38 | 39 | name: php-lint 40 | 41 | steps: 42 | - name: Checkout 43 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 44 | 45 | - name: Set up php ${{ matrix.php-versions }} 46 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 47 | with: 48 | php-version: ${{ matrix.php-versions }} 49 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 50 | coverage: none 51 | ini-file: development 52 | env: 53 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 54 | 55 | - name: Lint 56 | run: composer run lint 57 | 58 | summary: 59 | permissions: 60 | contents: none 61 | runs-on: ubuntu-latest-low 62 | needs: php-lint 63 | 64 | if: always() 65 | 66 | name: php-lint-summary 67 | 68 | steps: 69 | - name: Summary status 70 | run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi -------------------------------------------------------------------------------- /.github/workflows/phpunit-mysql.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: PHPUnit MySQL 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: phpunit-mysql-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | matrix: 22 | runs-on: ubuntu-latest-low 23 | outputs: 24 | matrix: ${{ steps.versions.outputs.sparse-matrix }} 25 | steps: 26 | - name: Checkout app 27 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 28 | 29 | - name: Get version matrix 30 | id: versions 31 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 32 | with: 33 | matrix: '{"mysql-versions": ["8.4"]}' 34 | 35 | changes: 36 | runs-on: ubuntu-latest-low 37 | permissions: 38 | contents: read 39 | pull-requests: read 40 | 41 | outputs: 42 | src: ${{ steps.changes.outputs.src}} 43 | 44 | steps: 45 | - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 46 | id: changes 47 | continue-on-error: true 48 | with: 49 | filters: | 50 | src: 51 | - '.github/workflows/**' 52 | - 'appinfo/**' 53 | - 'lib/**' 54 | - 'templates/**' 55 | - 'tests/**' 56 | - 'vendor/**' 57 | - 'vendor-bin/**' 58 | - '.php-cs-fixer.dist.php' 59 | - 'composer.json' 60 | - 'composer.lock' 61 | 62 | phpunit-mysql: 63 | runs-on: ubuntu-latest 64 | 65 | needs: [changes, matrix] 66 | if: needs.changes.outputs.src != 'false' 67 | 68 | strategy: 69 | matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} 70 | 71 | name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} 72 | 73 | services: 74 | mysql: 75 | image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest 76 | ports: 77 | - 4444:3306/tcp 78 | env: 79 | MYSQL_ROOT_PASSWORD: rootpassword 80 | options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10 81 | 82 | steps: 83 | - name: Set app env 84 | run: | 85 | # Split and keep last 86 | echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV 87 | 88 | - name: Checkout server 89 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 90 | with: 91 | submodules: true 92 | repository: nextcloud/server 93 | ref: ${{ matrix.server-versions }} 94 | 95 | - name: Checkout app 96 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 97 | with: 98 | path: apps/${{ env.APP_NAME }} 99 | 100 | - name: Set up php ${{ matrix.php-versions }} 101 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 102 | with: 103 | php-version: ${{ matrix.php-versions }} 104 | # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation 105 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql 106 | coverage: none 107 | ini-file: development 108 | env: 109 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 110 | 111 | - name: Enable ONLY_FULL_GROUP_BY MySQL option 112 | run: | 113 | echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword 114 | echo 'SELECT @@sql_mode;' | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword 115 | 116 | - name: Check composer file existence 117 | id: check_composer 118 | uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 119 | with: 120 | files: apps/${{ env.APP_NAME }}/composer.json 121 | 122 | - name: Set up dependencies 123 | # Only run if phpunit config file exists 124 | if: steps.check_composer.outputs.files_exists == 'true' 125 | working-directory: apps/${{ env.APP_NAME }} 126 | run: composer i 127 | 128 | - name: Set up Nextcloud 129 | env: 130 | DB_PORT: 4444 131 | run: | 132 | mkdir data 133 | ./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin 134 | ./occ app:enable --force ${{ env.APP_NAME }} 135 | 136 | - name: Check PHPUnit script is defined 137 | id: check_phpunit 138 | continue-on-error: true 139 | working-directory: apps/${{ env.APP_NAME }} 140 | run: | 141 | composer run --list | grep '^ test:unit ' | wc -l | grep 1 142 | 143 | - name: PHPUnit 144 | # Only run if phpunit config file exists 145 | if: steps.check_phpunit.outcome == 'success' 146 | working-directory: apps/${{ env.APP_NAME }} 147 | run: composer run test:unit 148 | 149 | - name: Check PHPUnit integration script is defined 150 | id: check_integration 151 | continue-on-error: true 152 | working-directory: apps/${{ env.APP_NAME }} 153 | run: | 154 | composer run --list | grep '^ test:integration ' | wc -l | grep 1 155 | 156 | - name: Run Nextcloud 157 | # Only run if phpunit integration config file exists 158 | if: steps.check_integration.outcome == 'success' 159 | run: php -S localhost:8080 & 160 | 161 | - name: PHPUnit integration 162 | # Only run if phpunit integration config file exists 163 | if: steps.check_integration.outcome == 'success' 164 | working-directory: apps/${{ env.APP_NAME }} 165 | run: composer run test:integration 166 | 167 | - name: Print logs 168 | if: always() 169 | run: | 170 | cat data/nextcloud.log 171 | 172 | - name: Skipped 173 | # Fail the action when neither unit nor integration tests ran 174 | if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' 175 | run: | 176 | echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' 177 | exit 1 178 | 179 | summary: 180 | permissions: 181 | contents: none 182 | runs-on: ubuntu-latest-low 183 | needs: [changes, phpunit-mysql] 184 | 185 | if: always() 186 | 187 | name: phpunit-mysql-summary 188 | 189 | steps: 190 | - name: Summary status 191 | run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi -------------------------------------------------------------------------------- /.github/workflows/phpunit-oci.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: PHPUnit OCI 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: phpunit-oci-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | matrix: 22 | runs-on: ubuntu-latest-low 23 | outputs: 24 | php-version: ${{ steps.versions.outputs.php-available-list }} 25 | server-max: ${{ steps.versions.outputs.branches-max-list }} 26 | steps: 27 | - name: Checkout app 28 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 29 | 30 | - name: Get version matrix 31 | id: versions 32 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 33 | 34 | changes: 35 | runs-on: ubuntu-latest-low 36 | permissions: 37 | contents: read 38 | pull-requests: read 39 | 40 | outputs: 41 | src: ${{ steps.changes.outputs.src }} 42 | 43 | steps: 44 | - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 45 | id: changes 46 | continue-on-error: true 47 | with: 48 | filters: | 49 | src: 50 | - '.github/workflows/**' 51 | - 'appinfo/**' 52 | - 'lib/**' 53 | - 'templates/**' 54 | - 'tests/**' 55 | - 'vendor/**' 56 | - 'vendor-bin/**' 57 | - '.php-cs-fixer.dist.php' 58 | - 'composer.json' 59 | - 'composer.lock' 60 | 61 | phpunit-oci: 62 | runs-on: ubuntu-latest 63 | 64 | needs: [changes, matrix] 65 | if: needs.changes.outputs.src != 'false' 66 | 67 | strategy: 68 | matrix: 69 | php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} 70 | server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} 71 | 72 | name: OCI PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} 73 | 74 | services: 75 | oracle: 76 | image: ghcr.io/gvenzl/oracle-xe:11 77 | 78 | # Provide passwords and other environment variables to container 79 | env: 80 | ORACLE_RANDOM_PASSWORD: true 81 | APP_USER: autotest 82 | APP_USER_PASSWORD: owncloud 83 | 84 | # Forward Oracle port 85 | ports: 86 | - 1521:1521/tcp 87 | 88 | # Provide healthcheck script options for startup 89 | options: >- 90 | --health-cmd healthcheck.sh 91 | --health-interval 10s 92 | --health-timeout 5s 93 | --health-retries 10 94 | 95 | steps: 96 | - name: Set app env 97 | run: | 98 | # Split and keep last 99 | echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV 100 | 101 | - name: Checkout server 102 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 103 | with: 104 | submodules: true 105 | repository: nextcloud/server 106 | ref: ${{ matrix.server-versions }} 107 | 108 | - name: Checkout app 109 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 110 | with: 111 | path: apps/${{ env.APP_NAME }} 112 | 113 | - name: Set up php ${{ matrix.php-versions }} 114 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 115 | with: 116 | php-version: ${{ matrix.php-versions }} 117 | # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation 118 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8 119 | coverage: none 120 | ini-file: development 121 | env: 122 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 123 | 124 | - name: Check composer file existence 125 | id: check_composer 126 | uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 127 | with: 128 | files: apps/${{ env.APP_NAME }}/composer.json 129 | 130 | - name: Set up dependencies 131 | # Only run if phpunit config file exists 132 | if: steps.check_composer.outputs.files_exists == 'true' 133 | working-directory: apps/${{ env.APP_NAME }} 134 | run: composer i 135 | 136 | - name: Set up Nextcloud 137 | env: 138 | DB_PORT: 1521 139 | run: | 140 | mkdir data 141 | ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin 142 | ./occ app:enable --force ${{ env.APP_NAME }} 143 | 144 | - name: Check PHPUnit script is defined 145 | id: check_phpunit 146 | continue-on-error: true 147 | working-directory: apps/${{ env.APP_NAME }} 148 | run: | 149 | composer run --list | grep '^ test:unit ' | wc -l | grep 1 150 | 151 | - name: PHPUnit 152 | # Only run if phpunit config file exists 153 | if: steps.check_phpunit.outcome == 'success' 154 | working-directory: apps/${{ env.APP_NAME }} 155 | run: composer run test:unit 156 | 157 | - name: Check PHPUnit integration script is defined 158 | id: check_integration 159 | continue-on-error: true 160 | working-directory: apps/${{ env.APP_NAME }} 161 | run: | 162 | composer run --list | grep '^ test:integration ' | wc -l | grep 1 163 | 164 | - name: Run Nextcloud 165 | # Only run if phpunit integration config file exists 166 | if: steps.check_integration.outcome == 'success' 167 | run: php -S localhost:8080 & 168 | 169 | - name: PHPUnit integration 170 | # Only run if phpunit integration config file exists 171 | if: steps.check_integration.outcome == 'success' 172 | working-directory: apps/${{ env.APP_NAME }} 173 | run: composer run test:integration 174 | 175 | - name: Print logs 176 | if: always() 177 | run: | 178 | cat data/nextcloud.log 179 | 180 | - name: Skipped 181 | # Fail the action when neither unit nor integration tests ran 182 | if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' 183 | run: | 184 | echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' 185 | exit 1 186 | 187 | summary: 188 | permissions: 189 | contents: none 190 | runs-on: ubuntu-latest-low 191 | needs: [changes, phpunit-oci] 192 | 193 | if: always() 194 | 195 | name: phpunit-oci-summary 196 | 197 | steps: 198 | - name: Summary status 199 | run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-oci.result != 'success' }}; then exit 1; fi -------------------------------------------------------------------------------- /.github/workflows/phpunit-pgsql.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: PHPUnit PostgreSQL 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: phpunit-pgsql-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | matrix: 22 | runs-on: ubuntu-latest-low 23 | outputs: 24 | php-version: ${{ steps.versions.outputs.php-available-list }} 25 | server-max: ${{ steps.versions.outputs.branches-max-list }} 26 | steps: 27 | - name: Checkout app 28 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 29 | 30 | - name: Get version matrix 31 | id: versions 32 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 33 | 34 | changes: 35 | runs-on: ubuntu-latest-low 36 | permissions: 37 | contents: read 38 | pull-requests: read 39 | 40 | outputs: 41 | src: ${{ steps.changes.outputs.src }} 42 | 43 | steps: 44 | - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 45 | id: changes 46 | continue-on-error: true 47 | with: 48 | filters: | 49 | src: 50 | - '.github/workflows/**' 51 | - 'appinfo/**' 52 | - 'lib/**' 53 | - 'templates/**' 54 | - 'tests/**' 55 | - 'vendor/**' 56 | - 'vendor-bin/**' 57 | - '.php-cs-fixer.dist.php' 58 | - 'composer.json' 59 | - 'composer.lock' 60 | 61 | phpunit-pgsql: 62 | runs-on: ubuntu-latest 63 | 64 | needs: [changes, matrix] 65 | if: needs.changes.outputs.src != 'false' 66 | 67 | strategy: 68 | matrix: 69 | php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} 70 | server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} 71 | 72 | name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} 73 | 74 | services: 75 | postgres: 76 | image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest 77 | ports: 78 | - 4444:5432/tcp 79 | env: 80 | POSTGRES_USER: root 81 | POSTGRES_PASSWORD: rootpassword 82 | POSTGRES_DB: nextcloud 83 | options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5 84 | 85 | steps: 86 | - name: Set app env 87 | run: | 88 | # Split and keep last 89 | echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV 90 | 91 | - name: Checkout server 92 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 93 | with: 94 | submodules: true 95 | repository: nextcloud/server 96 | ref: ${{ matrix.server-versions }} 97 | 98 | - name: Checkout app 99 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 100 | with: 101 | path: apps/${{ env.APP_NAME }} 102 | 103 | - name: Set up php ${{ matrix.php-versions }} 104 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 105 | with: 106 | php-version: ${{ matrix.php-versions }} 107 | # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation 108 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql 109 | coverage: none 110 | ini-file: development 111 | env: 112 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 113 | 114 | - name: Check composer file existence 115 | id: check_composer 116 | uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 117 | with: 118 | files: apps/${{ env.APP_NAME }}/composer.json 119 | 120 | - name: Set up dependencies 121 | # Only run if phpunit config file exists 122 | if: steps.check_composer.outputs.files_exists == 'true' 123 | working-directory: apps/${{ env.APP_NAME }} 124 | run: composer i 125 | 126 | - name: Set up Nextcloud 127 | env: 128 | DB_PORT: 4444 129 | run: | 130 | mkdir data 131 | ./occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin 132 | ./occ app:enable --force ${{ env.APP_NAME }} 133 | 134 | - name: Check PHPUnit script is defined 135 | id: check_phpunit 136 | continue-on-error: true 137 | working-directory: apps/${{ env.APP_NAME }} 138 | run: | 139 | composer run --list | grep '^ test:unit ' | wc -l | grep 1 140 | 141 | - name: PHPUnit 142 | # Only run if phpunit config file exists 143 | if: steps.check_phpunit.outcome == 'success' 144 | working-directory: apps/${{ env.APP_NAME }} 145 | run: composer run test:unit 146 | 147 | - name: Check PHPUnit integration script is defined 148 | id: check_integration 149 | continue-on-error: true 150 | working-directory: apps/${{ env.APP_NAME }} 151 | run: | 152 | composer run --list | grep '^ test:integration ' | wc -l | grep 1 153 | 154 | - name: Run Nextcloud 155 | # Only run if phpunit integration config file exists 156 | if: steps.check_integration.outcome == 'success' 157 | run: php -S localhost:8080 & 158 | 159 | - name: PHPUnit integration 160 | # Only run if phpunit integration config file exists 161 | if: steps.check_integration.outcome == 'success' 162 | working-directory: apps/${{ env.APP_NAME }} 163 | run: composer run test:integration 164 | 165 | - name: Print logs 166 | if: always() 167 | run: | 168 | cat data/nextcloud.log 169 | 170 | - name: Skipped 171 | # Fail the action when neither unit nor integration tests ran 172 | if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' 173 | run: | 174 | echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' 175 | exit 1 176 | 177 | summary: 178 | permissions: 179 | contents: none 180 | runs-on: ubuntu-latest-low 181 | needs: [changes, phpunit-pgsql] 182 | 183 | if: always() 184 | 185 | name: phpunit-pgsql-summary 186 | 187 | steps: 188 | - name: Summary status 189 | run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi -------------------------------------------------------------------------------- /.github/workflows/phpunit-sqlite.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: PHPUnit SQLite 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: phpunit-sqlite-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | matrix: 22 | runs-on: ubuntu-latest-low 23 | outputs: 24 | php-version: ${{ steps.versions.outputs.php-available-list }} 25 | server-max: ${{ steps.versions.outputs.branches-max-list }} 26 | steps: 27 | - name: Checkout app 28 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 29 | 30 | - name: Get version matrix 31 | id: versions 32 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 33 | 34 | changes: 35 | runs-on: ubuntu-latest-low 36 | permissions: 37 | contents: read 38 | pull-requests: read 39 | 40 | outputs: 41 | src: ${{ steps.changes.outputs.src}} 42 | 43 | steps: 44 | - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 45 | id: changes 46 | continue-on-error: true 47 | with: 48 | filters: | 49 | src: 50 | - '.github/workflows/**' 51 | - 'appinfo/**' 52 | - 'lib/**' 53 | - 'templates/**' 54 | - 'tests/**' 55 | - 'vendor/**' 56 | - 'vendor-bin/**' 57 | - '.php-cs-fixer.dist.php' 58 | - 'composer.json' 59 | - 'composer.lock' 60 | 61 | phpunit-sqlite: 62 | runs-on: ubuntu-latest 63 | 64 | needs: [changes, matrix] 65 | if: needs.changes.outputs.src != 'false' 66 | 67 | strategy: 68 | matrix: 69 | php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} 70 | server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} 71 | 72 | name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} 73 | 74 | steps: 75 | - name: Set app env 76 | run: | 77 | # Split and keep last 78 | echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV 79 | 80 | - name: Checkout server 81 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 82 | with: 83 | submodules: true 84 | repository: nextcloud/server 85 | ref: ${{ matrix.server-versions }} 86 | 87 | - name: Checkout app 88 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 89 | with: 90 | path: apps/${{ env.APP_NAME }} 91 | 92 | - name: Set up php ${{ matrix.php-versions }} 93 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 94 | with: 95 | php-version: ${{ matrix.php-versions }} 96 | # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation 97 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 98 | coverage: none 99 | ini-file: development 100 | env: 101 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 102 | 103 | - name: Check composer file existence 104 | id: check_composer 105 | uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 106 | with: 107 | files: apps/${{ env.APP_NAME }}/composer.json 108 | 109 | - name: Set up dependencies 110 | # Only run if phpunit config file exists 111 | if: steps.check_composer.outputs.files_exists == 'true' 112 | working-directory: apps/${{ env.APP_NAME }} 113 | run: composer i 114 | 115 | - name: Set up Nextcloud 116 | env: 117 | DB_PORT: 4444 118 | run: | 119 | mkdir data 120 | ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin 121 | ./occ app:enable --force ${{ env.APP_NAME }} 122 | 123 | - name: Check PHPUnit script is defined 124 | id: check_phpunit 125 | continue-on-error: true 126 | working-directory: apps/${{ env.APP_NAME }} 127 | run: | 128 | composer run --list | grep '^ test:unit ' | wc -l | grep 1 129 | 130 | - name: PHPUnit 131 | # Only run if phpunit config file exists 132 | if: steps.check_phpunit.outcome == 'success' 133 | working-directory: apps/${{ env.APP_NAME }} 134 | run: composer run test:unit 135 | 136 | - name: Check PHPUnit integration script is defined 137 | id: check_integration 138 | continue-on-error: true 139 | working-directory: apps/${{ env.APP_NAME }} 140 | run: | 141 | composer run --list | grep '^ test:integration ' | wc -l | grep 1 142 | 143 | - name: Run Nextcloud 144 | # Only run if phpunit integration config file exists 145 | if: steps.check_integration.outcome == 'success' 146 | run: php -S localhost:8080 & 147 | 148 | - name: PHPUnit integration 149 | # Only run if phpunit integration config file exists 150 | if: steps.check_integration.outcome == 'success' 151 | working-directory: apps/${{ env.APP_NAME }} 152 | run: composer run test:integration 153 | 154 | - name: Print logs 155 | if: always() 156 | run: | 157 | cat data/nextcloud.log 158 | 159 | - name: Skipped 160 | # Fail the action when neither unit nor integration tests ran 161 | if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' 162 | run: | 163 | echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' 164 | exit 1 165 | 166 | summary: 167 | permissions: 168 | contents: none 169 | runs-on: ubuntu-latest-low 170 | needs: [changes, phpunit-sqlite] 171 | 172 | if: always() 173 | 174 | name: phpunit-sqlite-summary 175 | 176 | steps: 177 | - name: Summary status 178 | run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi -------------------------------------------------------------------------------- /.github/workflows/pr-feedback.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | 6 | # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-FileCopyrightText: 2023 Marcel Klehr 8 | # SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com> 9 | # SPDX-FileCopyrightText: 2023 Daniel Kesselberg 10 | # SPDX-FileCopyrightText: 2023 Florian Steffens 11 | # SPDX-License-Identifier: MIT 12 | 13 | name: 'Ask for feedback on PRs' 14 | on: 15 | schedule: 16 | - cron: '30 1 * * *' 17 | 18 | permissions: 19 | contents: read 20 | pull-requests: write 21 | 22 | jobs: 23 | pr-feedback: 24 | if: ${{ github.repository_owner == 'nextcloud' }} 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: The get-github-handles-from-website action 28 | uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1 29 | id: scrape 30 | with: 31 | website: 'https://nextcloud.com/team/' 32 | 33 | - name: Get blocklist 34 | id: blocklist 35 | run: | 36 | blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) 37 | echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" 38 | 39 | - uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4 40 | with: 41 | feedback-message: | 42 | Hello there, 43 | Thank you so much for taking the time and effort to create a pull request to our Nextcloud project. 44 | 45 | We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. 46 | 47 | Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 48 | 49 | Thank you for contributing to Nextcloud and we hope to hear from you soon! 50 | 51 | (If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).) 52 | days-before-feedback: 14 53 | start-date: '2024-04-30' 54 | exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}' 55 | exempt-bots: true 56 | -------------------------------------------------------------------------------- /.github/workflows/psalm-matrix.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Static analysis 10 | 11 | on: pull_request 12 | 13 | concurrency: 14 | group: psalm-${{ github.head_ref || github.run_id }} 15 | cancel-in-progress: true 16 | 17 | jobs: 18 | matrix: 19 | runs-on: ubuntu-latest-low 20 | outputs: 21 | ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }} 22 | steps: 23 | - name: Checkout app 24 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 25 | - name: Get version matrix 26 | id: versions 27 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 28 | 29 | static-analysis: 30 | runs-on: ubuntu-latest 31 | needs: matrix 32 | strategy: 33 | # do not stop on another job's failure 34 | fail-fast: false 35 | matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }} 36 | 37 | name: static-psalm-analysis ${{ matrix.ocp-version }} 38 | steps: 39 | - name: Checkout 40 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 41 | 42 | - name: Set up php${{ matrix.php-versions }} 43 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 44 | with: 45 | php-version: ${{ matrix.php-versions }} 46 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 47 | coverage: none 48 | ini-file: development 49 | env: 50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 51 | 52 | - name: Install dependencies 53 | run: composer i 54 | 55 | - name: Install dependencies 56 | run: composer require --dev 'nextcloud/ocp:${{ matrix.ocp-version }}' --ignore-platform-reqs --with-dependencies 57 | 58 | - name: Run coding standards check 59 | run: composer run psalm 60 | 61 | summary: 62 | runs-on: ubuntu-latest-low 63 | needs: static-analysis 64 | 65 | if: always() 66 | 67 | name: static-psalm-analysis-summary 68 | 69 | steps: 70 | - name: Summary status 71 | run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi -------------------------------------------------------------------------------- /.github/workflows/reuse.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | 6 | # SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. 7 | # 8 | # SPDX-License-Identifier: CC0-1.0 9 | 10 | name: REUSE Compliance Check 11 | 12 | on: [pull_request] 13 | 14 | jobs: 15 | reuse-compliance-check: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 20 | with: 21 | persist-credentials: false 22 | 23 | - name: REUSE Compliance Check 24 | uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0 25 | -------------------------------------------------------------------------------- /.github/workflows/update-nextcloud-ocp.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Update nextcloud/ocp 10 | 11 | on: 12 | workflow_dispatch: 13 | schedule: 14 | - cron: "5 2 * * 0" 15 | 16 | jobs: 17 | update-nextcloud-ocp: 18 | runs-on: ubuntu-latest 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | branches: ['main', 'master', 'stable30', 'stable29', 'stable28'] 24 | 25 | name: update-nextcloud-ocp-${{ matrix.branches }} 26 | 27 | steps: 28 | - id: checkout 29 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 30 | with: 31 | ref: ${{ matrix.branches }} 32 | submodules: true 33 | continue-on-error: true 34 | 35 | - name: Set up php8.2 36 | if: steps.checkout.outcome == 'success' 37 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 38 | with: 39 | php-version: 8.2 40 | # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation 41 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 42 | coverage: none 43 | env: 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 45 | 46 | - name: Read codeowners 47 | if: steps.checkout.outcome == 'success' 48 | id: codeowners 49 | run: | 50 | grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT 51 | continue-on-error: true 52 | 53 | - name: Composer install 54 | if: steps.checkout.outcome == 'success' 55 | run: composer install 56 | 57 | - name: Composer update nextcloud/ocp 58 | id: update_branch 59 | if: ${{ steps.checkout.outcome == 'success' && matrix.branches != 'main' }} 60 | run: composer require --dev 'nextcloud/ocp:dev-${{ matrix.branches }}' 61 | 62 | - name: Raise on issue on failure 63 | uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 64 | if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }} 65 | with: 66 | token: ${{ secrets.GITHUB_TOKEN }} 67 | title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}' 68 | body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' 69 | 70 | - name: Composer update nextcloud/ocp 71 | id: update_main 72 | if: ${{ steps.checkout.outcome == 'success' && matrix.branches == 'main' }} 73 | run: composer require --dev nextcloud/ocp:dev-master 74 | 75 | - name: Raise on issue on failure 76 | uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 77 | if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_main.conclusion == 'failure' }} 78 | with: 79 | token: ${{ secrets.GITHUB_TOKEN }} 80 | title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}' 81 | body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' 82 | 83 | - name: Reset checkout 3rdparty 84 | if: steps.checkout.outcome == 'success' 85 | run: | 86 | git clean -f 3rdparty 87 | git checkout 3rdparty 88 | continue-on-error: true 89 | 90 | - name: Reset checkout vendor 91 | if: steps.checkout.outcome == 'success' 92 | run: | 93 | git clean -f vendor 94 | git checkout vendor 95 | continue-on-error: true 96 | 97 | - name: Reset checkout vendor-bin 98 | if: steps.checkout.outcome == 'success' 99 | run: | 100 | git clean -f vendor-bin 101 | git checkout vendor-bin 102 | continue-on-error: true 103 | 104 | - name: Create Pull Request 105 | if: steps.checkout.outcome == 'success' 106 | uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 107 | with: 108 | token: ${{ secrets.COMMAND_BOT_PAT }} 109 | commit-message: 'chore(dev-deps): Bump nextcloud/ocp package' 110 | committer: GitHub 111 | author: nextcloud-command 112 | signoff: true 113 | branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-ocp' 114 | title: '[${{ matrix.branches }}] Update nextcloud/ocp dependency' 115 | body: | 116 | Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency 117 | labels: | 118 | dependencies 119 | 3. to review -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | build 4 | vendor 5 | node_modules 6 | *.cache 7 | -------------------------------------------------------------------------------- /.nextcloudignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | .drone 4 | .git 5 | .github 6 | .gitignore 7 | .travis.yml 8 | krankerl.toml 9 | screenshots 10 | .nextcloudignore 11 | composer* 12 | ._php_cs* 13 | tests 14 | psalm.xml 15 | -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | getFinder() 17 | ->ignoreVCSIgnored(true) 18 | ->notPath('build') 19 | ->notPath('l10n') 20 | ->notPath('src') 21 | ->notPath('vendor') 22 | ->in(__DIR__); 23 | return $config; 24 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | 5 | # Authors 6 | 7 | - Andy Scherzinger 8 | - Benjamin Somers 9 | - Chris Hayes <6013871+Christopher-Hayes@users.noreply.github.com> 10 | - Hugo Renard 11 | - John Molakvoæ 12 | - Louis Chemineau 13 | - Robin Appelman 14 | - Vincent Petry 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 5 | # Changelog 6 | 7 | ## v0.1.5 8 | - Gracefully handle mis-configured S3 external storages 9 | 10 | ## v0.1.4 11 | - Compatible with Nextcloud 20 and 21 12 | 13 | ## v0.1.3 14 | - Fix "S3PreviewFile" log message 15 | - Release with new certificate due to https://github.com/nextcloud/app-certificate-requests/pull/265#issuecomment-620394763 16 | - Mark as compatible with the upcoming Nextcloud 19 17 | 18 | ## v0.1.2 19 | - Fix reverting versions with some S3 implementations 20 | 21 | ## v0.1.1 22 | - Compatible with Nextcloud 18 23 | 24 | ## v0.1.0 25 | Initial release for using S3 object versioning for file versioning 26 | 27 | ## v0.1.0-b1 28 | Initial beta release for using S3 object versioning for file versioning 29 | 30 | --- 31 | 32 | Generated by [changelog](https://github.com/gluons/changelog). 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | -------------------------------------------------------------------------------- /LICENSES/AGPL-3.0-or-later.txt: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | 6 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. 11 | 12 | The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. 13 | 14 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. 15 | 16 | Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. 17 | 18 | A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. 19 | 20 | The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. 21 | 22 | An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. 23 | 24 | The precise terms and conditions for copying, distribution and modification follow. 25 | 26 | TERMS AND CONDITIONS 27 | 28 | 0. Definitions. 29 | 30 | "This License" refers to version 3 of the GNU Affero General Public License. 31 | 32 | "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. 33 | 34 | "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. 35 | 36 | To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. 37 | 38 | A "covered work" means either the unmodified Program or a work based on the Program. 39 | 40 | To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. 41 | 42 | To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. 43 | 44 | An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 45 | 46 | 1. Source Code. 47 | The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. 48 | 49 | A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. 50 | 51 | The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. 52 | 53 | The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those 54 | subprograms and other parts of the work. 55 | 56 | The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. 57 | 58 | The Corresponding Source for a work in source code form is that same work. 59 | 60 | 2. Basic Permissions. 61 | All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. 62 | 63 | You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. 64 | 65 | Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 66 | 67 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 68 | No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. 69 | 70 | When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 71 | 72 | 4. Conveying Verbatim Copies. 73 | You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. 74 | 75 | You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 76 | 77 | 5. Conveying Modified Source Versions. 78 | You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: 79 | 80 | a) The work must carry prominent notices stating that you modified it, and giving a relevant date. 81 | 82 | b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". 83 | 84 | c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. 85 | 86 | d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. 87 | 88 | A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 89 | 90 | 6. Conveying Non-Source Forms. 91 | You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: 92 | 93 | a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. 94 | 95 | b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. 96 | 97 | c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. 98 | 99 | d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. 100 | 101 | e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. 102 | 103 | A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. 104 | 105 | A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. 106 | 107 | "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. 108 | 109 | If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). 110 | 111 | The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. 112 | 113 | Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 114 | 115 | 7. Additional Terms. 116 | "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. 117 | 118 | When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. 119 | 120 | Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: 121 | 122 | a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or 123 | 124 | b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or 125 | 126 | c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or 127 | 128 | d) Limiting the use for publicity purposes of names of licensors or authors of the material; or 129 | 130 | e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or 131 | 132 | f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. 133 | 134 | All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. 135 | 136 | If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. 137 | 138 | Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 139 | 140 | 8. Termination. 141 | 142 | You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). 143 | 144 | However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. 145 | 146 | Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. 147 | 148 | Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 149 | 150 | 9. Acceptance Not Required for Having Copies. 151 | 152 | You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 153 | 154 | 10. Automatic Licensing of Downstream Recipients. 155 | 156 | Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. 157 | 158 | An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. 159 | 160 | You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 161 | 162 | 11. Patents. 163 | 164 | A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". 165 | 166 | A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. 167 | 168 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. 169 | 170 | In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. 171 | 172 | If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent 173 | license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. 174 | 175 | If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. 176 | 177 | A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. 178 | 179 | Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 180 | 181 | 12. No Surrender of Others' Freedom. 182 | 183 | If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may 184 | not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 185 | 186 | 13. Remote Network Interaction; Use with the GNU General Public License. 187 | 188 | Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. 189 | 190 | Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 191 | 192 | 14. Revised Versions of this License. 193 | 194 | The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 195 | 196 | Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. 197 | 198 | If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. 199 | 200 | Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 201 | 202 | 15. Disclaimer of Warranty. 203 | 204 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 205 | 206 | 16. Limitation of Liability. 207 | 208 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 209 | 210 | 17. Interpretation of Sections 15 and 16. 211 | 212 | If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 213 | 214 | END OF TERMS AND CONDITIONS 215 | 216 | How to Apply These Terms to Your New Programs 217 | 218 | If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. 219 | 220 | To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. 221 | 222 | 223 | Copyright (C) 224 | 225 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 226 | 227 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 228 | 229 | You should have received a copy of the GNU Affero General Public License along with this program. If not, see . 230 | 231 | Also add information on how to contact you by electronic and paper mail. 232 | 233 | If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. 234 | 235 | You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . 236 | -------------------------------------------------------------------------------- /LICENSES/CC0-1.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | associated documentation files (the "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial 12 | portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 15 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 16 | EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 18 | USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 5 | # files_versions_s3 6 | 7 | [![REUSE status](https://api.reuse.software/badge/github.com/nextcloud/files_versions_s3)](https://api.reuse.software/info/github.com/nextcloud/files_versions_s3) 8 | 9 | Use S3 object versioning for file versioning 10 | 11 | ## Warning 12 | 13 | This app does not include any mechanism for expiring old s3 versions, 14 | you should setup your own version expiry (also called "Lifecycle management" in S3) 15 | to prevent versions from taking up an ever increasing amount of space. 16 | 17 | ## Nextcloud builtin versioning 18 | 19 | Note that the default versioning app for Nextcloud will still work with S3 object storage without enabling this app. 20 | The default Nextcloud versioning will create new objects for every versioning instead of multiple versions for the same object. 21 | 22 | Enabling this app should improve performance when creating new versions of large files and the integration with S3 native 23 | lifecycle management might be a desired feature, but comes with the downsides as described above. 24 | 25 | ## Limitations with renaming/moving files when using external storage 26 | 27 | Due to limitations in how versions are stored in S3, when using versioning on an S3 external storage, 28 | old versions will be lost when a file is moved or renamed. 29 | This issue does not occur when using S3 as primary storage. 30 | 31 | 32 | ## Usage 33 | 34 | - install the app 35 | - check if bucket versioning is enabled for your storage using `occ files_versions_s3:status` 36 | - enable bucket versioning if not yet enabled using `occ files_versions_s3:enable `. Where `` is the integer of the storage item from `occ files_versions_s3:status` that you want to enable versioning on. 37 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | version = 1 4 | SPDX-PackageName = "files_versions_s3" 5 | SPDX-PackageSupplier = "Nextcloud " 6 | SPDX-PackageDownloadLocation = "https://github.com/nextcloud/files_versions_s3" 7 | 8 | [[annotations]] 9 | path = ["composer.json", "composer.lock", "vendor-bin/cs-fixer/composer.json", "vendor-bin/cs-fixer/composer.lock", "vendor-bin/phpunit/composer.json", "vendor-bin/phpunit/composer.lock", "vendor-bin/psalm/composer.json", "vendor-bin/psalm/composer.lock"] 10 | precedence = "aggregate" 11 | SPDX-FileCopyrightText = "2020 Nextcloud GmbH and Nextcloud contributors" 12 | SPDX-License-Identifier = "AGPL-3.0-or-later" 13 | -------------------------------------------------------------------------------- /appinfo/info.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | files_versions_s3 9 | S3 Versioning 10 | Use S3 object versioning for file versioning 11 | `]]> 24 | 1.2.0 25 | agpl 26 | Robin Appelman 27 | FilesVersionsS3 28 | 29 | 30 | 31 | 32 | files 33 | 34 | https://github.com/nextcloud/files_versions_s3 35 | https://github.com/nextcloud/files_versions_s3/issues 36 | https://github.com/nextcloud/files_versions_s3.git 37 | 38 | 39 | 40 | 41 | 42 | 43 | OCA\FilesVersionsS3\Command\Status 44 | OCA\FilesVersionsS3\Command\Enable 45 | 46 | 47 | 48 | OCA\FilesVersionsS3\Versions\PrimaryS3VersionsBackend 49 | OCA\FilesVersionsS3\Versions\ExternalS3VersionsBackend 50 | 51 | 52 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "project", 3 | "require-dev": { 4 | "aws/aws-sdk-php": "^3.240", 5 | "sabre/dav": "^4.7.0", 6 | "nextcloud/ocp": "dev-master" 7 | }, 8 | "require": { 9 | "bamarni/composer-bin-plugin": "^1.8" 10 | }, 11 | "license": "AGPLv3", 12 | "scripts": { 13 | "post-install-cmd": [ 14 | "@composer bin all install --ansi" 15 | ], 16 | "post-update-cmd": [ 17 | "@composer bin all update --ansi" 18 | ], 19 | "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l", 20 | "cs:check": "php-cs-fixer fix --dry-run --diff", 21 | "cs:fix": "php-cs-fixer fix", 22 | "test:unit": "phpunit -c tests/phpunit.xml", 23 | "psalm": "psalm --threads=1", 24 | "psalm:update-baseline": "psalm --threads=1 --update-baseline", 25 | "psalm:clear": "psalm --clear-cache && psalm --clear-global-cache", 26 | "psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType" 27 | }, 28 | "config": { 29 | "allow-plugins": { 30 | "bamarni/composer-bin-plugin": true 31 | }, 32 | "platform": { 33 | "php": "8.1" 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /krankerl.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | [package] 4 | before_cmds = [ 5 | 6 | ] 7 | -------------------------------------------------------------------------------- /lib/Command/BrokenConfig.php: -------------------------------------------------------------------------------- 1 | id = $id; 21 | $this->bucket = $bucket; 22 | $this->name = $name; 23 | $this->exception = $exception; 24 | } 25 | 26 | public function getId(): string { 27 | return $this->id; 28 | } 29 | 30 | public function getBucket(): string { 31 | return $this->bucket; 32 | } 33 | 34 | public function getName(): string { 35 | return $this->name; 36 | } 37 | 38 | public function getException(): Exception { 39 | return $this->exception; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/Command/ConfigManager.php: -------------------------------------------------------------------------------- 1 | rootFolder = $rootFolder; 27 | 28 | if (class_exists(GlobalStoragesService::class)) { 29 | $this->globalService = $server->query(GlobalStoragesService::class); 30 | } else { 31 | $this->globalService = null; 32 | } 33 | } 34 | 35 | /** 36 | * @return (S3Config|BrokenConfig)[] 37 | */ 38 | public function getS3Configs() { 39 | if ($this->globalService) { 40 | $externalStorageConfigs = $this->globalService->getAllStorages(); 41 | $s3StorageConfigs = array_filter($externalStorageConfigs, function (StorageConfig $storage) { 42 | return $storage->getBackend() instanceof AmazonS3; 43 | }); 44 | $storages = array_map(function (StorageConfig $config) { 45 | $storageClass = $config->getBackend()->getStorageClass(); 46 | try { 47 | /** @var \OCA\Files_External\Lib\Storage\AmazonS3 $storage */ 48 | $storage = new $storageClass($config->getBackendOptions()); 49 | return new S3Config((string)$config->getId(), $storage->getConnection(), $storage->getBucket(), $config->getMountPoint()); 50 | } catch (Exception $e) { 51 | return new BrokenConfig((string)$config->getId(), $storage->getBucket(), $config->getMountPoint(), $e); 52 | } 53 | }, $s3StorageConfigs); 54 | } else { 55 | $storages = []; 56 | } 57 | 58 | $primaryStorage = $this->rootFolder->get('')->getStorage(); 59 | 60 | if ($primaryStorage->instanceOfStorage(ObjectStoreStorage::class) and $primaryStorage->getObjectStore() instanceof S3) { 61 | /** @var S3 $s3 */ 62 | $s3 = $primaryStorage->getObjectStore(); 63 | $storages[] = new S3Config('primary', $s3->getConnection(), $s3->getBucket(), 'Primary Storage'); 64 | } 65 | 66 | return $storages; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/Command/Enable.php: -------------------------------------------------------------------------------- 1 | configManager = $configManager; 22 | } 23 | 24 | protected function configure() { 25 | parent::configure(); 26 | 27 | $this 28 | ->setName('files_versions_s3:enable') 29 | ->setDescription('Enable S3 object versioning') 30 | ->addArgument('id', InputArgument::REQUIRED, 'Id of the s3 configuration to enable versioning for'); 31 | } 32 | 33 | protected function execute(InputInterface $input, OutputInterface $output): int { 34 | $configs = $this->configManager->getS3Configs(); 35 | 36 | $id = $input->getArgument('id'); 37 | 38 | $config = null; 39 | 40 | foreach ($configs as $config) { 41 | if ($config->getId() === $id) { 42 | if ($config instanceof BrokenConfig) { 43 | $output->writeln('S3 configuration is invalid'); 44 | $output->writeln('' . $config->getException()->getMessage() . ''); 45 | return 1; 46 | } 47 | $config->enableVersioning(); 48 | return 0; 49 | } 50 | } 51 | 52 | $output->writeln("Config not found: $id"); 53 | return 1; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/Command/S3Config.php: -------------------------------------------------------------------------------- 1 | id = $id; 21 | $this->s3 = $s3; 22 | $this->bucket = $bucket; 23 | $this->name = $name; 24 | } 25 | 26 | public function getId(): string { 27 | return $this->id; 28 | } 29 | 30 | public function getS3(): S3Client { 31 | return $this->s3; 32 | } 33 | 34 | public function getBucket(): string { 35 | return $this->bucket; 36 | } 37 | 38 | public function getName(): string { 39 | return $this->name; 40 | } 41 | 42 | public function getConnection(): S3Client { 43 | return $this->getS3(); 44 | } 45 | 46 | public function versioningEnabled(): bool { 47 | $result = $this->getS3()->getBucketVersioning(['Bucket' => $this->getBucket()]); 48 | return $result->get('Status') === 'Enabled'; 49 | } 50 | 51 | public function enableVersioning() { 52 | $this->getS3()->putBucketVersioning([ 53 | 'Bucket' => $this->getBucket(), 54 | 'VersioningConfiguration' => [ 55 | 'Status' => 'Enabled', 56 | ], 57 | ]); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/Command/Status.php: -------------------------------------------------------------------------------- 1 | configManager = $configManager; 21 | } 22 | 23 | protected function configure() { 24 | parent::configure(); 25 | 26 | $this 27 | ->setName('files_versions_s3:status') 28 | ->setDescription('S3 object versioning status'); 29 | } 30 | 31 | protected function execute(InputInterface $input, OutputInterface $output): int { 32 | $configs = $this->configManager->getS3Configs(); 33 | 34 | $status = []; 35 | 36 | $outputFormat = $input->getOption('output'); 37 | if ($outputFormat == Base::OUTPUT_FORMAT_JSON || $outputFormat == Base::OUTPUT_FORMAT_JSON_PRETTY) { 38 | foreach ($configs as $config) { 39 | $status[$config->getId()] = [ 40 | 'id' => $config->getId(), 41 | 'name' => $config->getName(), 42 | 'enabled' => $config->versioningEnabled(), 43 | ]; 44 | } 45 | } else { 46 | foreach ($configs as $config) { 47 | if ($config instanceof BrokenConfig) { 48 | $status[$config->getId() . ' ("' . $config->getName() . '")'] = '' . $config->getException()->getMessage() . ''; 49 | } elseif ($config instanceof S3Config) { 50 | $status[$config->getId() . ' ("' . $config->getName() . '")'] = $config->versioningEnabled(); 51 | } 52 | } 53 | } 54 | 55 | $this->writeArrayInOutputFormat($input, $output, $status); 56 | 57 | return 0; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/Versions/AbstractS3VersionBackend.php: -------------------------------------------------------------------------------- 1 | getS3($file); 46 | if ($s3) { 47 | return $this->versionProvider->getVersions($s3, $this->getUrn($file), $user, $file, $this); 48 | } 49 | 50 | return []; 51 | } 52 | 53 | public function createVersion(IUser $user, FileInfo $file) { 54 | // noop, handled by S3 55 | } 56 | 57 | public function rollback(IVersion $version) { 58 | if (!$this->currentUserHasPermissions($version->getSourceFile(), \OCP\Constants::PERMISSION_UPDATE)) { 59 | throw new Forbidden('You cannot restore this version because you do not have update permissions on the source file.'); 60 | } 61 | 62 | $source = $version->getSourceFile(); 63 | $s3 = $this->getS3($source); 64 | if ($s3) { 65 | $this->versionProvider->rollback($s3, $this->getUrn($source), $version->getRevisionId()); 66 | $this->postRollback($source, $version); 67 | return true; 68 | } 69 | 70 | return false; 71 | } 72 | 73 | public function read(IVersion $version) { 74 | $source = $version->getSourceFile(); 75 | $s3 = $this->getS3($source); 76 | if ($s3) { 77 | return $this->versionProvider->read($s3, $this->getUrn($version->getSourceFile()), $version->getRevisionId()); 78 | } 79 | 80 | 81 | return false; 82 | } 83 | 84 | public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File { 85 | $s3 = $this->getS3($sourceFile); 86 | if ($s3) { 87 | return new S3PreviewFile($sourceFile, function () use ($s3, $sourceFile, $revision) { 88 | return $this->versionProvider->read($s3, $this->getUrn($sourceFile), $revision); 89 | }, $revision); 90 | } 91 | throw new \Exception('Requested s3 version for a file not stored in s3'); 92 | } 93 | 94 | public function deleteVersion(IVersion $version): void { 95 | if (!$this->currentUserHasPermissions($version->getSourceFile(), \OCP\Constants::PERMISSION_DELETE)) { 96 | throw new Forbidden('You cannot delete this version because you do not have delete permissions on the source file.'); 97 | } 98 | 99 | $source = $version->getSourceFile(); 100 | $s3 = $this->getS3($source); 101 | if ($s3) { 102 | $this->versionProvider->deleteVersion($s3, $this->getUrn($version->getSourceFile()), $version->getRevisionId()); 103 | } 104 | } 105 | 106 | public function setMetadataValue(Node $node, int $revision, string $key, string $value): void { 107 | if (!$this->currentUserHasPermissions($node, \OCP\Constants::PERMISSION_UPDATE)) { 108 | throw new Forbidden('You cannot update the version\'s metadata because you do not have update permissions on the source file.'); 109 | } 110 | 111 | $versions = $this->getVersionsForFile($this->userSession->getUser(), $node); 112 | $version = array_values(array_filter($versions, fn (IVersion $version) => $version->getTimestamp() === $revision))[0] ?? null; 113 | 114 | $s3 = $this->getS3($node); 115 | if ($s3 && $version) { 116 | $this->versionProvider->setVersionMetadata($s3, $this->getUrn($node), $version->getRevisionId(), $key, $value); 117 | } 118 | } 119 | 120 | private function currentUserHasPermissions(FileInfo $sourceFile, int $permissions): bool { 121 | $currentUserId = $this->userSession->getUser()?->getUID(); 122 | 123 | if ($currentUserId === null) { 124 | throw new NotFoundException('No user logged in'); 125 | } 126 | 127 | return ($sourceFile->getPermissions() & $permissions) === $permissions; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /lib/Versions/ExternalS3VersionsBackend.php: -------------------------------------------------------------------------------- 1 | getStorage(); 29 | if ($storage->instanceOfStorage(AmazonS3::class)) { 30 | /** @var AmazonS3 $storage */ 31 | return $storage; 32 | } else { 33 | return null; 34 | } 35 | } 36 | 37 | protected function getUrn(FileInfo $file): string { 38 | $storage = $file->getStorage(); 39 | $path = $file->getInternalPath(); 40 | while ($storage->instanceOfStorage(Jail::class)) { 41 | /** @var Jail $storage */ 42 | $path = $storage->getUnjailedPath($path); 43 | $storage = $storage->getUnjailedStorage(); 44 | } 45 | return $path; 46 | } 47 | 48 | protected function postRollback(FileInfo $file, IVersion $version) { 49 | $file->getStorage()->getUpdater()->update($file->getInternalPath()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/Versions/PrimaryS3VersionsBackend.php: -------------------------------------------------------------------------------- 1 | instanceOfStorage(ObjectStoreStorage::class)) { 21 | /** @var ObjectStoreStorage $storage */ 22 | $objectStore = $storage->getObjectStore(); 23 | return $objectStore instanceof S3; 24 | } 25 | return false; 26 | } 27 | 28 | /** 29 | * @param FileInfo $file 30 | * @return S3ConnectionTrait|null 31 | */ 32 | protected function getS3(FileInfo $file) { 33 | $storage = $file->getStorage(); 34 | if ($storage->instanceOfStorage(ObjectStoreStorage::class)) { 35 | /** @var ObjectStoreStorage $storage */ 36 | $objectStore = $storage->getObjectStore(); 37 | if ($objectStore instanceof S3) { 38 | return $objectStore; 39 | } 40 | } 41 | 42 | return null; 43 | } 44 | 45 | protected function getUrn(FileInfo $file): string { 46 | /** @var ObjectStoreStorage $storage */ 47 | $storage = $file->getStorage(); 48 | return $storage->getURN($file->getId()); 49 | } 50 | 51 | protected function postRollback(FileInfo $file, IVersion $version) { 52 | $cache = $file->getStorage()->getCache(); 53 | $cache->update($file->getId(), [ 54 | 'mtime' => time(), 55 | 'etag' => $file->getStorage()->getETag($file->getInternalPath()), 56 | 'size' => $version->getSize(), 57 | ]); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/Versions/S3PreviewFile.php: -------------------------------------------------------------------------------- 1 | sourceFile = $sourceFile; 23 | $this->contentProvider = $contentProvider; 24 | $this->revisionId = $revisionId; 25 | } 26 | 27 | public function getContent(): string { 28 | return stream_get_contents(($this->contentProvider)()) ?: ''; 29 | } 30 | 31 | public function putContent($data) { 32 | throw new ForbiddenException('Preview files are read only', false); 33 | } 34 | 35 | public function fopen($mode) { 36 | if ($mode === 'r' || $mode === 'rb') { 37 | return ($this->contentProvider)(); 38 | } else { 39 | throw new ForbiddenException('Preview files are read only', false); 40 | } 41 | } 42 | 43 | public function hash($type, $raw = false) { 44 | return ''; 45 | } 46 | 47 | public function getChecksum() { 48 | return ''; 49 | } 50 | 51 | public function getMtime() { 52 | return $this->sourceFile->getMtime(); 53 | } 54 | 55 | public function getMimetype() { 56 | return $this->sourceFile->getMimeType(); 57 | } 58 | 59 | public function getMimePart() { 60 | return $this->sourceFile->getMimePart(); 61 | } 62 | 63 | public function isEncrypted() { 64 | return $this->sourceFile->isEncrypted(); 65 | } 66 | 67 | public function getType() { 68 | return $this->sourceFile->getType(); 69 | } 70 | 71 | public function isCreatable() { 72 | return $this->sourceFile->isCreatable(); 73 | } 74 | 75 | public function isShared() { 76 | return $this->sourceFile->isShared(); 77 | } 78 | 79 | public function isMounted() { 80 | return $this->sourceFile->isMounted(); 81 | } 82 | 83 | public function getMountPoint() { 84 | return $this->sourceFile->getMountPoint(); 85 | } 86 | 87 | public function getOwner() { 88 | return $this->sourceFile->getOwner(); 89 | } 90 | 91 | public function getExtension(): string { 92 | return $this->sourceFile->getExtension(); 93 | } 94 | 95 | public function getPreviewVersion(): string { 96 | return $this->revisionId; 97 | } 98 | 99 | public function move($targetPath) { 100 | throw new ForbiddenException('Preview files are read only', false); 101 | } 102 | 103 | public function delete() { 104 | throw new ForbiddenException('Preview files are read only', false); 105 | } 106 | 107 | public function copy($targetPath) { 108 | throw new ForbiddenException('Preview files are read only', false); 109 | } 110 | 111 | public function touch($mtime = null) { 112 | throw new ForbiddenException('Preview files are read only', false); 113 | } 114 | 115 | public function getStorage() { 116 | return $this->sourceFile->getStorage(); 117 | } 118 | 119 | public function getPath() { 120 | return $this->sourceFile->getPath(); 121 | } 122 | 123 | public function getInternalPath() { 124 | return $this->sourceFile->getInternalPath(); 125 | } 126 | 127 | public function getId() { 128 | return (int)$this->sourceFile->getId(); 129 | } 130 | 131 | public function stat() { 132 | return [ 133 | 'mtime' => $this->getMtime(), 134 | 'size' => $this->getSize() 135 | ]; 136 | } 137 | 138 | public function getSize($includeMounts = true) { 139 | return $this->sourceFile->getSize(); 140 | } 141 | 142 | public function getEtag() { 143 | return $this->revisionId; 144 | } 145 | 146 | public function getPermissions() { 147 | return $this->sourceFile->getPermissions(); 148 | } 149 | 150 | public function isReadable() { 151 | return $this->sourceFile->isReadable(); 152 | } 153 | 154 | public function isUpdateable() { 155 | return $this->sourceFile->isUpdateable(); 156 | } 157 | 158 | public function isDeletable() { 159 | return $this->sourceFile->isDeletable(); 160 | } 161 | 162 | public function isShareable() { 163 | return $this->sourceFile->isShareable(); 164 | } 165 | 166 | public function getParent() { 167 | if ($this->sourceFile instanceof File) { 168 | return $this->sourceFile->getParent(); 169 | } else { 170 | throw new \Exception('Invalid file'); 171 | } 172 | } 173 | 174 | public function getName() { 175 | return $this->sourceFile->getName(); 176 | } 177 | 178 | public function lock($type) { 179 | // noop 180 | } 181 | 182 | public function changeLock($targetType) { 183 | // noop 184 | } 185 | 186 | public function unlock($type) { 187 | // noop 188 | } 189 | 190 | public function getCreationTime(): int { 191 | return 0; 192 | } 193 | 194 | public function getUploadTime(): int { 195 | return 0; 196 | } 197 | 198 | public function getParentId(): int { 199 | return $this->getParent()->getId(); 200 | } 201 | 202 | public function getMetadata(): array { 203 | return []; 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /lib/Versions/S3VersionProvider.php: -------------------------------------------------------------------------------- 1 | getConnection(); 32 | $bucket = $objectStore->getBucket(); 33 | $result = $client->listObjectVersions([ 34 | 'Bucket' => $bucket, 35 | 'Prefix' => $urn, 36 | ]); 37 | /** @var list $s3versions */ 38 | $s3versions = array_values($result['Versions'] ?? []); 39 | $s3versions = array_filter($s3versions, function (array $version) use ($urn) { 40 | return $version['Key'] === $urn; 41 | }); 42 | $versions = array_map(function (array $version) use ($client, $bucket, $urn, $user, $sourceFile, $backend) { 43 | $versionId = $version['VersionId']; 44 | $lastModified = $version['LastModified']; 45 | 46 | $tagSet = $client->getObjectTagging([ 47 | 'Bucket' => $bucket, 48 | 'Key' => $urn, 49 | 'VersionId' => $versionId, 50 | ])['TagSet']; 51 | $tags = []; 52 | 53 | foreach ($tagSet as $tag) { 54 | if (str_starts_with($tag['Key'], 'metadata:')) { 55 | /** @var string $key */ 56 | $key = preg_replace('/^metadata:/', '', $tag['Key']); 57 | $value = base64_decode(str_replace('-', '=', $tag['Value'])); 58 | if ($value) { 59 | $tags[$key] = $value; 60 | } 61 | } 62 | } 63 | 64 | // Ensure compatibility with previous way of storing labels. 65 | if (!isset($tags['label'])) { 66 | foreach ($tagSet as $tag) { 67 | if ($tag['Key'] === 'Label') { 68 | $value = base64_decode(str_replace('-', '=', $tag['Value'])); 69 | if ($value) { 70 | $tags['label'] = $value; 71 | } 72 | } 73 | } 74 | } 75 | 76 | return new Version( 77 | $lastModified->getTimestamp(), 78 | $versionId, 79 | $sourceFile->getName(), 80 | (int)$version['Size'], 81 | $sourceFile->getMimetype(), 82 | $sourceFile->getId() . '/' . $lastModified->format('c'), 83 | $sourceFile, 84 | $backend, 85 | $user, 86 | $tags, 87 | ); 88 | }, $s3versions); 89 | usort($versions, function (IVersion $a, IVersion $b) { 90 | return $b->getTimestamp() - $a->getTimestamp(); 91 | }); 92 | return $versions; 93 | } 94 | 95 | /** 96 | * @param S3ConnectionTrait $objectStore 97 | * @param string $urn 98 | * @param string $versionId 99 | * @throws \OCP\Files\NotFoundException 100 | */ 101 | public function rollback($objectStore, string $urn, string $versionId) { 102 | $client = $objectStore->getConnection(); 103 | $bucket = $objectStore->getBucket(); 104 | 105 | $client->copyObject([ 106 | 'Bucket' => $bucket, 107 | 'CopySource' => S3Client::encodeKey($bucket . '/' . $urn) . '?versionId=' . urlencode($versionId), 108 | 'Key' => $urn, 109 | ]); 110 | } 111 | 112 | /** 113 | * @param S3ConnectionTrait $objectStore 114 | * @param string $urn 115 | * @param string $versionId 116 | * @return bool|resource 117 | * @throws \OCP\Files\NotFoundException 118 | */ 119 | public function read($objectStore, string $urn, string $versionId) { 120 | $client = $objectStore->getConnection(); 121 | $command = $client->getCommand('GetObject', [ 122 | 'Bucket' => $objectStore->getBucket(), 123 | 'Key' => $urn, 124 | 'VersionId' => $versionId, 125 | ]); 126 | $request = \Aws\serialize($command); 127 | $headers = []; 128 | foreach ($request->getHeaders() as $key => $values) { 129 | foreach ($values as $value) { 130 | $headers[] = "$key: $value"; 131 | } 132 | } 133 | $opts = [ 134 | 'http' => [ 135 | 'header' => $headers, 136 | ], 137 | ]; 138 | 139 | $context = stream_context_create($opts); 140 | return fopen((string)$request->getUri(), 'r', false, $context); 141 | } 142 | 143 | /** 144 | * @param S3ConnectionTrait $objectStore 145 | * @param string $urn 146 | * @param string $versionId 147 | * @param string $label 148 | * @throws \OCP\Files\NotFoundException 149 | */ 150 | public function setVersionMetadata($objectStore, string $urn, string $versionId, string $key, string $value) { 151 | $client = $objectStore->getConnection(); 152 | $bucket = $objectStore->getBucket(); 153 | 154 | $tagSet = $client->getObjectTagging([ 155 | 'Bucket' => $bucket, 156 | 'Key' => $urn, 157 | 'VersionId' => $versionId, 158 | ])['TagSet']; 159 | 160 | if ($value === '') { 161 | // Filter the key out if the value is empty 162 | $tagSet = array_filter($tagSet, function (array $tag) use ($key) { 163 | return $tag['Key'] !== "metadata:$key"; 164 | }); 165 | } else { 166 | $saved = false; 167 | foreach ($tagSet as &$tag) { 168 | if ($tag['Key'] === "metadata:$key") { 169 | $tag['Value'] = str_replace('=', '-', base64_encode($value)); 170 | $saved = true; 171 | break; 172 | } 173 | } 174 | 175 | if (!$saved) { 176 | $tagSet[] = [ 177 | 'Key' => "metadata:$key", 178 | 'Value' => str_replace('=', '-', base64_encode($value)), 179 | ]; 180 | } 181 | } 182 | 183 | $client->putObjectTagging([ 184 | 'Bucket' => $bucket, 185 | 'Key' => $urn, 186 | 'VersionId' => $versionId, 187 | 'Tagging' => [ 188 | 'TagSet' => $tagSet, 189 | ], 190 | ]); 191 | } 192 | 193 | /** 194 | * @param S3ConnectionTrait $objectStore 195 | * @param string $urn 196 | * @param string $versionId 197 | * @throws \OCP\Files\NotFoundException 198 | */ 199 | public function deleteVersion($objectStore, string $urn, string $versionId) { 200 | $client = $objectStore->getConnection(); 201 | $bucket = $objectStore->getBucket(); 202 | 203 | $client->deleteObject([ 204 | 'Bucket' => $bucket, 205 | 'Key' => $urn, 206 | 'VersionId' => $versionId, 207 | ]); 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /psalm.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/Command/S3ConfigTest.php: -------------------------------------------------------------------------------- 1 | query(ConfigManager::class); 26 | $configs = $configManager->getS3Configs(); 27 | $configs = array_filter($configs, function ($config) { 28 | return $config instanceof S3Config; 29 | }); 30 | 31 | if (!$configs) { 32 | $this->markTestSkipped('No S3 configured'); 33 | return; 34 | } 35 | $this->config = current($configs); 36 | } 37 | 38 | public function testEnable() { 39 | if ($this->config->versioningEnabled()) { 40 | $this->markTestSkipped('S3 versioning already enabled'); 41 | return; 42 | } 43 | 44 | $this->config->enableVersioning(); 45 | usleep(100 * 1000); 46 | $this->assertTrue($this->config->versioningEnabled()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | registerService(IDBConnection::class, function () { 19 | return self::$realDatabase; 20 | }); 21 | } 22 | $dataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest'); 23 | 24 | self::tearDownAfterClassCleanStrayDataFiles($dataDir); 25 | self::tearDownAfterClassCleanStrayHooks(); 26 | self::tearDownAfterClassCleanStrayLocks(); 27 | 28 | \PHPUnit\Framework\TestCase::tearDownAfterClass(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/Versions/S3VersionProviderTest.php: -------------------------------------------------------------------------------- 1 | query(ConfigManager::class); 38 | $configs = $configManager->getS3Configs(); 39 | $configs = array_filter($configs, function ($config) { 40 | return $config instanceof S3Config; 41 | }); 42 | 43 | if (!$configs) { 44 | $this->markTestSkipped('No S3 configured'); 45 | return; 46 | } 47 | $this->config = current($configs); 48 | $this->versionProvider = new S3VersionProvider(); 49 | $this->user = $this->createMock(IUser::class); 50 | $this->backend = $this->createMock(IVersionBackend::class); 51 | 52 | if (!$this->config->versioningEnabled()) { 53 | $this->config->enableVersioning(); 54 | } 55 | } 56 | 57 | public function testListVersions() { 58 | $sourceFile = $this->createMock(FileInfo::class); 59 | $sourceFile->method('getName')->willReturn('foo'); 60 | $sourceFile->method('getMimeType')->willReturn('mime'); 61 | $sourceFile->method('getId')->willReturn('1'); 62 | $this->config->getS3()->upload($this->config->getBucket(), 'foo', 'bar'); 63 | 64 | // delay to make sure we have distinct timestamps for sorting 65 | sleep(1); 66 | 67 | $this->assertEmpty($this->versionProvider->getVersions( 68 | $this->config, 69 | 'foo', 70 | $this->user, 71 | $sourceFile, 72 | $this->backend 73 | )); 74 | 75 | $this->config->getS3()->upload($this->config->getBucket(), 'foo', 'foo'); 76 | 77 | $versions = $this->versionProvider->getVersions($this->config, 'foo', $this->user, $sourceFile, $this->backend); 78 | $this->assertCount(1, $versions); 79 | $version1 = $versions[0]; 80 | 81 | $this->config->getS3()->upload($this->config->getBucket(), 'foo', 'asd'); 82 | $versions = $this->versionProvider->getVersions($this->config, 'foo', $this->user, $sourceFile, $this->backend); 83 | $this->assertCount(2, $versions); 84 | 85 | // sorted newest first 86 | $this->assertLessThan($versions[0]->getTimestamp(), $versions[1]->getTimestamp()); 87 | $this->assertEquals($version1->getRevisionId(), $versions[1]->getRevisionId()); 88 | } 89 | 90 | public function testReadVersion() { 91 | $sourceFile = $this->createMock(FileInfo::class); 92 | $sourceFile->method('getName')->willReturn('foo'); 93 | $sourceFile->method('getMimeType')->willReturn('mime'); 94 | $sourceFile->method('getId')->willReturn('1'); 95 | $this->config->getS3()->upload($this->config->getBucket(), 'bar', 'bar'); 96 | sleep(1); 97 | $this->config->getS3()->upload($this->config->getBucket(), 'bar', 'foo'); 98 | $this->config->getS3()->upload($this->config->getBucket(), 'bar', 'asd'); 99 | $versions = $this->versionProvider->getVersions($this->config, 'bar', $this->user, $sourceFile, $this->backend); 100 | $this->assertCount(2, $versions); 101 | 102 | 103 | $this->assertEquals( 104 | 'bar', 105 | stream_get_contents($this->versionProvider->read($this->config, 'bar', $versions[1]->getRevisionId())) 106 | ); 107 | $this->assertEquals( 108 | 'foo', 109 | stream_get_contents($this->versionProvider->read($this->config, 'bar', $versions[0]->getRevisionId())) 110 | ); 111 | } 112 | 113 | public function testRollback() { 114 | if (getenv('SKIP_ROLLBACK')) { 115 | $this->markTestSkipped(); 116 | } 117 | $sourceFile = $this->createMock(FileInfo::class); 118 | $sourceFile->method('getName')->willReturn('foo'); 119 | $sourceFile->method('getMimeType')->willReturn('mime'); 120 | $sourceFile->method('getId')->willReturn('1'); 121 | $this->config->getS3()->upload($this->config->getBucket(), 'rollback', 'bar'); 122 | $this->config->getS3()->upload($this->config->getBucket(), 'rollback', 'foo'); 123 | $this->config->getS3()->upload($this->config->getBucket(), 'rollback', 'asd'); 124 | $versions = $this->versionProvider->getVersions( 125 | $this->config, 126 | 'rollback', 127 | $this->user, 128 | $sourceFile, 129 | $this->backend 130 | ); 131 | $this->assertCount(2, $versions); 132 | 133 | $this->versionProvider->rollback($this->config, 'rollback', $versions[0]->getRevisionId()); 134 | 135 | $versions = $this->versionProvider->getVersions( 136 | $this->config, 137 | 'rollback', 138 | $this->user, 139 | $sourceFile, 140 | $this->backend 141 | ); 142 | $this->assertCount(3, $versions); 143 | 144 | 145 | $this->assertEquals('foo', (string)$this->config->getS3()->getObject([ 146 | 'Bucket' => $this->config->getBucket(), 147 | 'Key' => 'rollback', 148 | ])['Body']); 149 | } 150 | 151 | public function testLabeling() { 152 | if (getenv('SKIP_LABEL')) { 153 | $this->markTestSkipped(); 154 | } 155 | $sourceFile = $this->createMock(FileInfo::class); 156 | $sourceFile->method('getName')->willReturn('foo'); 157 | $sourceFile->method('getMimeType')->willReturn('mime'); 158 | $sourceFile->method('getId')->willReturn('1'); 159 | $this->config->getS3()->upload($this->config->getBucket(), 'labeling', 'bar'); 160 | $this->config->getS3()->upload($this->config->getBucket(), 'labeling', 'foo'); 161 | $this->config->getS3()->upload($this->config->getBucket(), 'labeling', 'asd'); 162 | /** @var (INameableVersion|IVersion)[] $versions */ 163 | $versions = $this->versionProvider->getVersions( 164 | $this->config, 165 | 'labeling', 166 | $this->user, 167 | $sourceFile, 168 | $this->backend 169 | ); 170 | 171 | $this->assertEquals('', $versions[1]->getLabel()); 172 | 173 | $this->versionProvider->setVersionMetadata($this->config, 'labeling', $versions[1]->getRevisionId(), 'label', 'label'); 174 | 175 | /** @var (INameableVersion|IVersion)[] $versions */ 176 | $versions = $this->versionProvider->getVersions( 177 | $this->config, 178 | 'labeling', 179 | $this->user, 180 | $sourceFile, 181 | $this->backend 182 | ); 183 | 184 | $this->assertEquals('label', $versions[1]->getLabel()); 185 | 186 | $this->versionProvider->setVersionMetadata($this->config, 'labeling', $versions[1]->getRevisionId(), 'label', ''); 187 | 188 | /** @var (INameableVersion|IVersion)[] $versions */ 189 | $versions = $this->versionProvider->getVersions( 190 | $this->config, 191 | 'labeling', 192 | $this->user, 193 | $sourceFile, 194 | $this->backend 195 | ); 196 | 197 | $this->assertEquals('', $versions[1]->getLabel()); 198 | } 199 | 200 | public function testDeleteVersion() { 201 | $sourceFile = $this->createMock(FileInfo::class); 202 | $sourceFile->method('getName')->willReturn('foo'); 203 | $sourceFile->method('getMimeType')->willReturn('mime'); 204 | $sourceFile->method('getId')->willReturn('1'); 205 | $this->config->getS3()->upload($this->config->getBucket(), 'delete', 'bar'); 206 | $this->config->getS3()->upload($this->config->getBucket(), 'delete', 'foo'); 207 | $this->config->getS3()->upload($this->config->getBucket(), 'delete', 'asd'); 208 | $versions = $this->versionProvider->getVersions( 209 | $this->config, 210 | 'delete', 211 | $this->user, 212 | $sourceFile, 213 | $this->backend 214 | ); 215 | 216 | $this->assertCount(2, $versions); 217 | 218 | $this->versionProvider->deleteVersion($this->config, 'delete', $versions[1]->getRevisionId()); 219 | 220 | $versions = $this->versionProvider->getVersions( 221 | $this->config, 222 | 'delete', 223 | $this->user, 224 | $sourceFile, 225 | $this->backend 226 | ); 227 | 228 | $this->assertCount(1, $versions); 229 | } 230 | } 231 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); 13 | \OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/', true); 14 | 15 | OC_App::loadApp('files_versions_s3'); 16 | 17 | OC_Hook::clear(); 18 | -------------------------------------------------------------------------------- /tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 12 | . 13 | 14 | 15 | 16 | ../ 17 | 18 | ../tests 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/stubs/stub.phpstub: -------------------------------------------------------------------------------- 1 | metadata[$key] ?? null; 206 | } 207 | } 208 | } 209 | 210 | namespace OC\Files\Storage { 211 | 212 | use OCP\Files\Storage\IStorage; 213 | 214 | class AbstractStorage implements IStorage { 215 | public function __construct($parameters) { 216 | } 217 | public function getId() { 218 | } 219 | public function mkdir($path) { 220 | } 221 | public function rmdir($path) { 222 | } 223 | public function opendir($path) { 224 | } 225 | public function is_dir($path) { 226 | } 227 | public function is_file($path) { 228 | } 229 | public function stat($path) { 230 | } 231 | public function filetype($path) { 232 | } 233 | public function filesize($path) { 234 | } 235 | public function isCreatable($path) { 236 | } 237 | public function isReadable($path) { 238 | } 239 | public function isUpdatable($path) { 240 | } 241 | public function isDeletable($path) { 242 | } 243 | public function isSharable($path) { 244 | } 245 | public function getPermissions($path) { 246 | } 247 | public function file_exists($path) { 248 | } 249 | public function filemtime($path) { 250 | } 251 | public function file_get_contents($path) { 252 | } 253 | public function file_put_contents($path, $data) { 254 | } 255 | public function unlink($path) { 256 | } 257 | public function rename($path1, $path2) { 258 | } 259 | public function copy($path1, $path2) { 260 | } 261 | public function fopen($path, $mode) { 262 | } 263 | public function getMimeType($path) { 264 | } 265 | public function hash($type, $path, $raw = false) { 266 | } 267 | public function free_space($path) { 268 | } 269 | public function touch($path, $mtime = null) { 270 | } 271 | public function getLocalFile($path) { 272 | } 273 | public function hasUpdated($path, $time) { 274 | } 275 | public function getETag($path) { 276 | } 277 | public function isLocal() { 278 | } 279 | public function instanceOfStorage($class) { 280 | } 281 | public function getDirectDownload($path) { 282 | } 283 | public function verifyPath($path, $fileName) { 284 | } 285 | public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { 286 | } 287 | public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { 288 | } 289 | public function test() { 290 | } 291 | public function getAvailability() { 292 | } 293 | public function setAvailability($isAvailable) { 294 | } 295 | public function getOwner($path) { 296 | } 297 | public function getCache() { 298 | } 299 | public function getPropagator() { 300 | } 301 | public function getScanner() { 302 | } 303 | public function getUpdater() { 304 | } 305 | public function getWatcher() { 306 | } 307 | } 308 | } 309 | 310 | namespace OC\Files\Storage\Wrapper { 311 | 312 | use OCP\Files\Storage\IStorage; 313 | 314 | class Jail extends \OC\Files\Storage\AbstractStorage { 315 | public function getUnjailedPath(string $path): string { 316 | } 317 | 318 | public function getUnjailedStorage(): IStorage { 319 | } 320 | } 321 | } 322 | 323 | namespace OC\Hooks { 324 | interface Emitter { 325 | 326 | } 327 | } 328 | 329 | namespace OCA\DAV\Connector\Sabre\Exception { 330 | class Forbidden extends \Sabre\DAV\Exception\Forbidden { 331 | public const NS_OWNCLOUD = 'http://owncloud.org/ns'; 332 | 333 | /** 334 | * @param string $message 335 | * @param bool $retry 336 | * @param \Exception $previous 337 | */ 338 | public function __construct($message, $retry = false, \Exception $previous = null) {} 339 | 340 | /** 341 | * This method allows the exception to include additional information 342 | * into the WebDAV error response 343 | * 344 | * @param \Sabre\DAV\Server $server 345 | * @param \DOMElement $errorNode 346 | * @return void 347 | */ 348 | public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) {} 349 | } 350 | } 351 | -------------------------------------------------------------------------------- /vendor-bin/cs-fixer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "nextcloud/coding-standard": "^1.3.1" 4 | }, 5 | "config": { 6 | "platform": { 7 | "php": "8.1" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor-bin/cs-fixer/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "b80be9f75e57093d11f0a5065039b255", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "kubawerlos/php-cs-fixer-custom-fixers", 12 | "version": "v3.23.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", 16 | "reference": "b3210c6e546bdfc95664297a8971ae3b6b1f4a5a" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/b3210c6e546bdfc95664297a8971ae3b6b1f4a5a", 21 | "reference": "b3210c6e546bdfc95664297a8971ae3b6b1f4a5a", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "ext-filter": "*", 26 | "ext-tokenizer": "*", 27 | "friendsofphp/php-cs-fixer": "^3.61.1", 28 | "php": "^7.4 || ^8.0" 29 | }, 30 | "require-dev": { 31 | "phpunit/phpunit": "^9.6.4 || ^10.5.29" 32 | }, 33 | "type": "library", 34 | "autoload": { 35 | "psr-4": { 36 | "PhpCsFixerCustomFixers\\": "src" 37 | } 38 | }, 39 | "notification-url": "https://packagist.org/downloads/", 40 | "license": [ 41 | "MIT" 42 | ], 43 | "authors": [ 44 | { 45 | "name": "Kuba Werłos", 46 | "email": "werlos@gmail.com" 47 | } 48 | ], 49 | "description": "A set of custom fixers for PHP CS Fixer", 50 | "support": { 51 | "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", 52 | "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.23.0" 53 | }, 54 | "time": "2025-02-15T09:15:56+00:00" 55 | }, 56 | { 57 | "name": "nextcloud/coding-standard", 58 | "version": "v1.3.2", 59 | "source": { 60 | "type": "git", 61 | "url": "https://github.com/nextcloud/coding-standard.git", 62 | "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" 63 | }, 64 | "dist": { 65 | "type": "zip", 66 | "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", 67 | "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", 68 | "shasum": "" 69 | }, 70 | "require": { 71 | "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", 72 | "php": "^7.3|^8.0", 73 | "php-cs-fixer/shim": "^3.17" 74 | }, 75 | "type": "library", 76 | "autoload": { 77 | "psr-4": { 78 | "Nextcloud\\CodingStandard\\": "src" 79 | } 80 | }, 81 | "notification-url": "https://packagist.org/downloads/", 82 | "license": [ 83 | "MIT" 84 | ], 85 | "authors": [ 86 | { 87 | "name": "Christoph Wurst", 88 | "email": "christoph@winzerhof-wurst.at" 89 | } 90 | ], 91 | "description": "Nextcloud coding standards for the php cs fixer", 92 | "support": { 93 | "issues": "https://github.com/nextcloud/coding-standard/issues", 94 | "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" 95 | }, 96 | "time": "2024-10-14T16:49:05+00:00" 97 | }, 98 | { 99 | "name": "php-cs-fixer/shim", 100 | "version": "v3.70.2", 101 | "source": { 102 | "type": "git", 103 | "url": "https://github.com/PHP-CS-Fixer/shim.git", 104 | "reference": "ff041542719ad3be54bd34647d0fd5bc7900115e" 105 | }, 106 | "dist": { 107 | "type": "zip", 108 | "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/ff041542719ad3be54bd34647d0fd5bc7900115e", 109 | "reference": "ff041542719ad3be54bd34647d0fd5bc7900115e", 110 | "shasum": "" 111 | }, 112 | "require": { 113 | "ext-json": "*", 114 | "ext-tokenizer": "*", 115 | "php": "^7.4 || ^8.0" 116 | }, 117 | "replace": { 118 | "friendsofphp/php-cs-fixer": "self.version" 119 | }, 120 | "suggest": { 121 | "ext-dom": "For handling output formats in XML", 122 | "ext-mbstring": "For handling non-UTF8 characters." 123 | }, 124 | "bin": [ 125 | "php-cs-fixer", 126 | "php-cs-fixer.phar" 127 | ], 128 | "type": "application", 129 | "notification-url": "https://packagist.org/downloads/", 130 | "license": [ 131 | "MIT" 132 | ], 133 | "authors": [ 134 | { 135 | "name": "Fabien Potencier", 136 | "email": "fabien@symfony.com" 137 | }, 138 | { 139 | "name": "Dariusz Rumiński", 140 | "email": "dariusz.ruminski@gmail.com" 141 | } 142 | ], 143 | "description": "A tool to automatically fix PHP code style", 144 | "support": { 145 | "issues": "https://github.com/PHP-CS-Fixer/shim/issues", 146 | "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.70.2" 147 | }, 148 | "time": "2025-03-03T21:07:46+00:00" 149 | } 150 | ], 151 | "aliases": [], 152 | "minimum-stability": "stable", 153 | "stability-flags": {}, 154 | "prefer-stable": false, 155 | "prefer-lowest": false, 156 | "platform": {}, 157 | "platform-dev": {}, 158 | "platform-overrides": { 159 | "php": "8.1" 160 | }, 161 | "plugin-api-version": "2.6.0" 162 | } 163 | -------------------------------------------------------------------------------- /vendor-bin/phpunit/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "phpunit/phpunit": "^9" 4 | }, 5 | "config": { 6 | "platform": { 7 | "php": "8.1" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor-bin/psalm/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "vimeo/psalm": "^6" 4 | }, 5 | "config": { 6 | "platform": { 7 | "php": "8.1.17" 8 | } 9 | } 10 | } 11 | --------------------------------------------------------------------------------