From 917288eb54a9d81cac7588aafa3a9a48e50d7f04 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 31 Mar 2023 14:07:19 +0200 Subject: [PATCH 1/4] add signature generation rename steps --- .woodpecker.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1c02aa5..9c24f2b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -8,13 +8,13 @@ pipeline: event: [tag, push, pull_request] branch: [master, develop, feature/*, fix/*, translations] - osv_detector: + osv-detector: image: gitnet.fr/deblan/osv-detector:v0.10 commands: - osv-detector package-lock.json failure: ignore - build_js: + build-js: image: node:16 commands: - npm run build @@ -22,7 +22,7 @@ pipeline: branch: [master, develop, feature/*, fix/*, translations] event: [tag, push, pull_request] - build_php: + build-translations: image: deblan/php:8.0 commands: - php bin/generate_l10n.php @@ -30,7 +30,24 @@ pipeline: branch: [master, develop, feature/*, fix/*, translations] event: [tag, push, pull_request] - code_quality: + create-signature: + image: nextcloud:25 + secrets: [app_certificate, app_public_certificate] + environment: + SQLITE_DATABASE: /var/www/data/data.db + NEXTCLOUD_ADMIN_USER: admin + NEXTCLOUD_ADMIN_PASSWORD: admin + commands: + - echo "$APP_CERTIFICATE" > "/tmp/side_menu.key" + - echo "$APP_PUBLIC_CERTIFICATE" > "/tmp/side_menu.crt" + - /usr/src/nextcloud/occ integrity:sign-app + --privateKey=/tmp/side_menu.key + --certificate=/tmp/side_menu.crt + --path=$CI_WORKSPACE + when: + event: [tag] + + check-code-quality: image: sonarsource/sonar-scanner-cli secrets: [sonar_token, sonar_host, sonar_project] commands: @@ -45,7 +62,7 @@ pipeline: when: event: [pull_request] - package: + create-package: image: deblan/php:8.0 volumes: - /var/www/html/artifacts:/var/www/html/artifacts @@ -61,7 +78,7 @@ pipeline: when: event: [tag] - release: + push-release: image: plugins/gitea-release volumes: - /var/www/html/artifacts:/var/www/html/artifacts From 361badff6b0f7756917d5c2b660bca578bbd3b5a Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 31 Mar 2023 17:06:30 +0200 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a44bf0..6992410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [Unreleased] +### Added +* add signature on build + ## 3.7.2 ### Added * update pipeline conditions allowing `fix/*` From dca727c120e94869995ada878aba307a1bd0d2d7 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 14 Apr 2023 20:58:56 +0200 Subject: [PATCH 3/4] use app href for redirection (fix #244) --- lib/Controller/AppController.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/Controller/AppController.php b/lib/Controller/AppController.php index 83a0e8c..5516090 100644 --- a/lib/Controller/AppController.php +++ b/lib/Controller/AppController.php @@ -78,29 +78,33 @@ class AppController extends Controller continue; } - return $this->redirectToApp($app['id']); + return $this->redirectToApp($app, true); } return $this->redirectToApp('files'); } - protected function redirectToApp($appId): RedirectResponse + protected function redirectToApp($app, bool $isHref = false): RedirectResponse { - $isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue( - 'htaccess.IgnoreFrontController', - false - ); + if (!$isHref) { + $isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue( + 'htaccess.IgnoreFrontController', + false + ); - $isFrontControllerActive = 'true' === getenv('front_controller_active'); + $isFrontControllerActive = 'true' === getenv('front_controller_active'); - if ($isIgnoreFrontController || $isFrontControllerActive) { - $path = '/apps/%s/'; + if ($isIgnoreFrontController || $isFrontControllerActive) { + $path = '/apps/%s/'; + } else { + $path = '/index.php/apps/%s/'; + } + + $url = $this->urlGenerator->getAbsoluteURL(sprintf($path, $app)); } else { - $path = '/index.php/apps/%s/'; + $url = $app['href']; } - $url = $this->urlGenerator->getAbsoluteURL(sprintf($path, $appId)); - return new RedirectResponse($url); } } From b9264d7e0511f61809d783edbb382adcd239db4e Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 14 Apr 2023 21:12:35 +0200 Subject: [PATCH 4/4] release v3.7.3 --- CHANGELOG.md | 3 +++ appinfo/info.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6992410..0b84da9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [Unreleased] +## 3.7.3 +### Fixed +* fix #244: use app href for redirection ### Added * add signature on build diff --git a/appinfo/info.xml b/appinfo/info.xml index 8614a98..b24bd58 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -32,7 +32,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 3.7.2 + 3.7.3 agpl Simon Vieille SideMenu