From b0eac1ce88331c8cf6329e3194ca52876d4f87ba Mon Sep 17 00:00:00 2001 From: ljf Date: Sun, 27 May 2018 05:44:54 +0200 Subject: [PATCH 01/17] [fix] Upgrade disappeared sources --- conf/app.src | 6 +++--- manifest.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/app.src b/conf/app.src index ade633c..a4a130c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://releases.wekan.team/wekan-0.89.tar.gz -SOURCE_SUM=17b2ff34912794c02b41799000f64236d9c7a562546c234167332d56492f29ae +SOURCE_URL=https://releases.wekan.team/wekan-1.02.tar.gz +SOURCE_SUM=892efb817ef3b7db34abd5c42f9751953338fea027db74babcf66cf5d2f4549e SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=wekan-0.89.tar.gz +SOURCE_FILENAME=wekan-1.02.tar.gz diff --git a/manifest.json b/manifest.json index 138fe37..8584318 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "Wekan", "id": "wekan", "packaging_format": 1, - "version": "0.89~ynh1", + "version": "1.02~ynh2", "description": { "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" From 786ba73f67b9f46a156497167ff28de492a1b04d Mon Sep 17 00:00:00 2001 From: ljf Date: Tue, 29 Jan 2019 00:19:27 +0100 Subject: [PATCH 02/17] [fix] Can't install on ROOT uris --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d2d3064..2451411 100755 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,8 @@ app=$YNH_APP_INSTANCE_NAME final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" +path_url=$(ynh_normalize_url_path $path_url) + # Register (book) web path ynh_webpath_register $app $domain $path_url @@ -104,7 +106,7 @@ ynh_print_info "Adding wekan systemd service ..." ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__DB_NAME__" "$app" "../conf/systemd.service" -ynh_replace_string "__URI__" "$path_url/" "../conf/systemd.service" +ynh_replace_string "__URI__" "$path_url" "../conf/systemd.service" ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" ynh_replace_string "__DOMAIN__" "$domain" "../conf/systemd.service" ynh_add_systemd_config From ee4c6e9c9321ee77f57f4ebe6af7da1db5108bd7 Mon Sep 17 00:00:00 2001 From: ljf Date: Tue, 29 Jan 2019 00:56:45 +0100 Subject: [PATCH 03/17] [enh] Upgrade to version 2.09 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 2d2d562..61359cd 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,7 @@ # This is on YunoHost server just to avoid the file from disappearing # Original source is https://releases.wekan.team/ -SOURCE_URL=https://build.yunohost.org/apps/wekan-1.07.tar.gz -SOURCE_SUM=34105938c067b6ebcacaa3e2472061c919eb9e00aaa8e114c0e6b31a89772735 +SOURCE_URL=https://build.yunohost.org/apps/wekan-2.09.tar.gz +SOURCE_SUM=1956dd19f17d76a6d820a15bcf93a3eb12172f9f5cb1dd40d9925b977e8f930d SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 85bf91796497194536847b8d779bc84aeba7c0f6 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 29 Jan 2019 02:13:16 +0100 Subject: [PATCH 04/17] Check that architecture is supported --- scripts/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index d2d3064..3bc3e21 100755 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,10 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= + +# Check machine architecture (in particular, we don't support ARM and 32bit machines) +[[ $(uname -m) == "x86_64" ]] || ynh_die "Sorry, but this app can only be installed on a x86, 64 bits machine :(" + final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" From 71affe55145f268f17f6fb8ed016ba2be395a624 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 17:35:26 +0100 Subject: [PATCH 05/17] Desactivate change_url for now, not implemented --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 831514f..130e18e 100644 --- a/check_process +++ b/check_process @@ -17,7 +17,7 @@ multi_instance=1 incorrect_path=1 port_already_use=1 - change_url=1 + change_url=0 ;;; Levels Level 1=auto Level 2=auto From d4cc83fbbf2c1df1ac75ec90ff32d55b8c601fbf Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 17:38:12 +0100 Subject: [PATCH 06/17] adding ynh_systemd_action --- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 1 + scripts/ynh_systemd_action | 89 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 scripts/ynh_systemd_action diff --git a/scripts/install b/scripts/install index e156162..ce4b4ee 100755 --- a/scripts/install +++ b/scripts/install @@ -5,6 +5,7 @@ # IMPORT GENERIC HELPERS #================================================= source _future.sh +source ynh_systemd_action source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index 9649ae7..8d13fc2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= source ../settings/scripts/_future.sh +source ../settings/scripts/ynh_systemd_action source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e6b37f2..5854c49 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,7 @@ #================================================= source _future.sh +source ynh_systemd_action source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/ynh_systemd_action b/scripts/ynh_systemd_action new file mode 100644 index 0000000..6bed6be --- /dev/null +++ b/scripts/ynh_systemd_action @@ -0,0 +1,89 @@ +#!/bin/bash + +# Start (or other actions) a service, print a log in case of failure and optionnaly wait until the service is completely started +# +# usage: ynh_systemd_action [-n service_name] [-a action] [ [-l "line to match"] [-p log_path] [-t timeout] [-e length] ] +# | arg: -n, --service_name= - Name of the service to reload. Default : $app +# | arg: -a, --action= - Action to perform with systemctl. Default: start +# | arg: -l, --line_match= - Line to match - The line to find in the log to attest the service have finished to boot. +# If not defined it don't wait until the service is completely started. +# | arg: -p, --log_path= - Log file - Path to the log file. Default : /var/log/$app/$app.log +# | arg: -t, --timeout= - Timeout - The maximum time to wait before ending the watching. Default : 300 seconds. +# | arg: -e, --length= - Length of the error log : Default : 20 +ynh_systemd_action() { + # Declare an array to define the options of this helper. + declare -Ar args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= ) + local service_name + local action + local line_match + local length + local log_path + local timeout + + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + local service_name="${service_name:-$app}" + local action=${action:-start} + local log_path="${log_path:-/var/log/$service_name/$service_name.log}" + local length=${length:-20} + local timeout=${timeout:-300} + + # Start to read the log + if [[ -n "${line_match:-}" ]] + then + local templog="$(mktemp)" + # Following the starting of the app in its log + if [ "$log_path" == "systemd" ] ; then + # Read the systemd journal + journalctl -u $service_name -f --since=-45 > "$templog" & + else + # Read the specified log file + tail -F -n0 "$log_path" > "$templog" & + fi + # Get the PID of the tail command + local pid_tail=$! + fi + + echo "${action^} the service $service_name" >&2 + systemctl $action $service_name \ + || ( journalctl --lines=$length -u $service_name >&2 \ + ; test -n "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 \ + ; false ) + + # Start the timeout and try to find line_match + if [[ -n "${line_match:-}" ]] + then + local i=0 + for i in $(seq 1 $timeout) + do + # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout + if grep --quiet "$line_match" "$templog" + then + echo "The service $service_name has correctly started." >&2 + break + fi + echo -n "." >&2 + sleep 1 + done + if [ $i -eq $timeout ] + then + echo "The service $service_name didn't fully started before the timeout." >&2 + journalctl --lines=$length -u $service_name >&2 + test -n "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 + fi + + echo "" + ynh_clean_check_starting + fi +} + +# Clean temporary process and file used by ynh_check_starting +# (usually used in ynh_clean_setup scripts) +# +# usage: ynh_clean_check_starting +ynh_clean_check_starting () { + # Stop the execution of tail. + kill -s 15 $pid_tail 2>&1 + ynh_secure_remove "$templog" 2>&1 +} From b60392128cca1b78be521df08d0f7c65d977928b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 17:41:18 +0100 Subject: [PATCH 07/17] Implementing ynh_systemd_action on all scripts/install --- scripts/install | 10 ++++++---- scripts/restore | 8 +++++++- scripts/upgrade | 8 +++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index ce4b4ee..c7d337d 100755 --- a/scripts/install +++ b/scripts/install @@ -147,9 +147,11 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info "Starting wekan ..." -systemctl restart $app + systemctl reload nginx -ynh_print_info "Waiting for wekan to be up ..." -sleep 20 +#================================================= +# START SERVICE +#================================================= + +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" diff --git a/scripts/restore b/scripts/restore index 8d13fc2..a70004d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -107,5 +107,11 @@ fi #================================================= # RELOAD NGINX #================================================= -systemctl restart $app + systemctl reload nginx + +#================================================= +# START SERVICE +#================================================= + +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" diff --git a/scripts/upgrade b/scripts/upgrade index 5854c49..bc6d4dd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,5 +114,11 @@ popd #================================================= # RELOAD NGINX #================================================= -systemctl restart $app + systemctl reload nginx + +#================================================= +# START SERVICE +#================================================= + +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" From e3a609bd762f4efdfa5c84cf732dc44a3e84a416 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 17:44:15 +0100 Subject: [PATCH 08/17] change nodejs version to the good one --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index a70004d..0c9a179 100644 --- a/scripts/restore +++ b/scripts/restore @@ -53,7 +53,7 @@ ynh_system_user_create $app "$final_path" #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_install_nodejs 4.8.7 +ynh_install_nodejs 8.9.3 # Install mongodb ynh_install_app_dependencies "mongodb mongodb-server" From 99d2a66d21e8f437b0770df00eff20e3a40a2dbe Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 17:44:40 +0100 Subject: [PATCH 09/17] fix mongodb restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 0c9a179..82e432e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -64,7 +64,7 @@ ynh_install_app_dependencies "mongodb mongodb-server" # Start mogodb systemctl enable mongodb systemctl start mongodb -mongorestore --db $app ./dump +mongorestore --db $app ./dump/$app #================================================= # SPECIFIC SETUP From 80c6123606f483c6bf05791e33dbd01bdcb030c1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 17:45:03 +0100 Subject: [PATCH 10/17] Fix bad path --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 82e432e..a797b65 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,7 +72,7 @@ mongorestore --db $app ./dump/$app # Install wekan dependencies chown -R $app $final_path -pushd $final_path/bundle/programs/server +pushd $final_path/programs/server ynh_use_nodejs npm install popd From 1f7fa01735954e7bb6e1c36d426f613a51664109 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 19:53:27 +0100 Subject: [PATCH 11/17] adding time for service to start + fix restore --- scripts/install | 1 + scripts/restore | 17 +++++++++-------- scripts/upgrade | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index c7d337d..ab1bc82 100755 --- a/scripts/install +++ b/scripts/install @@ -155,3 +155,4 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" +sleep 10 diff --git a/scripts/restore b/scripts/restore index a797b65..41a87f1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,10 +32,10 @@ port=$(ynh_app_setting_get $app final_path) # CHECK IF THE APP CAN BE RESTORED #================================================= -yunohost app checkurl "${domain}${path_url}" -a "$app" \ - || ynh_die "Path not available: ${domain}${path_url}" +ynh_webpath_available $domain $path_url \ + || ynh_die "Path not available: ${domain}${path_url}" test ! -d $final_path \ -|| ynh_die "There is already a directory: $final_path " + || ynh_die "There is already a directory: $final_path " #================================================= # STANDARD RESTORE STEPS @@ -71,11 +71,11 @@ mongorestore --db $app ./dump/$app #================================================= # Install wekan dependencies -chown -R $app $final_path -pushd $final_path/programs/server -ynh_use_nodejs -npm install -popd +#chown -R $app $final_path +#pushd $final_path/programs/server +#ynh_use_nodejs +#npm install +#popd #================================================= # GENERIC FINALIZATION @@ -115,3 +115,4 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" +sleep 10 diff --git a/scripts/upgrade b/scripts/upgrade index bc6d4dd..357efd5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,3 +122,4 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" +sleep 10 From d6c921308f3089120d8b8615291d4994f4eba32a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 18 Feb 2019 19:53:35 +0100 Subject: [PATCH 12/17] replace restart by start in scripts/upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 357efd5..6d2d9cd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,5 +121,5 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" +ynh_systemd_action --action=restart --service_name=$app --log_path="systemd" sleep 10 From 6d48c42f04b02ab80f1665b8862db90bcfb88741 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 21:10:09 +0100 Subject: [PATCH 13/17] Reorder from example_ynh --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 98c2599..d9a6f81 100644 --- a/manifest.json +++ b/manifest.json @@ -2,11 +2,11 @@ "name": "Wekan", "id": "wekan", "packaging_format": 1, - "version": "1.07~ynh2", "description": { "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, + "version": "1.07~ynh2", "url": "https://wekan.io", "license": "MIT", "maintainer": { From b32b01c869946ef7e7bb164b396dd639834435a7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 21:12:41 +0100 Subject: [PATCH 14/17] Remove mongodb, not a yunohost base service --- manifest.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index d9a6f81..e01f71f 100644 --- a/manifest.json +++ b/manifest.json @@ -19,8 +19,7 @@ }, "multi_instance": true, "services": [ - "nginx", - "mongod" + "nginx" ], "arguments": { "install" : [ From 082cdebf7fdcbc55f3231b54dcc63d34590b2202 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 21:13:37 +0100 Subject: [PATCH 15/17] Remove old source filename --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 61359cd..0b7bb83 100644 --- a/conf/app.src +++ b/conf/app.src @@ -5,4 +5,4 @@ SOURCE_SUM=1956dd19f17d76a6d820a15bcf93a3eb12172f9f5cb1dd40d9925b977e8f930d SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=wekan-1.07.tar.gz +SOURCE_FILENAME= From 3105eb5a3c515ea55a38b8b80c9b5dda1277a82e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 5 Feb 2019 21:16:13 +0100 Subject: [PATCH 16/17] update version number to 2.09 --- README.md | 2 ++ manifest.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ed8ff1..ee4286f 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Wekan is an open-source kanban board (task manager and organizer) [![Integration level](https://dash.yunohost.org/integration/wekan.svg)](https://dash.yunohost.org/appci/app/wekan) [![Install Wordpress with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=wekan) +**Shipped version:** 2.09 + ## Screenshot ![](screenshot.jpg) diff --git a/manifest.json b/manifest.json index e01f71f..13cf267 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "1.07~ynh2", + "version": "2.09~ynh1", "url": "https://wekan.io", "license": "MIT", "maintainer": { From ef78b7cf1fa2dc31f19e3e4570c4c6075edef632 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 20 Feb 2019 16:42:47 +0100 Subject: [PATCH 17/17] Emphasis on current limitations --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee4286f..a552aaf 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Wekan is an open-source kanban board (task manager and organizer) ## Status -- This app only works on x86, 64bits architecture ! In particular, it won't work on 32 bit machines or ARM. See the discussion [here](https://github.com/YunoHost-Apps/wekan_ynh/issues/1#issuecomment-401612500). On the long term, [support for ARM64 might happen](https://blog.wekan.team/2018/01/wekan-progress-on-x64-and-arm/index.html)... +- This app **only works on x86, 64bits architecture** ! In particular, it won't work on 32 bit machines or ARM. See the discussion [here](https://github.com/YunoHost-Apps/wekan_ynh/issues/1#issuecomment-401612500). On the long term, [support for ARM64 might happen](https://blog.wekan.team/2018/01/wekan-progress-on-x64-and-arm/index.html)... -- There is currently no SSO/LDAP integration though it might be integrated at some point in the app, now that it's supported in Meteor/Wekan. c.f. discussion in [here](https://github.com/YunoHost-Apps/wekan_ynh/issues/4). In the meantime, users can create accounts (in fact, they can create infinite number of accounts) manually, and need to login manually specifically in Wekan. +- There is currently **no SSO/LDAP integration** though it might be integrated at some point in the app, now that it's supported in Meteor/Wekan. c.f. discussion in [here](https://github.com/YunoHost-Apps/wekan_ynh/issues/4). In the meantime, users can create accounts (in fact, they can create infinite number of accounts) manually, and need to login manually specifically in Wekan. ## Infos