mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
Merge pull request #144 from YunoHost-Apps/example_ynh
example_ynh corrections
This commit is contained in:
commit
0486d088e8
5 changed files with 28 additions and 19 deletions
|
@ -61,7 +61,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Backing up the PostgreSQL database..." --weight=4
|
||||
|
||||
ynh_psql_dump_db "$db_name" > db.sql
|
||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
|
|
|
@ -33,7 +33,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
#db_user=$db_name
|
||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
admin_mail=$(ynh_app_setting_get --app=$app --key=admin_mail)
|
||||
|
||||
#=================================================
|
||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||
|
|
|
@ -77,8 +77,8 @@ ynh_app_setting_set --app=$app --key=language --value=$language
|
|||
ynh_script_progression --message="Configuring firewall..." --weight=1
|
||||
|
||||
# Find a free port
|
||||
port_web=$(ynh_find_port 3000)
|
||||
port_stream=$(ynh_find_port 4000)
|
||||
port_web=$(ynh_find_port --port=3000)
|
||||
port_stream=$(ynh_find_port --port=4000)
|
||||
# Open this port
|
||||
ynh_app_setting_set --app=$app --key=port_web --value=$port_web
|
||||
ynh_app_setting_set --app=$app --key=port_stream --value=$port_stream
|
||||
|
@ -230,7 +230,7 @@ ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming
|
|||
ynh_script_progression --message="Storing the config file checksum..." --weight=1
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum "${final_path}/live/.env.production"
|
||||
ynh_store_file_checksum --file="${final_path}/live/.env.production"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -54,9 +54,9 @@ fi
|
|||
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=27
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config "$app-web"
|
||||
ynh_remove_systemd_config "$app-sidekiq"
|
||||
ynh_remove_systemd_config "$app-streaming"
|
||||
ynh_remove_systemd_config --service="$app-web"
|
||||
ynh_remove_systemd_config --service="$app-sidekiq"
|
||||
ynh_remove_systemd_config --service="$app-streaming"
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE POSTGRESQL DATABASE
|
||||
|
|
|
@ -37,6 +37,12 @@ otp_secret=$(ynh_app_setting_get --app=$app --key=otp_secret)
|
|||
vapid_private_key=$(ynh_app_setting_get --app=$app --key=vapid_private_key)
|
||||
vapid_public_key=$(ynh_app_setting_get --app=$app --key=vapid_public_key)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
@ -143,19 +149,23 @@ ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=sy
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=14
|
||||
|
||||
# Download Mastodon
|
||||
mv "$final_path/live" "$final_path/live_back"
|
||||
ynh_setup_source --dest_dir="$final_path/live"
|
||||
if [ -z $final_path/live_back/public/system ]; then
|
||||
rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/."
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=14
|
||||
|
||||
# Download Mastodon
|
||||
mv "$final_path/live" "$final_path/live_back"
|
||||
ynh_setup_source --dest_dir="$final_path/live"
|
||||
if [ -z $final_path/live_back/public/system ]; then
|
||||
rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/."
|
||||
fi
|
||||
rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
|
||||
rm -Rf "$final_path/live_back"
|
||||
|
||||
# Clean files which are not needed anymore
|
||||
ynh_secure_remove --file="$final_path/live/config/initializers/timeout.rb"
|
||||
fi
|
||||
rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
|
||||
rm -Rf "$final_path/live_back"
|
||||
|
||||
# Clean files which are not needed anymore
|
||||
ynh_secure_remove --file="$final_path/live/config/initializers/timeout.rb"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
|
Loading…
Reference in a new issue