1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fluxbb_ynh.git synced 2024-09-03 18:36:14 +02:00

Merge pull request #14 from YunoHost-Apps/patch

Cleaning up
This commit is contained in:
Éric Gaspar 2021-05-01 12:13:14 +02:00 committed by GitHub
commit 2eb21446e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 67 deletions

View file

@ -7,7 +7,7 @@
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install FluxBB quickly and simply on a YunoHost server. > *This package allow you to install FluxBB quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.*
## Overview ## Overview
@ -25,28 +25,28 @@ FluxBB is fast, light, user-friendly forum software for your website.
## Configuration ## Configuration
How to configure this app: by the admin panel. * How to configure this app: by the admin panel.
## Documentation ## Documentation
* Official documentation: https://fluxbb.org/docs/ * Official documentation: https://fluxbb.org/docs/
* YunoHost documentation: https://yunohost.org/#/app_fluxbb * YunoHost documentation: https://yunohost.org/en/app_fluxbb
## YunoHost specific features ## YunoHost specific features
#### Multi-users support #### Multi-users support
* Are LDAP and HTTP auth supported? no * Are LDAP and HTTP auth supported? **No**
* Can the app be used by multiple users? yes * Can the app be used by multiple users? **Yes**
#### Supported architectures #### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/fluxbb%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/fluxbb/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/fluxbb.svg)](https://ci-apps.yunohost.org/ci/apps/fluxbb/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/fluxbb%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/fluxbb/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/fluxbb.svg)](https://ci-apps-arm.yunohost.org/ci/apps/fluxbb/)
## Limitations ## Limitations
* Change-url : once you change the URL, you should go to the admin panel and change the `Base URL` * Change-URL: once you change the URL, you should go to the admin panel and change the `Base URL`
## Additional information ## Additional information

View file

@ -2,12 +2,12 @@
[![](https://dash.yunohost.org/integration/fluxbb.svg) ![](https://ci-apps.yunohost.org/ci/badges/fluxbb.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/fluxbb.maintain.svg) [![](https://dash.yunohost.org/integration/fluxbb.svg) ![](https://ci-apps.yunohost.org/ci/badges/fluxbb.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/fluxbb.maintain.svg)
](https://dash.yunohost.org/appci/app/fluxbb) ](https://dash.yunohost.org/appci/app/fluxbb)
[![Install FluxBB with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=fluxbb) [![Install FluxBB with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=fluxbb)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer FluxBB rapidement et simplement sur un serveur Yunohost. > *Ce package vous permet d'installer FluxBB rapidement et simplement sur un serveur Yunohost.
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble ## Vue d'ensemble
@ -25,12 +25,12 @@ FluxBB est un forum de discussions écrit en PHP rapide et léger.
## Configuration ## Configuration
Comment configurer cette application : via le panneau d'administration. * Comment configurer cette application : via le panneau d'administration.
## Documentation ## Documentation
* Documentation officielle: https://fluxbb.org/docs/ * Documentation officielle: https://fluxbb.org/docs/
* Documentation YunoHost: https://yunohost.org/#/app_fluxbb * Documentation YunoHost: https://yunohost.org/fr/app_fluxbb
## Caractéristiques spécifiques YunoHost ## Caractéristiques spécifiques YunoHost
@ -41,8 +41,8 @@ Comment configurer cette application : via le panneau d'administration.
#### Architectures supportées #### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/fluxbb%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/fluxbb/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/fluxbb.svg)](https://ci-apps.yunohost.org/ci/apps/fluxbb/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/fluxbb%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/fluxbb/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/fluxbb.svg)](https://ci-apps-arm.yunohost.org/ci/apps/fluxbb/)
## Limitations ## Limitations
@ -50,7 +50,7 @@ Comment configurer cette application : via le panneau d'administration.
## Informations additionnelles ## Informations additionnelles
* Change-url : une fois l'url modifiée, allez dans le panneau de configuration pour modifier le champ `Base URL` * Change-url : une fois l'URL modifiée, allez dans le panneau de configuration pour modifier le champ `Base URL`
## Liens ## Liens

View file

@ -24,7 +24,6 @@
upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=

View file

@ -15,12 +15,12 @@
"url": "https://miaou.org" "url": "https://miaou.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.0.0" "yunohost": ">= 4.1.7"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.0-fpm", "php7.3-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -28,38 +28,22 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for FluxBB",
"fr": "Choisissez un nom de domaine pour FluxBB"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for FluxBB",
"fr": "Choisissez un chemin pour FluxBB"
},
"example": "/forum", "example": "/forum",
"default": "/fluxbb" "default": "/fluxbb"
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez ladministrateur"
},
"example": "johndoe" "example": "johndoe"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": { "help": {
"en": "Visibility of the forum", "en": "Visibility of the forum",
"fr": "La visibilité du forum" "fr": "La visibilité du forum"
@ -78,11 +62,7 @@
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password"
"ask": {
"en": "Set the administrator password",
"fr": "Définissez le mot de passe administrateur"
}
} }
] ]
} }

View file

@ -13,6 +13,4 @@
## Package_check results ## Package_check results
--- ---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* * An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/fluxbb_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/fluxbb_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -24,19 +24,27 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info "Loading installation settings..." ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
#================================================= #=================================================
# CHECK THE SYNTAX OF THE PATHS # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."
test -n "$old_path" || old_path="/" # Backup the current version of the app
test -n "$new_path" || new_path="/" ynh_backup_before_upgrade
new_path=$(ynh_normalize_url_path $new_path) ynh_clean_setup () {
old_path=$(ynh_normalize_url_path $old_path) # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED # CHECK WHICH PARTS SHOULD BE CHANGED
@ -59,7 +67,7 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_print_info "Updating nginx web server configuration..." ynh_script_progression --message="Updating nginx web server configuration..."
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
@ -90,7 +98,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_print_info "Reloading NGINX web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -51,7 +51,6 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=language --value=$language
#================================================= #=================================================
@ -110,7 +109,7 @@ chown -R $app: $final_path
#================================================= #=================================================
# Set the app as temporarily public for cURL call # Set the app as temporarily public for cURL call
ynh_permission_update --permission "main" --add "visitors" ynh_permission_update --permission="main" --add="visitors"
# Reload NGINX # Reload NGINX
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -131,11 +130,11 @@ yunohost service add $app --description="Fast, light, user-friendly forum softwa
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_print_info "Configuring SSOwat..." ynh_print_info "Configuring permissions..."
if [ $is_public -eq 0 ] if [ $is_public -eq 0 ]
then then
ynh_permission_update --permission "main" --remove "visitors" ynh_permission_update --permission="main" --remove="visitors"
fi fi
#================================================= #=================================================

View file

@ -101,8 +101,8 @@ yunohost service add $app --description="Fast, light, user-friendly forum softwa
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
systemctl reload php$phpversion-fpm ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
systemctl reload nginx ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -30,15 +29,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
ynh_print_info "Ensuring downward compatibility..." ynh_print_info "Ensuring downward compatibility..."
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set $app is_public 1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set $app is_public 0
is_public=0
fi
# If db_name doesn't exist, create it # If db_name doesn't exist, create it
if [ -z $db_name ]; then if [ -z $db_name ]; then
db_name=$(ynh_sanitize_dbid $app) db_name=$(ynh_sanitize_dbid $app)
@ -51,6 +41,13 @@ if [ -z $final_path ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -78,7 +75,7 @@ ynh_setup_source "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info "Upgrading nginx web server configuration..." ynh_print_info "Upgrading NGINX web server configuration..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config