From 41fb3044b84f285cb6ab529ff3b6c0cafe1f71b0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 12 Feb 2023 11:26:40 +0100 Subject: [PATCH] Testing : v2.5.4 + add auto-updater + add logrotate (#164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Apply last example_ynh (#117) * Apply last example_ynh * Cleanup backup * Create DISCLAIMER.md * Create DISCLAIMER_fr.md * Auto-update README * Add files via upload * Fix heading size * Auto-update README * Fix heading size * Auto-update README * Fix charset * Auto-update README * Update check_process * 2.4.3 (#125) * Upgrade to 2.4.2~ynh1 * Fix craue_config_setting * Upgrade to 2.4.3~ynh1 * Upgrade to 2.4.3~ynh1 * Auto-update README Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> * Specify PHP version in every calls (#132) * Specify PHP version in every calls * Switch (back) to php7.4 * Add PHP-xml dependency for DOM extension Co-authored-by: lapineige * Auto-update README * Fix php version reference (#136) * Auto-update README * Use YNH_PHP_VERSION * Proper YNH_PHP_VERSION syntax * Proper YNH_PHP_VERSION syntax : typo * YNH_PHP_VERSION: fix missing change * Fix phpversion → YNH_PHP_VERSION * Upgrade to 2.5 (#134) * Upgrade to 2.5 * Auto-update README * Upgrade to 2.5 Co-authored-by: yunohost-bot * Merge master (2.4.3/php7.4) into testing (2.5) (#137) * Testing (#124) * Apply last example_ynh (#117) * Apply last example_ynh * Cleanup backup * Create DISCLAIMER.md * Create DISCLAIMER_fr.md * Auto-update README * Add files via upload * Fix heading size * Auto-update README * Fix heading size * Auto-update README * Fix charset * Auto-update README * Update check_process Co-authored-by: lapineige Co-authored-by: Yunohost-Bot <> * Testing: update to 2.4.3 (#128) * Apply last example_ynh (#117) * Apply last example_ynh * Cleanup backup * Create DISCLAIMER.md * Create DISCLAIMER_fr.md * Auto-update README * Add files via upload * Fix heading size * Auto-update README * Fix heading size * Auto-update README * Fix charset * Auto-update README * Update check_process * 2.4.3 (#125) * Upgrade to 2.4.2~ynh1 * Fix craue_config_setting * Upgrade to 2.4.3~ynh1 * Upgrade to 2.4.3~ynh1 * Auto-update README Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> * Specify PHP version in every calls (#132) * Specify PHP version in every calls * Switch (back) to php7.4 * Add PHP-xml dependency for DOM extension Co-authored-by: lapineige * Auto-update README * Fix php version reference (#136) * Auto-update README * Use YNH_PHP_VERSION * Proper YNH_PHP_VERSION syntax * Proper YNH_PHP_VERSION syntax : typo * YNH_PHP_VERSION: fix missing change * Fix phpversion → YNH_PHP_VERSION Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean Co-authored-by: yunohost-bot Co-authored-by: yalh76 Co-authored-by: tituspijean Co-authored-by: yunohost-bot * 2.5 (#138) * Upgrade to 2.5 * Auto-update README * Upgrade to 2.5 Co-authored-by: yunohost-bot * Auto-update README * Fix PHP dependencies (#142) * Switch version to 2.5.0~ynh2 * Auto-update README * 2.5.1 (#146) * v2.5.1 * Auto-update README * v2.5.1 Co-authored-by: yunohost-bot * fix version number * Auto-update README * fix php7.4-redis conflicting with php-redis (#145) * Auto-update README * Typo in version number (2.5.1, not 2.5.2) * Auto-update README * Setup logrotate (#144) * Setup logrotate * Setup logrotate * Setup logrotate * Setup logrotate * Setup logrotate * bum version number * Auto-update README Co-authored-by: yunohost-bot * Auto-update README * Specify PHP version for Redis (#155) * Specify PHP version for Redis Now available in Bullseye * Auto-update README * Bump requirement to YNH11 for php${version}-redis * Auto-update README Co-authored-by: yunohost-bot * 2.5.2 (#158) * 2.5.2 * Auto-update README Co-authored-by: yunohost-bot * v2.5.2 * Auto-update README * Add auto-updater (#126) * 2.5.4 (#163) * Wallabag 2.5.4 --------- Co-authored-by: yunohost-bot * v2.5.4 updated * Auto-update README --------- Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean Co-authored-by: yunohost-bot Co-authored-by: JimboJoe --- .github/workflows/updater.sh | 90 +++++++++++++++++++ .github/workflows/updater.yml | 49 ++++++++++ README.md | 4 +- README_fr.md | 22 ++--- conf/app.src | 4 +- manifest.json | 2 +- sources/patches/app-02-oauth-workaround.patch | 2 +- 7 files changed, 156 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/updater.sh create mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..31aea45 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) +asset_url="https://static.wallabag.org/releases/wallabag-release-$version.tar.gz" + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +echo "Handling asset at $asset_url" + +src="app" +extension="tar.gz" + +# Create the temporary directory +tempdir="$(mktemp -d)" + +# Download sources and calculate checksum +filename=${asset_url##*/} +curl --silent -4 -L $asset_url -o "$tempdir/$filename" +checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + +# Delete temporary directory +rm -rf $tempdir + +# Rewrite source file +cat < conf/$src.src +SOURCE_URL=$asset_url +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=$extension +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true +EOT +echo "... conf/$src.src updated" + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/README.md b/README.md index 28271ed..8ec3b07 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Wallabag for YunoHost -[![Integration level](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Working status](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Working status](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Install Wallabag with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) *[Lire ce readme en français.](./README_fr.md)* @@ -21,7 +21,7 @@ It extracts content so that you can read it when you have time. It provides a web interface, browser (Firefox / Chrome / Opera) add-ons, mobile apps (Android / iOS / Windows Phone) and even on e-reader (PocketBook / Kobo). -**Shipped version:** 2.5.2~ynh1 +**Shipped version:** 2.5.4~ynh2 **Demo:** https://demo.yunohost.org/wallabag/ diff --git a/README_fr.md b/README_fr.md index a6166a7..3eaf985 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,28 +5,28 @@ It shall NOT be edited by hand. # Wallabag pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Installer Wallabag avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Wallabag rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Wallabag rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble [Wallabag](https://www.wallabag.org/) est une application de lecture différée : elle permet simplement d’archiver une page web en ne conservant que le contenu. Les éléments superflus (menus, publicités, etc.) sont supprimés. Sont disponibles une interface web, des add-ons pour navigateurs (Firefox / Chrome / Opera), des applications pour mobile (Android / iOS / Windows Phone) et même sur liseuse (PocketBook / Kobo). -**Version incluse :** 2.5.2~ynh1 +**Version incluse :** 2.5.4~ynh2 **Démo :** https://demo.yunohost.org/wallabag/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Wallabag](./doc/screenshots/screenshot1.webp) +![Capture d’écran de Wallabag](./doc/screenshots/screenshot1.webp) ## Avertissements / informations importantes @@ -55,9 +55,9 @@ Attention : Une mise à jour classique avec l'interface d'administration ou avec ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -73,4 +73,4 @@ ou sudo yunohost app upgrade wallabag2 -u https://github.com/YunoHost-Apps/wallabag2_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/conf/app.src b/conf/app.src index 1af0e45..7387187 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://static.wallabag.org/releases/wallabag-release-2.5.2.tar.gz -SOURCE_SUM=43df3d4a8ac63e6dca06e4211808a7614e871886bd46b86d44fbf01802d4ea39 +SOURCE_URL=https://static.wallabag.org/releases/wallabag-release-2.5.4.tar.gz +SOURCE_SUM=c953105e3181f18bf592541a1c46c318c6663ad00d4687052676b02a7d74c618 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 1f5fe63..6b2beda 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A self hostable read-it-later app", "fr": "Une application de lecture-plus-tard auto-hébergeable" }, - "version": "2.5.2~ynh1", + "version": "2.5.4~ynh2", "url": "https://www.wallabag.org", "upstream": { "license": "MIT", diff --git a/sources/patches/app-02-oauth-workaround.patch b/sources/patches/app-02-oauth-workaround.patch index 7636c08..6326570 100644 --- a/sources/patches/app-02-oauth-workaround.patch +++ b/sources/patches/app-02-oauth-workaround.patch @@ -1,6 +1,6 @@ --- a/vendor/friendsofsymfony/oauth-server-bundle/Storage/OAuthStorage.php 2016-02-22 13:57:55.000000000 +0000 +++ b/vendor/friendsofsymfony/oauth-server-bundle/Storage/OAuthStorage.php 2017-04-13 17:16:06.298501506 +0000 -@@ -166,7 +166,7 @@ +@@ -170,7 +170,7 @@ if (null !== $user) { $encoder = $this->encoderFactory->getEncoder($user);