From 528156889c0e93fb42f833a202108227bd1a6990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 8 Mar 2022 11:45:16 +0100 Subject: [PATCH] Testing (#74) * Upgrade Nodejs to 12 --- README.md | 2 +- README_fr.md | 2 +- conf/config.json.example | 2 +- manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/install | 13 ++++++------- scripts/upgrade | 16 ++++++++-------- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5a7124d..b5542f0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. -**Shipped version:** 2.4.1~ynh5 +**Shipped version:** 2.4.1~ynh6 diff --git a/README_fr.md b/README_fr.md index d807d75..2d8acd2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l' CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. -**Version incluse :** 2.4.1~ynh5 +**Version incluse :** 2.4.1~ynh6 diff --git a/conf/config.json.example b/conf/config.json.example index 1b80da5..89d0d06 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -29,7 +29,7 @@ "addGoogleAnalytics": false }, "db": { - "username": "__DB_NAME__", + "username": "__DB_USER__", "password": "__DB_PWD__", "database": "__DB_NAME__", "host": "localhost", diff --git a/manifest.json b/manifest.json index 53fddac..17ffbb5 100644 --- a/manifest.json +++ b/manifest.json @@ -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": "2.4.1~ynh5", + "version": "2.4.1~ynh6", "url": "https://github.com/hackmdio/codimd", "upstream": { "license": "AGPL-3.0-only", diff --git a/scripts/_common.sh b/scripts/_common.sh index 6901352..3d61bd4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="postgresql apt-transport-https libssl-dev" -nodejs_version=11 +nodejs_version=12 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 343d75d..b31def0 100644 --- a/scripts/install +++ b/scripts/install @@ -83,10 +83,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_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +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 @@ -125,14 +125,13 @@ popd #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Modifying a config file..." --weight=1 -path=${path_url:1} ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" -chmod 600 $final_path/config.json ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc" -chmod 600 $final_path/.sequelizerc +chmod 600 $final_path/config.json +chmod 600 $final_path/.sequelizerc chmod +x $final_path/app.js #================================================= @@ -146,7 +145,7 @@ ynh_add_systemd_config #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log" diff --git a/scripts/upgrade b/scripts/upgrade index fc0480c..186b2b7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,24 +83,24 @@ then ynh_script_progression --message="Upgrading source files..." --weight=16 # Create a temporary directory - tmpdir="$(mktemp -d)" + #tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - cp -a "$final_path/config.json" "$tmpdir/config.json" - cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc" + #cp -a "$final_path/config.json" "$tmpdir/config.json" + #cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc" # Remove the app directory securely - ynh_secure_remove --file=$final_path + #ynh_secure_remove --file=$final_path # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path + ynh_setup_source --dest_dir=$final_path --keep="$final_path/config.json $final_path/.sequelizerc" #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.json" "$final_path/config.json" - cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc" + #cp -a "$tmpdir/config.json" "$final_path/config.json" + #cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc" # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + #ynh_secure_remove --file="$tmpdir" fi chmod 750 "$final_path"