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

Cleaning up

This commit is contained in:
ericgaspar 2021-04-28 23:49:17 +02:00
parent bdf370bc8a
commit a8a7d70e3d
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 43 additions and 52 deletions

View file

@ -7,7 +7,7 @@
*[Lire ce readme en français.](./README_fr.md)*
> *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
@ -30,7 +30,7 @@ How to configure this app: by the admin panel.
## Documentation
* Official documentation: https://fluxbb.org/docs/
* YunoHost documentation: https://yunohost.org/#/app_fluxbb
* YunoHost documentation: https://yunohost.org/en/app_fluxbb
## YunoHost specific features
@ -41,8 +41,8 @@ How to configure this app: by the admin panel.
#### 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/)
* 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/)
* 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.svg)](https://ci-apps-arm.yunohost.org/ci/apps/fluxbb/)
## Limitations

View file

@ -7,7 +7,7 @@
*[Read this readme in english.](./README.md)*
> *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
@ -30,7 +30,7 @@ Comment configurer cette application : via le panneau d'administration.
## Documentation
* 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
@ -41,8 +41,8 @@ Comment configurer cette application : via le panneau d'administration.
#### 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/)
* 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/)
* 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.svg)](https://ci-apps-arm.yunohost.org/ci/apps/fluxbb/)
## Limitations

View file

@ -15,7 +15,7 @@
"url": "https://miaou.org"
},
"requirements": {
"yunohost": ">= 4.0.0"
"yunohost": ">= 4.1.7"
},
"multi_instance": true,
"services": [
@ -28,38 +28,22 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for FluxBB",
"fr": "Choisissez un nom de domaine pour FluxBB"
},
"example": "example.com"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for FluxBB",
"fr": "Choisissez un chemin pour FluxBB"
},
"example": "/forum",
"default": "/fluxbb"
},
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez ladministrateur"
},
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": {
"en": "Visibility of the forum",
"fr": "La visibilité du forum"
@ -79,10 +63,6 @@
{
"name": "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
---
*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*
[![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)/)
* 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!"*

View file

@ -24,11 +24,28 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info "Loading installation settings..."
ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# 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 THE SYNTAX OF THE PATHS
#=================================================
@ -59,7 +76,7 @@ fi
#=================================================
# 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
@ -90,7 +107,7 @@ fi
#=================================================
# 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

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=path --value=$path_url
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
#=================================================
@ -110,7 +109,7 @@ chown -R $app: $final_path
#=================================================
# 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
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
#=================================================
ynh_print_info "Configuring SSOwat..."
ynh_print_info "Configuring permissions..."
if [ $is_public -eq 0 ]
then
ynh_permission_update --permission "main" --remove "visitors"
ynh_permission_update --permission="main" --remove="visitors"
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..."
systemctl reload php$phpversion-fpm
systemctl reload nginx
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT

View file

@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
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)
language=$(ynh_app_setting_get --app=$app --key=language)
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..."
# 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 [ -z $db_name ]; then
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
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
#=================================================
@ -78,7 +75,7 @@ ynh_setup_source "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_print_info "Upgrading nginx web server configuration..."
ynh_print_info "Upgrading NGINX web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config