mirror of
https://github.com/YunoHost-Apps/nodebb_ynh.git
synced 2024-09-03 19:46:29 +02:00
cleaning
This commit is contained in:
parent
f3dfd81099
commit
336a571c65
5 changed files with 5 additions and 32 deletions
|
@ -13,23 +13,13 @@ ynh_print_info "Declaring files to be backed up..."
|
||||||
ynh_backup "$install_dir"
|
ynh_backup "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC BACKUP
|
|
||||||
#=================================================
|
|
||||||
# BACKUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup "/etc/logrotate.d/$app"
|
ynh_backup "/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup "/etc/systemd/system/$app.service"
|
ynh_backup "/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -61,7 +61,6 @@ setup="{
|
||||||
}"
|
}"
|
||||||
|
|
||||||
pushd $install_dir
|
pushd $install_dir
|
||||||
|
|
||||||
npm install npm@latest --location=global
|
npm install npm@latest --location=global
|
||||||
ynh_exec_as_app node_load_PATH npm install lodash --save
|
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
|
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..."
|
ynh_script_progression "Configuring $app's systemd service..."
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
|
||||||
ynh_config_add_systemd
|
ynh_config_add_systemd
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
|
||||||
ynh_config_add_logrotate
|
ynh_config_add_logrotate
|
||||||
|
|
||||||
yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log"
|
||||||
|
|
|
@ -4,10 +4,9 @@ source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# REMOVE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
|
||||||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
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`)
|
# 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
|
if ynh_hide_warnings yunohost service status $app >/dev/null
|
||||||
|
@ -16,16 +15,12 @@ then
|
||||||
yunohost service remove $app
|
yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
|
||||||
ynh_config_remove_systemd
|
ynh_config_remove_systemd
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
|
||||||
ynh_config_remove_logrotate
|
ynh_config_remove_logrotate
|
||||||
|
|
||||||
# Remove the dedicated NGINX config
|
|
||||||
ynh_config_remove_nginx
|
ynh_config_remove_nginx
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_nodejs_remove
|
ynh_nodejs_remove
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -14,14 +14,11 @@ ynh_restore "$install_dir"
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC RESTORATION
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Reinstalling dependencies..."
|
ynh_script_progression "Reinstalling dependencies..."
|
||||||
|
|
||||||
# Install Nodejs
|
|
||||||
ynh_nodejs_install
|
ynh_nodejs_install
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -29,7 +26,7 @@ ynh_nodejs_install
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Restoring the PostgreSQL database..."
|
ynh_script_progression "Restoring the PostgreSQL database..."
|
||||||
|
|
||||||
ynh_psql_db_shell < "./db.sql""
|
ynh_psql_db_shell < "./db.sql"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# 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_script_progression "Starting $app's systemd service..."
|
||||||
|
|
||||||
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
ynh_systemctl --service=nginx --action=reload
|
ynh_systemctl --service=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -18,16 +18,14 @@ ynh_systemctl --service=$app --action="stop" --log_path="systemd"
|
||||||
ynh_script_progression "Upgrading source files..."
|
ynh_script_progression "Upgrading source files..."
|
||||||
|
|
||||||
pushd $install_dir
|
pushd $install_dir
|
||||||
|
|
||||||
# Shut down your forum
|
# Shut down your forum
|
||||||
git config --system --add safe.directory $install_dir
|
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
|
# Grab the latest and greatest code
|
||||||
git fetch # Grab the latest code from the NodeBB Repository
|
git fetch # Grab the latest code from the NodeBB Repository
|
||||||
git reset --hard origin/$nodebb_version # Replace v1.12.x with the branch name!
|
git reset --hard origin/$nodebb_version # Replace v1.12.x with the branch name!
|
||||||
# Run the NodeBB upgrade script
|
# Run the NodeBB upgrade script
|
||||||
ynh_exec_as_app node_load_PATH $install_dir/nodebb upgrade 2>/dev/null
|
ynh_exec_as_app node_load_PATH $install_dir/nodebb upgrade 2>/dev/null
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
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..."
|
ynh_script_progression "Upgrading NGINX web server configuration..."
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_config_add_nginx
|
ynh_config_add_nginx
|
||||||
|
|
||||||
# Install Nodejs
|
|
||||||
ynh_nodejs_install
|
ynh_nodejs_install
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
|
||||||
ynh_config_add_systemd
|
ynh_config_add_systemd
|
||||||
|
|
||||||
yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log"
|
||||||
|
|
Loading…
Reference in a new issue