mirror of
https://github.com/YunoHost-Apps/h5ai_ynh.git
synced 2024-09-03 20:36:25 +02:00
Fix some linter warnings + use ynh_script_progression
This commit is contained in:
parent
b4a4bdb67d
commit
6a8d3c4348
3 changed files with 16 additions and 3 deletions
|
@ -14,7 +14,7 @@
|
||||||
"email": "alex.aubin@mailoo.org"
|
"email": "alex.aubin@mailoo.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.0.0"
|
"yunohost": ">= 3.5.0"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -36,6 +36,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||||
|
|
||||||
# Register (book) web path
|
# Register (book) web path
|
||||||
ynh_webpath_register $app $domain $path_url
|
ynh_webpath_register $app $domain $path_url
|
||||||
|
@ -46,6 +47,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||||
|
|
||||||
ynh_app_setting_set $app is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
|
@ -53,17 +55,19 @@ ynh_app_setting_set $app final_path $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
# For this app sources are in app subdirectory
|
# For this app sources are in app subdirectory
|
||||||
ynh_setup_source "$final_path"
|
ynh_setup_source "$final_path"
|
||||||
|
|
||||||
# Set permissions to phpsysinfo directory
|
# Set permissions to phpsysinfo directory
|
||||||
sudo chown -R www-data: "$final_path"
|
chown -R www-data: "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring nginx web server..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -71,6 +75,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring SSOwat..." --weight=1
|
||||||
|
|
||||||
# Make app public if necessary or protect it
|
# Make app public if necessary or protect it
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
|
@ -82,5 +87,8 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
ynh_script_progression --message="Installation of $app completed" --last
|
||||||
|
|
|
@ -11,6 +11,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
|
@ -19,13 +20,17 @@ final_path=$(ynh_app_setting_get "$app" final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE MAIN DIR OF THE APP
|
# REMOVE THE MAIN DIR OF THE APP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing app main directory..." --weight=1
|
||||||
|
|
||||||
# Remove sources
|
# Remove sources
|
||||||
ynh_secure_remove "$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE NGINX CONFIGURATION
|
# REMOVE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing nginx web server configuration..." --weight=1
|
||||||
|
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
ynh_script_progression --message="Removal of $app completed" --last
|
||||||
|
|
Loading…
Reference in a new issue