mirror of
https://github.com/YunoHost-Apps/fluxbb_ynh.git
synced 2024-09-03 18:36:14 +02:00
Fix
This commit is contained in:
parent
6683b4249e
commit
afa2a00d76
15 changed files with 72 additions and 144 deletions
|
@ -36,8 +36,8 @@ How to configure this app: by the admin panel.
|
||||||
|
|
||||||
#### 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
|
||||||
|
|
||||||
|
@ -46,15 +46,12 @@ Can the app be used by multiple users? yes
|
||||||
|
|
||||||
## 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
|
||||||
|
|
||||||
* Other info you would like to add about this app.
|
* Other info you would like to add about this app.
|
||||||
|
|
||||||
**More info on the documentation page:**
|
|
||||||
https://yunohost.org/packaging_apps
|
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
* 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
|
@ -1,7 +1,5 @@
|
||||||
# FluxBB pour YunoHost
|
# FluxBB pour YunoHost
|
||||||
|
|
||||||
![fluxbb_logo](sources/images/fluxbb_logo.png)
|
|
||||||
|
|
||||||
[![](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.png)](https://install-app.yunohost.org/?app=fluxbb)
|
||||||
|
@ -27,7 +25,7 @@ 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
|
||||||
|
|
||||||
|
@ -38,8 +36,8 @@ Comment configurer cette application: via le panneau d'administration.
|
||||||
|
|
||||||
#### Support multi-utilisateur
|
#### Support multi-utilisateur
|
||||||
|
|
||||||
L'authentification LDAP et HTTP est-elle prise en charge? non
|
* L'authentification LDAP et HTTP est-elle prise en charge ? **Non**
|
||||||
L'application peut-elle être utilisée par plusieurs utilisateurs? oui
|
* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui**
|
||||||
|
|
||||||
#### Architectures supportées
|
#### Architectures supportées
|
||||||
|
|
||||||
|
@ -54,9 +52,6 @@ L'application peut-elle être utilisée par plusieurs utilisateurs? oui
|
||||||
|
|
||||||
* 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`
|
||||||
|
|
||||||
**Plus d'informations sur la page de documentation :**
|
|
||||||
https://yunohost.org/packaging_apps
|
|
||||||
|
|
||||||
## Liens
|
## Liens
|
||||||
|
|
||||||
* Signaler un bug: https://github.com/YunoHost-Apps/fluxbb_ynh/issues
|
* Signaler un bug: https://github.com/YunoHost-Apps/fluxbb_ynh/issues
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
# 1.5.11
|
|
||||||
upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c
|
upgrade=1 from_commit=6a8fea2965da32112d10a659637e3b1cd0b2c61c
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
|
|
|
@ -9,7 +9,6 @@ location __PATH__/ {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
### Example PHP configuration (remove it if not used)
|
|
||||||
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
|
||||||
|
@ -26,7 +25,6 @@ location __PATH__/ {
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
}
|
}
|
||||||
### End of PHP configuration part
|
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Small description of the service
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=__APP__
|
|
||||||
Group=__APP__
|
|
||||||
WorkingDirectory=__FINALPATH__/
|
|
||||||
ExecStart=__FINALPATH__/script >> /var/log/__APP__/__APP__.log 2>&1
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -3,8 +3,8 @@
|
||||||
"id": "fluxbb",
|
"id": "fluxbb",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"description": {
|
"description": {
|
||||||
"en": "A fast, light, user-friendly forum software",
|
"en": "Fast, light, user-friendly forum software",
|
||||||
"fr": "Un forum de discussions rapide et léger."
|
"fr": "Forum de discussions rapide et léger."
|
||||||
},
|
},
|
||||||
"version": "1.5.11~ynh1",
|
"version": "1.5.11~ynh1",
|
||||||
"url": "https://fluxbb.org/",
|
"url": "https://fluxbb.org/",
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
"url": "https://miaou.org"
|
"url": "https://miaou.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.4"
|
"yunohost": ">= 4.0.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
"fr": "Choisissez un chemin pour FluxBB"
|
"fr": "Choisissez un chemin pour FluxBB"
|
||||||
},
|
},
|
||||||
"example": "/forum",
|
"example": "/forum",
|
||||||
"default": "/forum"
|
"default": "/fluxbb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# COMMON VARIABLES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
YNH_PHP_VERSION="7.3"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -15,7 +14,6 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
|
|
|
@ -29,10 +29,6 @@ ynh_print_info "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)
|
||||||
|
|
||||||
# Add settings here as needed by your application
|
|
||||||
#db_name=$(ynh_app_setting_get "$app" db_name)
|
|
||||||
#db_pwd=$(ynh_app_setting_get $app db_pwd)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK THE SYNTAX OF THE PATHS
|
# CHECK THE SYNTAX OF THE PATHS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -96,10 +92,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Reloading NGINX web server..."
|
ynh_print_info "Reloading NGINX web server..."
|
||||||
|
|
||||||
systemctl reload nginx
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info "Change of URL completed for $app"
|
ynh_script_progression --message="Change of URL completed for $app"
|
||||||
|
|
|
@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
|
@ -36,7 +35,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Validating installation parameters..."
|
ynh_script_progression --message="Validating installation parameters..."
|
||||||
|
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||||
|
@ -47,7 +46,7 @@ ynh_webpath_register $app $domain $path_url
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Storing installation settings..."
|
ynh_script_progression --message="Storing installation settings..."
|
||||||
|
|
||||||
ynh_app_setting_set $app domain $domain
|
ynh_app_setting_set $app domain $domain
|
||||||
ynh_app_setting_set $app path $path_url
|
ynh_app_setting_set $app path $path_url
|
||||||
|
@ -68,7 +67,7 @@ ynh_mysql_setup_db $db_user $db_name
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Setting up source files..."
|
ynh_script_progression --message="Setting up source files..."
|
||||||
|
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
|
@ -77,7 +76,7 @@ ynh_setup_source "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Configuring nginx web server..."
|
ynh_script_progression --message="Configuring NGINX web server..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -85,7 +84,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Configuring system user..."
|
ynh_script_progression --message="Configuring system user..."
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
@ -93,55 +92,35 @@ ynh_system_user_create $app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Configuring php-fpm..."
|
ynh_script_progression --message="Configuring PHP-FPM..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP APPLICATION WITH CURL
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Set right permissions for curl install
|
|
||||||
chown -R $app: $final_path
|
|
||||||
|
|
||||||
# Set the app as temporarily public for curl call
|
|
||||||
ynh_print_info "Configuring SSOwat..."
|
|
||||||
ynh_app_setting_set $app skipped_uris "/"
|
|
||||||
# Reload SSOwat config
|
|
||||||
yunohost app ssowatconf
|
|
||||||
|
|
||||||
# Reload Nginx
|
|
||||||
systemctl reload nginx
|
|
||||||
|
|
||||||
# Installation with curl
|
|
||||||
ynh_print_info "Finalizing installation..."
|
|
||||||
#ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
|
|
||||||
# ==== modif perso =====
|
|
||||||
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"
|
|
||||||
# ==== modif perso =====
|
|
||||||
|
|
||||||
# Remove the public access
|
|
||||||
if [ $is_public -eq 0 ]
|
|
||||||
then
|
|
||||||
ynh_app_setting_delete $app skipped_uris
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Removing install.php"
|
|
||||||
|
|
||||||
ynh_secure_remove ${final_path}/install.php # modif perso
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R root: $final_path
|
chown -R $app: $final_path # modif perso
|
||||||
chown -R $app:$app $final_path # modif perso
|
|
||||||
|
#=================================================
|
||||||
|
# SETUP APPLICATION WITH CURL
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Set the app as temporarily public for cURL call
|
||||||
|
ynh_permission_update --permission "main" --add "visitors"
|
||||||
|
|
||||||
|
# Reload NGINX
|
||||||
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
# Installation with cURL
|
||||||
|
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_secure_remove "$final_path/install.php" # modif perso
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
@ -154,22 +133,20 @@ yunohost service add $app --log="/var/log/$app/$app.log"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Configuring SSOwat..."
|
ynh_print_info "Configuring SSOwat..."
|
||||||
|
|
||||||
# Make app public if necessary
|
if [ $is_public -eq 0 ]
|
||||||
if [ $is_public -eq 1 ]
|
|
||||||
then
|
then
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
ynh_permission_update --permission "main" --remove "visitors"
|
||||||
ynh_app_setting_set $app unprotected_uris "/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Reloading NGINX web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
systemctl reload nginx
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info "Installation of $app completed"
|
ynh_script_progression --message="Installation of $app completed"
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -31,14 +31,14 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
# Remove a service from the admin panel, added by `yunohost service add`
|
# Remove a service from the admin panel, added by `yunohost service add`
|
||||||
if yunohost service status $app >/dev/null 2>&1
|
if yunohost service status $app >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
ynh_print_info "Removing $app service"
|
ynh_script_progression --message="Removing $app service"
|
||||||
yunohost service remove $app
|
yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE MYSQL DATABASE
|
# REMOVE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Removing the MySQL database"
|
ynh_script_progression --message="Removing the MySQL database"
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_mysql_remove_db $db_user $db_name
|
ynh_mysql_remove_db $db_user $db_name
|
||||||
|
@ -46,7 +46,7 @@ ynh_mysql_remove_db $db_user $db_name
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Removing app main directory"
|
ynh_script_progression --message="Removing app main directory"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove "$final_path"
|
ynh_secure_remove "$final_path"
|
||||||
|
@ -54,7 +54,7 @@ ynh_secure_remove "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Removing nginx web server configuration"
|
ynh_script_progression --message="Removing NGINX web server configuration"
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated nginx config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
@ -62,7 +62,7 @@ ynh_remove_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE PHP-FPM CONFIGURATION
|
# REMOVE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Removing php-fpm configuration"
|
ynh_script_progression --message="Removing PHP-FPM configuration"
|
||||||
|
|
||||||
# Remove the dedicated php-fpm config
|
# Remove the dedicated php-fpm config
|
||||||
ynh_remove_fpm_config
|
ynh_remove_fpm_config
|
||||||
|
@ -72,7 +72,7 @@ ynh_remove_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEDICATED USER
|
# REMOVE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Removing the dedicated system user"
|
ynh_script_progression --message="Removing the dedicated system user"
|
||||||
|
|
||||||
# Delete a system user
|
# Delete a system user
|
||||||
ynh_system_user_delete $app
|
ynh_system_user_delete $app
|
||||||
|
@ -81,4 +81,4 @@ ynh_system_user_delete $app
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info "Removal of $app completed"
|
ynh_script_progression --message="Removal of $app completed"
|
||||||
|
|
|
@ -24,7 +24,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Loading settings..."
|
ynh_script_progression --message="Loading settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -32,11 +32,12 @@ domain=$(ynh_app_setting_get $app domain)
|
||||||
path_url=$(ynh_app_setting_get $app path)
|
path_url=$(ynh_app_setting_get $app path)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..."
|
||||||
|
|
||||||
ynh_webpath_available $domain $path_url \
|
ynh_webpath_available $domain $path_url \
|
||||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||||
|
@ -54,14 +55,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Restoring the app main directory..."
|
ynh_script_progression --message="Restoring the app main directory..."
|
||||||
|
|
||||||
ynh_restore_file "$final_path"
|
ynh_restore_file "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Recreating the dedicated system user..."
|
ynh_script_progression --message="Recreating the dedicated system user..."
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
@ -83,7 +84,7 @@ ynh_restore_file "/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE MYSQL DATABASE
|
# RESTORE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Restoring the MySQL database..."
|
ynh_script_progression --message="Restoring the MySQL database..."
|
||||||
|
|
||||||
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
||||||
ynh_mysql_setup_db $db_name $db_name $db_pwd
|
ynh_mysql_setup_db $db_name $db_name $db_pwd
|
||||||
|
@ -100,7 +101,7 @@ yunohost service add $app --log="/var/log/$app/$app.log"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Reloading nginx web server and php-fpm..."
|
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
||||||
|
|
||||||
systemctl reload php$phpversion-fpm
|
systemctl reload php$phpversion-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
@ -109,4 +110,4 @@ systemctl reload nginx
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info "Restoration completed for $app"
|
ynh_script_progression --message="Restoration completed for $app"
|
||||||
|
|
|
@ -23,6 +23,7 @@ is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
language=$(ynh_app_setting_get $app language)
|
language=$(ynh_app_setting_get $app language)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
@ -100,39 +101,24 @@ ynh_system_user_create $app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Upgrading php-fpm configuration..."
|
ynh_print_info "Upgrading PHP-FPM configuration..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPGRADE
|
|
||||||
#=================================================
|
|
||||||
# ...
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
|
||||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
|
||||||
ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE"
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
|
||||||
#ynh_store_file_checksum "$final_path/CONFIG_FILE"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing install.php"
|
||||||
|
|
||||||
## === modif perso ====
|
ynh_secure_remove "$final_path/install.php"
|
||||||
ynh_print_info "Removing install.php"
|
|
||||||
ynh_secure_remove ${final_path}/install.php # modif perso
|
|
||||||
## === modif perso ====
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
chown -R root: $final_path
|
chown -R $app: $final_path # modif perso
|
||||||
chown -R $app:$app $final_path # modif perso
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
@ -140,27 +126,15 @@ chown -R $app:$app $final_path # modif perso
|
||||||
|
|
||||||
yunohost service add $app --log="/var/log/$app/$app.log"
|
yunohost service add $app --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Upgrading SSOwat configuration..."
|
|
||||||
|
|
||||||
# Make app public if necessary
|
|
||||||
if [ $is_public -eq 1 ]
|
|
||||||
then
|
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway
|
|
||||||
ynh_app_setting_set $app unprotected_uris "/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Reloading nginx web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
systemctl reload nginx
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info "Upgrade of $app completed"
|
ynh_script_progression --message="Upgrade of $app completed"
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 255 KiB |
Loading…
Reference in a new issue