mirror of
https://github.com/YunoHost-Apps/hedgedoc_ynh.git
synced 2024-09-03 19:25:52 +02:00
Testing (#40)
- Fix Urls have tree slashs after installation #19 HedgeDoc edit note icon redirect on https://hedgedoc/s/ without yunohost domain #38
This commit is contained in:
parent
ec76e11ccc
commit
56b1ce1fc9
10 changed files with 25 additions and 26 deletions
|
@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
Collaborative editor to work on notes written in Markdown
|
||||
|
||||
**Shipped version:** 1.9.1~ynh1
|
||||
**Shipped version:** 1.9.2~ynh1
|
||||
|
||||
**Demo:** https://demo.hedgedoc.org/
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
|
||||
Éditeur collaboratif pour travailler sur des notes en Markdown
|
||||
|
||||
**Version incluse :** 1.9.1~ynh1
|
||||
**Version incluse :** 1.9.2~ynh1
|
||||
|
||||
**Démo :** https://demo.hedgedoc.org/
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Collaborative editor to work on notes written in Markdown",
|
||||
"fr": "Éditeur collaboratif pour travailler sur des notes en Markdown"
|
||||
},
|
||||
"version": "1.9.1~ynh1",
|
||||
"version": "1.9.2~ynh1",
|
||||
"url": "https://hedgedoc.org",
|
||||
"upstream": {
|
||||
"license": "free",
|
||||
|
|
|
@ -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
|
||||
|
@ -124,7 +125,7 @@ popd
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
env_path="$PATH"
|
||||
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -126,8 +126,7 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
|
||||
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…
Add table
Reference in a new issue