diff --git a/README.md b/README.md index 5a07dec..08abbe0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview An open source, modern and powerful wiki app built on Node.js, Git and Markdown for YunoHost. -**Shipped version:** 2.0.1 +**Shipped version:** 2.0.12 ## Important points to read before installing @@ -43,7 +43,6 @@ The app can be used by multiple users * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/wikijs/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/wikijs/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/wikijs/) ## Limitations diff --git a/check_process b/check_process index 50bfff4..8ea0523 100644 --- a/check_process +++ b/check_process @@ -10,7 +10,6 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=62db8a96750dfd28880126d3eb9228d4d71f0814 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. diff --git a/conf/app.src b/conf/app.src index 1a84c9d..f890230 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Requarks/wiki/releases/download/2.0.1/wiki-js.tar.gz -SOURCE_SUM=086186b1b5a915f9c5d1ff8545e1008da331b885c3debdc512da27817a2a91d0 +SOURCE_URL=https://github.com/Requarks/wiki/releases/download/2.0.12/wiki-js.tar.gz +SOURCE_SUM=67ad4b7b3d70085da277fb7beacbfd99f97715cd81d99ff5e6eef3c407c05bc3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=false diff --git a/conf/config.sample.yml b/conf/config.sample.yml index 1875e47..e2a320f 100644 --- a/conf/config.sample.yml +++ b/conf/config.sample.yml @@ -37,14 +37,6 @@ db: ####################################################################### # Do not change unless you know what you are doing! -# --------------------------------------------------------------------- -# Use X-Forwarded-For header -# --------------------------------------------------------------------- -# Enable only if Wiki.js is behind a reverse-proxy (nginx, apache, etc) -# or a cloud proxying services like Cloudflare. - -trustProxy: true - # --------------------------------------------------------------------- # SSL/TLS Settings # --------------------------------------------------------------------- diff --git a/manifest.json b/manifest.json index e287f47..3ff1298 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "An open source, modern and powerful wiki app built on Node.js, Git and Markdown.", "fr": "Un wiki moderne et open source propulsé Node.js, Git et Markdown." }, - "version": "2.0.1~ynh1", + "version": "2.0.12~ynh1", "url": "https://wiki.js.org/", "license": "AGPL-3.0-or-later", "maintainer": { diff --git a/scripts/backup b/scripts/backup index 1f976ee..e8307c5 100644 --- a/scripts/backup +++ b/scripts/backup @@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service" #================================================= # BACKUP THE APP MAIN DIR @@ -70,6 +70,13 @@ ynh_print_info --message="Backing up systemd configuration..." ynh_backup --src_path="/etc/systemd/system/$app.service" +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_print_info --message="Starting a systemd service..." + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index 4b116d6..59de0e0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -35,6 +35,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #db_user=$db_name #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_print_info --message="Backing up the app before changing its url (may take a while)..." + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. + ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= @@ -58,7 +75,7 @@ fi #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service" #================================================= # MODIFY URL IN NGINX CONF @@ -96,7 +113,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 6f02f56..9c0ce57 100644 --- a/scripts/install +++ b/scripts/install @@ -108,7 +108,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Configuring system user ..." +ynh_print_info --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" @@ -138,16 +138,16 @@ ynh_add_systemd_config config_file="$final_path/config.yml" cp -f ../conf/config.sample.yml $config_file -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=$config_file -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$config_file -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file=$config_file +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file" #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= # Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file=$config_file +ynh_store_file_checksum --file="$config_file" #================================================= # GENERIC FINALIZATION @@ -159,19 +159,17 @@ ynh_store_file_checksum --file=$config_file chown -R "$app":"$app" "$final_path" #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# INTEGRATE SERVICE IN YUNOHOST #================================================= # if using yunohost version 3.2 or more in the 'manifest.json', a description can be added -yunohost service add $app --description "$app daemon for Wiki.js" -t systemd +yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd #================================================= # START SYSTEMD SERVICE #================================================= -ynh_systemd_action --service_name=$app --action=start --line_match="Browse to http://localhost" --log_path=systemd - -sleep 30 +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" #================================================= # SETUP SSOWAT diff --git a/scripts/remove b/scripts/remove index 5d9c264..86f4b65 100644 --- a/scripts/remove +++ b/scripts/remove @@ -27,10 +27,10 @@ ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user) #================================================= # STANDARD REMOVE #================================================= -# REMOVE SERVICE FROM ADMIN PANEL +# REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove a service from the admin panel, added by `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 then ynh_print_info --message="Removing $app service..." diff --git a/scripts/restore b/scripts/restore index dad24bc..ce472a0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -106,19 +106,17 @@ ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# INTEGRATE SERVICE IN YUNOHOST #================================================= -yunohost service add $app --description "$app daemon for Wiki.js" -t systemd +yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd #================================================= # START SYSTEMD SERVICE #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action=start --log_path=systemd - -sleep 30 +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" #================================================= # CREATE LDAP USER diff --git a/scripts/upgrade b/scripts/upgrade index 2585817..afa2fa0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,7 +101,7 @@ ynh_abort_if_errors #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -150,16 +150,16 @@ config_file="$final_path/config.yml" ynh_backup_if_checksum_is_different --file=$config_file cp -f ../conf/config.sample.yml $config_file -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=$config_file -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$config_file -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file=$config_file +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file" #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= # Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file=$config_file +ynh_store_file_checksum --file="$config_file" #================================================= # SETUP SYSTEMD @@ -196,9 +196,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd - -sleep 30 +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:" #================================================= # RELOAD NGINX