From 5bf623c629c8020f48c3237839c6609a35352c93 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 24 Oct 2021 22:59:18 +0200 Subject: [PATCH 01/11] Fix change_url : $domain or $path may be unbound... --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 2a27927..4c1c94a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -128,7 +128,7 @@ fi # SPECIFIC MODIFICATIONS #================================================= -ynh_exec_as $app $final_path/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name +ynh_exec_as $app $final_path/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$new_domain$new_path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name #================================================= # GENERIC FINALIZATION From d999d807ccfc803e99153ae6af305494fbb94a2b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Nov 2021 16:54:36 +0100 Subject: [PATCH 02/11] Update manifest.json --- manifest.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 75a6d53..1e699a0 100644 --- a/manifest.json +++ b/manifest.json @@ -6,14 +6,13 @@ "en": "RSS aggregator with a nice and mobile-friendly design", "fr": "Agrégateur de flux RSS avec une interface adaptée au mobile" }, - "version": "1.18.1~ynh3", + "version": "1.18.1~ynh4", "url": "http://freshrss.org/", "upstream": { "license": "AGPL-3.0-only", "website": "http://freshrss.org/", "demo": "https://demo.freshrss.org", "admindoc": "https://freshrss.github.io/FreshRSS/", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/FreshRSS/FreshRSS" }, "license": "AGPL-3.0-only", @@ -34,8 +33,7 @@ "install": [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "path", @@ -46,8 +44,7 @@ { "name": "admin", "type": "user", - "optional": false, - "example": "homer" + "optional": false }, { "name": "is_public", From cdf555ba8fdc334a7e15ebe13aa4def003a237ad Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 13 Nov 2021 15:54:44 +0000 Subject: [PATCH 03/11] Auto-update README --- README.md | 3 +-- README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a972912..cb12cc5 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in RSS aggregator with a nice and mobile-friendly design -**Shipped version:** 1.18.1~ynh3 +**Shipped version:** 1.18.1~ynh4 **Demo:** https://demo.freshrss.org @@ -38,7 +38,6 @@ API (mini) How To: ## Documentation and resources * Official app website: http://freshrss.org/ -* Official user documentation: https://yunohost.org/apps * Official admin documentation: https://freshrss.github.io/FreshRSS/ * Upstream app code repository: https://github.com/FreshRSS/FreshRSS * YunoHost documentation for this app: https://yunohost.org/app_freshrss diff --git a/README_fr.md b/README_fr.md index 2561f87..763f893 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Agrégateur de flux RSS avec une interface adaptée au mobile -**Version incluse :** 1.18.1~ynh3 +**Version incluse :** 1.18.1~ynh4 **Démo :** https://demo.freshrss.org @@ -34,7 +34,6 @@ API (mini) How To: ## Documentations et ressources * Site officiel de l'app : http://freshrss.org/ -* Documentation officielle utilisateur : https://yunohost.org/apps * Documentation officielle de l'admin : https://freshrss.github.io/FreshRSS/ * Dépôt de code officiel de l'app : https://github.com/FreshRSS/FreshRSS * Documentation YunoHost pour cette app : https://yunohost.org/app_freshrss From f62af276515692313090dd62f8ea8cd1d1093a85 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Nov 2021 16:54:52 +0100 Subject: [PATCH 04/11] Update restore --- scripts/restore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index bb5a383..42773f4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,8 +35,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " From 83bb09373b3100b958ebf215eefa79159543ab4a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 21 Nov 2021 23:15:26 +0100 Subject: [PATCH 05/11] 4.3 --- .github/workflows/updater.sh | 129 +++++++++++++++++++++++++++++++++++ conf/nginx.conf | 4 +- manifest.json | 2 +- scripts/_common.sh | 4 +- scripts/install | 2 +- scripts/restore | 2 - scripts/upgrade | 2 +- 7 files changed, 134 insertions(+), 11 deletions(-) create mode 100755 .github/workflows/updater.sh diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100755 index 0000000..8184f65 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,129 @@ +#!/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. + +# Remove this exit command when you are ready to run this Action +exit 1 + +#================================================= +# 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) +assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) + +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then + version=${version:1} +fi + +# 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 + +# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) +echo "${#assets[@]} available asset(s)" + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +# Here we use the $assets variable to get the resources published in the upstream release. +# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. + +# Let's loop over the array of assets URLs +for asset_url in ${assets[@]}; do + +echo "Handling asset at $asset_url" + +# Assign the asset to a source file in conf/ directory +# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) +# Leave $src empty to ignore the asset +case $asset_url in + *".tar.gz") + src="app" + ;; +esac + +# If $src is not empty, let's process the asset +if [ ! -z "$src" ]; then + +# 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 + +# Get extension +if [[ $filename == *.tar.gz ]]; then + extension=tar.gz +else + extension=${filename##*.} +fi + +# 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 +EOT +echo "... conf/$src.src updated" + +else +echo "... asset ignored" +fi + +done + +#================================================= +# 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/conf/nginx.conf b/conf/nginx.conf index f1cc745..e46bba4 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,7 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { + alias __FINALPATH__/p/; - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } index index.html index.php; diff --git a/manifest.json b/manifest.json index 1e699a0..a327412 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "plopoyop@gmail.com" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 77aad72..49c1c1a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,11 +4,9 @@ # COMMON VARIABLES #================================================= -pkg_dependencies="acl" - YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" +pkg_dependencies="acl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/install b/scripts/install index be73d6f..6333466 100755 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 42773f4..11f8677 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,8 +81,6 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --package="$extra_php_dependencies" - #================================================= # SPECIFIC RESTORATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7ac6a12..a3c2f04 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,7 +121,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # SPECIFIC UPGRADE From 303c8d900983954d311e4fa49288e0ff10277539 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 5 Jan 2022 21:28:58 +0100 Subject: [PATCH 06/11] Update to v1.19.0 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 6741ea2..260fec3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.18.1.tar.gz -SOURCE_SUM=162b0be7bdc0e51022061c895b46e7a8f229588d530b196f06ddd8d9aaaf248a +SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.19.0.tar.gz +SOURCE_SUM=75913b4f2317959d83c7847871f78f3a6f410ca52f3000ac03e5795b3437760f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 5a6b6d269829b609bd61c23a6a3c6f743d66cae4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 5 Jan 2022 21:30:29 +0100 Subject: [PATCH 07/11] Update to v1.19.0 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a327412..a8fd1c5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "RSS aggregator with a nice and mobile-friendly design", "fr": "Agrégateur de flux RSS avec une interface adaptée au mobile" }, - "version": "1.18.1~ynh4", + "version": "1.19.0~ynh1", "url": "http://freshrss.org/", "upstream": { "license": "AGPL-3.0-only", From 7da5b81dea2ad49b18141b737b82fcaab0ad3c04 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 5 Jan 2022 20:30:32 +0000 Subject: [PATCH 08/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb12cc5..b70c034 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in RSS aggregator with a nice and mobile-friendly design -**Shipped version:** 1.18.1~ynh4 +**Shipped version:** 1.19.0~ynh1 **Demo:** https://demo.freshrss.org diff --git a/README_fr.md b/README_fr.md index 763f893..e805f96 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Agrégateur de flux RSS avec une interface adaptée au mobile -**Version incluse :** 1.18.1~ynh4 +**Version incluse :** 1.19.0~ynh1 **Démo :** https://demo.freshrss.org From 949417ab58aca8ed27374865fd4cbf4f2d3ecf66 Mon Sep 17 00:00:00 2001 From: lapineige Date: Thu, 6 Jan 2022 10:33:05 +0100 Subject: [PATCH 09/11] Update to 1.19.1 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a8fd1c5..cb2d6a2 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "RSS aggregator with a nice and mobile-friendly design", "fr": "Agrégateur de flux RSS avec une interface adaptée au mobile" }, - "version": "1.19.0~ynh1", + "version": "1.19.1~ynh1", "url": "http://freshrss.org/", "upstream": { "license": "AGPL-3.0-only", From 8f7fadc01748a6183106e857428b62aa3151deca Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 6 Jan 2022 09:33:07 +0000 Subject: [PATCH 10/11] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b70c034..21e6022 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in RSS aggregator with a nice and mobile-friendly design -**Shipped version:** 1.19.0~ynh1 +**Shipped version:** 1.19.1~ynh1 **Demo:** https://demo.freshrss.org diff --git a/README_fr.md b/README_fr.md index e805f96..698f455 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Agrégateur de flux RSS avec une interface adaptée au mobile -**Version incluse :** 1.19.0~ynh1 +**Version incluse :** 1.19.1~ynh1 **Démo :** https://demo.freshrss.org From 6b7c212ce9bd7af54b187f85efbcd47ef5e5d2fd Mon Sep 17 00:00:00 2001 From: lapineige Date: Thu, 6 Jan 2022 10:33:52 +0100 Subject: [PATCH 11/11] Update to 1.19.1 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 260fec3..e6431de 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.19.0.tar.gz -SOURCE_SUM=75913b4f2317959d83c7847871f78f3a6f410ca52f3000ac03e5795b3437760f +SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.19.1.tar.gz +SOURCE_SUM=32fd540e12380f755cf9e169f8bb405fcd1033b96e78460a29d00948e3a7029c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true