mirror of
https://github.com/YunoHost-Apps/hedgedoc_ynh.git
synced 2024-09-03 19:25:52 +02:00
Fix (#39)
This commit is contained in:
parent
9ec757470b
commit
5a06d5edfc
7 changed files with 20 additions and 21 deletions
|
@ -3,7 +3,7 @@
|
|||
"protocolUseSSL": true,
|
||||
"domain": "__DOMAIN__",
|
||||
"port": "__PORT__",
|
||||
"urlPath": "__PATH__",
|
||||
"urlPath": "__URL_PATH__",
|
||||
"loglevel": "info",
|
||||
"useCDN": false,
|
||||
"allowGravatar": false,
|
||||
|
@ -30,7 +30,7 @@
|
|||
"addGoogleAnalytics": false
|
||||
},
|
||||
"db": {
|
||||
"username": "__DB_NAME__",
|
||||
"username": "__DB_USER__",
|
||||
"password": "__DB_PWD__",
|
||||
"database": "__DB_NAME__",
|
||||
"host": "localhost",
|
||||
|
|
|
@ -66,4 +66,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_print_info --message="Backup script completed for HedgeDoc. (YunoHost will then actually copy those files to the archive)."
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
|
|
|
@ -73,7 +73,7 @@ fi
|
|||
#=================================================
|
||||
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
|
||||
|
@ -113,10 +113,13 @@ fi
|
|||
ynh_backup_if_checksum_is_different --file="$final_path/config.json"
|
||||
|
||||
domain=$new_domain
|
||||
path=${new_path:1}
|
||||
url_path=${new_path#/}
|
||||
|
||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
|
||||
|
||||
chmod 400 "$final_path/config.json"
|
||||
chown $app:$app "$final_path/config.json"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
|
@ -138,4 +141,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for HedgeDoc" --last
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||
|
|
|
@ -86,9 +86,10 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
|||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -133,10 +134,12 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Modifying a config file..." --weight=1
|
||||
|
||||
path=${path_url:1}
|
||||
|
||||
url_path=${path_url#/}
|
||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
|
||||
|
||||
chmod 400 "$final_path/config.json"
|
||||
chown $app:$app "$final_path/config.json"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -186,4 +189,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Installation of HedgeDoc completed" --last
|
||||
ynh_script_progression --message="Installation of $app completed" --last
|
||||
|
|
|
@ -63,7 +63,7 @@ ynh_remove_nodejs
|
|||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing HedgeDoc main directory..." --weight=6
|
||||
ynh_script_progression --message="Removing $app main directory..." --weight=6
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
@ -90,4 +90,4 @@ ynh_system_user_delete --username=$app
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Removal of HedgeDoc completed" --last
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
|
|
|
@ -64,12 +64,6 @@ ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring user rights..." --weight=2
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app:$app $final_path
|
||||
chmod o-rwx $final_path
|
||||
chmod 600 $final_path/config.json
|
||||
|
@ -134,4 +128,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for HedgeDoc" --last
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
|
|
|
@ -127,7 +127,6 @@ fi
|
|||
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
||||
|
||||
env_path="$PATH"
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
@ -168,4 +167,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of HedgeDoc completed" --last
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
|
|
Loading…
Reference in a new issue