diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 852b265..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,50 +0,0 @@ -version: 2 -updates: - - package-ecosystem: composer - directory: "/" - schedule: - interval: weekly - day: saturday - time: "03:00" - timezone: Europe/Paris - open-pull-requests-limit: 10 - - package-ecosystem: composer - directory: "/vendor-bin/cs-fixer" - schedule: - interval: weekly - day: saturday - time: "03:00" - timezone: Europe/Paris - open-pull-requests-limit: 10 - - package-ecosystem: composer - directory: "/vendor-bin/openapi-extractor" - schedule: - interval: weekly - day: saturday - time: "03:00" - timezone: Europe/Paris - open-pull-requests-limit: 10 - - package-ecosystem: composer - directory: "/vendor-bin/phpunit" - schedule: - interval: weekly - day: saturday - time: "03:00" - timezone: Europe/Paris - open-pull-requests-limit: 10 - - package-ecosystem: composer - directory: "/vendor-bin/psalm" - schedule: - interval: weekly - day: saturday - time: "03:00" - timezone: Europe/Paris - open-pull-requests-limit: 10 - - package-ecosystem: npm - directory: "/" - schedule: - interval: weekly - day: saturday - time: "03:00" - timezone: Europe/Paris - open-pull-requests-limit: 10 diff --git a/.github/workflows/block-unconventional-commits.yml b/.github/workflows/block-unconventional-commits.yml deleted file mode 100644 index 295c30b..0000000 --- a/.github/workflows/block-unconventional-commits.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Block unconventional commits - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: block-unconventional-commits-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - block-unconventional-commits: - name: Block unconventional commits - - runs-on: ubuntu-latest-low - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml deleted file mode 100644 index 98d4992..0000000 --- a/.github/workflows/fixup.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Block fixup and squash commits - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: fixup-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - commit-message-check: - if: github.event.pull_request.draft == false - - permissions: - pull-requests: write - name: Block fixup and squash commits - - runs-on: ubuntu-latest-low - - steps: - - name: Run check - uses: skjnldsv/block-fixup-merge-action@42d26e1b536ce61e5cf467d65fb76caf4aa85acf # v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml deleted file mode 100644 index d0a8a2f..0000000 --- a/.github/workflows/lint-eslint.yml +++ /dev/null @@ -1,95 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -# -# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks - -name: Lint eslint - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-eslint-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'src/**' - - 'appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '.eslintrc.*' - - '.eslintignore' - - '**.js' - - '**.ts' - - '**.vue' - - lint: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - name: NPM lint - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install dependencies - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: npm ci - - - name: Lint - run: npm run lint - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, lint] - - if: always() - - # This is the summary, we just avoid to rename it so that branch protection rules still match - name: eslint - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml deleted file mode 100644 index 492e8a0..0000000 --- a/.github/workflows/lint-info-xml.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Lint info.xml - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-info-xml-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - xml-linters: - runs-on: ubuntu-latest-low - - name: info.xml lint - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Download schema - run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd - - - name: Lint info.xml - uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 - with: - xml-file: ./appinfo/info.xml - xml-schema-file: ./info.xsd diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml deleted file mode 100644 index 1ffee78..0000000 --- a/.github/workflows/lint-php-cs.yml +++ /dev/null @@ -1,45 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Lint php-cs - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-php-cs-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - - name: php-cs - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - - name: Set up php${{ steps.versions.outputs.php-available }} - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2 - with: - php-version: ${{ steps.versions.outputs.php-available }} - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: composer i - - - name: Lint - run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml deleted file mode 100644 index c37ab3f..0000000 --- a/.github/workflows/lint-php.yml +++ /dev/null @@ -1,67 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Lint php - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-php-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-versions: ${{ steps.versions.outputs.php-versions }} - steps: - - name: Checkout app - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0 - - php-lint: - runs-on: ubuntu-latest - needs: matrix - strategy: - matrix: - php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}} - - name: php-lint - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Lint - run: composer run lint - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: php-lint - - if: always() - - name: php-lint-summary - - steps: - - name: Summary status - run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml deleted file mode 100644 index 4effd42..0000000 --- a/.github/workflows/lint-stylelint.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Lint stylelint - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-stylelint-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - - name: stylelint - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install dependencies - env: - CYPRESS_INSTALL_BINARY: 0 - run: npm ci - - - name: Lint - run: npm run stylelint diff --git a/.github/workflows/npm-audit-fix.yml b/.github/workflows/npm-audit-fix.yml deleted file mode 100644 index 0fa447f..0000000 --- a/.github/workflows/npm-audit-fix.yml +++ /dev/null @@ -1,73 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Npm audit fix and compile - -on: - workflow_dispatch: - schedule: - # At 2:30 on Sundays - - cron: '30 2 * * 0' - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - branches: ['main', 'master', 'stable29', 'stable28', 'stable27'] - - name: npm-audit-fix-${{ matrix.branches }} - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ matrix.branches }} - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Fix npm audit - run: | - npm audit fix - - - name: Run npm ci and npm run build - if: always() - env: - CYPRESS_INSTALL_BINARY: 0 - run: | - npm ci - npm run build --if-present - - - name: Create Pull Request - if: always() - uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v6.0.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: "fix(deps): fix npm audit" - committer: GitHub - author: nextcloud-command - signoff: true - branch: automated/noid/${{ matrix.branches }}-fix-npm-audit - title: "[${{ matrix.branches }}] Fix npm audit" - body: | - Auto-generated fix of npm audit - labels: | - dependencies - 3. to review diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml deleted file mode 100644 index b0c3ce2..0000000 --- a/.github/workflows/openapi.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: OpenAPI - -on: pull_request - -permissions: - contents: read - -concurrency: - group: openapi-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - openapi: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Get php version - id: php_versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - - name: Set up php - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2 - with: - php-version: ${{ steps.php_versions.outputs.php-available }} - extensions: xml - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check Typescript OpenApi types - id: check_typescript_openapi - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "src/types/openapi/openapi*.ts" - - - name: Read package.json node and npm engines version - if: steps.check_typescript_openapi.outputs.files_exists == 'true' - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 - id: node_versions - # Continue if no package.json - continue-on-error: true - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version: ${{ steps.node_versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - run: npm i -g npm@"${{ steps.node_versions.outputs.npmVersion }}" - - - name: Install dependencies & build - if: ${{ steps.node_versions.outputs.nodeVersion }} - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: | - npm ci - - - name: Set up dependencies - run: composer i - - - name: Regenerate OpenAPI - run: composer run openapi - - - name: Check openapi*.json and typescript changes - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and (if applicable) src/types/openapi/openapi*.ts, see the section \"Show changes on failure\" for details' && exit 1)" - - - name: Show changes on failure - if: failure() - run: | - git status - git --no-pager diff - exit 1 # make it red to grab attention diff --git a/.github/workflows/psalm-matrix.yml b/.github/workflows/psalm-matrix.yml deleted file mode 100644 index 8e3d42f..0000000 --- a/.github/workflows/psalm-matrix.yml +++ /dev/null @@ -1,68 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Static analysis - -on: pull_request - -concurrency: - group: psalm-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }} - steps: - - name: Checkout app - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - static-analysis: - runs-on: ubuntu-latest - needs: matrix - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }} - - name: static-psalm-analysis ${{ matrix.ocp-version }} - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Set up php${{ matrix.php-versions }} - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: composer i - - - name: Install dependencies - run: composer require --dev nextcloud/ocp:${{ matrix.ocp-version }} --ignore-platform-reqs --with-dependencies - - - name: Run coding standards check - run: composer run psalm - - summary: - runs-on: ubuntu-latest-low - needs: static-analysis - - if: always() - - name: static-psalm-analysis-summary - - steps: - - name: Summary status - run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/update-nextcloud-ocp-approve-merge.yml b/.github/workflows/update-nextcloud-ocp-approve-merge.yml deleted file mode 100644 index 9d24f73..0000000 --- a/.github/workflows/update-nextcloud-ocp-approve-merge.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Auto approve nextcloud/ocp - -on: - pull_request_target: - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: update-nextcloud-ocp-approve-merge-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - auto-approve-merge: - if: github.actor == 'nextcloud-command' - runs-on: ubuntu-latest-low - permissions: - # for hmarr/auto-approve-action to approve PRs - pull-requests: write - # for alexwilson/enable-github-automerge-action to approve PRs - contents: write - - steps: - - uses: mdecoleman/pr-branch-name@bab4c71506bcd299fb350af63bb8e53f2940a599 # v2.0.0 - id: branchname - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - # GitHub actions bot approve - - uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2 - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Enable GitHub auto merge - - name: Auto merge - uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # main - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-nextcloud-ocp-matrix.yml b/.github/workflows/update-nextcloud-ocp-matrix.yml deleted file mode 100644 index e1fa4d9..0000000 --- a/.github/workflows/update-nextcloud-ocp-matrix.yml +++ /dev/null @@ -1,94 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Update nextcloud/ocp - -on: - workflow_dispatch: - schedule: - - cron: '5 2 * * 0' - -jobs: - update-nextcloud-ocp: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - branches: ['main'] - target: ['stable29'] - - name: update-nextcloud-ocp-${{ matrix.branches }} - - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ matrix.branches }} - submodules: true - - - name: Set up php8.2 - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2 - with: - php-version: 8.2 - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Read codeowners - id: codeowners - run: | - grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT - continue-on-error: true - - - name: Composer install - run: composer install - - - name: Composer update nextcloud/ocp - id: update_branch - run: composer require --dev nextcloud/ocp:dev-${{ matrix.target }} - - - name: Raise on issue on failure - uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 - if: ${{ failure() && steps.update_branch.conclusion == 'failure' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: Failed to update nextcloud/ocp package} - 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 }} - - - name: Reset checkout 3rdparty - run: | - git clean -f 3rdparty - git checkout 3rdparty - continue-on-error: true - - - name: Reset checkout vendor - run: | - git clean -f vendor - git checkout vendor - continue-on-error: true - - - name: Reset checkout vendor-bin - run: | - git clean -f vendor-bin - git checkout vendor-bin - continue-on-error: true - - - name: Create Pull Request - uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v6.0.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: "chore(dev-deps): Bump nextcloud/ocp package" - committer: GitHub - author: nextcloud-command - signoff: true - branch: automated/noid/${{ matrix.branches }}-update-nextcloud-ocp - title: "[${{ matrix.branches }}] Update nextcloud/ocp dependency" - body: | - Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency - labels: | - dependencies - 3. to review diff --git a/appinfo/info.xml b/appinfo/info.xml index a2a7fe5..1be8da3 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -14,4 +14,13 @@ + + + webtransfer + Web Transfer + webtransfer.page.index + app.svg + link + + diff --git a/appinfo/routes.php b/appinfo/routes.php index 222ad94..fc9e23a 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -2,7 +2,6 @@ return [ 'routes' => [ ['name' => 'page#main', 'url' => '/', 'verb' => 'GET'], - ['name' => 'page#zipDrop', 'url' => '/zipDrop', 'verb' => 'GET'], - ['name' => 'page#getZipFile', 'url' => '/getZipFile', 'verb' => 'GET'] + ['name' => 'page#post', 'url' => '/post', 'verb' => 'POST'], ] ]; diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index bb1e9fb..7fe7930 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -33,97 +33,15 @@ class PageController extends Controller { #[NoCSRFRequired] #[NoAdminRequired] - #[OpenAPI(OpenAPI::SCOPE_IGNORE)] - #[FrontpageRoute(verb: 'GET', url: '/zipDrop')] - public function zipDrop() { - // Récupérer le paramètre subUrl (compatible GET et POST) - $subUrl = $this->request->getParam('subUrl'); - - if (!$subUrl) { - return new \OCP\AppFramework\Http\DataResponse([ - 'error' => 'Le paramètre subUrl est manquant' - ], 400); - } - - // Optionnel : Validation de l'URL - if (filter_var($subUrl, FILTER_VALIDATE_URL) === false) { - return new \OCP\AppFramework\Http\DataResponse([ - 'error' => 'subUrl n\'est pas une URL valide' - ], 400); - } - - $parameters = array('archiveUrl' => $subUrl); - - // Réponse de succès + #[FrontpageRoute(verb: 'POST', url: '/zipDeposit')] + public function post($archiveUrl, $token) { + $request = $this->request; + $parameters = array('archiveUrl' => $archiveUrl, 'token' => $token); + return new TemplateResponse( Application::APP_ID, 'index', $parameters ); } - - #[NoCSRFRequired] - #[NoAdminRequired] - #[OpenAPI(OpenAPI::SCOPE_IGNORE)] - #[FrontpageRoute(verb: 'GET', url: '/getZipFile')] - public function getZipFile() { - // Récupérer les données envoyées dans la requête - $zipUrl = $this->request->getParam('subUrl'); - - // Initialiser les paramètres de réponse - $parameters = [ - 'status' => 'error', // Par défaut, la réponse indique une erreur - 'message' => '', - 'data' => null - ]; - - // Valider l'URL - if (!$zipUrl || filter_var($zipUrl, FILTER_VALIDATE_URL) === false) { - $parameters['message'] = 'Invalid URL'; - return new JsonResponse($parameters, 400); // 400 Bad Request - } - - try { - // Initialiser cURL - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $zipUrl); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Timeout de 10 secondes - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Suivre les redirections - - // Récupérer le contenu - $response = curl_exec($ch); - - // Gérer les erreurs cURL - if (curl_errno($ch)) { - $parameters['message'] = 'cURL error: ' . curl_error($ch); - curl_close($ch); - return new JsonResponse(['parameters' => $parameters, 'status' => 500]); // 500 Internal Server Error - } - - // Vérifier le code HTTP - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($httpCode !== 200) { - $parameters['message'] = "HTTP error: $httpCode"; - return new JsonResponse(['parameters' => $parameters, 'status' => $httpCode]); - } - - // Encodage explicite en UTF-8 si nécessaire - if (!mb_detect_encoding($response, 'UTF-8', true)) { - $response = utf8_encode($response); - } - - // Si tout est OK, construire la réponse - $parameters['status'] = 'success'; - $parameters['message'] = 'File retrieved successfully'; - $parameters['data'] = $response; // Encodage Base64 pour éviter les problèmes d'encodage JSON - - return new JsonResponse(['parameters' => $parameters, 'status' => 200]); // 200 OK - } catch (\Exception $e) { - $parameters['message'] = 'Exception: ' . $e->getMessage(); - return new JsonResponse(['parameters' => $parameters, 'status' => 500]); // 500 Internal Server Error - } - } -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 7696e87..80fe678 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,6 @@ "@nextcloud/files": "^3.10.0", "@nextcloud/initial-state": "^2.2.0", "@nextcloud/vue": "^8.20.0", - "file-type": "^19.6.0", - "i18next": "^24.0.2", "jszip": "^3.10.1", "vue": "^2.7.16", "vue-material-design-icons": "^5.3.1" @@ -1820,12 +1818,6 @@ "license": "MIT", "peer": true }, - "node_modules/@sec-ant/readable-stream": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", - "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", - "license": "MIT" - }, "node_modules/@shikijs/core": { "version": "1.23.1", "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.23.1.tgz", @@ -1889,12 +1881,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@tokenizer/token": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", - "license": "MIT" - }, "node_modules/@types/body-parser": { "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", @@ -6725,24 +6711,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/file-type": { - "version": "19.6.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-19.6.0.tgz", - "integrity": "sha512-VZR5I7k5wkD0HgFnMsq5hOsSc710MJMu5Nc5QYsbe38NN5iPV/XTObYLc/cpttRTf6lX538+5uO1ZQRhYibiZQ==", - "license": "MIT", - "dependencies": { - "get-stream": "^9.0.1", - "strtok3": "^9.0.1", - "token-types": "^6.0.0", - "uint8array-extras": "^1.3.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sindresorhus/file-type?sponsor=1" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -7095,22 +7063,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", - "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", - "license": "MIT", - "dependencies": { - "@sec-ant/readable-stream": "^0.4.1", - "is-stream": "^4.0.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -7830,37 +7782,6 @@ "node": ">=10.18" } }, - "node_modules/i18next": { - "version": "24.0.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-24.0.2.tgz", - "integrity": "sha512-D88xyIGcWAKwBTAs4RSqASi8NXR/NhCVSTM4LDbdoU8qb/5dcEZjNCLDhtQBB7Epw/Cp1w2vH/3ujoTbqLSs5g==", - "funding": [ - { - "type": "individual", - "url": "https://locize.com" - }, - { - "type": "individual", - "url": "https://locize.com/i18next.html" - }, - { - "type": "individual", - "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" - } - ], - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.23.2" - }, - "peerDependencies": { - "typescript": "^5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/ical.js": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", @@ -7899,6 +7820,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, "funding": [ { "type": "github", @@ -7913,7 +7835,8 @@ "url": "https://feross.org/support" } ], - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/ignore": { "version": "5.3.2", @@ -8600,18 +8523,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", - "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -11100,19 +11011,6 @@ "node": ">=0.12" } }, - "node_modules/peek-readable": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.3.1.tgz", - "integrity": "sha512-GVlENSDW6KHaXcd9zkZltB7tCLosKB/4Hg0fqBJkAoBgYG2Tn1xtMgXtSUuMU9AK/gCm/tTdT8mgAeF4YNeeqw==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -13588,23 +13486,6 @@ "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", "license": "MIT" }, - "node_modules/strtok3": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-9.1.1.tgz", - "integrity": "sha512-FhwotcEqjr241ZbjFzjlIYg6c5/L/s4yBGWSMvJ9UoExiSqL+FnFA/CaeZx17WGaZMS/4SOZp8wH18jSS4R4lw==", - "license": "MIT", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.3.1" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, "node_modules/style-loader": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", @@ -14332,23 +14213,6 @@ "node": ">=0.6" } }, - "node_modules/token-types": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.0.tgz", - "integrity": "sha512-lbDrTLVsHhOMljPscd0yitpozq7Ga2M5Cvez5AjGg8GASBjtt6iERCAJ93yommPmz62fb45oFIXHEZ3u9bfJEA==", - "license": "MIT", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, "node_modules/tree-dump": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz", @@ -14691,18 +14555,6 @@ "license": "MIT", "peer": true }, - "node_modules/uint8array-extras": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.4.0.tgz", - "integrity": "sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", diff --git a/package.json b/package.json index 2a0e26c..21e0260 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,7 @@ "dev": "NODE_ENV=development webpack --config webpack.js --progress", "watch": "NODE_ENV=development webpack --config webpack.js --progress --watch", "lint": "eslint src", - "stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css", - "tailwind": "npx tailwindcss -i ./src/input.css -o ./src/output.css", - "buildAll": "npm i && npm run tailwind && npm run build" + "stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css" }, "browserslist": [ "extends @nextcloud/browserslist-config" @@ -23,8 +21,6 @@ "@nextcloud/files": "^3.10.0", "@nextcloud/initial-state": "^2.2.0", "@nextcloud/vue": "^8.20.0", - "file-type": "^19.6.0", - "i18next": "^24.0.2", "jszip": "^3.10.1", "vue": "^2.7.16", "vue-material-design-icons": "^5.3.1" diff --git a/src/App.vue b/src/App.vue index 85519f5..a647972 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,16 +1,16 @@