diff --git a/scripts/backup b/scripts/backup index 421c331..402ecb5 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,23 +13,13 @@ ynh_print_info "Declaring files to be backed up..." ynh_backup "$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup "/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/install b/scripts/install index 43140ef..7ae0c0d 100644 --- a/scripts/install +++ b/scripts/install @@ -61,7 +61,6 @@ setup="{ }" pushd $install_dir - npm install npm@latest --location=global ynh_exec_as_app node_load_PATH npm install lodash --save ynh_exec_as_app node_load_PATH $install_dir/nodebb setup "${setup}" 2>/dev/null @@ -76,10 +75,8 @@ chown $app:$app "$install_dir/config.json" #================================================= ynh_script_progression "Configuring $app's systemd service..." -# Create a dedicated systemd config ynh_config_add_systemd -# Use logrotate to manage application logfile(s) ynh_config_add_logrotate yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index 488456a..93c838d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -4,10 +4,9 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression "Removing system configurations related to $app..." # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null @@ -16,16 +15,12 @@ then yunohost service remove $app fi -# Remove the dedicated systemd config ynh_config_remove_systemd -# Remove the app-specific logrotate config ynh_config_remove_logrotate -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove metapackage and its dependencies ynh_nodejs_remove #================================================= diff --git a/scripts/restore b/scripts/restore index 37acc76..957616d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,14 +14,11 @@ ynh_restore "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= ynh_script_progression "Reinstalling dependencies..." -# Install Nodejs ynh_nodejs_install #================================================= @@ -29,7 +26,7 @@ ynh_nodejs_install #================================================= ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_db_shell < "./db.sql"" +ynh_psql_db_shell < "./db.sql" #================================================= # RESTORE SYSTEMD @@ -49,7 +46,6 @@ yunohost service add $app --description="Forum software" --log="/var/log/$app/$a ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service=$app --action="start" --log_path="systemd" - ynh_systemctl --service=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index df5ebd6..bd0e935 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,16 +18,14 @@ ynh_systemctl --service=$app --action="stop" --log_path="systemd" ynh_script_progression "Upgrading source files..." pushd $install_dir - # Shut down your forum git config --system --add safe.directory $install_dir - ynh_exec_as_app node_load_PATH" $install_dir/nodebb stop + ynh_exec_as_app node_load_PATH $install_dir/nodebb stop # Grab the latest and greatest code git fetch # Grab the latest code from the NodeBB Repository git reset --hard origin/$nodebb_version # Replace v1.12.x with the branch name! # Run the NodeBB upgrade script ynh_exec_as_app node_load_PATH $install_dir/nodebb upgrade 2>/dev/null - popd chmod -R o-rwx "$install_dir" @@ -38,13 +36,10 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression "Upgrading NGINX web server configuration..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Install Nodejs ynh_nodejs_install -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log"