1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nodebb_ynh.git synced 2024-09-03 19:46:29 +02:00
This commit is contained in:
Éric Gaspar 2024-06-24 14:19:30 +02:00
parent f3dfd81099
commit 336a571c65
5 changed files with 5 additions and 32 deletions

View file

@ -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"
#=================================================

View file

@ -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"

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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"