mirror of
https://github.com/YunoHost-Apps/nodered_ynh.git
synced 2024-09-03 19:46:25 +02:00
cleaning
This commit is contained in:
parent
4edd1a38cd
commit
0364348fd4
5 changed files with 9 additions and 50 deletions
|
@ -27,8 +27,6 @@ ynh_backup --src_path="$install_dir"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC BACKUP
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -31,7 +31,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
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"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
|
@ -59,7 +59,7 @@ chown -R $app: "$install_dir/data/settings.js"
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -55,6 +55,8 @@ ynh_script_progression --message="Adding a configuration file..."
|
||||||
# Set up the settings file
|
# Set up the settings file
|
||||||
mkdir -p $install_dir/data
|
mkdir -p $install_dir/data
|
||||||
ynh_add_config --template="../conf/settings.js" --destination="$install_dir/data/settings.js"
|
ynh_add_config --template="../conf/settings.js" --destination="$install_dir/data/settings.js"
|
||||||
|
chmod a-w "$install_dir/data/settings.js"
|
||||||
|
|
||||||
ynh_add_config --template="../conf/settings.user.js" --destination="$install_dir/data/settings.user.js"
|
ynh_add_config --template="../conf/settings.user.js" --destination="$install_dir/data/settings.user.js"
|
||||||
|
|
||||||
# Small hack to have the "/" path answer with a 200 code to satisfy the CI
|
# Small hack to have the "/" path answer with a 200 code to satisfy the CI
|
||||||
|
@ -69,8 +71,6 @@ fi
|
||||||
chmod 750 "$install_dir"
|
chmod 750 "$install_dir"
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app: "$install_dir"
|
chown -R $app: "$install_dir"
|
||||||
# make settings.js readonly
|
|
||||||
chmod a-w "$install_dir/data/settings.js"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -88,7 +88,7 @@ yunohost service add $app --description="Low-code programming for event-driven a
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -29,7 +29,7 @@ chown -R $app: /var/log/$app
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..."
|
ynh_script_progression --message="Reinstalling dependencies..."
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ yunohost service add $app --description="Low-code programming for event-driven a
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
|
@ -22,52 +22,13 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
# If install_dir doesn't exist, create it
|
|
||||||
if [ -z "$install_dir" ]; then
|
|
||||||
#REMOVEME? install_dir=/var/www/$app
|
|
||||||
#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
|
||||||
#REMOVEME? if ynh_legacy_permissions_exists; then
|
|
||||||
#REMOVEME? ynh_legacy_permissions_delete_all
|
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
# After 1.3.5~ynh2, permissions have been reworked
|
|
||||||
#REMOVEME? if ynh_permission_exists --permission="admin"; then
|
|
||||||
# Delete the admin permission
|
|
||||||
ynh_permission_delete --permission="admin"
|
|
||||||
# We use main as admin permission
|
|
||||||
ynh_permission_url --permission="main" --url="/admin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#REMOVEME? if ! ynh_permission_exists --permission="ui"; then
|
|
||||||
# Create ui permission, for the dashboard
|
|
||||||
#REMOVEME? ynh_permission_create --permission="ui" --url="/ui" --show_tile=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
#REMOVEME? if ! ynh_permission_exists --permission="endpoints"; then
|
|
||||||
# Create endpoints permission
|
|
||||||
#REMOVEME? ynh_permission_create --permission="endpoints" --url="/" --show_tile=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Transfer the publicness of the app to ui and endpoints
|
|
||||||
if ynh_permission_has_user --permission=main --user=visitors; then
|
|
||||||
#REMOVEME? ynh_permission_update --permission="ui" --add="visitors"
|
|
||||||
#REMOVEME? ynh_permission_update --permission="endpoints" --add="visitors"
|
|
||||||
# Remove visitor access to the admin panel
|
|
||||||
#REMOVEME? ynh_permission_update --permission="main" --remove="visitors"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Flows were stored in file named after the hostname.
|
# Flows were stored in file named after the hostname.
|
||||||
# Not very portable. Let's fix that.
|
# Not very portable. Let's fix that.
|
||||||
if [[ ! -f "$install_dir/data/flows.json" && -f "$install_dir/data/flows_$(hostname).json" ]]; then
|
if [[ ! -f "$install_dir/data/flows.json" && -f "$install_dir/data/flows_$(hostname).json" ]]; then
|
||||||
|
@ -157,7 +118,7 @@ chmod a-w "$install_dir/data/settings.js"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue