From 3a76876468057e212901a60232806566b17c0943 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Nov 2021 07:30:14 +0100 Subject: [PATCH 1/6] fix --- conf/nginx.conf | 5 ----- manifest.json | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 556b622..549b52a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file diff --git a/manifest.json b/manifest.json index a6cc7ef..05fcfc1 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "website": "https://fluxbb.org/", "demo": "https://fluxbb.org/forums/index.php", "admindoc": "https://fluxbb.org/docs/", - "userdoc": "https://yunohost.org/en/app_fluxbb" + "code": "https://github.com/fluxbb/fluxbb/" }, "license": "GPL-2.0-only", "maintainer": { @@ -22,7 +22,7 @@ "url": "https://miaou.org" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ From ee7707946343c9c042e8950c2438baba15bc2313 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 22 Nov 2021 06:30:25 +0000 Subject: [PATCH 2/6] 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 e973afd..9a7001d 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ HTTP and LDAP authentication are not supported. ## Documentation and resources * Official app website: https://fluxbb.org/ -* Official user documentation: https://yunohost.org/en/app_fluxbb * Official admin documentation: https://fluxbb.org/docs/ +* Upstream app code repository: https://github.com/fluxbb/fluxbb/ * YunoHost documentation for this app: https://yunohost.org/app_fluxbb * Report a bug: https://github.com/YunoHost-Apps/fluxbb_ynh/issues diff --git a/README_fr.md b/README_fr.md index d3e99ef..f1578ff 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,8 +30,8 @@ HTTP and LDAP authentication are not supported. ## Documentations et ressources * Site officiel de l'app : https://fluxbb.org/ -* Documentation officielle utilisateur : https://yunohost.org/en/app_fluxbb * Documentation officielle de l'admin : https://fluxbb.org/docs/ +* Dépôt de code officiel de l'app : https://github.com/fluxbb/fluxbb/ * Documentation YunoHost pour cette app : https://yunohost.org/app_fluxbb * Signaler un bug : https://github.com/YunoHost-Apps/fluxbb_ynh/issues From 17062d2e8280d4760b5d907de23fdb3a8354586a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 17:29:57 +0100 Subject: [PATCH 3/6] Fix --- .github/workflows/updater.sh | 129 +++++++++++++++++++++++++++++++++++ conf/app.src | 4 +- scripts/restore | 3 +- 3 files changed, 132 insertions(+), 4 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..ea6c155 --- /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 + *"fluxbb-"*".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/app.src b/conf/app.src index 7a9849a..d5dde2e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://fluxbb.org/download/releases/1.5.11/fluxbb-1.5.11.tar.gz -SOURCE_SUM=dacc6ae22fc8a6183b47e7e0ddc7d0a0a75b6c7203efc2194fd3af32c65a734f +SOURCE_URL=https://github.com/fluxbb/fluxbb/archive/refs/tags/fluxbb-1.5.11.tar.gz +SOURCE_SUM=af464ebebb739a9aec7afbe30edf0c6afdcd7df711a73f98fb814b2bffe4bb9e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/scripts/restore b/scripts/restore index 90e99b3..61c68f7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -36,8 +36,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die "There is already a directory: $final_path " +test ! -d $final_path || ynh_die "There is already a directory: $final_path " #================================================= # RESTORE THE NGINX CONFIGURATION From a3c25937c2a39581ad67016847da3414994f7992 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 17:38:41 +0100 Subject: [PATCH 4/6] Fix --- check_process | 1 - conf/config.php | 17 ----------------- doc/DESCRIPTION_fr.md | 1 + doc/DISCLAIMER_fr.md | 3 +++ manifest.json | 2 +- scripts/install | 3 ++- 6 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 conf/config.php create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 doc/DISCLAIMER_fr.md diff --git a/check_process b/check_process index 0e4d873..cfd7fab 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,6 @@ admin="john" is_public=1 password="password_fluxbb" - port="666" ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/conf/config.php b/conf/config.php deleted file mode 100644 index c3536ee..0000000 --- a/conf/config.php +++ /dev/null @@ -1,17 +0,0 @@ - Date: Tue, 23 Nov 2021 16:38:46 +0000 Subject: [PATCH 5/6] Auto-update README --- README.md | 2 +- README_fr.md | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9a7001d..8b9683e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in FluxBB is designed as a lighter, faster alternative to some of the traditional feature heavy forum applications. It is easy to use and has a proven track record of stability and security making it an ideal choice of forum for your website. -**Shipped version:** 1.5.11~ynh4 +**Shipped version:** 1.5.11~ynh5 **Demo:** https://fluxbb.org/forums/index.php diff --git a/README_fr.md b/README_fr.md index f1578ff..669b8ab 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,10 +11,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -FluxBB is designed as a lighter, faster alternative to some of the traditional feature heavy forum applications. It is easy to use and has a proven track record of stability and security making it an ideal choice of forum for your website. +FluxBB est conçu comme une alternative plus légère et plus rapide à certaines des applications traditionnelles de forum lourdes en fonctionnalités. Il est facile à utiliser et a fait ses preuves en matière de stabilité et de sécurité, ce qui en fait un choix de forum idéal pour votre site Web. - -**Version incluse :** 1.5.11~ynh4 +**Version incluse :** 1.5.11~ynh5 **Démo :** https://fluxbb.org/forums/index.php @@ -24,9 +23,9 @@ FluxBB is designed as a lighter, faster alternative to some of the traditional f ## Avertissements / informations importantes -### Limitations with YunoHost +### Limitations avec YunoHost -HTTP and LDAP authentication are not supported. +Les authentifications HTTP et LDAP ne sont pas prises en charge. ## Documentations et ressources * Site officiel de l'app : https://fluxbb.org/ From e3ba7a4b7fcf022a2b5c74c2648e3c4be03e4b89 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 18:39:44 +0100 Subject: [PATCH 6/6] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index cfd7fab..21f632b 100644 --- a/check_process +++ b/check_process @@ -13,7 +13,7 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c + #upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c backup_restore=1 multi_instance=1 change_url=1