|
|
@@ -49,49 +49,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
-#=================================================
|
|
|
-# ENSURE DOWNWARD COMPATIBILITY
|
|
|
-#=================================================
|
|
|
-ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
|
|
-
|
|
|
-#
|
|
|
-# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
|
|
|
-# of what you may want to do in some cases (e.g. a setting was not defined on
|
|
|
-# some legacy installs and you therefore want to initiaze stuff during upgrade)
|
|
|
-#
|
|
|
-
|
|
|
-# If db_name doesn't exist, create it
|
|
|
-#if [ -z "$db_name" ]; then
|
|
|
-# db_name=$(ynh_sanitize_dbid --db_name=$app)
|
|
|
-# ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
|
|
-#fi
|
|
|
-
|
|
|
-# If final_path doesn't exist, create it
|
|
|
-#if [ -z "$final_path" ]; then
|
|
|
-# final_path=/var/www/$app
|
|
|
-# ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|
|
-#fi
|
|
|
-
|
|
|
-### If nobody installed your app before 4.1,
|
|
|
-### then you may safely remove these lines
|
|
|
-
|
|
|
-# Cleaning legacy permissions
|
|
|
-if ynh_legacy_permissions_exists; then
|
|
|
- ynh_legacy_permissions_delete_all
|
|
|
-
|
|
|
- ynh_app_setting_delete --app=$app --key=is_public
|
|
|
-fi
|
|
|
-
|
|
|
-if ! ynh_permission_exists --permission="admin"; then
|
|
|
- # Create the required permissions
|
|
|
- ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
|
|
|
-fi
|
|
|
-
|
|
|
-# Create a permission if needed
|
|
|
-if ! ynh_permission_exists --permission="api"; then
|
|
|
- ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
|
|
|
-fi
|
|
|
-
|
|
|
#=================================================
|
|
|
# CREATE DEDICATED USER
|
|
|
#=================================================
|
|
|
@@ -140,6 +97,7 @@ ynh_add_nginx_config
|
|
|
#=================================================
|
|
|
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
|
|
|
|
|
+env_path="$PATH"
|
|
|
# Create a dedicated systemd config
|
|
|
ynh_add_systemd_config
|
|
|
|
|
|
@@ -148,7 +106,7 @@ ynh_add_systemd_config
|
|
|
#=================================================
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|
|
|
|
|
-yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
|
|
+yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
|
|
|
|
|
|
#=================================================
|
|
|
# START SYSTEMD SERVICE
|