1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00

small fixes

This commit is contained in:
ericgaspar 2020-11-19 21:56:06 +01:00
parent f8511cb20a
commit 9883e7e655
No known key found for this signature in database
GPG key ID: 574F281483054D44
9 changed files with 25 additions and 26 deletions

View file

@ -45,6 +45,7 @@ You can configure HedgeDoc by editing this file `/var/www/hedgedoc/config.json`
## Links ## Links
* Report a bug: https://github.com/YunoHost-Apps/hedgedoc_ynh/issues * Report a bug: https://github.com/YunoHost-Apps/hedgedoc_ynh/issues
* App website: https://hedgedoc.org
* Upstream app repository: https://github.com/hedgedoc/hedgedoc * Upstream app repository: https://github.com/hedgedoc/hedgedoc
* YunoHost website: https://yunohost.org/ * YunoHost website: https://yunohost.org/

View file

@ -45,6 +45,7 @@ Vous pouvez configurer HedgeDoc en modifiant le fichier `/var/www/hedgedoc/confi
## Liens ## Liens
* Signaler un bug : https://github.com/YunoHost-Apps/hedgedoc_ynh/issues * Signaler un bug : https://github.com/YunoHost-Apps/hedgedoc_ynh/issues
* Site de l'application : https://hedgedoc.org
* Dépôt de l'application principale : https://github.com/hedgedoc/hedgedoc * Dépôt de l'application principale : https://github.com/hedgedoc/hedgedoc
* Site web YunoHost : https://yunohost.org/ * Site web YunoHost : https://yunohost.org/

View file

@ -1,4 +1,5 @@
location ^~ __PATH__/ { location ^~ __PATH__/ {
# Force usage of https # Force usage of https
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;

View file

@ -13,7 +13,7 @@
"name": "" "name": ""
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.0.0" "yunohost": ">= 4.0.8"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -107,7 +107,7 @@ fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================
# CONFIGURE CODIMD # CONFIGURE HEDGEDOC
#================================================= #=================================================
ynh_backup_if_checksum_is_different --file="$final_path/config.json" ynh_backup_if_checksum_is_different --file="$final_path/config.json"

View file

@ -108,7 +108,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." --weight=3 ynh_script_progression --message="Configuring system user..." --weight=2
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir=$final_path
@ -116,16 +116,14 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#============================================== #==============================================
# INSTALL CODIMD # INSTALL HEDGEDOC
#============================================== #==============================================
ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=240 ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=10
pushd "$final_path" || ynh_die pushd "$final_path" || ynh_die
ynh_use_nodejs ynh_use_nodejs
bin/setup bin/setup
ynh_exec_warn_less yarn run build ynh_exec_warn_less yarn run build
popd || ynh_die popd || ynh_die
#================================================= #=================================================
@ -141,7 +139,7 @@ ynh_add_systemd_config
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..." --weight=1
cp ../conf/config.json.example "$final_path/config.json" cp ../conf/config.json.example "$final_path/config.json"
@ -170,7 +168,7 @@ ynh_store_file_checksum --file="$final_path/.sequelizerc"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_script_progression --message="Securing files and directories..." ynh_script_progression --message="Securing files and directories..." --weight=1
# Set permissions to app files # Set permissions to app files
chown -R $app:$app $final_path chown -R $app:$app $final_path
@ -178,7 +176,7 @@ chown -R $app:$app $final_path
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log" yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log"

View file

@ -28,7 +28,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# REMOVE SERVICE INTEGRATION IN YUNOHOST # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
# 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_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service..." --weight=1 ynh_script_progression --message="Removing $app service..." --weight=1

View file

@ -48,14 +48,14 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the NGINX configuration..." ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=60 ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=10
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
@ -70,7 +70,7 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
ynh_script_progression --message="Restoring user rights..." ynh_script_progression --message="Restoring user rights..." --weight=2
# Restore permissions on app files # Restore permissions on app files
chown -R $app:$app $final_path chown -R $app:$app $final_path
@ -80,7 +80,7 @@ chown -R $app:$app $final_path
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=7 ynh_script_progression --message="Reinstalling dependencies..." --weight=6
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -111,7 +111,7 @@ systemctl enable $app.service
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description "collaborative Markdown editor" --log "/var/log/$app/$app.log" yunohost service add $app --description "collaborative Markdown editor" --log "/var/log/$app/$app.log"

View file

@ -29,14 +29,14 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..." ynh_script_progression --message="Checking version..." --weight=2
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up HedgeDoc before upgrading (may take a while)..." --weight=120 ynh_script_progression --message="Backing up HedgeDoc before upgrading (may take a while)..." --weight=10
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -62,7 +62,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=160 ynh_script_progression --message="Upgrading source files..." --weight=10
# Create a temporary directory # Create a temporary directory
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
@ -96,7 +96,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=18 ynh_script_progression --message="Upgrading dependencies..." --weight=10
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -117,18 +117,16 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#============================================== #==============================================
# INSTALL CODIMD # INSTALL HEDGEDOC
#============================================== #==============================================
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=160 ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=10
pushd "$final_path" || ynh_die pushd "$final_path" || ynh_die
ynh_use_nodejs ynh_use_nodejs
bin/setup bin/setup
ynh_exec_warn_less yarn run build ynh_exec_warn_less yarn run build
popd || ynh_die popd || ynh_die
fi fi
@ -169,7 +167,7 @@ ynh_add_systemd_config
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_script_progression --message="Securing files and directories..." ynh_script_progression --message="Securing files and directories..." --weight=1
# Set permissions on app files # Set permissions on app files
chown -R $app:$app $final_path chown -R $app:$app $final_path
@ -177,7 +175,7 @@ chown -R $app:$app $final_path
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log" yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log"