From c9aba16783ff2214891f6ba6fcc352908aa1c64a Mon Sep 17 00:00:00 2001 From: Kai Henseler Date: Wed, 24 Jul 2024 14:10:22 +0200 Subject: [PATCH 01/81] IONOS(theme): add theme & header as submodule Signed-off-by: Kai Henseler --- .gitmodules | 21 +++++++++++++++++++++ themes/nc-ionos-theme | 1 + 2 files changed, 22 insertions(+) create mode 160000 themes/nc-ionos-theme diff --git a/.gitmodules b/.gitmodules index 61195b5d6fd81..a221c0a74c7de 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,24 @@ [submodule "3rdparty"] path = 3rdparty url = https://github.com/nextcloud/3rdparty.git +[submodule "IONOS"] + path = IONOS + url = git@github.com:IONOS-Productivity/easystorage-config.git +[submodule "apps-external/extract"] + path = apps-external/extract + url = https://github.com/PaulLereverend/NextcloudExtract +[submodule "apps-external/viewer"] + path = apps-external/viewer + url = https://github.com/nextcloud/viewer.git +[submodule "apps-custom/simplesettings"] + path = apps-custom/simplesettings + url = git@github.com:IONOS-Productivity/nc-simplesettings.git +[submodule "apps-external/user_oidc"] + path = apps-external/user_oidc + url = https://github.com/nextcloud/user_oidc.git +[submodule "apps-custom/googleanalytics"] + path = apps-custom/googleanalytics + url = git@github.com:IONOS-Productivity/nc-googleanalytics.git +[submodule "themes/nc-ionos-theme"] + path = themes/nc-ionos-theme + url = git@github.com:IONOS-Productivity/nc-ionos-theme.git diff --git a/themes/nc-ionos-theme b/themes/nc-ionos-theme new file mode 160000 index 0000000000000..09f0c1bcdc2ce --- /dev/null +++ b/themes/nc-ionos-theme @@ -0,0 +1 @@ +Subproject commit 09f0c1bcdc2ce9182e42cb29aafb6812ec6ad5e1 From 0bfd8f0a8b264ccbd21d5ed0e3f668db38ffe552 Mon Sep 17 00:00:00 2001 From: Kai Henseler Date: Wed, 24 Jul 2024 15:40:15 +0200 Subject: [PATCH 02/81] IONOS(ci/build): switch to checkout v4 Signed-off-by: Kai Henseler --- .github/workflows/easycloud-build.yml | 171 ++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 .github/workflows/easycloud-build.yml diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml new file mode 100644 index 0000000000000..f6b93c02a6232 --- /dev/null +++ b/.github/workflows/easycloud-build.yml @@ -0,0 +1,171 @@ +name: EasyCloud Build + +# The EasyCloud source is packaged as a container image. +# This is a workaround because releases can not be created without tags +# and we want to be able to create snapshots from branches. + +on: + pull_request: + paths: + - '.github/workflows/**' + - 'src/**' + - 'apps/**/appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.js' + - '**.ts' + - '**.vue' + push: + branches: + - main + - master + - stable* + - ionos-dev + +env: + TARGET_PACKAGE_NAME: easy-storage.zip + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +permissions: + contents: read + +jobs: + easycloud-build: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + name: easycloud-build + steps: + - name: Checkout server + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + with: + submodules: true + + - name: Set up node with version from package.json's engines + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version-file: "package.json" + + - name: Install dependencies & build simplesettings app + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + cd apps-custom/simplesettings + npm ci + npm run build + cd ../.. + + - name: Install dependencies & build user_oidc app + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + cd apps-external/user_oidc + composer install --no-dev -o + npm ci + npm run build + cd ../.. + + - name: Add config partials + run: | + cp IONOS/configs/*.config.php config/ + + - name: Zip dependencies + run: | + buildDate=$(date +%s) + buildRef=${{ github.sha }} + jq -n --arg buildDate "$buildDate" --arg buildRef "$buildRef" '{buildDate: $buildDate, buildRef: $buildRef}' > version.json + + echo "version.json created" + jq . version.json + + echo "zip relevant files to ${{ env.TARGET_PACKAGE_NAME }}" + zip -r "${{ env.TARGET_PACKAGE_NAME }}" \ + IONOS/ \ + 3rdparty/ \ + apps/ \ + apps-custom/ \ + apps-external/ \ + config/ \ + core/ \ + dist/ \ + lib/ \ + ocs/ \ + ocs-provider/ \ + resources/ \ + themes/ \ + AUTHORS \ + composer.json \ + composer.lock \ + console.php \ + COPYING \ + cron.php \ + index.html \ + index.php \ + occ \ + package.json \ + package-lock.json \ + public.php \ + remote.php \ + robots.txt \ + status.php \ + version.php \ + version.json \ + -x "apps/theming/img/background/**" \ + -x "apps/*/tests/**" \ + -x "apps-*/*/.git" \ + -x "apps-*/*/.github" \ + -x "apps-*/*/src**" \ + -x "apps-*/*/node_modules**" \ + -x "apps-*/*/tests**" \ + -x "**/cypress/**" \ + -x "*.git*" \ + -x "*.editorconfig*" + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" + + - name: Create Dockerfile + run: | + cat >Dockerfile << EOF + FROM busybox as builder + COPY ./${{ env.TARGET_PACKAGE_NAME }} / + WORKDIR /builder + RUN unzip /${{ env.TARGET_PACKAGE_NAME }} -d /builder + + FROM scratch + WORKDIR /app + VOLUME /app + COPY --from=builder /builder /app + EOF + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention From ff965a1cb94afbf765bf002ff3f9f68a174efc6d Mon Sep 17 00:00:00 2001 From: Kai Henseler Date: Wed, 24 Jul 2024 15:55:56 +0200 Subject: [PATCH 03/81] IONOS(ci/build): adds build step for ionos theme elements Signed-off-by: Kai Henseler --- .github/workflows/easycloud-build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index f6b93c02a6232..d455f8d64e1cb 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -72,6 +72,16 @@ jobs: npm run build cd ../.. + - name: Install dependencies & build IONOS theme custom elements + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + cd themes/nc-ionos-theme/IONOS + npm ci + npm run build + cd ../.. + - name: Add config partials run: | cp IONOS/configs/*.config.php config/ @@ -126,7 +136,9 @@ jobs: -x "apps-*/*/tests**" \ -x "**/cypress/**" \ -x "*.git*" \ - -x "*.editorconfig*" + -x "*.editorconfig*" \ + -x "themes/nc-ionos-theme/README.md" \ + -x "themes/nc-ionos-theme/IONOS**" - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 From f42d13d4fc24b154c3244d16a4b0d13fdc0aac49 Mon Sep 17 00:00:00 2001 From: Kai Henseler Date: Thu, 1 Aug 2024 14:28:45 +0200 Subject: [PATCH 04/81] IONOS(ci): build via makefile Signed-off-by: Kai Henseler --- .github/workflows/easycloud-build.yml | 75 ++------------------------- 1 file changed, 5 insertions(+), 70 deletions(-) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index d455f8d64e1cb..b6c5381c3278a 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -55,90 +55,25 @@ jobs: env: CYPRESS_INSTALL_BINARY: 0 PUPPETEER_SKIP_DOWNLOAD: true - run: | - cd apps-custom/simplesettings - npm ci - npm run build - cd ../.. + run: make -f IONOS/Makefile build_dep_simplesettings_app - name: Install dependencies & build user_oidc app env: CYPRESS_INSTALL_BINARY: 0 PUPPETEER_SKIP_DOWNLOAD: true - run: | - cd apps-external/user_oidc - composer install --no-dev -o - npm ci - npm run build - cd ../.. + run: make -f IONOS/Makefile build_dep_user_oidc_app - name: Install dependencies & build IONOS theme custom elements env: CYPRESS_INSTALL_BINARY: 0 PUPPETEER_SKIP_DOWNLOAD: true - run: | - cd themes/nc-ionos-theme/IONOS - npm ci - npm run build - cd ../.. + run: make -f IONOS/Makefile build_dep_ionos_theme - name: Add config partials - run: | - cp IONOS/configs/*.config.php config/ + run: make -f IONOS/Makefile add_config_partials - name: Zip dependencies - run: | - buildDate=$(date +%s) - buildRef=${{ github.sha }} - jq -n --arg buildDate "$buildDate" --arg buildRef "$buildRef" '{buildDate: $buildDate, buildRef: $buildRef}' > version.json - - echo "version.json created" - jq . version.json - - echo "zip relevant files to ${{ env.TARGET_PACKAGE_NAME }}" - zip -r "${{ env.TARGET_PACKAGE_NAME }}" \ - IONOS/ \ - 3rdparty/ \ - apps/ \ - apps-custom/ \ - apps-external/ \ - config/ \ - core/ \ - dist/ \ - lib/ \ - ocs/ \ - ocs-provider/ \ - resources/ \ - themes/ \ - AUTHORS \ - composer.json \ - composer.lock \ - console.php \ - COPYING \ - cron.php \ - index.html \ - index.php \ - occ \ - package.json \ - package-lock.json \ - public.php \ - remote.php \ - robots.txt \ - status.php \ - version.php \ - version.json \ - -x "apps/theming/img/background/**" \ - -x "apps/*/tests/**" \ - -x "apps-*/*/.git" \ - -x "apps-*/*/.github" \ - -x "apps-*/*/src**" \ - -x "apps-*/*/node_modules**" \ - -x "apps-*/*/tests**" \ - -x "**/cypress/**" \ - -x "*.git*" \ - -x "*.editorconfig*" \ - -x "themes/nc-ionos-theme/README.md" \ - -x "themes/nc-ionos-theme/IONOS**" + run: make -f IONOS/Makefile zip_dependencies TARGET_PACKAGE_NAME=${{ env.TARGET_PACKAGE_NAME }} - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 From 450c25a4510f1181b4b98ff6fd448d2cfcbf2687 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 26 Aug 2024 11:28:40 +0200 Subject: [PATCH 05/81] IONOS(config): switch submodule (viewer) to ionos nc-viewer Signed-off-by: Misha M.-Kupriyanov --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index a221c0a74c7de..7024902482507 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = https://github.com/PaulLereverend/NextcloudExtract [submodule "apps-external/viewer"] path = apps-external/viewer - url = https://github.com/nextcloud/viewer.git + url = git@github.com:IONOS-Productivity/nc-viewer.git [submodule "apps-custom/simplesettings"] path = apps-custom/simplesettings url = git@github.com:IONOS-Productivity/nc-simplesettings.git From 4033e646a9b28ecc5809411e490f37fb69650103 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 3 Sep 2024 17:31:52 +0200 Subject: [PATCH 06/81] IONOS(ci/build): adds build step to build custom viewer app Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/easycloud-build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index b6c5381c3278a..618d54732bca4 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -57,6 +57,12 @@ jobs: PUPPETEER_SKIP_DOWNLOAD: true run: make -f IONOS/Makefile build_dep_simplesettings_app + - name: Install dependencies & build viewer app + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: make -f IONOS/Makefile build_dep_viewer_app + - name: Install dependencies & build user_oidc app env: CYPRESS_INSTALL_BINARY: 0 From 74211616f6331118e7db28434307c3cb6c0998d3 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 16 Sep 2024 14:38:19 +0200 Subject: [PATCH 07/81] IONOS(theming): add nc-theming as submodule Signed-off-by: Misha M.-Kupriyanov --- .gitmodules | 3 +++ apps-custom/nc_theming | 1 + 2 files changed, 4 insertions(+) create mode 160000 apps-custom/nc_theming diff --git a/.gitmodules b/.gitmodules index 7024902482507..75fac27ab01d2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "themes/nc-ionos-theme"] path = themes/nc-ionos-theme url = git@github.com:IONOS-Productivity/nc-ionos-theme.git +[submodule "apps-custom/nc_theming"] + path = apps-custom/nc_theming + url = git@github.com:IONOS-Productivity/nc-theming.git diff --git a/apps-custom/nc_theming b/apps-custom/nc_theming new file mode 160000 index 0000000000000..15853ff3dbcbd --- /dev/null +++ b/apps-custom/nc_theming @@ -0,0 +1 @@ +Subproject commit 15853ff3dbcbd3e5f6d9455005e5097dd955953c From 294ee6cc210f29ffceda3d2dc49084c7b5ca4609 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 19 Sep 2024 12:01:11 +0200 Subject: [PATCH 08/81] IONOS(ci-build): build easycloud on apps-custom changes in order to be able to evaluate PR artifacts Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/easycloud-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index 618d54732bca4..aa4cc6d0b07ac 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -10,6 +10,7 @@ on: - '.github/workflows/**' - 'src/**' - 'apps/**/appinfo/info.xml' + - 'apps-custom/**' - 'package.json' - 'package-lock.json' - 'tsconfig.json' From fd851e76e13452aab288bda610676cc4cf873b83 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 10 Sep 2024 13:07:43 +0200 Subject: [PATCH 09/81] IONOS(nc-vue-icons): add nc-vue-material-design-icons as submodule Signed-off-by: Misha M.-Kupriyanov --- .gitmodules | 3 +++ custom-npms/nc-vue-material-design-icons | 1 + package.json | 8 +++++--- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 160000 custom-npms/nc-vue-material-design-icons diff --git a/.gitmodules b/.gitmodules index 75fac27ab01d2..b7f09d0d5f9ae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,3 +28,6 @@ [submodule "apps-custom/nc_theming"] path = apps-custom/nc_theming url = git@github.com:IONOS-Productivity/nc-theming.git +[submodule "custom-npms/nc-vue-material-design-icons"] + path = custom-npms/nc-vue-material-design-icons + url = git@github.com:IONOS-Productivity/nc-vue-material-design-icons.git diff --git a/custom-npms/nc-vue-material-design-icons b/custom-npms/nc-vue-material-design-icons new file mode 160000 index 0000000000000..952419c24338b --- /dev/null +++ b/custom-npms/nc-vue-material-design-icons @@ -0,0 +1 @@ +Subproject commit 952419c24338b1b41e4eacc53b15364fab59ff81 diff --git a/package.json b/package.json index 5d395139979c4..0798c069d7549 100644 --- a/package.json +++ b/package.json @@ -185,7 +185,8 @@ "webpack": "^5.104.1", "webpack-cli": "^6.0.1", "webpack-merge": "^6.0.1", - "workbox-webpack-plugin": "^7.4.0" + "workbox-webpack-plugin": "^7.4.0", + "vue-material-design-icons": "file:./custom-npms/nc-vue-material-design-icons/dist" }, "browserslist": [ "extends @nextcloud/browserslist-config" @@ -195,6 +196,7 @@ "npm": "^10.5.0" }, "overrides": { - "colors": "1.4.0" - } + "colors": "1.4.0", + "vue-material-design-icons" : "$vue-material-design-icons" + } } From 43f258d74ed70a9b00f838bc95d610eada27601b Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 10 Sep 2024 16:22:48 +0200 Subject: [PATCH 10/81] IONOS(nc-vue-icons): adjust folder-{open}-icon size font awesome folder icon is smaller then MDI icon Signed-off-by: Misha M.-Kupriyanov Co-authored-by: Tatjana Kaschperko Lindt --- apps/files/src/components/FilesListVirtual.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index 5fc5d71cac87d..d085667551858 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -723,15 +723,11 @@ export default defineComponent({ width: var(--icon-preview-size); height: var(--icon-preview-size); } - - // Slightly increase the size of the folder icon + // Slightly decrease the size of the folder icon &.folder-icon, - &.folder-open-icon { - margin: -3px; - svg { - width: calc(var(--icon-preview-size) + 6px); - height: calc(var(--icon-preview-size) + 6px); - } + &.folder-open-icon svg { + width: calc(var(--icon-preview-size) - 6px); + height: calc(var(--icon-preview-size) - 6px); } } From 11de13a059b7790d642b4fe365b77320f86ba160 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 10 Sep 2024 17:18:30 +0200 Subject: [PATCH 11/81] IONOS(nc-vue-icons): add vue icons build step to github workflow Signed-off-by: Misha M.-Kupriyanov ci(make): add build_vue_icons_package job in order to be able to build with custom vue icons Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/easycloud-build.yml | 5 +++++ IONOS | 1 + 2 files changed, 6 insertions(+) create mode 160000 IONOS diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index aa4cc6d0b07ac..9a440287846ee 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -9,6 +9,8 @@ on: paths: - '.github/workflows/**' - 'src/**' + - 'custom-npms/**' + - 'apps/**' - 'apps/**/appinfo/info.xml' - 'apps-custom/**' - 'package.json' @@ -52,6 +54,9 @@ jobs: with: node-version-file: "package.json" + - name: Build Nextcloud + run: make -f IONOS/Makefile build_nextcloud FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} + - name: Install dependencies & build simplesettings app env: CYPRESS_INSTALL_BINARY: 0 diff --git a/IONOS b/IONOS new file mode 160000 index 0000000000000..e881b3c8443fd --- /dev/null +++ b/IONOS @@ -0,0 +1 @@ +Subproject commit e881b3c8443fdefba4e22f9cedd0158476ab5142 From ec91413d61c16da5601341f4f98265b9208d3500 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 2 Oct 2024 17:15:19 +0200 Subject: [PATCH 12/81] IONOS(ci-build): build easycloud for ionos-dev30 branch in order to be able to test build artifacts Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/easycloud-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index 9a440287846ee..7db0e6113d5f6 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -25,6 +25,7 @@ on: - master - stable* - ionos-dev + - ionos-dev30 env: TARGET_PACKAGE_NAME: easy-storage.zip From 8863fe24098b7907ce380fefd3005936dfc5b154 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 2 Oct 2024 17:19:58 +0200 Subject: [PATCH 13/81] IONOS(chore): add license headers Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/easycloud-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index 7db0e6113d5f6..2cef8aa5ef111 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -1,5 +1,9 @@ name: EasyCloud Build +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2024 STRATO AG +# SPDX-License-Identifier: AGPL-3.0-or-later + # The EasyCloud source is packaged as a container image. # This is a workaround because releases can not be created without tags # and we want to be able to create snapshots from branches. From d159d3f6dd8101d09c7a94fb6f902d9b59c3779c Mon Sep 17 00:00:00 2001 From: Kai Henseler Date: Fri, 27 Sep 2024 14:13:52 +0200 Subject: [PATCH 14/81] IONOS(ci): build custom css during build process Signed-off-by: Kai Henseler --- .github/workflows/easycloud-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index 2cef8aa5ef111..a7834dd5d04a3 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -80,6 +80,9 @@ jobs: PUPPETEER_SKIP_DOWNLOAD: true run: make -f IONOS/Makefile build_dep_user_oidc_app + - name: Build Custom CSS + run: make -f IONOS/Makefile build_dep_theming_app + - name: Install dependencies & build IONOS theme custom elements env: CYPRESS_INSTALL_BINARY: 0 From 3f6faf99734e43a661403e2d3968c36f91bebe29 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 9 Sep 2024 15:50:27 +0200 Subject: [PATCH 15/81] IONOS(search): reduce search providers via core config unified_search.providers_allowed reduce search providers by setting core config value to unified_search.providers_allowed = [ 'files', 'setting' ] ./occ config:app:set --value '["files","settings"]' --type array core unified_search.providers_allowed Signed-off-by: Misha M.-Kupriyanov --- lib/private/Search/SearchComposer.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/private/Search/SearchComposer.php b/lib/private/Search/SearchComposer.php index c017d1ec9a338..b28e32595a2be 100644 --- a/lib/private/Search/SearchComposer.php +++ b/lib/private/Search/SearchComposer.php @@ -211,7 +211,24 @@ function (array $providerData) use ($route, $routeParameters) { return $provider1['order'] <=> $provider2['order']; }); - return $providers; + return $this->reduceProviders($providers); + } + + /** + * reduce providers based on 'unified_search.providers_allowed' core app config array + * @param array $providers + * @return array + */ + private function reduceProviders(array $providers): array { + $allowedProviders = $this->appConfig->getValueArray('core', 'unified_search.providers_allowed'); + + if (empty($allowedProviders)) { + return $providers; + } + + return array_values(array_filter($providers, function ($p) use ($allowedProviders) { + return in_array($p['id'], $allowedProviders); + })); } /** From a1a8db456479b42d7ff3e8a96c32302c33dc0312 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 11 Sep 2024 15:58:43 +0200 Subject: [PATCH 16/81] IONOS(search): set person search to be disableable Signed-off-by: Misha M.-Kupriyanov --- core/src/components/UnifiedSearch/UnifiedSearchModal.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue index 15242316632ed..3fa0edcd16e7a 100644 --- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue +++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue @@ -67,6 +67,7 @@ Date: Tue, 22 Oct 2024 15:12:43 +0200 Subject: [PATCH 17/81] IONOS(search): disable person search component Signed-off-by: Misha M.-Kupriyanov --- core/src/components/UnifiedSearch/UnifiedSearchModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue index 3fa0edcd16e7a..c6259e2d209ee 100644 --- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue +++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue @@ -275,7 +275,7 @@ export default defineComponent({ */ peopleSearchEnabled: { type: Boolean, - default: true, + default: false, } }, From 0f3679652229cef5dd09eace8158c513f158c31d Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 11 Nov 2024 10:40:20 +0100 Subject: [PATCH 18/81] IONOS(ci): build themes on pull_request in order to be able to evaluate theme via pull request Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/easycloud-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/easycloud-build.yml index a7834dd5d04a3..fe7c07f7ce893 100644 --- a/.github/workflows/easycloud-build.yml +++ b/.github/workflows/easycloud-build.yml @@ -19,6 +19,7 @@ on: - 'apps-custom/**' - 'package.json' - 'package-lock.json' + - 'themes/**' - 'tsconfig.json' - '**.js' - '**.ts' From c5044823fb56bdb9d8c2407b3196fa7a11b6dbe8 Mon Sep 17 00:00:00 2001 From: Franziska Bath Date: Tue, 5 Nov 2024 10:42:27 +0100 Subject: [PATCH 19/81] IONOS(nc-mdi-svg): add nc-MaterialDesign-SVG as submodule Signed-off-by: Franziska Bath --- .gitmodules | 3 +++ custom-npms/nc-mdi-svg | 1 + package.json | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 160000 custom-npms/nc-mdi-svg diff --git a/.gitmodules b/.gitmodules index b7f09d0d5f9ae..0f5f5debe0628 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "custom-npms/nc-vue-material-design-icons"] path = custom-npms/nc-vue-material-design-icons url = git@github.com:IONOS-Productivity/nc-vue-material-design-icons.git +[submodule "custom-npms/nc-mdi-svg"] + path = custom-npms/nc-mdi-svg + url = git@github.com:IONOS-Productivity/nc-MaterialDesign-SVG.git diff --git a/custom-npms/nc-mdi-svg b/custom-npms/nc-mdi-svg new file mode 160000 index 0000000000000..f0b32e714a243 --- /dev/null +++ b/custom-npms/nc-mdi-svg @@ -0,0 +1 @@ +Subproject commit f0b32e714a243dfaf9b538dd576752b3354cd2e3 diff --git a/package.json b/package.json index 0798c069d7549..ddc8444a2b603 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,8 @@ "webpack-cli": "^6.0.1", "webpack-merge": "^6.0.1", "workbox-webpack-plugin": "^7.4.0", - "vue-material-design-icons": "file:./custom-npms/nc-vue-material-design-icons/dist" + "vue-material-design-icons": "file:./custom-npms/nc-vue-material-design-icons/dist", + "@mdi/svg": "file:./custom-npms/nc-mdi-svg" }, "browserslist": [ "extends @nextcloud/browserslist-config" @@ -197,6 +198,7 @@ }, "overrides": { "colors": "1.4.0", - "vue-material-design-icons" : "$vue-material-design-icons" + "vue-material-design-icons" : "$vue-material-design-icons", + "@mdi/svg" : "$@mdi/svg" } } From b24b1cc87824a2502688b1def7d194d94f16cae2 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 12 Nov 2024 15:04:17 +0100 Subject: [PATCH 20/81] IONOS(nc-mdi-svg): use custom nc-MaterialDesign-SVG dist Signed-off-by: Misha M.-Kupriyanov --- custom-npms/nc-mdi-svg | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-npms/nc-mdi-svg b/custom-npms/nc-mdi-svg index f0b32e714a243..74b7a2a79b264 160000 --- a/custom-npms/nc-mdi-svg +++ b/custom-npms/nc-mdi-svg @@ -1 +1 @@ -Subproject commit f0b32e714a243dfaf9b538dd576752b3354cd2e3 +Subproject commit 74b7a2a79b2645019dc80a1d3a3f233e04ae728c diff --git a/package.json b/package.json index ddc8444a2b603..6cb6c54956cb5 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "webpack-merge": "^6.0.1", "workbox-webpack-plugin": "^7.4.0", "vue-material-design-icons": "file:./custom-npms/nc-vue-material-design-icons/dist", - "@mdi/svg": "file:./custom-npms/nc-mdi-svg" + "@mdi/svg": "file:./custom-npms/nc-mdi-svg/dist" }, "browserslist": [ "extends @nextcloud/browserslist-config" From 588789fa7b9b4ee66a61c29bd788ec0150630be6 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 11 Nov 2024 12:25:50 +0100 Subject: [PATCH 21/81] IONOS(nc-mdi-js): add nc-MaterialDesign-JS as submodule git submodule add git@github.com:IONOS-Productivity/nc-MaterialDesign-JS.git custom-npms/nc-mdi-js Signed-off-by: Misha M.-Kupriyanov --- .gitmodules | 3 +++ custom-npms/nc-mdi-js | 1 + 2 files changed, 4 insertions(+) create mode 160000 custom-npms/nc-mdi-js diff --git a/.gitmodules b/.gitmodules index 0f5f5debe0628..23e24f45fc0c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,6 @@ [submodule "custom-npms/nc-mdi-svg"] path = custom-npms/nc-mdi-svg url = git@github.com:IONOS-Productivity/nc-MaterialDesign-SVG.git +[submodule "custom-npms/nc-mdi-js"] + path = custom-npms/nc-mdi-js + url = git@github.com:IONOS-Productivity/nc-MaterialDesign-JS.git diff --git a/custom-npms/nc-mdi-js b/custom-npms/nc-mdi-js new file mode 160000 index 0000000000000..47d99c7b945bd --- /dev/null +++ b/custom-npms/nc-mdi-js @@ -0,0 +1 @@ +Subproject commit 47d99c7b945bd5c080d9bc9acb4d1c6bc38ef06c From 871062f43e8337e11e3143e90e049e465c6bccf9 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 11 Nov 2024 14:23:23 +0100 Subject: [PATCH 22/81] IONOS(build): switch to custom mdi icons Signed-off-by: Misha M.-Kupriyanov --- custom-npms/nc-mdi-js | 2 +- custom-npms/nc-mdi-svg | 2 +- custom-npms/nc-vue-material-design-icons | 2 +- package.json | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/custom-npms/nc-mdi-js b/custom-npms/nc-mdi-js index 47d99c7b945bd..8d88d020adff2 160000 --- a/custom-npms/nc-mdi-js +++ b/custom-npms/nc-mdi-js @@ -1 +1 @@ -Subproject commit 47d99c7b945bd5c080d9bc9acb4d1c6bc38ef06c +Subproject commit 8d88d020adff2215b7d87707b63fec6fd7215e9d diff --git a/custom-npms/nc-mdi-svg b/custom-npms/nc-mdi-svg index 74b7a2a79b264..38251205f7131 160000 --- a/custom-npms/nc-mdi-svg +++ b/custom-npms/nc-mdi-svg @@ -1 +1 @@ -Subproject commit 74b7a2a79b2645019dc80a1d3a3f233e04ae728c +Subproject commit 38251205f7131f7a311592c4f410895494191470 diff --git a/custom-npms/nc-vue-material-design-icons b/custom-npms/nc-vue-material-design-icons index 952419c24338b..e15f983a5f2d3 160000 --- a/custom-npms/nc-vue-material-design-icons +++ b/custom-npms/nc-vue-material-design-icons @@ -1 +1 @@ -Subproject commit 952419c24338b1b41e4eacc53b15364fab59ff81 +Subproject commit e15f983a5f2d3be6aa1fd94878b12101783f023c diff --git a/package.json b/package.json index 6cb6c54956cb5..770d7cb42b51f 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,8 @@ "webpack-merge": "^6.0.1", "workbox-webpack-plugin": "^7.4.0", "vue-material-design-icons": "file:./custom-npms/nc-vue-material-design-icons/dist", - "@mdi/svg": "file:./custom-npms/nc-mdi-svg/dist" + "@mdi/svg": "file:./custom-npms/nc-mdi-svg/dist", + "@mdi/js": "file:./custom-npms/nc-mdi-js" }, "browserslist": [ "extends @nextcloud/browserslist-config" @@ -199,6 +200,7 @@ "overrides": { "colors": "1.4.0", "vue-material-design-icons" : "$vue-material-design-icons", - "@mdi/svg" : "$@mdi/svg" + "@mdi/svg" : "$@mdi/svg", + "@mdi/js" : "$@mdi/js" } } From 03ed1da4faccb460a0f3cd9a9534271082370264 Mon Sep 17 00:00:00 2001 From: Franziska Bath Date: Fri, 22 Nov 2024 13:28:56 +0100 Subject: [PATCH 23/81] IONOS(nc-nextcloud-vue): add nc-nextcloud-vue as submodule Signed-off-by: Franziska Bath --- .gitmodules | 3 +++ custom-npms/nc-nextcloud-vue | 1 + 2 files changed, 4 insertions(+) create mode 160000 custom-npms/nc-nextcloud-vue diff --git a/.gitmodules b/.gitmodules index 23e24f45fc0c5..2890dbf501524 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,3 +37,6 @@ [submodule "custom-npms/nc-mdi-js"] path = custom-npms/nc-mdi-js url = git@github.com:IONOS-Productivity/nc-MaterialDesign-JS.git +[submodule "custom-npms/nc-nextcloud-vue"] + path = custom-npms/nc-nextcloud-vue + url = git@github.com:IONOS-Productivity/nc-nextcloud-vue.git diff --git a/custom-npms/nc-nextcloud-vue b/custom-npms/nc-nextcloud-vue new file mode 160000 index 0000000000000..1ecb2f83a947b --- /dev/null +++ b/custom-npms/nc-nextcloud-vue @@ -0,0 +1 @@ +Subproject commit 1ecb2f83a947b74a52c18a543792e95f9cfe91cf From 413d2220a0a922efd84499a9eee283aec714fddc Mon Sep 17 00:00:00 2001 From: Franziska Bath Date: Fri, 22 Nov 2024 14:05:50 +0100 Subject: [PATCH 24/81] IONOS(build): switch to custom nextcloud vue Signed-off-by: Franziska Bath --- custom-npms/nc-nextcloud-vue | 2 +- package.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/custom-npms/nc-nextcloud-vue b/custom-npms/nc-nextcloud-vue index 1ecb2f83a947b..a942093393dd6 160000 --- a/custom-npms/nc-nextcloud-vue +++ b/custom-npms/nc-nextcloud-vue @@ -1 +1 @@ -Subproject commit 1ecb2f83a947b74a52c18a543792e95f9cfe91cf +Subproject commit a942093393dd62cf92ddeb19ade9d202ed07faef diff --git a/package.json b/package.json index 770d7cb42b51f..39f9cca538137 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@nextcloud/router": "^3.1.0", "@nextcloud/sharing": "^0.3.0", "@nextcloud/upload": "^1.11.1", - "@nextcloud/vue": "^8.35.3", + "@nextcloud/vue": "file:./custom-npms/nc-nextcloud-vue", "@simplewebauthn/browser": "^13.2.2", "@vue/web-component-wrapper": "^1.3.0", "@vueuse/components": "^11.3.0", @@ -201,6 +201,7 @@ "colors": "1.4.0", "vue-material-design-icons" : "$vue-material-design-icons", "@mdi/svg" : "$@mdi/svg", - "@mdi/js" : "$@mdi/js" + "@mdi/js" : "$@mdi/js", + "@nextcloud/vue" : "$@nextcloud/vue" } } From 80c7ce596f1cdb26d707a3d50d6a723aef035ada Mon Sep 17 00:00:00 2001 From: Tatjana Kaschperko Lindt Date: Tue, 3 Dec 2024 12:26:43 +0100 Subject: [PATCH 25/81] IONOS(build): remove original "@mdi/js", "@mdi/svg", vue-material-design-icons" dependencies they are linked further to custom libraries. no need to installthem twice. Signed-off-by: Tatjana Kaschperko Lindt --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 39f9cca538137..c809d9a9e0205 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,6 @@ "license": "AGPL-3.0-or-later", "dependencies": { "@chenfengyuan/vue-qrcode": "^1.0.2", - "@mdi/js": "^7.4.47", - "@mdi/svg": "^7.4.47", "@nextcloud/auth": "^2.5.2", "@nextcloud/axios": "^2.5.2", "@nextcloud/browser-storage": "^0.5.0", @@ -109,7 +107,6 @@ "vue-frag": "^1.4.3", "vue-infinite-loading": "^2.4.5", "vue-localstorage": "^0.6.2", - "vue-material-design-icons": "^5.3.1", "vue-router": "^3.6.5", "vuedraggable": "^2.24.3", "vuex": "^3.6.2", From ce98577bfa98822118469706fe9f15949d3f44e3 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Fri, 22 Nov 2024 14:19:49 +0100 Subject: [PATCH 26/81] IONOS(ci): rename easycloud-build.yml to hidrive-next-build.yml in order to reflect product name Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/{easycloud-build.yml => hidrive-next-build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{easycloud-build.yml => hidrive-next-build.yml} (100%) diff --git a/.github/workflows/easycloud-build.yml b/.github/workflows/hidrive-next-build.yml similarity index 100% rename from .github/workflows/easycloud-build.yml rename to .github/workflows/hidrive-next-build.yml From b54946d523bbb9bc00713f670c8b578fb1563e85 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Fri, 22 Nov 2024 14:22:11 +0100 Subject: [PATCH 27/81] IONOS(ci): use HiDrive Next in hidrive-next-build.yml in order to reflect current product name Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index fe7c07f7ce893..a72ab8fab5efa 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -1,10 +1,10 @@ -name: EasyCloud Build +name: HiDrive Next Build # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors # SPDX-FileCopyrightText: 2024 STRATO AG # SPDX-License-Identifier: AGPL-3.0-or-later -# The EasyCloud source is packaged as a container image. +# The HiDrive Next source is packaged as a container image. # This is a workaround because releases can not be created without tags # and we want to be able to create snapshots from branches. @@ -33,7 +33,7 @@ on: - ionos-dev30 env: - TARGET_PACKAGE_NAME: easy-storage.zip + TARGET_PACKAGE_NAME: hidrive-next.zip REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -41,14 +41,14 @@ permissions: contents: read jobs: - easycloud-build: + hidrive-next-build: runs-on: ubuntu-latest permissions: contents: read packages: write - name: easycloud-build + name: hidrive-next-build steps: - name: Checkout server uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 From 8015c2370c5ed2052d7ca98ca6419eac7d331829 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 26 Nov 2024 12:26:30 +0100 Subject: [PATCH 28/81] IONOS(ci): split action to build and push to ghcr.io in order to be able to define different targets Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 31 ++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index a72ab8fab5efa..2335085c36a07 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -96,6 +96,35 @@ jobs: - name: Zip dependencies run: make -f IONOS/Makefile zip_dependencies TARGET_PACKAGE_NAME=${{ env.TARGET_PACKAGE_NAME }} + - name: Upload artifact result for job hidrive-next-build + uses: actions/upload-artifact@v4 + with: + name: hidrive_next_build_zip + path: ${{ env.TARGET_PACKAGE_NAME }} + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention + + hidirve-next-artifact-to-ghcr_io: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + name: Push artifact to ghcr.io + needs: hidrive-next-build + + steps: + - name: Download artifact zip + uses: actions/download-artifact@v4 + with: + name: hidrive_next_build_zip + - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: @@ -134,6 +163,4 @@ jobs: - name: Show changes on failure if: failure() run: | - git status - git --no-pager diff exit 1 # make it red to grab attention From 1598a96a70665202e05af5d6e60fc309641d4b26 Mon Sep 17 00:00:00 2001 From: Thomas Lehmann Date: Fri, 18 Oct 2024 16:24:59 +0200 Subject: [PATCH 29/81] IONOS(feat): add ionos_processes custom app Signed-off-by: Thomas Lehmann Co-authored-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 3 +++ .gitmodules | 3 +++ apps-custom/nc_ionos_processes | 1 + 3 files changed, 7 insertions(+) create mode 160000 apps-custom/nc_ionos_processes diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 2335085c36a07..1846f0a2de0e6 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -81,6 +81,9 @@ jobs: PUPPETEER_SKIP_DOWNLOAD: true run: make -f IONOS/Makefile build_dep_user_oidc_app + - name: Install dependencies for external apps nc_ionos_processes + run: make -f IONOS/Makefile build_dep_nc_ionos_processes_app + - name: Build Custom CSS run: make -f IONOS/Makefile build_dep_theming_app diff --git a/.gitmodules b/.gitmodules index 2890dbf501524..5c6d425488523 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,3 +40,6 @@ [submodule "custom-npms/nc-nextcloud-vue"] path = custom-npms/nc-nextcloud-vue url = git@github.com:IONOS-Productivity/nc-nextcloud-vue.git +[submodule "apps-custom/nc_ionos_processes"] + path = apps-custom/nc_ionos_processes + url = git@github.com:IONOS-Productivity/nc_ionos_processes.git diff --git a/apps-custom/nc_ionos_processes b/apps-custom/nc_ionos_processes new file mode 160000 index 0000000000000..2131797d290b2 --- /dev/null +++ b/apps-custom/nc_ionos_processes @@ -0,0 +1 @@ +Subproject commit 2131797d290b29af63ca5fa485b741f672db9b2a From debc1dff6e738500012c82094d60403c465d3e19 Mon Sep 17 00:00:00 2001 From: Mikhailo Matiyenko-Kupriyanov <145785698+printminion-co@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:36:09 +0000 Subject: [PATCH 30/81] IONOS(ci): use self-hosted runner Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 1846f0a2de0e6..83c83097ca63e 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -42,7 +42,7 @@ permissions: jobs: hidrive-next-build: - runs-on: ubuntu-latest + runs-on: self-hosted permissions: contents: read @@ -60,6 +60,23 @@ jobs: with: node-version-file: "package.json" + - name: Install Dependencies + run: sudo apt-get update && sudo apt-get install -y make zip unzip + + - name: Print dependencies versions + run: make --version && node --version && npm --version + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 #v2.31.1 + with: + tools: composer:v2 + extensions: gd, zip, curl, xml, xmlrpc, mbstring, sqlite, xdebug, pgsql, intl, imagick, gmp, apcu, bcmath, redis, soap, imap, opcache + env: + runner: self-hosted + + - name: Print PHP install + run: php -i && php -m + - name: Build Nextcloud run: make -f IONOS/Makefile build_nextcloud FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} From 070105d4457c46003e59069d65e40267edecfeee Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Fri, 10 Jan 2025 10:48:39 +0100 Subject: [PATCH 31/81] IONOS(serverinfo): add external app git submodule add git@github.com:nextcloud/serverinfo.git apps-external/serverinfo Signed-off-by: Misha M.-Kupriyanov --- .gitignore | 5 +++++ .gitmodules | 3 +++ apps-external/serverinfo | 1 + 3 files changed, 9 insertions(+) create mode 160000 apps-external/serverinfo diff --git a/.gitignore b/.gitignore index 83382dbdf2332..aafff162b588d 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,11 @@ /apps/files_external/3rdparty/irodsphp/prods/tutorials /apps/files_external/3rdparty/irodsphp/prods/test* /apps/files_external/tests/config.*.php +# IONOS: this should not be upsteamed! +!/apps-external/viewer +!/apps-external/user_oidc +!/apps-external/serverinfo +!/apps-custom/* # apps modules /apps/*/node_modules diff --git a/.gitmodules b/.gitmodules index 5c6d425488523..c58f281eec412 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,6 @@ [submodule "apps-custom/nc_ionos_processes"] path = apps-custom/nc_ionos_processes url = git@github.com:IONOS-Productivity/nc_ionos_processes.git +[submodule "apps-external/serverinfo"] + path = apps-external/serverinfo + url = git@github.com:nextcloud/serverinfo.git diff --git a/apps-external/serverinfo b/apps-external/serverinfo new file mode 160000 index 0000000000000..b0579de727c6a --- /dev/null +++ b/apps-external/serverinfo @@ -0,0 +1 @@ +Subproject commit b0579de727c6a1959f5f89a6b9caf4f86aa25659 From 7c1880d0bee6b7ba691d979706c04cf3b8457966 Mon Sep 17 00:00:00 2001 From: Tatjana Kaschperko Lindt Date: Tue, 14 Jan 2025 16:11:05 +0100 Subject: [PATCH 32/81] IONOS(chore): Remap icons for external-share to custom svg icons (legacy) Signed-off-by: Tatjana Kaschperko Lindt --- core/src/icons.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/core/src/icons.js b/core/src/icons.js index 5845b01fea14c..7f4accf104eea 100644 --- a/core/src/icons.js +++ b/core/src/icons.js @@ -128,6 +128,25 @@ const icons = { 'view-previous': path.join(__dirname, '../img', 'actions', 'arrow-left.svg'), } +const customIconPath = '../../custom-npms/nc-mdi-svg/dist/svg/' + +icons.add = path.join(__dirname, customIconPath, 'plus.svg') +icons.confirm = path.join(__dirname, customIconPath, 'arrow-right.svg') +icons.rename = path.join(__dirname, customIconPath, 'pencil.svg') +icons.external = path.join(__dirname, customIconPath, 'folder-move.svg') +icons.download = path.join(__dirname, customIconPath, 'download.svg') +icons.upload = path.join(__dirname, customIconPath, 'upload.svg') +icons.delete = path.join(__dirname, customIconPath, 'trash-can.svg') +icons.more = path.join(__dirname, customIconPath, 'dots-horizontal.svg') +icons.public = path.join(__dirname, customIconPath, 'link.svg') +icons.comment = path.join(__dirname, customIconPath, 'comment.svg') +icons.home = path.join(__dirname, customIconPath, 'home.svg') +icons['triangle-s'] = path.join(__dirname, customIconPath, 'chevron-down.svg') +icons['triangle-n'] = path.join(__dirname, customIconPath, 'chevron-up.svg') +icons['triangle-e'] = path.join(__dirname, customIconPath, 'chevron-right.svg') +icons['toggle-pictures'] = path.join(__dirname, customIconPath, 'view-grid.svg') +icons['toggle-filelist'] = path.join(__dirname, customIconPath, 'format-list-bulleted-square.svg') + const iconsColor = { 'add-folder-description': { path: path.join(__dirname, '../img', 'actions', 'add-folder-description.svg'), @@ -154,7 +173,7 @@ const iconsColor = { color: 'grey', }, 'delete-color': { - path: path.join(__dirname, '../img', 'actions', 'delete.svg'), + path: icons.delete, color: 'red', }, 'file': { From 1d846006bec683e87aaa0f9a2a6f13ac6655d39c Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 29 Jan 2025 11:23:42 +0100 Subject: [PATCH 33/81] IONOS(build): always build artifact on IONOS submodule change Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 83c83097ca63e..9edb106d50929 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -17,6 +17,7 @@ on: - 'apps/**' - 'apps/**/appinfo/info.xml' - 'apps-custom/**' + - 'IONOS' - 'package.json' - 'package-lock.json' - 'themes/**' From e579e60e28e50a8879f96fe75860ea03ef9c1458 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 4 Feb 2025 13:29:51 +0100 Subject: [PATCH 34/81] IONOS(groupquota): add external app v0.2.1 git submodule add git@github.com:nextcloud/groupquota.git apps-external/groupquota Signed-off-by: Misha M.-Kupriyanov --- .gitignore | 1 + .gitmodules | 3 +++ apps-external/groupquota | 1 + 3 files changed, 5 insertions(+) create mode 160000 apps-external/groupquota diff --git a/.gitignore b/.gitignore index aafff162b588d..b2ca31e228cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ !/apps-external/viewer !/apps-external/user_oidc !/apps-external/serverinfo +!/apps-external/groupquota !/apps-custom/* # apps modules diff --git a/.gitmodules b/.gitmodules index c58f281eec412..833536e33689e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,3 +46,6 @@ [submodule "apps-external/serverinfo"] path = apps-external/serverinfo url = git@github.com:nextcloud/serverinfo.git +[submodule "apps-external/groupquota"] + path = apps-external/groupquota + url = git@github.com:nextcloud/groupquota.git diff --git a/apps-external/groupquota b/apps-external/groupquota new file mode 160000 index 0000000000000..f4d8a3f900f1f --- /dev/null +++ b/apps-external/groupquota @@ -0,0 +1 @@ +Subproject commit f4d8a3f900f1fded4499e55a3b5f016a6a7593e2 From ec475d234293f3e2db255a831e30934fd0786a6d Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 4 Feb 2025 13:58:35 +0100 Subject: [PATCH 35/81] IONOS(build): always build artifact on apps-external submodule change Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 9edb106d50929..2db0bab8b92b9 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -17,6 +17,7 @@ on: - 'apps/**' - 'apps/**/appinfo/info.xml' - 'apps-custom/**' + - 'apps-external/**' - 'IONOS' - 'package.json' - 'package-lock.json' From 9828d1a1e2ae5a0ac79dc931fef01cdd2e2cdf70 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 30 Jan 2025 17:40:15 +0100 Subject: [PATCH 36/81] IONOS(login-flow-v2): reject unknown api clients by user agent Signed-off-by: Misha M.-Kupriyanov --- core/Controller/ClientFlowLoginV2Controller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/Controller/ClientFlowLoginV2Controller.php b/core/Controller/ClientFlowLoginV2Controller.php index 8c0c1e8179d92..07a67d926103d 100644 --- a/core/Controller/ClientFlowLoginV2Controller.php +++ b/core/Controller/ClientFlowLoginV2Controller.php @@ -11,6 +11,7 @@ use OC\Core\Db\LoginFlowV2; use OC\Core\Exception\LoginFlowV2ClientForbiddenException; use OC\Core\Exception\LoginFlowV2NotFoundException; +use OC\Core\Exception\LoginFlowV2ClientForbiddenException; use OC\Core\ResponseDefinitions; use OC\Core\Service\LoginFlowV2Service; use OCP\AppFramework\Controller; From 99eb25b46f87def35072fc4c5deeaade95a3cbe0 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 10:01:01 +0100 Subject: [PATCH 37/81] IONOS(build): rename hidrive_next_build_zip to hidrive_next_build_artifact in case we switch to tar.gz Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 2db0bab8b92b9..facf5e0a812bc 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -121,7 +121,7 @@ jobs: - name: Upload artifact result for job hidrive-next-build uses: actions/upload-artifact@v4 with: - name: hidrive_next_build_zip + name: hidrive_next_build_artifact path: ${{ env.TARGET_PACKAGE_NAME }} - name: Show changes on failure @@ -145,7 +145,7 @@ jobs: - name: Download artifact zip uses: actions/download-artifact@v4 with: - name: hidrive_next_build_zip + name: hidrive_next_build_artifact - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 From 3d159ba66dc9ea701a3d4814c595477390c3c314 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 13:21:23 +0100 Subject: [PATCH 38/81] IONOS(build): save build artifacts only for 30 days in order not go over gitlab quota. since we use it just to pass from job to job. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index facf5e0a812bc..73fa7ba9134bd 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -121,6 +121,7 @@ jobs: - name: Upload artifact result for job hidrive-next-build uses: actions/upload-artifact@v4 with: + retention-days: 30 name: hidrive_next_build_artifact path: ${{ env.TARGET_PACKAGE_NAME }} From cbd80d1e3eed98c1c6820b3a629882839c17088c Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 18 Feb 2025 15:08:25 +0100 Subject: [PATCH 39/81] IONOS(build): remove unused permissions Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 73fa7ba9134bd..7ea341d7243b6 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -48,7 +48,6 @@ jobs: permissions: contents: read - packages: write name: hidrive-next-build steps: From 61f16b1c68b1baf6f04a4dd6cec532c1c719b69c Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 14:27:49 +0100 Subject: [PATCH 40/81] IONOS(build): remove build on non-hidrivenext branches main, master, stable* are non-hidrivenext branches Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 7ea341d7243b6..378d9dfeb73cc 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -28,11 +28,7 @@ on: - '**.vue' push: branches: - - main - - master - - stable* - ionos-dev - - ionos-dev30 env: TARGET_PACKAGE_NAME: hidrive-next.zip From 6aa7a4ddb88925b0e65988d391bf98233a1bcf54 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 12 Feb 2025 17:13:48 +0100 Subject: [PATCH 41/81] IONOS(build): upload dev artifact to artifactory on PR push Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 76 ++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 378d9dfeb73cc..3e84d38c54d87 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -34,6 +34,7 @@ env: TARGET_PACKAGE_NAME: hidrive-next.zip REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + ARTIFACTORY_REPOSITORY_SNAPSHOT: ionos-productivity-hdnext-snapshot permissions: contents: read @@ -45,6 +46,9 @@ jobs: permissions: contents: read + outputs: + NC_VERSION: ${{ steps.get_nc_version.outputs.NC_VERSION }} + name: hidrive-next-build steps: - name: Checkout server @@ -113,6 +117,19 @@ jobs: - name: Zip dependencies run: make -f IONOS/Makefile zip_dependencies TARGET_PACKAGE_NAME=${{ env.TARGET_PACKAGE_NAME }} + - name: Get NC version + id: get_nc_version + run: | + NC_VERSION=$(jq -r '.ncVersion' version.json) + echo "NC_VERSION: $NC_VERSION" + + if [ -z "$NC_VERSION" ]; then + echo "NC_VERSION is empty" + exit 1 + fi + + echo "NC_VERSION=$NC_VERSION" >> $GITHUB_OUTPUT + - name: Upload artifact result for job hidrive-next-build uses: actions/upload-artifact@v4 with: @@ -127,6 +144,65 @@ jobs: git --no-pager diff exit 1 # make it red to grab attention + upload-to-artifactory: + runs-on: self-hosted + # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev" branch push defined in the on:push:branches + if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' + + name: Push artifact to artifactory as dev build + needs: hidrive-next-build + + env: + BUILD_NAME: "hidrive_next-snapshot" + + steps: + - name: Download artifact zip + uses: actions/download-artifact@v4 + with: + name: hidrive_next_build_artifact + + # This action sets up the JFrog CLI with the Artifactory URL and access token + - uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: ${{ secrets.JF_ARTIFACTORY_URL }} + JF_USER: ${{ secrets.JF_ARTIFACTORY_USER }} + JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} + + - name: Ping the JF server + run: | + # Ping the server + jf rt ping + + - name: Upload build to artifactory + run: | + # PR builds are stored in a separate directory as "dev/pr/hidrive-next-pr-.zip" + # Push to "ionos-dev" branch is stored as "dev/hidrive-next-.zip" + + ARTIFACTORY_STAGE_PREFIX="dev" + + export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}" + PATH_TO_FILE="pr/hidrive-next-pr-${{ github.event.pull_request.number }}.zip" + + if [ -z "${{ github.event.pull_request.number }}" ]; then + PATH_TO_FILE="hidrive-next-${{ needs.hidrive-next-build.outputs.NC_VERSION }}.zip" + fi + + export PATH_TO_LATEST_ARTIFACT="${PATH_TO_DIRECTORY}/${PATH_TO_FILE}" + + # Promote current build to the "latest" dev build + jf rt upload "${{ env.TARGET_PACKAGE_NAME }}" \ + --build-name "${{ env.BUILD_NAME }}" \ + --build-number ${{ github.run_number }} \ + --target-props "hdnext.nc_version=${{ needs.hidrive-next-build.outputs.NC_VERSION }};vcs.branch=${{ github.ref }};vcs.revision=${{ github.sha }}" \ + $PATH_TO_LATEST_ARTIFACT + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention + hidirve-next-artifact-to-ghcr_io: runs-on: ubuntu-latest From b1225db06d5e1dbacd39bf3e391af008f6fdd05d Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 17 Feb 2025 15:05:34 +0100 Subject: [PATCH 42/81] IONOS(build): upload dev artifact to artifactory on ionos-stable push artifact will be saved under ionos-productivity-hdnext-snapshot/stable folder Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 3e84d38c54d87..207972ef05527 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -29,6 +29,7 @@ on: push: branches: - ionos-dev + - ionos-stable env: TARGET_PACKAGE_NAME: hidrive-next.zip @@ -146,8 +147,8 @@ jobs: upload-to-artifactory: runs-on: self-hosted - # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev" branch push defined in the on:push:branches - if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' + # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable" branch push defined in the on:push:branches + if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' name: Push artifact to artifactory as dev build needs: hidrive-next-build @@ -180,6 +181,11 @@ jobs: ARTIFACTORY_STAGE_PREFIX="dev" + # set ARTIFACTORY_STAGE_PREFIX=stable on ionos-stable branch + if [ "${{ github.ref_name }}" == "ionos-stable" ]; then + ARTIFACTORY_STAGE_PREFIX="stable" + fi + export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}" PATH_TO_FILE="pr/hidrive-next-pr-${{ github.event.pull_request.number }}.zip" From d459b78bc7650975721e4e2fae2f4d6ebe81a6b0 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 18 Feb 2025 16:44:19 +0100 Subject: [PATCH 43/81] IONOS(build): do not build on unknown ncVersion it is important for the build flow Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 207972ef05527..d3f195a453f57 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -120,6 +120,7 @@ jobs: - name: Get NC version id: get_nc_version + continue-on-error: false run: | NC_VERSION=$(jq -r '.ncVersion' version.json) echo "NC_VERSION: $NC_VERSION" From cbddfa2ee46c37cceb834d47b317d6f6849db777 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 19 Feb 2025 16:27:50 +0100 Subject: [PATCH 44/81] IONOS(build): fix stable artifactory push Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index d3f195a453f57..e69b11c509454 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -151,7 +151,7 @@ jobs: # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable" branch push defined in the on:push:branches if: github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' - name: Push artifact to artifactory as dev build + name: Push to artifactory needs: hidrive-next-build env: @@ -183,7 +183,7 @@ jobs: ARTIFACTORY_STAGE_PREFIX="dev" # set ARTIFACTORY_STAGE_PREFIX=stable on ionos-stable branch - if [ "${{ github.ref_name }}" == "ionos-stable" ]; then + if [ ${{ github.ref_name }} == "ionos-stable" ]; then ARTIFACTORY_STAGE_PREFIX="stable" fi From 75de1b5397cc4412cf57a28bfe34323de4239371 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 13 Feb 2025 17:45:39 +0100 Subject: [PATCH 45/81] IONOS(build): trigger remote build pipeline Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 62 ++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index e69b11c509454..2d17deb4a380f 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -154,6 +154,9 @@ jobs: name: Push to artifactory needs: hidrive-next-build + outputs: + ARTIFACTORY_LAST_BUILD_PATH: ${{ steps.artifactory_upload.outputs.ARTIFACTORY_LAST_BUILD_PATH }} + env: BUILD_NAME: "hidrive_next-snapshot" @@ -176,6 +179,7 @@ jobs: jf rt ping - name: Upload build to artifactory + id: artifactory_upload run: | # PR builds are stored in a separate directory as "dev/pr/hidrive-next-pr-.zip" # Push to "ionos-dev" branch is stored as "dev/hidrive-next-.zip" @@ -203,6 +207,8 @@ jobs: --target-props "hdnext.nc_version=${{ needs.hidrive-next-build.outputs.NC_VERSION }};vcs.branch=${{ github.ref }};vcs.revision=${{ github.sha }}" \ $PATH_TO_LATEST_ARTIFACT + echo "ARTIFACTORY_LAST_BUILD_PATH=${PATH_TO_LATEST_ARTIFACT}" >> $GITHUB_OUTPUT + - name: Show changes on failure if: failure() run: | @@ -265,3 +271,59 @@ jobs: if: failure() run: | exit 1 # make it red to grab attention + + + trigger-remote-dev-worflow: + runs-on: self-hosted + + name: Trigger remote workflow + needs: [ hidrive-next-build, upload-to-artifactory ] + # Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches + if: github.event_name == 'push' && ( github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' ) + steps: + - name: Trigger remote workflow + run: | + # Enable command echo + set -x + + # The 'ionos-dev' branch will trigger remote "dev" branch workflow + GITLAB_BRANCH="dev" + + # set ARTIFACTORY_STAGE_PREFIX=stable on ionos-stable branch + if [ ${{ github.ref_name }} == "ionos-stable" ]; then + GITLAB_BRANCH="stable" + fi + + # Call webhook + curl \ + --silent \ + --insecure \ + --request POST \ + --fail-with-body \ + -o response.json \ + --form token=${{ secrets.GITLAB_TOKEN }} \ + --form ref="${GITLAB_BRANCH}" \ + --form "variables[GITHUB_SHA]=${{ github.sha }}" \ + --form "variables[ARTIFACTORY_LAST_BUILD_PATH]=${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" \ + --form "variables[NC_VERSION]=${{ needs.hidrive-next-build.outputs.NC_VERSION }}" \ + --form "variables[BUILD_ID]=${{ github.run_id }}" \ + "${{ secrets.GITLAB_TRIGGER_URL }}" || ( RETCODE="$?"; jq . response.json; exit "$RETCODE" ) + + # Disable command echo + set +x + + # Print and parse json + # jq . response.json + echo "json<> $GITHUB_OUTPUT + cat response.json >> $GITHUB_OUTPUT + echo "END" >> $GITHUB_OUTPUT + echo "web_url<> $GITHUB_OUTPUT + cat response.json | jq --raw-output '.web_url' >> $GITHUB_OUTPUT + echo "END" >> $GITHUB_OUTPUT + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention From 912a6c8d42631d2bb64c1780d5d46a9d0ca07a06 Mon Sep 17 00:00:00 2001 From: Lara Fernandez Cueto Date: Wed, 26 Feb 2025 12:08:04 +0100 Subject: [PATCH 46/81] IONOS(richdocuments): Add the richdocuments as app-external --- .gitmodules | 3 +++ apps-external/richdocuments | 1 + 2 files changed, 4 insertions(+) create mode 160000 apps-external/richdocuments diff --git a/.gitmodules b/.gitmodules index 833536e33689e..1e02e756bea2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "apps-external/groupquota"] path = apps-external/groupquota url = git@github.com:nextcloud/groupquota.git +[submodule "apps-external/richdocuments"] + path = apps-external/richdocuments + url = https://github.com/nextcloud/richdocuments.git diff --git a/apps-external/richdocuments b/apps-external/richdocuments new file mode 160000 index 0000000000000..561873ffdfd42 --- /dev/null +++ b/apps-external/richdocuments @@ -0,0 +1 @@ +Subproject commit 561873ffdfd425f42768fc01bc24ef78f9213ef6 From 26122c6e6dae8b28b4dd76104d7124f7c99be7c9 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 4 Mar 2025 11:21:39 +0100 Subject: [PATCH 47/81] IONOS(build): run hidrive-next-build on ./lib/** changes in order to be able to build e.g. on cherry-picked commits Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 2d17deb4a380f..4f20ff7c74881 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -22,6 +22,7 @@ on: - 'package.json' - 'package-lock.json' - 'themes/**' + - 'lib/**' - 'tsconfig.json' - '**.js' - '**.ts' From 56f7b6eb4c777c1e5926042df9f43cb6adb9683b Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 5 Mar 2025 17:56:00 +0100 Subject: [PATCH 48/81] IONOS(build): add richdocuments build job Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 4f20ff7c74881..00d3602ce563e 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -95,6 +95,9 @@ jobs: PUPPETEER_SKIP_DOWNLOAD: true run: make -f IONOS/Makefile build_dep_viewer_app + - name: Install dependencies & build richdocuments app + run: make -f IONOS/Makefile build_richdocuments_app + - name: Install dependencies & build user_oidc app env: CYPRESS_INSTALL_BINARY: 0 From ab0cd8d09719633cd62ccd0bea792d4a27b07b35 Mon Sep 17 00:00:00 2001 From: Kai Henseler Date: Thu, 13 Mar 2025 11:28:57 +0100 Subject: [PATCH 49/81] IONOS(feat): block unknown user agents Signed-off-by: Kai Henseler --- .../Exceptions/UserAgentForbidden.php | 12 ++ lib/private/User/Session.php | 12 ++ ocs/v1.php | 2 + tests/lib/User/SessionTest.php | 134 ++++++++++++++++++ 4 files changed, 160 insertions(+) create mode 100644 lib/private/Authentication/Exceptions/UserAgentForbidden.php diff --git a/lib/private/Authentication/Exceptions/UserAgentForbidden.php b/lib/private/Authentication/Exceptions/UserAgentForbidden.php new file mode 100644 index 0000000000000..616823002d40c --- /dev/null +++ b/lib/private/Authentication/Exceptions/UserAgentForbidden.php @@ -0,0 +1,12 @@ +server['PHP_AUTH_USER']) && !empty($request->server['PHP_AUTH_PW'])) { try { + // Check if the client is using an allowed user agent + $allowedAgents = $this->config->getSystemValue('core.login_flow_v2.allowed_user_agents', []); + if (!empty($allowedAgents)) { + $clientUserAgent = $request->server['HTTP_USER_AGENT']; + + foreach ($allowedAgents as $allowedAgent) { + if (preg_match($allowedAgent, $clientUserAgent) !== 1) { + throw new UserAgentForbidden('Client not allowed'); + } + } + } if ($this->logClientIn($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'], $request, $throttler)) { /** * Add DAV authenticated. This should in an ideal world not be diff --git a/ocs/v1.php b/ocs/v1.php index e12cd6ddc1147..68702f3fd1cf5 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -70,6 +70,8 @@ http_response_code(405); } catch (LoginException $e) { ApiHelper::respond(OCSController::RESPOND_UNAUTHORISED, 'Unauthorised'); +} catch (\OC\Authentication\Exceptions\UserAgentForbidden $ex) { + ApiHelper::respond(403, $ex->getMessage()); } catch (\Exception $e) { Server::get(LoggerInterface::class)->error($e->getMessage(), ['exception' => $e]); diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index 50c449559a003..c88bc1e1b2a29 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -13,6 +13,7 @@ use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Exceptions\PasswordlessTokenException; use OC\Authentication\Exceptions\PasswordLoginForbiddenException; +use OC\Authentication\Exceptions\UserAgentForbidden; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; use OC\Authentication\Token\PublicKeyToken; @@ -1183,6 +1184,139 @@ public function testTryBasicAuthLoginValid(): void { $this->assertSame(1000, $lastPasswordConfirmSet); } + public function testTryBasicAuthLoginValidClient() { + $allowedClients = [ + '/Custom Allowed Client/i' + ]; + + $this->config->expects($this->exactly(1)) + ->method('getSystemValue') + ->willReturn($this->returnCallback(function ($key) use ($allowedClients) { + // Note: \OCP\IConfig::getSystemValue returns either an array or string. + return $key == 'core.login_flow_v2.allowed_user_agents' ? $allowedClients : ''; + })); + + $request = $this->createMock(Request::class); + $request->method('__get') + ->willReturn([ + 'PHP_AUTH_USER' => 'username', + 'PHP_AUTH_PW' => 'password', + 'HTTP_USER_AGENT' => 'Custom Allowed Client Curl Client/1.0', + ]); + $request->method('__isset') + ->with('server') + ->willReturn(true); + + $davAuthenticatedSet = false; + $lastPasswordConfirmSet = false; + + $this->session + ->method('set') + ->willReturnCallback(function ($k, $v) use (&$davAuthenticatedSet, &$lastPasswordConfirmSet) { + switch ($k) { + case Auth::DAV_AUTHENTICATED: + $davAuthenticatedSet = $v; + return; + case 'last-password-confirm': + $lastPasswordConfirmSet = 1000; + return; + default: + throw new \Exception(); + } + }); + + $userSession = $this->getMockBuilder(Session::class) + ->setConstructorArgs([ + $this->manager, + $this->session, + $this->timeFactory, + $this->tokenProvider, + $this->config, + $this->random, + $this->lockdownManager, + $this->logger, + $this->dispatcher + ]) + ->setMethods([ + 'logClientIn', + 'getUser', + ]) + ->getMock(); + + /** @var Session|MockObject */ + $userSession->expects($this->once()) + ->method('logClientIn') + ->with( + $this->equalTo('username'), + $this->equalTo('password'), + $this->equalTo($request), + $this->equalTo($this->throttler) + )->willReturn(true); + + $user = $this->createMock(IUser::class); + $user->method('getUID')->willReturn('username'); + + $userSession->expects($this->once()) + ->method('getUser') + ->willReturn($user); + + $this->assertTrue($userSession->tryBasicAuthLogin($request, $this->throttler)); + + $this->assertSame('username', $davAuthenticatedSet); + $this->assertSame(1000, $lastPasswordConfirmSet); + } + + public function testTryBasicAuthLoginInvalidClient() { + $this->expectException(UserAgentForbidden::class); + $this->expectExceptionMessage('Client not allowed'); + + $allowedClients = [ + '/Custom Allowed Client/i' + ]; + + $this->config->expects($this->exactly(1)) + ->method('getSystemValue') + ->willReturn($this->returnCallback(function ($key) use ($allowedClients) { + // Note: \OCP\IConfig::getSystemValue returns either an array or string. + return $key == 'core.login_flow_v2.allowed_user_agents' ? $allowedClients : ''; + })); + + $request = $this->createMock(Request::class); + $request->method('__get') + ->willReturn([ + 'PHP_AUTH_USER' => 'username', + 'PHP_AUTH_PW' => 'password', + 'HTTP_USER_AGENT' => 'Rogue Curl Client/1.0', + ]); + $request->method('__isset') + ->with('server') + ->willReturn(true); + + $userSession = $this->getMockBuilder(Session::class) + ->setConstructorArgs([ + $this->manager, + $this->session, + $this->timeFactory, + $this->tokenProvider, + $this->config, + $this->random, + $this->lockdownManager, + $this->logger, + $this->dispatcher + ]) + ->setMethods([ + 'logClientIn', + 'getUser', + ]) + ->getMock(); + + /** @var Session|MockObject */ + $userSession->expects($this->never()) + ->method('logClientIn'); + + $userSession->tryBasicAuthLogin($request, $this->throttler); + } + public function testTryBasicAuthLoginNoLogin(): void { $request = $this->createMock(Request::class); $request->method('__get') From adea84d0a936dd0354cea87d71e693738343f3ba Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 31 Mar 2025 11:07:40 +0200 Subject: [PATCH 50/81] IONOS(config): change submodule repo (nc-ionos-processes) I order to use different repo name. git submodule add git@github.com:IONOS-Productivity/nc-ionos-processes.git apps-custom/nc-ionos-processes git rm -f apps-custom/nc_ionos_processes Signed-off-by: Misha M.-Kupriyanov --- .gitmodules | 6 +++--- apps-custom/{nc_ionos_processes => nc-ionos-processes} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename apps-custom/{nc_ionos_processes => nc-ionos-processes} (100%) diff --git a/.gitmodules b/.gitmodules index 1e02e756bea2d..65ac70313d816 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,9 +40,6 @@ [submodule "custom-npms/nc-nextcloud-vue"] path = custom-npms/nc-nextcloud-vue url = git@github.com:IONOS-Productivity/nc-nextcloud-vue.git -[submodule "apps-custom/nc_ionos_processes"] - path = apps-custom/nc_ionos_processes - url = git@github.com:IONOS-Productivity/nc_ionos_processes.git [submodule "apps-external/serverinfo"] path = apps-external/serverinfo url = git@github.com:nextcloud/serverinfo.git @@ -52,3 +49,6 @@ [submodule "apps-external/richdocuments"] path = apps-external/richdocuments url = https://github.com/nextcloud/richdocuments.git +[submodule "apps-custom/nc-ionos-processes"] + path = apps-custom/nc-ionos-processes + url = git@github.com:IONOS-Productivity/nc-ionos-processes.git diff --git a/apps-custom/nc_ionos_processes b/apps-custom/nc-ionos-processes similarity index 100% rename from apps-custom/nc_ionos_processes rename to apps-custom/nc-ionos-processes From 6b6b03e5d68c2846f3c05fd13771907394913229 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 2 Apr 2025 18:00:15 +0200 Subject: [PATCH 51/81] IONOS(config): remove unused submodule (NextcloudExtract) Signed-off-by: Misha M.-Kupriyanov --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 65ac70313d816..1a13d01200cb7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "IONOS"] path = IONOS url = git@github.com:IONOS-Productivity/easystorage-config.git -[submodule "apps-external/extract"] - path = apps-external/extract - url = https://github.com/PaulLereverend/NextcloudExtract [submodule "apps-external/viewer"] path = apps-external/viewer url = git@github.com:IONOS-Productivity/nc-viewer.git From 7783697fa2cc9582556be4aedbe5b92bd09f4271 Mon Sep 17 00:00:00 2001 From: Kai Henseler <78687674+bromiesTM@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:12:21 +0200 Subject: [PATCH 52/81] IONOS(build): switch to ssh submodule urls Signed-off-by: Kai Henseler <78687674+bromiesTM@users.noreply.github.com> --- .github/workflows/hidrive-next-build.yml | 1 + .gitmodules | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 00d3602ce563e..068d7f5f1733b 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -27,6 +27,7 @@ on: - '**.js' - '**.ts' - '**.vue' + - '.gitmodules' push: branches: - ionos-dev diff --git a/.gitmodules b/.gitmodules index 1a13d01200cb7..f2cccd90f0b70 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = git@github.com:IONOS-Productivity/nc-simplesettings.git [submodule "apps-external/user_oidc"] path = apps-external/user_oidc - url = https://github.com/nextcloud/user_oidc.git + url = git@github.com:nextcloud/user_oidc.git [submodule "apps-custom/googleanalytics"] path = apps-custom/googleanalytics url = git@github.com:IONOS-Productivity/nc-googleanalytics.git @@ -45,7 +45,7 @@ url = git@github.com:nextcloud/groupquota.git [submodule "apps-external/richdocuments"] path = apps-external/richdocuments - url = https://github.com/nextcloud/richdocuments.git + url = git@github.com:nextcloud/richdocuments.git [submodule "apps-custom/nc-ionos-processes"] path = apps-custom/nc-ionos-processes url = git@github.com:IONOS-Productivity/nc-ionos-processes.git From 0cfe743009e896f591ef60e7514560954ed738e9 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 17 Apr 2025 16:32:53 +0200 Subject: [PATCH 53/81] IONOS(fix): block unknown user agents fix the case we have multiple user agents Signed-off-by: Misha M.-Kupriyanov --- lib/private/User/Session.php | 37 ++++++++++++++++++++++++---------- tests/lib/User/SessionTest.php | 3 ++- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index caa413b1bc4cb..95d1173a185ff 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -538,22 +538,15 @@ protected function prepareUserLogin($firstTimeLogin, $refreshCsrfToken = true) { * @param IRequest $request * @param IThrottler $throttler * @return boolean if the login was successful + * @throws UserAgentForbidden|LoginException */ public function tryBasicAuthLogin(IRequest $request, IThrottler $throttler) { if (!empty($request->server['PHP_AUTH_USER']) && !empty($request->server['PHP_AUTH_PW'])) { try { - // Check if the client is using an allowed user agent - $allowedAgents = $this->config->getSystemValue('core.login_flow_v2.allowed_user_agents', []); - if (!empty($allowedAgents)) { - $clientUserAgent = $request->server['HTTP_USER_AGENT']; - - foreach ($allowedAgents as $allowedAgent) { - if (preg_match($allowedAgent, $clientUserAgent) !== 1) { - throw new UserAgentForbidden('Client not allowed'); - } - } - } + $userAgent = $request->server['HTTP_USER_AGENT'] ?? ''; + $this->validateUserAgent($userAgent); + if ($this->logClientIn($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'], $request, $throttler)) { /** * Add DAV authenticated. This should in an ideal world not be @@ -580,6 +573,28 @@ public function tryBasicAuthLogin(IRequest $request, return false; } + /** + * Validate the user agent and check if it is allowed to use the login flow. + * Throws an exception if the user agent is not allowed. + * + * @param string $clientUserAgent + * @throws UserAgentForbidden + */ + private function validateUserAgent(string $clientUserAgent): void { + $allowedAgents = $this->config->getSystemValue('core.login_flow_v2.allowed_user_agents', []); + if (empty($allowedAgents)) { + return; + } + + foreach ($allowedAgents as $allowedAgent) { + if (preg_match($allowedAgent, $clientUserAgent) === 1) { + return; + } + } + + throw new UserAgentForbidden('Client not allowed'); + } + /** * Log an user in via login name and password * diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index c88bc1e1b2a29..d035f6a669880 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -1186,7 +1186,8 @@ public function testTryBasicAuthLoginValid(): void { public function testTryBasicAuthLoginValidClient() { $allowedClients = [ - '/Custom Allowed Client/i' + '/Rogue Client/i', + '/Custom Allowed Client/i', ]; $this->config->expects($this->exactly(1)) From 1bf6f2ea0eeff12f76a892fce86eb2a8042a68cf Mon Sep 17 00:00:00 2001 From: Tatjana Kaschperko Lindt Date: Tue, 6 May 2025 12:52:34 +0200 Subject: [PATCH 54/81] IONOS(chore): add "image-viewer" icon mapping for external-share (legacy) Signed-off-by: Tatjana Kaschperko Lindt --- core/src/icons.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/icons.js b/core/src/icons.js index 7f4accf104eea..49d3fa9a29a9b 100644 --- a/core/src/icons.js +++ b/core/src/icons.js @@ -141,6 +141,7 @@ icons.more = path.join(__dirname, customIconPath, 'dots-horizontal.svg') icons.public = path.join(__dirname, customIconPath, 'link.svg') icons.comment = path.join(__dirname, customIconPath, 'comment.svg') icons.home = path.join(__dirname, customIconPath, 'home.svg') +icons.viewer = path.join(__dirname, customIconPath, 'eye.svg') icons['triangle-s'] = path.join(__dirname, customIconPath, 'chevron-down.svg') icons['triangle-n'] = path.join(__dirname, customIconPath, 'chevron-up.svg') icons['triangle-e'] = path.join(__dirname, customIconPath, 'chevron-right.svg') From 8fca645ebbe45a463116d12ecd9517ff11647ba2 Mon Sep 17 00:00:00 2001 From: Franziska Bath Date: Wed, 14 May 2025 16:15:58 +0200 Subject: [PATCH 55/81] IONOS(config): switch submodule (richdocuments) to ionos nc-richdocuments Signed-off-by: Franziska Bath --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f2cccd90f0b70..a0aef2a244eaf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -45,7 +45,7 @@ url = git@github.com:nextcloud/groupquota.git [submodule "apps-external/richdocuments"] path = apps-external/richdocuments - url = git@github.com:nextcloud/richdocuments.git + url = git@github.com:IONOS-Productivity/nc-richdocuments.git [submodule "apps-custom/nc-ionos-processes"] path = apps-custom/nc-ionos-processes url = git@github.com:IONOS-Productivity/nc-ionos-processes.git From 308343fec332daec3e5fde421d09caf1f8d76b8f Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 22 May 2025 18:23:37 +0200 Subject: [PATCH 56/81] IONOS(files-sharing): show pending menu only if feature enabled ./occ config:system:set --value true --type boolean -- sharing.enable_share_accept ./occ config:system:set --value false --type boolean -- sharing.enable_share_accept Signed-off-by: Misha M.-Kupriyanov --- .../lib/Listener/LoadAdditionalListener.php | 11 +++++++ apps/files_sharing/src/files_views/shares.ts | 13 ++++++++ .../Listener/LoadAdditionalListenerTest.php | 32 +++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php index b089c8309b78a..6b93ed7d9b76e 100644 --- a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php +++ b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php @@ -8,10 +8,12 @@ */ namespace OCA\Files_Sharing\Listener; +use OC\InitialStateService; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files_Sharing\AppInfo\Application; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; +use OCP\IConfig; use OCP\Server; use OCP\Share\IManager; use OCP\Util; @@ -31,5 +33,14 @@ public function handle(Event $event): void { if ($shareManager->shareApiEnabled() && class_exists('\OCA\Files\App')) { Util::addInitScript(Application::APP_ID, 'init'); } + + $this->provideInitialStates(); + } + + private function provideInitialStates(): void { + $initialState = \OC::$server->get(InitialStateService::class); + $config = \OC::$server->get(IConfig::class); + $defaultAcceptSystemConfig = $config->getSystemValueBool('sharing.enable_share_accept'); + $initialState->provideInitialState(Application::APP_ID, 'accept_default', $defaultAcceptSystemConfig); } } diff --git a/apps/files_sharing/src/files_views/shares.ts b/apps/files_sharing/src/files_views/shares.ts index aa9903c242854..8424195a1eddd 100644 --- a/apps/files_sharing/src/files_views/shares.ts +++ b/apps/files_sharing/src/files_views/shares.ts @@ -24,6 +24,15 @@ export const deletedSharesViewId = 'deletedshares' export const pendingSharesViewId = 'pendingshares' export const fileRequestViewId = 'filerequest' +/** + * Checks if share accept approval required by nextcloud configuration. + * + * @returns {boolean} True if share accept approval is required, otherwise false. + */ +function isShareAcceptApprovalRequired(): boolean { + return loadState('files_sharing', 'accept_default', false) +} + export default () => { const Navigation = getNavigation() Navigation.register(new View({ @@ -137,6 +146,10 @@ export default () => { getContents: () => getContents(false, false, false, true), })) + if (!isShareAcceptApprovalRequired()) { + return + } + Navigation.register(new View({ id: pendingSharesViewId, name: t('files_sharing', 'Pending shares'), diff --git a/apps/files_sharing/tests/Listener/LoadAdditionalListenerTest.php b/apps/files_sharing/tests/Listener/LoadAdditionalListenerTest.php index 75bee35d58a24..e72a6c49c4e5c 100644 --- a/apps/files_sharing/tests/Listener/LoadAdditionalListenerTest.php +++ b/apps/files_sharing/tests/Listener/LoadAdditionalListenerTest.php @@ -117,4 +117,36 @@ public function testHandleWithLoadAdditionalScriptsEventWithShareApiEnabled(): v // assert array $scripts contains the expected scripts $this->assertContains('files_sharing/js/init', $scriptsAfter); } + + public function testProvideInitialStates(): void { + $listener = new LoadAdditionalListener(); + + // Expect config to be queried for 'sharing.enable_share_accept' + $this->config->expects($this->once()) + ->method('getSystemValueBool') + ->with('sharing.enable_share_accept') + ->willReturn(true); + + // Expect initial state to be provided with correct values + $this->initialStateService->expects($this->once()) + ->method('provideInitialState') + ->with( + 'files_sharing', + 'accept_default', + true + ); + + // Other dependencies required by the listener + $this->shareManager->method('shareApiEnabled')->willReturn(true); + + // Mock the server container to return the correct dependencies + $this->overwriteService(IManager::class, $this->shareManager); + $this->overwriteService(InitialStateService::class, $this->initialStateService); + $this->overwriteService(IConfig::class, $this->config); + $this->overwriteService(IFactory::class, $this->factory); + + $listener->handle($this->event); + + $this->assertTrue(true); + } } From 3ff8440f9b85e55f484869fe9f669a13da4559e9 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 18 Jun 2025 12:07:41 +0200 Subject: [PATCH 57/81] IONOS(config): add files_downloadlimit submodule and update .gitignore Signed-off-by: Misha M.-Kupriyanov --- .gitignore | 1 + .gitmodules | 3 +++ apps-external/files_downloadlimit | 1 + 3 files changed, 5 insertions(+) create mode 160000 apps-external/files_downloadlimit diff --git a/.gitignore b/.gitignore index b2ca31e228cbc..26a3886433776 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ !/apps-external/user_oidc !/apps-external/serverinfo !/apps-external/groupquota +!/apps-external/files_downloadlimit !/apps-custom/* # apps modules diff --git a/.gitmodules b/.gitmodules index a0aef2a244eaf..eaec1bbc8d94b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "apps-custom/nc-ionos-processes"] path = apps-custom/nc-ionos-processes url = git@github.com:IONOS-Productivity/nc-ionos-processes.git +[submodule "apps-external/files_downloadlimit"] + path = apps-external/files_downloadlimit + url = git@github.com:nextcloud/files_downloadlimit.git diff --git a/apps-external/files_downloadlimit b/apps-external/files_downloadlimit new file mode 160000 index 0000000000000..ae20646b6a2d4 --- /dev/null +++ b/apps-external/files_downloadlimit @@ -0,0 +1 @@ +Subproject commit ae20646b6a2d40c92d8fd362f2268b54b370b0cf From 5e68e0a4856f54d4b3e1efb25f4494108fb6da7c Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 22 Jul 2025 14:08:43 +0200 Subject: [PATCH 58/81] IONOS(ci): Update hidrive-next-build.yml to use ubuntu-latest runner due to issues with self-hosted runner Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 068d7f5f1733b..15bdb72925359 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -44,7 +44,7 @@ permissions: jobs: hidrive-next-build: - runs-on: self-hosted + runs-on: ubuntu-latest permissions: contents: read From b13c264b35e4865688170a38fc77649afc3a833b Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Thu, 17 Jul 2025 13:10:13 +0200 Subject: [PATCH 59/81] IONOS(sbom-matrix): add SBOM generation workflow Co-Authored-By: Thomas Lehmann Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/sbom-matrix.yaml | 425 +++++++++++++++++++++++++++++ 1 file changed, 425 insertions(+) create mode 100644 .github/workflows/sbom-matrix.yaml diff --git a/.github/workflows/sbom-matrix.yaml b/.github/workflows/sbom-matrix.yaml new file mode 100644 index 0000000000000..b4ed7f24462b5 --- /dev/null +++ b/.github/workflows/sbom-matrix.yaml @@ -0,0 +1,425 @@ +name: SBOM generation (matrix) + +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2025 STRATO AG +# SPDX-License-Identifier: AGPL-3.0-or-later + +# ============================================================================ +# SBOM Generation Workflow +# ============================================================================ +# +# This workflow automates the generation and upload of Software Bill of Materials +# (SBOMs) for security and compliance purposes. It processes multiple components +# of the Nextcloud ecosystem in parallel using a matrix strategy. +# +# REQUIREMENTS: +# - Repository secrets: +# * DEPENDENCY_TRACK_API_KEY: API key for Dependency Track instance +# * IONOS_CA: CA certificate for secure communication +# * FONTAWESOME_PACKAGE_TOKEN: Token for FontAwesome packages +# - Repository variables: +# * DEPENDENCY_TRACK_BASE_URL: Base URL of Dependency Track instance +# * DT_OBJECT_*: Project IDs for each component in Dependency Track +# +# TRIGGERS: +# - Push to ionos-stable branch (production) +# +# OUTPUT: +# - CycloneDX SBOM files in JSON format (spec version 1.6) +# - Separate SBOMs for PHP (Composer) and JavaScript (NPM) dependencies +# - Combined SBOMs for components with both dependency types +# - Automatic upload to Dependency Track for vulnerability analysis +# ============================================================================ +# +# This workflow generates Software Bill of Materials (SBOMs) for the Nextcloud server +# and its associated components, including themes and apps. It uses a matrix strategy +# to process multiple components in parallel, generating separate SBOMs for: +# - PHP dependencies (via Composer and CycloneDX) +# - JavaScript dependencies (via NPM and CycloneDX) +# - Combined SBOMs when components have both PHP and NPM dependencies +# +# The generated SBOMs are then uploaded to a Dependency Track instance for +# vulnerability scanning and license compliance monitoring. +# +# Workflow Structure: +# 1. get-version: Extracts the project version from version.php +# 2. setup-matrix: Defines the matrix of components to process +# 3. generate-sbom: Generates SBOMs for each component (runs in parallel) +# 4. upload-sboms: Uploads all generated SBOMs to Dependency Track +# +# Components processed: +# - Main Nextcloud server (root directory) +# - Custom legacy theme (themes/nc-ionos-theme/IONOS) +# - Custom apps (apps-custom/*) +# - External apps (apps-external/*) + +on: + push: + branches: + # Enable once approved + - ionos-stable + +env: + NODE_OPTIONS: "--max-old-space-size=4096" + +jobs: + # Job 1: Extract version information from the repository + # This job retrieves the version.php file and extracts the version string + # to create a consistent project version identifier for all SBOMs + get-version: + runs-on: self-hosted + permissions: + contents: read + name: get-version + + outputs: + project_version: ${{ steps.get-version.outputs.project_version }} + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + - name: Get version.php + run: curl -o version.php https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/version.php + + - name: Get version string from version.php + id: get-version + run: | + # Extract version string from PHP file and create project version identifier + VERSION_STRING=$(php -r "include 'version.php'; echo \$OC_VersionString;") + COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7) + PROJECT_VERSION="v${VERSION_STRING}-${COMMIT_SHA}" + echo "version_string=${VERSION_STRING}" >> $GITHUB_OUTPUT + echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT + echo "project_version=${PROJECT_VERSION}" >> $GITHUB_OUTPUT + echo "Project version: ${PROJECT_VERSION}" + + # Job 2: Define the matrix of components to process + # This job creates a JSON matrix containing all components that need SBOM generation. + # Each component entry includes: + # - name: Component identifier + # - path: Relative path to the component directory + # - has_composer: Whether the component has PHP dependencies + # - has_npm: Whether the component has NPM dependencies + # - composer_output/npm_output: Output filenames for generated SBOMs + # - project_id: Environment variable name for Dependency Track project ID + setup-matrix: + runs-on: self-hosted + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + run: | + # Define the matrix of components to process + # Each component entry specifies its dependencies and output configuration + matrix='{ + "component": [ + { + "name": "nextcloud", + "project_name": "HiDrive NEXT Core", + "path": ".", + "composer_output": "bom.nextcloud.composer.json", + "npm_output": "bom.nextcloud.npm.json" + }, + { + "name": "theme-nc-ionos-theme-legacy", + "project_name": "HiDrive NEXT Theme: nc-ionos-theme", + "path": "themes/nc-ionos-theme/IONOS", + "npm_output": "bom.theme-nc-ionos-theme-legacy.json" + }, + { + "name": "app-simplesettings", + "project_name": "HiDrive NEXT App: simplesettings", + "path": "apps-custom/simplesettings", + "composer_output": "bom.app-simplesettings.composer.json", + "npm_output": "bom.app-simplesettings.npm.json" + }, + { + "name": "app-googleanalytics", + "project_name": "HiDrive NEXT App: googleanalytics", + "path": "apps-custom/googleanalytics", + "composer_output": "bom.app-googleanalytics.json" + }, + { + "name": "app-ionos-processes", + "project_name": "HiDrive NEXT App: nc_ionos_processes", + "path": "apps-custom/nc_ionos_processes", + "composer_output": "bom.app-ionos-processes.json" + }, + { + "name": "app-theming", + "project_name": "HiDrive NEXT App: nc_theming", + "path": "apps-custom/nc_theming", + "composer_output": "bom.app-theming.json" + }, + { + "name": "app-viewer", + "project_name": "HiDrive NEXT App: viewer", + "path": "apps-external/viewer", + "composer_output": "bom.app-viewer.composer.json", + "npm_output": "bom.app-viewer.npm.json" + }, + { + "name": "app-user_oidc", + "project_name": "HiDrive NEXT App: user_oidc", + "path": "apps-external/user_oidc", + "composer_output": "bom.app-user_oidc.composer.json", + "npm_output": "bom.app-user_oidc.npm.json" + }, + { + "name": "app-groupquota", + "project_name": "HiDrive NEXT App: groupquota", + "path": "apps-external/groupquota", + "composer_output": "bom.app-groupquota.json" + }, + { + "name": "app-richdocuments", + "project_name": "HiDrive NEXT App: richdocuments", + "path": "apps-external/richdocuments", + "composer_output": "bom.app-richdocuments.composer.json", + "npm_output": "bom.app-richdocuments.npm.json" + }, + { + "name": "app-files_downloadlimit", + "project_name": "HiDrive NEXT App: files_downloadlimit", + "path": "apps-external/files_downloadlimit", + "composer_output": "bom.app-files_downloadlimit.composer.json", + "npm_output": "bom.app-files_downloadlimit.npm.json" + }, + { + "name": "app-serverinfo", + "project_name": "HiDrive NEXT App: serverinfo", + "path": "apps-external/serverinfo", + "composer_output": "bom.app-serverinfo.json" + } + ] + }' + echo "matrix=$(echo $matrix | jq -c .)" >> $GITHUB_OUTPUT + + # Job 3: Generate SBOMs for each component (runs in parallel) + # This job uses the matrix strategy to process each component defined in setup-matrix. + # For each component, it: + # 1. Sets up the appropriate runtime environment (PHP and/or Node.js) + # 2. Installs SBOM generation tools (CycloneDX for Composer and NPM) + # 3. Generates SBOMs in CycloneDX format (JSON, spec version 1.6) + # 4. For components with both PHP and NPM dependencies, creates a combined SBOM + # 5. Uploads the generated SBOMs as workflow artifacts + generate-sbom: + runs-on: self-hosted + permissions: + contents: read + name: generate-sbom + needs: [get-version, setup-matrix] + + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} + + steps: + - name: Checkout server + uses: actions/checkout@v5 + with: + submodules: true + + - name: Setup PHP with PECL extension + if: matrix.component.composer_output + uses: shivammathur/setup-php@v2 + with: + tools: composer:v2 + extensions: gd, zip, curl, xml, xmlrpc, mbstring, sqlite, xdebug, pgsql, intl, imagick, gmp, apcu, bcmath, redis, soap, imap, opcache + env: + runner: self-hosted + + - name: Install CycloneDX (Composer) + if: matrix.component.composer_output + run: | + composer global config --no-plugins allow-plugins.cyclonedx/cyclonedx-php-composer true + composer global require cyclonedx/cyclonedx-php-composer:^v5.2.3 + + - name: Generate SBOM (Composer) + if: matrix.component.composer_output + run: | + parent_dir=$(pwd) + echo "parent_dir=${parent_dir}" + cd "${{ matrix.component.path }}" + echo "PWD: $(pwd)" + composer CycloneDX:make-sbom --output-file="${parent_dir}/${{ matrix.component.composer_output }}" --output-format=JSON --spec-version=1.6 + ls -la "${parent_dir}/${{ matrix.component.composer_output }}" + + - name: Set up Node.js + if: matrix.component.npm_output + uses: actions/setup-node@v4 + with: + node-version-file: "${{ matrix.component.path }}/package.json" + cache: 'npm' + cache-dependency-path: "${{ matrix.component.path }}/package-lock.json" + + - name: Install NPM dependencies + if: matrix.component.npm_output + working-directory: ${{ matrix.component.path }} + env: + FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }} + run: | + if [ "${{ matrix.component.name }}" == "nextcloud" ]; then + cd custom-npms/nc-mdi-js && npm ci && cd ../.. + cd custom-npms/nc-vue-material-design-icons && npm ci && cd ../.. + cd custom-npms/nc-nextcloud-vue && npm ci && cd ../.. + fi + npm ci + + - name: Generate SBOM (NPM) + if: matrix.component.npm_output + run: | + parent_dir=$(pwd) + cd "${{ matrix.component.path }}" + npx @cyclonedx/cyclonedx-npm --ignore-npm-errors --package-lock-only --output-format JSON --spec-version 1.6 --output-file "${parent_dir}/${{ matrix.component.npm_output }}" + ls -la "${parent_dir}/${{ matrix.component.npm_output }}" + + - name: Upload component SBOM artifacts + uses: actions/upload-artifact@v4 + with: + name: sbom-${{ matrix.component.name }} + path: | + ${{ matrix.component.composer_output }} + ${{ matrix.component.npm_output }} + if-no-files-found: ignore + + # Job 4: Upload SBOMs to Dependency Track + # This job downloads all SBOM artifacts generated by the previous job and uploads + # them to a Dependency Track instance for vulnerability scanning and analysis. + # The upload only happens for specific branches (ionos-stable and the feature branch). + # + # The job: + # 1. Downloads all SBOM artifacts from the generate-sbom job + # 2. Iterates through each component in the matrix + # 3. Determines which SBOM file to upload (combined, composer-only, or npm-only) + # 4. Uploads each SBOM to the corresponding Dependency Track project + # 5. Uses custom CA certificate for secure communication with Dependency Track + upload-sboms: + needs: [ get-version, setup-matrix, generate-sbom ] + runs-on: self-hosted + + steps: + - name: Download all SBOM artifacts + uses: actions/download-artifact@v5 + with: + pattern: sbom-* + merge-multiple: true + + - name: List downloaded files + run: | + ls -la *.json || echo "No BOM JSON files found" + + - name: Upload SBOMs to Dependency Track + if: github.ref == 'refs/heads/ionos-stable' + env: + DT_BASE_URL: ${{ vars.DEPENDENCY_TRACK_BASE_URL }} + DT_API_KEY: ${{ secrets.DEPENDENCY_TRACK_API_KEY }} + DT_ROOT_OBJECT_ID: ${{ vars.DT_ROOT_OBJECT_ID }} + IONOS_CA_CERT: ${{ secrets.IONOS_CA }} + MATRIX_CONTEXT: ${{ needs.setup-matrix.outputs.matrix }} + PROJECT_VERSION: ${{ needs.get-version.outputs.project_version }} + run: | + # Create temporary CA cert file + cert_file=$(mktemp) + echo "$IONOS_CA_CERT" > "${cert_file}" + + echo "Beginning SBOM upload process..." + echo "PROJECT_VERSION: $PROJECT_VERSION" + + # Function to upload SBOM to Dependency Track via REST API + upload_bom() { + local bom_file="$1" + local project_name="$2" + local artifact_type="$3" + local qualified_artifact_name="$2 $3" + + if [[ ! -f "$bom_file" ]]; then + echo "Warning: $bom_file not found, skipping..." + return 0 + fi + + echo "Uploading SBOM ($bom_file) to parent project ${DT_ROOT_OBJECT_ID} ($project_name and artifact type $artifact_type)..." + + response=$(curl \ + --cacert "${cert_file}" \ + --fail-with-body \ + --silent \ + --show-error \ + --write-out "HTTPSTATUS:%{http_code}" \ + -X POST "${DT_BASE_URL}/api/v1/bom" \ + -H "Content-Type: multipart/form-data" \ + -H "X-API-Key: ${DT_API_KEY}" \ + -F "isLatest=true" \ + -F "autoCreate=true" \ + -F "parentUUID=${DT_ROOT_OBJECT_ID}" \ + -F "projectName=${qualified_artifact_name}" \ + -F "projectTags=hidrive_next,nextcloud" \ + -F "projectVersion=${PROJECT_VERSION}" \ + -F "bom=@${bom_file}") + + http_code=$(echo "$response" | grep -o "HTTPSTATUS:[0-9]*" | cut -d: -f2) + body=$(echo "$response" | sed -E 's/HTTPSTATUS:[0-9]*$//') + + if [[ "$http_code" -ge 200 && "$http_code" -lt 300 ]]; then + echo "✓ Successfully uploaded $bom_file" + else + echo "✗ Failed to upload $bom_file (HTTP $http_code)" + echo "Response: $body" + return 1 + fi + } + + # Upload all BOMs by iterating through the matrix components + # Each component is processed to determine which SBOM file to upload + upload_failed=false + + # Use a temporary file to track failures across subshell boundary + failure_file=$(mktemp) + + echo "${MATRIX_CONTEXT}" | jq -r '.component[] | @base64' | while read -r i; do + echo "Processing component from matrix context..." + component_json=$(echo "$i" | base64 --decode) + + composer_output=$(echo "$component_json" | jq -r '.composer_output') + npm_output=$(echo "$component_json" | jq -r '.npm_output') + component_name=$(echo "$component_json" | jq -r '.name') + project_name=$(echo "$component_json" | jq -r '.project_name') + + echo "Processing component: ${component_name}" + + if [[ "$composer_output" == "null" ]] && [[ "$npm_output" == "null" ]]; then + echo "Skipping component with neither composer nor npm." + continue + fi + + if [[ "$composer_output" != "null" ]]; then + bom_file=$(echo "$component_json" | jq -r '.composer_output') + if ! upload_bom "$bom_file" "$project_name" "composer"; then + echo "Failed to upload composer SBOM for $component_name" + echo "UPLOAD_FAILED" > "$failure_file" + fi + fi + + if [[ "$npm_output" != "null" ]]; then + bom_file=$(echo "$component_json" | jq -r '.npm_output') + if ! upload_bom "$bom_file" "$project_name" "npm"; then + echo "Failed to upload npm SBOM for $component_name" + echo "UPLOAD_FAILED" > "$failure_file" + fi + fi + done + + # Check if any uploads failed by reading the temporary file + if [[ -f "$failure_file" && -s "$failure_file" ]]; then + echo "One or more SBOM uploads failed" + rm -f "$failure_file" "${cert_file}" + exit 1 + fi + + # Cleanup + rm -f "$failure_file" "${cert_file}" + + echo "All SBOMs uploaded successfully!" From 946f3730ea50288d2508a34e658e040dbe861971 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 1 Apr 2026 12:47:42 +0200 Subject: [PATCH 60/81] IONOS(fix): trigger GitLab image pipeline on main branch Per HDNEXT-1373 and HDNEXT-1091, the hidrivenext-image pipeline must be triggered on the 'main' branch (same as ncw-server). Pass BUILD_TYPE variable instead to differentiate dev/stable builds. --- .github/workflows/hidrive-next-build.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 15bdb72925359..4c70b1afea586 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -291,12 +291,17 @@ jobs: # Enable command echo set -x - # The 'ionos-dev' branch will trigger remote "dev" branch workflow - GITLAB_BRANCH="dev" + # Branch to GitLab Trigger Mapping (see HDNEXT-1373): + # | ref_name | GITLAB_REF | BUILD_TYPE | + # |--------------|------------|------------| + # | ionos-dev | main | dev | + # | ionos-stable | main | stable | - # set ARTIFACTORY_STAGE_PREFIX=stable on ionos-stable branch + BUILD_TYPE="dev" + + # Override build type for stable branch if [ ${{ github.ref_name }} == "ionos-stable" ]; then - GITLAB_BRANCH="stable" + BUILD_TYPE="stable" fi # Call webhook @@ -307,11 +312,12 @@ jobs: --fail-with-body \ -o response.json \ --form token=${{ secrets.GITLAB_TOKEN }} \ - --form ref="${GITLAB_BRANCH}" \ + --form ref="main" \ --form "variables[GITHUB_SHA]=${{ github.sha }}" \ --form "variables[ARTIFACTORY_LAST_BUILD_PATH]=${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" \ --form "variables[NC_VERSION]=${{ needs.hidrive-next-build.outputs.NC_VERSION }}" \ --form "variables[BUILD_ID]=${{ github.run_id }}" \ + --form "variables[BUILD_TYPE]=${BUILD_TYPE}" \ "${{ secrets.GITLAB_TRIGGER_URL }}" || ( RETCODE="$?"; jq . response.json; exit "$RETCODE" ) # Disable command echo From 4ec1583115454a578a69914202d352eb44d738d7 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 1 Apr 2026 12:52:03 +0200 Subject: [PATCH 61/81] IONOS(ci): pass SOURCE_BUILD_URL to GitLab trigger Adds traceability link back to the GitHub Actions run that triggered the GitLab image pipeline, matching ncw-server behaviour. --- .github/workflows/hidrive-next-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 4c70b1afea586..9bef39c8470c7 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -304,6 +304,10 @@ jobs: BUILD_TYPE="stable" fi + # Construct source build URL for traceability + SOURCE_BUILD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + echo "Source Build URL: $SOURCE_BUILD_URL" + # Call webhook curl \ --silent \ @@ -318,6 +322,7 @@ jobs: --form "variables[NC_VERSION]=${{ needs.hidrive-next-build.outputs.NC_VERSION }}" \ --form "variables[BUILD_ID]=${{ github.run_id }}" \ --form "variables[BUILD_TYPE]=${BUILD_TYPE}" \ + --form "variables[SOURCE_BUILD_URL]=${SOURCE_BUILD_URL}" \ "${{ secrets.GITLAB_TRIGGER_URL }}" || ( RETCODE="$?"; jq . response.json; exit "$RETCODE" ) # Disable command echo From dd9a7cb49ad36266072413e2db76a0e58c10951b Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 1 Apr 2026 12:52:32 +0200 Subject: [PATCH 62/81] IONOS(ci): add retry logic to GitLab trigger (3 attempts, exponential backoff) Mirrors ncw-server behaviour: retries up to 3 times with 5s/10s/20s delays before failing the job, making the trigger more resilient to transient errors. --- .github/workflows/hidrive-next-build.yml | 67 ++++++++++++++++++------ 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 9bef39c8470c7..c950da2a7428e 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -308,28 +308,61 @@ jobs: SOURCE_BUILD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" echo "Source Build URL: $SOURCE_BUILD_URL" - # Call webhook - curl \ - --silent \ - --insecure \ - --request POST \ - --fail-with-body \ - -o response.json \ - --form token=${{ secrets.GITLAB_TOKEN }} \ - --form ref="main" \ - --form "variables[GITHUB_SHA]=${{ github.sha }}" \ - --form "variables[ARTIFACTORY_LAST_BUILD_PATH]=${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" \ - --form "variables[NC_VERSION]=${{ needs.hidrive-next-build.outputs.NC_VERSION }}" \ - --form "variables[BUILD_ID]=${{ github.run_id }}" \ - --form "variables[BUILD_TYPE]=${BUILD_TYPE}" \ - --form "variables[SOURCE_BUILD_URL]=${SOURCE_BUILD_URL}" \ - "${{ secrets.GITLAB_TRIGGER_URL }}" || ( RETCODE="$?"; jq . response.json; exit "$RETCODE" ) + # Trigger GitLab pipeline via webhook with retry logic (3 attempts with exponential backoff) + MAX_ATTEMPTS=3 + ATTEMPT=1 + TRIGGER_SUCCESS=false + DELAY_SEC=5 + + while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do + echo "Trigger attempt $ATTEMPT of $MAX_ATTEMPTS..." + + if curl \ + --silent \ + --insecure \ + --request POST \ + --fail-with-body \ + -o response.json \ + --form token=${{ secrets.GITLAB_TOKEN }} \ + --form ref="main" \ + --form "variables[GITHUB_SHA]=${{ github.sha }}" \ + --form "variables[ARTIFACTORY_LAST_BUILD_PATH]=${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" \ + --form "variables[NC_VERSION]=${{ needs.hidrive-next-build.outputs.NC_VERSION }}" \ + --form "variables[BUILD_ID]=${{ github.run_id }}" \ + --form "variables[BUILD_TYPE]=${BUILD_TYPE}" \ + --form "variables[SOURCE_BUILD_URL]=${SOURCE_BUILD_URL}" \ + "${{ secrets.GITLAB_TRIGGER_URL }}"; then + TRIGGER_SUCCESS=true + echo "✅ Trigger successful on attempt $ATTEMPT" + break + else + RETCODE="$?" + echo "⚠️ Trigger attempt $ATTEMPT failed with code $RETCODE" + if [ -f response.json ]; then + jq . response.json || cat response.json + fi + if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then + echo "Waiting ${DELAY_SEC} seconds before retry..." + sleep $DELAY_SEC + DELAY_SEC=$((DELAY_SEC * 2)) # Exponential backoff: 5s, 10s, 20s + fi + fi + + ATTEMPT=$((ATTEMPT + 1)) + done + + if [ "$TRIGGER_SUCCESS" != "true" ]; then + echo "❌ Trigger failed after $MAX_ATTEMPTS attempts" + if [ -f response.json ]; then + jq . response.json || cat response.json + fi + exit 1 + fi # Disable command echo set +x # Print and parse json - # jq . response.json echo "json<> $GITHUB_OUTPUT cat response.json >> $GITHUB_OUTPUT echo "END" >> $GITHUB_OUTPUT From ed9963d09f2b345c64e77e98917db7f0f400f9be Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 1 Apr 2026 12:52:57 +0200 Subject: [PATCH 63/81] IONOS(ci): add prerequisites check step to GitLab trigger job Validates that all required secrets and job outputs are present before attempting the trigger, providing clear error messages on misconfiguration. --- .github/workflows/hidrive-next-build.yml | 52 +++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index c950da2a7428e..3c585750bb47b 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -286,9 +286,59 @@ jobs: # Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches if: github.event_name == 'push' && ( github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' ) steps: + - name: Check prerequisites + run: | + echo "Checking if all required variables are set..." + error_count=0 + + if [ -z "${{ secrets.GITLAB_TOKEN }}" ]; then + echo "::error::GITLAB_TOKEN secret is not set" + error_count=$((error_count + 1)) + fi + + if [ -z "${{ secrets.GITLAB_TRIGGER_URL }}" ]; then + echo "::error::GITLAB_TRIGGER_URL secret is not set" + error_count=$((error_count + 1)) + fi + + if [ -z "${{ needs.hidrive-next-build.outputs.NC_VERSION }}" ]; then + echo "::error::NC_VERSION output from hidrive-next-build job is not set" + error_count=$((error_count + 1)) + else + echo "✓ NC_VERSION: ${{ needs.hidrive-next-build.outputs.NC_VERSION }}" + fi + + if [ -z "${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" ]; then + echo "::error::ARTIFACTORY_LAST_BUILD_PATH output from upload-to-artifactory job is not set" + error_count=$((error_count + 1)) + else + echo "✓ ARTIFACTORY_LAST_BUILD_PATH: ${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" + fi + + if [ -z "${{ github.sha }}" ]; then + echo "::error::github.sha is not set" + error_count=$((error_count + 1)) + else + echo "✓ GITHUB_SHA: ${{ github.sha }}" + fi + + if [ -z "${{ github.run_id }}" ]; then + echo "::error::github.run_id is not set" + error_count=$((error_count + 1)) + else + echo "✓ BUILD_ID: ${{ github.run_id }}" + fi + + if [ $error_count -ne 0 ]; then + echo "::error::Required variables are not set. Aborting." + exit 1 + fi + + echo "✅ All required variables are set" + - name: Trigger remote workflow run: | - # Enable command echo + # Enable command echo for debugging purposes set -x # Branch to GitLab Trigger Mapping (see HDNEXT-1373): From 3192322fd9b2650bf1c0523db09f324ea4dfe09b Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 1 Apr 2026 12:53:26 +0200 Subject: [PATCH 64/81] IONOS(ci): add DISABLE_REMOTE_TRIGGER guard and explicit job conditions Allows disabling the GitLab trigger via a repository variable without modifying the workflow file. Also makes dependent job success conditions explicit, matching ncw-server behaviour. --- .github/workflows/hidrive-next-build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index 3c585750bb47b..dfa0cf7443049 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -284,7 +284,15 @@ jobs: name: Trigger remote workflow needs: [ hidrive-next-build, upload-to-artifactory ] # Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches - if: github.event_name == 'push' && ( github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' ) + # Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable) + # Configure at: https://github.com/IONOS-Productivity/nc-server/settings/variables/actions + if: | + always() && + github.event_name == 'push' && + (github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') && + needs.hidrive-next-build.result == 'success' && + needs.upload-to-artifactory.result == 'success' && + vars.DISABLE_REMOTE_TRIGGER != 'true' steps: - name: Check prerequisites run: | From 51c4b91fa21b7bd82905146b11c67a289212e1f1 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 7 Apr 2026 17:01:36 +0200 Subject: [PATCH 65/81] IONOS(build): inject build number as 5th version component Implements build number injection system for production traceability: - Modified version.php to read .buildnumber file and append build ID as $OC_Version[4] - Updated hidrive-next-build.yml workflow to create .buildnumber file with GitHub run_number - Added .buildnumber to .gitignore for CI/CD generated files This preserves the original semantic version while adding build metadata for tracking specific CI/CD runs in production environments. Ported from IONOS-Productivity/ncw-server commit 0f2d429d4c5 Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/hidrive-next-build.yml | 9 +++++ .gitignore | 3 ++ version.php | 48 ++++++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/.github/workflows/hidrive-next-build.yml b/.github/workflows/hidrive-next-build.yml index dfa0cf7443049..4003a91762670 100644 --- a/.github/workflows/hidrive-next-build.yml +++ b/.github/workflows/hidrive-next-build.yml @@ -120,6 +120,15 @@ jobs: - name: Add config partials run: make -f IONOS/Makefile add_config_partials + # IONOS Customization: Inject build number for production traceability + # This is specific to IONOS HiDrive Next and not part of upstream Nextcloud + - name: Inject build number + run: | + echo "${{ github.run_number }}" > .buildnumber + echo "✅ Build number injected: ${{ github.run_number }}" + echo "📄 File created: .buildnumber" + cat .buildnumber + - name: Zip dependencies run: make -f IONOS/Makefile zip_dependencies TARGET_PACKAGE_NAME=${{ env.TARGET_PACKAGE_NAME }} diff --git a/.gitignore b/.gitignore index 26a3886433776..e29c711eb51b2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ /translationfiles /translationtool.phar +# CI/CD generated files +/.buildnumber + # ignore all apps except core ones /apps*/* !/apps/cloud_federation_api diff --git a/version.php b/version.php index d4ccca163f7e8..7d8857d385d32 100644 --- a/version.php +++ b/version.php @@ -35,3 +35,51 @@ // Vendor of this package $vendor = 'nextcloud'; + +// ============================================================================ +// CI/CD Build Number Injection (IONOS Nextcloud Workspace) +// ============================================================================ +// Injects a 5th element into the $OC_Version array from the .buildnumber file. +// This file is automatically created by the CI/CD pipeline (build-artifact.yml) +// and contains the GitHub workflow run ID for traceability. +// +// NOTE: This is an IONOS-specific customization for Nextcloud Workspace. +// It is not part of upstream Nextcloud and is used for tracking +// IONOS Nextcloud Workspace builds in production environments. +// +// @since 31.0.8 +// +// Purpose: +// - Track which specific CI/CD run produced this artifact +// - Enable direct linking to workflow logs and build details +// - Distinguish between different builds of the same version +// - Support debugging by identifying exact build in production +// +// File Format: +// .buildnumber - Single line containing an integer (GitHub run ID) +// Example: 12345678901 +// +// Result: +// Without .buildnumber: $OC_Version = [31, 0, 8, 1] +// With .buildnumber: $OC_Version = [31, 0, 8, 1, 12345678901] +// +// Accessed via: +// - ServerVersion::getBuildId() -> 12345678901 +// - ServerVersion::getHumanVersion() -> "31.0.8 (12345678901)" +// - ServerVersion::getVersion() -> [31, 0, 8, 1, 12345678901] +// +// Workflow URL Construction: +// https://github.com/{org}/{repo}/actions/runs/{buildId} +// +// ============================================================================ +$buildNumberFile = __DIR__ . '/.buildnumber'; +if (file_exists($buildNumberFile)) { + $buildNumberContent = @file_get_contents($buildNumberFile); + if ($buildNumberContent !== false) { + $buildId = (int)trim($buildNumberContent); + if ($buildId > 0) { + // Append build ID as 5th element in version array + $OC_Version[] = $buildId; + } + } +} From 0a750ff08f80afff6297726e7a26d87ed212585a Mon Sep 17 00:00:00 2001 From: Arsalan Ul Haq Sohni Date: Wed, 22 Apr 2026 11:26:58 +0200 Subject: [PATCH 66/81] IONOS: apply latest submodule pointers from ionos-dev Apply final submodule pointer state from ionos-dev for all IONOS-managed submodules (apps-custom, apps-external, custom-npms, themes, IONOS config). apps-external pointers are placeholders and will be updated to v32-compatible commits in a follow-up step. --- apps-custom/googleanalytics | 1 + apps-custom/nc_theming | 2 +- apps-custom/simplesettings | 1 + apps-external/files_downloadlimit | 2 +- apps-external/groupquota | 2 +- apps-external/richdocuments | 2 +- apps-external/serverinfo | 2 +- apps-external/user_oidc | 1 + apps-external/viewer | 1 + custom-npms/nc-mdi-svg | 2 +- custom-npms/nc-nextcloud-vue | 2 +- custom-npms/nc-vue-material-design-icons | 2 +- themes/nc-ionos-theme | 2 +- 13 files changed, 13 insertions(+), 9 deletions(-) create mode 160000 apps-custom/googleanalytics create mode 160000 apps-custom/simplesettings create mode 160000 apps-external/user_oidc create mode 160000 apps-external/viewer diff --git a/apps-custom/googleanalytics b/apps-custom/googleanalytics new file mode 160000 index 0000000000000..8766e392f60cb --- /dev/null +++ b/apps-custom/googleanalytics @@ -0,0 +1 @@ +Subproject commit 8766e392f60cb07f0442e4564e14a3463f6dceca diff --git a/apps-custom/nc_theming b/apps-custom/nc_theming index 15853ff3dbcbd..e4b1228608d07 160000 --- a/apps-custom/nc_theming +++ b/apps-custom/nc_theming @@ -1 +1 @@ -Subproject commit 15853ff3dbcbd3e5f6d9455005e5097dd955953c +Subproject commit e4b1228608d076bb85a9fca9e1fdd049cc853b4c diff --git a/apps-custom/simplesettings b/apps-custom/simplesettings new file mode 160000 index 0000000000000..ed207cd49591d --- /dev/null +++ b/apps-custom/simplesettings @@ -0,0 +1 @@ +Subproject commit ed207cd49591db0b5797d2f7e8a016e2c2ef115d diff --git a/apps-external/files_downloadlimit b/apps-external/files_downloadlimit index ae20646b6a2d4..045dbe9d319af 160000 --- a/apps-external/files_downloadlimit +++ b/apps-external/files_downloadlimit @@ -1 +1 @@ -Subproject commit ae20646b6a2d40c92d8fd362f2268b54b370b0cf +Subproject commit 045dbe9d319af844c0f40dd5c5c503d3aeba3316 diff --git a/apps-external/groupquota b/apps-external/groupquota index f4d8a3f900f1f..4536f1cbc03c8 160000 --- a/apps-external/groupquota +++ b/apps-external/groupquota @@ -1 +1 @@ -Subproject commit f4d8a3f900f1fded4499e55a3b5f016a6a7593e2 +Subproject commit 4536f1cbc03c83171ebde36ac556710b3e1ed19a diff --git a/apps-external/richdocuments b/apps-external/richdocuments index 561873ffdfd42..a0cc10c64432b 160000 --- a/apps-external/richdocuments +++ b/apps-external/richdocuments @@ -1 +1 @@ -Subproject commit 561873ffdfd425f42768fc01bc24ef78f9213ef6 +Subproject commit a0cc10c64432b848def95b829e0088ad2e47e4f4 diff --git a/apps-external/serverinfo b/apps-external/serverinfo index b0579de727c6a..a3fd4aa42c281 160000 --- a/apps-external/serverinfo +++ b/apps-external/serverinfo @@ -1 +1 @@ -Subproject commit b0579de727c6a1959f5f89a6b9caf4f86aa25659 +Subproject commit a3fd4aa42c281ae80c04d522aaeda54817536f2a diff --git a/apps-external/user_oidc b/apps-external/user_oidc new file mode 160000 index 0000000000000..b5a67c7c6454e --- /dev/null +++ b/apps-external/user_oidc @@ -0,0 +1 @@ +Subproject commit b5a67c7c6454ec6f3872ed424283b788cbbae86b diff --git a/apps-external/viewer b/apps-external/viewer new file mode 160000 index 0000000000000..c29e117568089 --- /dev/null +++ b/apps-external/viewer @@ -0,0 +1 @@ +Subproject commit c29e1175680892c21cbf24231f5c31fc5eb9192a diff --git a/custom-npms/nc-mdi-svg b/custom-npms/nc-mdi-svg index 38251205f7131..f5ce243caa55b 160000 --- a/custom-npms/nc-mdi-svg +++ b/custom-npms/nc-mdi-svg @@ -1 +1 @@ -Subproject commit 38251205f7131f7a311592c4f410895494191470 +Subproject commit f5ce243caa55b4bc42b37ca037814b7af74144ba diff --git a/custom-npms/nc-nextcloud-vue b/custom-npms/nc-nextcloud-vue index a942093393dd6..4b74a2074c8d6 160000 --- a/custom-npms/nc-nextcloud-vue +++ b/custom-npms/nc-nextcloud-vue @@ -1 +1 @@ -Subproject commit a942093393dd62cf92ddeb19ade9d202ed07faef +Subproject commit 4b74a2074c8d6dbd2c9e33228973b19189fcf6c3 diff --git a/custom-npms/nc-vue-material-design-icons b/custom-npms/nc-vue-material-design-icons index e15f983a5f2d3..0f588c162bb05 160000 --- a/custom-npms/nc-vue-material-design-icons +++ b/custom-npms/nc-vue-material-design-icons @@ -1 +1 @@ -Subproject commit e15f983a5f2d3be6aa1fd94878b12101783f023c +Subproject commit 0f588c162bb05e6676f4b56035dff17eae8d15cf diff --git a/themes/nc-ionos-theme b/themes/nc-ionos-theme index 09f0c1bcdc2ce..2463c233a1bb6 160000 --- a/themes/nc-ionos-theme +++ b/themes/nc-ionos-theme @@ -1 +1 @@ -Subproject commit 09f0c1bcdc2ce9182e42cb29aafb6812ec6ad5e1 +Subproject commit 2463c233a1bb69d2d04f0db9fcbebe3bd5e6d120 From 84ae0aba1337add37a7a7a0978a0e1abffddf8ef Mon Sep 17 00:00:00 2001 From: Thomas Lehmann Date: Fri, 5 Jul 2024 16:22:38 +0200 Subject: [PATCH 67/81] IONOS: feat(base): add "redirect" config The "redirects" config allows configuring redirects from paths to routes. Example config: "redirects" => { "^/path/regexp" => "an.apps.controller.route.locator" } Use case: * An administrator can configure another app as target for certain paths. Differentiation from Apache redirects: * this allows configuring redirects in one place and avoids spreading the configuration in multiple places. * the target route locator is more expressive/easier to trace than a path Signed-off-by: Thomas Lehmann Signed-off-by: Misha M.-Kupriyanov --- config/config.sample.php | 18 ++++++++++++++++++ lib/base.php | 22 +++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/config/config.sample.php b/config/config.sample.php index 2a886f687a3c6..0c7b6bd806e9b 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -2828,4 +2828,22 @@ * Defaults to `\OC::$SERVERROOT . '/resources/config/ca-bundle.crt'`. */ 'default_certificates_bundle_path' => \OC::$SERVERROOT . '/resources/config/ca-bundle.crt', + +/** + * Request path without /index.php/ maps to a controller path in the form + * ... + * + * - For a FooController.php the controller name is "foo" (lowercase) + * - A handler would be a method in FooController that was annotated with + * - either #[FrontpageRoute] attribute + * - or configured in routes.php + * + * Defaults to ``[]`` (no redirects) + */ +'redirects' => [ + /** + * Example: + * '^\/settings' => 'acmesettings.page.index' + */ +], ]; diff --git a/lib/base.php b/lib/base.php index 8fe9b552bde94..4bf4b3bd03aec 100644 --- a/lib/base.php +++ b/lib/base.php @@ -1088,7 +1088,27 @@ public static function handleRequest(): void { $appManager->loadApps(['filesystem', 'logging']); $appManager->loadApps(); } - Server::get(\OC\Route\Router::class)->match($request->getRawPathInfo()); + $requestPath = $request->getRawPathInfo(); + $redirects = $systemConfig->getValue('redirects', []); + + if ($redirects) { + foreach ($redirects as $fromPattern => $toLocator) { + if (!preg_match('/' . $fromPattern . '/', $requestPath)) { + continue; + } + + try { + $targetLocation = Server::get(IURLGenerator::class)->linkToRouteAbsolute($toLocator); + header('Location: ' . $targetLocation); + return; + } catch (\Exception) { + // In case of container exceptions or + // route not found exceptions we proceed as usual. + } + } + } + + Server::get(\OC\Route\Router::class)->match($requestPath); return; } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) { //header('HTTP/1.0 404 Not Found'); From 2b1464d604a35ae9e5932f8f27e32d1306d6d634 Mon Sep 17 00:00:00 2001 From: Thomas Lehmann Date: Fri, 5 Jul 2024 16:22:38 +0200 Subject: [PATCH 68/81] IONOS: config/redirects.config.php: add redirect /settings => simplesettings The config for the previously added "redirects" feature. Signed-off-by: Thomas Lehmann --- config/redirects.config.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 config/redirects.config.php diff --git a/config/redirects.config.php b/config/redirects.config.php new file mode 100644 index 0000000000000..9730428d36a01 --- /dev/null +++ b/config/redirects.config.php @@ -0,0 +1,13 @@ + [ + // Request path without /index.php/ maps to a controller path in the form + // ... + + // - For a FooController.php the controller name is "foo" (lowercase) + // - A handler would be a method in FooController that was annotated with + // - either #[FrontpageRoute] attribute + // - or configured in routes.php + '^\/settings(\/.*)?' => 'simplesettings.page.index' + ], +]; From 7623b87d29aa85e90acd90df703785794cf3d162 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Fri, 2 Aug 2024 17:44:31 +0200 Subject: [PATCH 69/81] IONOS: feat(files_sharing): confirm share deletion Signed-off-by: Misha M.-Kupriyanov --- apps/files_sharing/src/mixins/SharesMixin.js | 38 +++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 0fdedd6fad0ad..58c158ca0a8d1 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -4,9 +4,10 @@ */ import { getCurrentUser } from '@nextcloud/auth' -import { showError, showSuccess } from '@nextcloud/dialogs' +import { DialogBuilder, showError, showSuccess } from '@nextcloud/dialogs' import { ShareType } from '@nextcloud/sharing' import { emit } from '@nextcloud/event-bus' +import { fetchNode } from '../services/WebdavClient.ts' import PQueue from 'p-queue' import debounce from 'debounce' @@ -278,10 +279,45 @@ export default { } }, + /** + * Display delete share confirmation dialog + * @returns {Promise} + */ + async askDeleteConfirmation() { + let confirmed = false + await new DialogBuilder() + .setName(t('files_sharing', 'Confirm deletion')) + .setText(t('files_sharing', 'You are about to delete this share')) + .setButtons([ + { + label: t('core', 'Cancel'), + }, + { + label: t('files_sharing', 'Delete share'), + type: 'error', + callback: () => { + confirmed = true + }, + }, + ]) + .build() + .show() + + return confirmed + }, /** * Delete share button handler */ async onDelete() { + console.debug('Deleting share', this.share.id) + this.open = false + const deletionConfirmed = await this.askDeleteConfirmation() + + if (!deletionConfirmed) { + console.debug('Deletion aborted', this.share.id) + return + } + try { this.loading = true this.open = false From 4f89f9b049f698949a8b946b7e3fb2b25e67a560 Mon Sep 17 00:00:00 2001 From: Franziska Bath Date: Mon, 16 Sep 2024 19:40:34 +0200 Subject: [PATCH 70/81] IONOS: feat(files): add SidebarQuota component Signed-off-by: Franziska Bath Co-authored-by: Kai Henseler Signed-off-by: Kai Henseler --- apps/files/src/components/SidebarQuota.vue | 161 +++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 apps/files/src/components/SidebarQuota.vue diff --git a/apps/files/src/components/SidebarQuota.vue b/apps/files/src/components/SidebarQuota.vue new file mode 100644 index 0000000000000..ac728ae309657 --- /dev/null +++ b/apps/files/src/components/SidebarQuota.vue @@ -0,0 +1,161 @@ + + + + + + + From fe9ac56dfcc4f2ea579dad4b0e6269c128cfe700 Mon Sep 17 00:00:00 2001 From: Franziska Bath Date: Mon, 16 Sep 2024 19:42:17 +0200 Subject: [PATCH 71/81] IONOS: feat(files): replace NavigationQuota with SidebarQuota Signed-off-by: Franziska Bath --- apps/files/src/views/Navigation.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/files/src/views/Navigation.vue b/apps/files/src/views/Navigation.vue index 0f3c3647c6e86..1ce3dac091aa9 100644 --- a/apps/files/src/views/Navigation.vue +++ b/apps/files/src/views/Navigation.vue @@ -25,7 +25,7 @@