mirror of
https://github.com/YunoHost-Apps/fluxbb_ynh.git
synced 2024-09-03 18:36:14 +02:00
commit
7ad43c4f6b
12 changed files with 149 additions and 40 deletions
129
.github/workflows/updater.sh
vendored
Executable file
129
.github/workflows/updater.sh
vendored
Executable file
|
@ -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 <<EOT > 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
|
|
@ -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.
|
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
|
**Demo:** https://fluxbb.org/forums/index.php
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ HTTP and LDAP authentication are not supported.
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
* Official app website: https://fluxbb.org/
|
* Official app website: https://fluxbb.org/
|
||||||
* Official user documentation: https://yunohost.org/en/app_fluxbb
|
|
||||||
* Official admin documentation: https://fluxbb.org/docs/
|
* 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
|
* YunoHost documentation for this app: https://yunohost.org/app_fluxbb
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/fluxbb_ynh/issues
|
* Report a bug: https://github.com/YunoHost-Apps/fluxbb_ynh/issues
|
||||||
|
|
||||||
|
|
11
README_fr.md
11
README_fr.md
|
@ -11,10 +11,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
||||||
|
|
||||||
## Vue d'ensemble
|
## 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~ynh5
|
||||||
**Version incluse :** 1.5.11~ynh4
|
|
||||||
|
|
||||||
**Démo :** https://fluxbb.org/forums/index.php
|
**Démo :** https://fluxbb.org/forums/index.php
|
||||||
|
|
||||||
|
@ -24,14 +23,14 @@ FluxBB is designed as a lighter, faster alternative to some of the traditional f
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## 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
|
## Documentations et ressources
|
||||||
|
|
||||||
* Site officiel de l'app : https://fluxbb.org/
|
* 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/
|
* 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
|
* Documentation YunoHost pour cette app : https://yunohost.org/app_fluxbb
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/fluxbb_ynh/issues
|
* Signaler un bug : https://github.com/YunoHost-Apps/fluxbb_ynh/issues
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
admin="john"
|
admin="john"
|
||||||
is_public=1
|
is_public=1
|
||||||
password="password_fluxbb"
|
password="password_fluxbb"
|
||||||
port="666"
|
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=1
|
||||||
|
@ -14,7 +13,7 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c
|
#upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
change_url=1
|
change_url=1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://fluxbb.org/download/releases/1.5.11/fluxbb-1.5.11.tar.gz
|
SOURCE_URL=https://github.com/fluxbb/fluxbb/archive/refs/tags/fluxbb-1.5.11.tar.gz
|
||||||
SOURCE_SUM=dacc6ae22fc8a6183b47e7e0ddc7d0a0a75b6c7203efc2194fd3af32c65a734f
|
SOURCE_SUM=af464ebebb739a9aec7afbe30edf0c6afdcd7df711a73f98fb814b2bffe4bb9e
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
$db_type = 'mysqli';
|
|
||||||
$db_host = 'localhost';
|
|
||||||
$db_name = 'DB_NAME';
|
|
||||||
$db_username = 'DB_USER';
|
|
||||||
$db_password = 'DB_PASS';
|
|
||||||
$db_prefix = '';
|
|
||||||
$p_connect = false;
|
|
||||||
|
|
||||||
$cookie_name = 'pun_cookie_a07c36';
|
|
||||||
$cookie_domain = '';
|
|
||||||
$cookie_path = '/';
|
|
||||||
$cookie_secure = 0;
|
|
||||||
$cookie_seed = 'b47bf15566b0f545';
|
|
||||||
|
|
||||||
define('PUN', 1);
|
|
|
@ -4,11 +4,6 @@ location __PATH__/ {
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __FINALPATH__/ ;
|
alias __FINALPATH__/ ;
|
||||||
|
|
||||||
# Force usage of https
|
|
||||||
if ($scheme = http) {
|
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
|
||||||
}
|
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
||||||
|
|
1
doc/DESCRIPTION_fr.md
Normal file
1
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
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.
|
3
doc/DISCLAIMER_fr.md
Normal file
3
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
### Limitations avec YunoHost
|
||||||
|
|
||||||
|
Les authentifications HTTP et LDAP ne sont pas prises en charge.
|
|
@ -6,14 +6,14 @@
|
||||||
"en": "Fast, light, user-friendly forum software",
|
"en": "Fast, light, user-friendly forum software",
|
||||||
"fr": "Forum de discussions rapide et léger"
|
"fr": "Forum de discussions rapide et léger"
|
||||||
},
|
},
|
||||||
"version": "1.5.11~ynh4",
|
"version": "1.5.11~ynh5",
|
||||||
"url": "https://fluxbb.org/",
|
"url": "https://fluxbb.org/",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "GPL-2.0-only",
|
"license": "GPL-2.0-only",
|
||||||
"website": "https://fluxbb.org/",
|
"website": "https://fluxbb.org/",
|
||||||
"demo": "https://fluxbb.org/forums/index.php",
|
"demo": "https://fluxbb.org/forums/index.php",
|
||||||
"admindoc": "https://fluxbb.org/docs/",
|
"admindoc": "https://fluxbb.org/docs/",
|
||||||
"userdoc": "https://yunohost.org/en/app_fluxbb"
|
"code": "https://github.com/fluxbb/fluxbb/"
|
||||||
},
|
},
|
||||||
"license": "GPL-2.0-only",
|
"license": "GPL-2.0-only",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
"url": "https://miaou.org"
|
"url": "https://miaou.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.2.4"
|
"yunohost": ">= 4.3.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -25,6 +25,7 @@ path_url=$YNH_APP_ARG_PATH
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
password=$YNH_APP_ARG_PASSWORD
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# Installation with cURL
|
# Installation with cURL
|
||||||
ynh_script_progression --message="Finalizing installation..."
|
ynh_script_progression --message="Finalizing installation..."
|
||||||
|
|
||||||
ynh_local_curl "/install.php" "form_sent=1" "install_lang=English" "req_db_type=mysqli_innodb" "req_db_host=localhost" "req_db_name=$db_name" "db_username=$db_user" "db_password=$db_pwd" "db_prefix=fl_" "req_username=$admin" "req_password1=$password" "req_password2=$password" "req_email=$admin@$domain" "req_title=YunoFluxBB" "desc=FluxBB_package_for_Yunohost" "req_base_url=https://$domain$path_url" "req_default_lang=English" "req_default_style=Air"
|
ynh_local_curl "/install.php" "form_sent=1" "install_lang=English" "req_db_type=mysqli_innodb" "req_db_host=localhost" "req_db_name=$db_name" "db_username=$db_user" "db_password=$db_pwd" "db_prefix=fl_" "req_username=$admin" "req_password1=$password" "req_password2=$password" "req_email=$email" "req_title=YunoFluxBB" "desc=FluxBB_package_for_Yunohost" "req_base_url=https://$domain$path_url" "req_default_lang=English" "req_default_style=Air"
|
||||||
|
|
||||||
ynh_secure_remove "$final_path/install.php"
|
ynh_secure_remove "$final_path/install.php"
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path || ynh_die "There is already a directory: $final_path "
|
||||||
|| ynh_die "There is already a directory: $final_path "
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
|
|
Loading…
Reference in a new issue