From 827f6cace8681005c52a305a8df7165c45df979d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 02:28:23 +0100 Subject: [PATCH 02/54] Update to 2.37 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ff06768..8cae7a8 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 Wekan is an open-source kanban board (task manager and organizer) -**Shipped version:** 2.09 +**Shipped version:** 2.37 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 0b7bb83..4f533d4 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-2.09.tar.gz -SOURCE_SUM=1956dd19f17d76a6d820a15bcf93a3eb12172f9f5cb1dd40d9925b977e8f930d +SOURCE_URL=https://github.com/yalh76/wekan_ynh/blob/2.37/conf/wekan-2.37.tar.gz +SOURCE_SUM=471c3c9190119da0b988a9ae0c28aa80388e07bd8d3720ff44e8a9ecac681c5b SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 13cf267..da2e4bc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "2.09~ynh1", + "version": "2.37~ynh1", "url": "https://wekan.io", "license": "MIT", "maintainer": { From 8bc11ee9cabe9014902bc9b0adfb2e824d351dd4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 02:36:52 +0100 Subject: [PATCH 03/54] Fix sha256 checksum --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 4f533d4..8aad521 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://github.com/yalh76/wekan_ynh/blob/2.37/conf/wekan-2.37.tar.gz -SOURCE_SUM=471c3c9190119da0b988a9ae0c28aa80388e07bd8d3720ff44e8a9ecac681c5b +SOURCE_SUM=dd1b9767550bcf61e7261329ec1a2fd51ff8a5d6d8493dc7029f61927400e10a SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 7da87135bace2989ffb558e3d0c1e77efac5d8df Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 02:40:53 +0100 Subject: [PATCH 04/54] Fix app source --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 8aad521..207507f 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ # This is on YunoHost server just to avoid the file from disappearing # Original source is https://releases.wekan.team/ -SOURCE_URL=https://github.com/yalh76/wekan_ynh/blob/2.37/conf/wekan-2.37.tar.gz +SOURCE_URL=https://raw.githubusercontent.com/yalh76/wekan_ynh/2.37/conf/wekan-2.37.tar.gz SOURCE_SUM=dd1b9767550bcf61e7261329ec1a2fd51ff8a5d6d8493dc7029f61927400e10a SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz From c0ae0697a385c98bcdf193d9a630e49b4fca047b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 02:55:19 +0100 Subject: [PATCH 05/54] fix sha256 checksum --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 207507f..990cf9d 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://raw.githubusercontent.com/yalh76/wekan_ynh/2.37/conf/wekan-2.37.tar.gz -SOURCE_SUM=dd1b9767550bcf61e7261329ec1a2fd51ff8a5d6d8493dc7029f61927400e10a +SOURCE_SUM=471c3c9190119da0b988a9ae0c28aa80388e07bd8d3720ff44e8a9ecac681c5b SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From fcfff7fefbc806c243d374408a9fe5cc79c099e5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 04:05:48 +0100 Subject: [PATCH 06/54] move environment variable to dedicated file --- conf/.env | 11 +++++++++++ conf/systemd.service | 5 +---- scripts/install | 29 ++++++++++++++++++++++++----- scripts/upgrade | 14 +++++++++----- 4 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 conf/.env diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..912f470 --- /dev/null +++ b/conf/.env @@ -0,0 +1,11 @@ +# The path to NODEJS +PATH=__NODEJS_PATH__ + +# URL of the mongodb +MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ + +# Root URL +ROOT_URL=https://__DOMAIN_URI__ PORT=__PORT__ + +# The Node Environnement +NODE_ENV=production diff --git a/conf/systemd.service b/conf/systemd.service index 0fb4618..5abbcbf 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,10 +7,7 @@ After=network.target mongodb.service Type=simple User=__APP__ Group=__APP__ -Environment="PATH=__ENV_PATH__" -Environment=NODE_ENV=production -Environment=MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ -Environment=ROOT_URL=https://__DOMAIN_URI__ PORT=__PORT__ +EnvironmentFile=__FINALPATH__/.env WorkingDirectory=__FINALPATH__ ExecStart=/opt/node_n/bin/node __FINALPATH__/main.js Restart=on-failure diff --git a/scripts/install b/scripts/install index 90daf64..29f7d26 100755 --- a/scripts/install +++ b/scripts/install @@ -194,13 +194,32 @@ ynh_print_info "Configuring a systemd service..." ### - And the section "SETUP SYSTEMD" in the upgrade script # Create a dedicated systemd config -ynh_print_info "Adding wekan systemd service ..." -ynh_replace_string "__ENV_PATH__" "$nodejs_path" "../conf/systemd.service" -ynh_replace_string "__DB_NAME__" "$db_name" "../conf/systemd.service" -ynh_replace_string "__DOMAIN_URI__" "$domain$path_url" "../conf/systemd.service" -ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" ynh_add_systemd_config +#================================================= +# MODIFY A CONFIG FILE +#================================================= + +### `ynh_replace_string` is used to replace a string in a file. +### (It's compatible with sed regular expressions syntax) +cp "../conf/.env" "$final_path/.env" + +ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" +ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" +ynh_replace_string "__DOMAIN_URI__" "$domain$path_url" "$final_path/.env" +ynh_replace_string "__PORT__" "$port" "$final_path/.env" + +#================================================= +# STORE THE CONFIG FILE CHECKSUM +#================================================= + +### `ynh_store_file_checksum` is used to store the checksum of a file. +### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, +### you can make a backup of this file before modifying it again if the admin had modified it. + +# Calculate and store the config file checksum into the app settings +ynh_store_file_checksum "$final_path/.env" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4f48cfa..6240306 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,13 +69,17 @@ fi if ynh_version_gt "0.77-2" "${previous_version}" ; then ynh_install_nodejs 8.9.3 - ynh_use_nodejs + ynh_use_nodejs # Create a dedicated systemd config - ynh_replace_string "__ENV_PATH__" "$nodejs_path" "../conf/systemd.service" - ynh_replace_string "__DB_NAME__" "$db_name" "../conf/systemd.service" - ynh_replace_string "__DOMAIN_URI__" "$domain$path_url" "../conf/systemd.service" - ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" ynh_add_systemd_config + # Create a dedicated .env config + ynh_backup_if_checksum_is_different "$final_path/.env" + cp "../conf/.env" "$final_path/.env" + ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" + ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" + ynh_replace_string "__DOMAIN_URI__" "$domain$path_url" "$final_path/.env" + ynh_replace_string "__PORT__" "$port" "$final_path/.env" + ynh_store_file_checksum "$final_path/.env" fi if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then From 83077dd5aca9224b1aa018cb074f1e28239b0e17 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 04:15:18 +0100 Subject: [PATCH 07/54] Fix port --- conf/.env | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 912f470..f94c4e5 100644 --- a/conf/.env +++ b/conf/.env @@ -5,7 +5,10 @@ PATH=__NODEJS_PATH__ MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ # Root URL -ROOT_URL=https://__DOMAIN_URI__ PORT=__PORT__ +ROOT_URL=https://__DOMAIN_URI__ + +#Port +PORT=__PORT__ # The Node Environnement NODE_ENV=production From 4c1f2fe29a51861bd827238ebe862c4a012eabaa Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 04:33:12 +0100 Subject: [PATCH 08/54] Remove npm install step --- scripts/install | 8 -------- scripts/upgrade | 6 ------ 2 files changed, 14 deletions(-) diff --git a/scripts/install b/scripts/install index ab1bc82..8af2114 100755 --- a/scripts/install +++ b/scripts/install @@ -90,14 +90,6 @@ ynh_system_user_create $app "$final_path" #================================================= # SPECIFIC SETUP #================================================= -# Install wekan dependencies -ynh_print_info "Installing npm dependencies ..." -chown -R $app $final_path -pushd $final_path/programs/server -ynh_use_nodejs -npm install -popd - # Start mogodb ynh_print_info "Starting mongodb ..." systemctl enable mongodb diff --git a/scripts/upgrade b/scripts/upgrade index 6d2d9cd..f0b7bc9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -105,12 +105,6 @@ chown -R $app: "$final_path" chmod -R 640 "$final_path" find "$final_path" -type d -print0 | xargs -0 chmod 750 -# Relaunch a npm install -pushd $final_path/programs/server -ynh_use_nodejs -npm install -popd - #================================================= # RELOAD NGINX #================================================= From 44a11d252023fd58306c52748c2603c6438b1e12 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 05:05:49 +0100 Subject: [PATCH 09/54] Add additional environment variables --- conf/.env | 330 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 327 insertions(+), 3 deletions(-) diff --git a/conf/.env b/conf/.env index f94c4e5..17d1c80 100644 --- a/conf/.env +++ b/conf/.env @@ -1,14 +1,338 @@ +# The Node Environnement +NODE_ENV=production + # The path to NODEJS PATH=__NODEJS_PATH__ +# Activate Debug mode +#DEBUG=true + # URL of the mongodb MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ # Root URL ROOT_URL=https://__DOMAIN_URI__ -#Port +# Mail URL +MAIL_URL='smtp://user:pass@mailserver.example.com:25/' + +# This is local port where Wekan Node.js runs PORT=__PORT__ -# The Node Environnement -NODE_ENV=production +#--------------------------------------------- +# Wekan Export Board works when WITH_API=true. +# If you disable Wekan API with false, Export Board does not work. +WITH_API='true' + +#--------------------------------------------- +# CORS: Set Access-Control-Allow-Origin header. Example: * +#CORS=* + +#--------------------------------------------- +## Optional: Integration with Matomo https://matomo.org that is installed to your server +## The address of the server where Matomo is hosted: +# Example: MATOMO_ADDRESS=https://example.com/matomo +#MATOMO_ADDRESS= + +## The value of the site ID given in Matomo server for Wekan +# Example: MATOMO_SITE_ID=123456789 +#MATOMO_SITE_ID='' + +## The option do not track which enables users to not be tracked by matomo" +#Example: MATOMO_DO_NOT_TRACK=false +#MATOMO_DO_NOT_TRACK=true + +## The option that allows matomo to retrieve the username: +# Example: MATOMO_WITH_USERNAME=true +#MATOMO_WITH_USERNAME='false' + +#--------------------------------------------- +# Enable browser policy and allow one trusted URL that can have iframe that has Wekan embedded inside. +# Setting this to false is not recommended, it also disables all other browser policy protections +# and allows all iframing etc. See wekan/server/policy.js +# Default value: true +BROWSER_POLICY_ENABLED=true + +# When browser policy is enabled, HTML code at this Trusted URL can have iframe that embeds Wekan inside. +# Example: TRUSTED_URL=http://example.com +TRUSTED_URL='' + +# What to send to Outgoing Webhook, or leave out. Example, that includes all that are default: cardId,listId,oldListId,boardId,comment,user,card,commentId . +# Example: WEBHOOKS_ATTRIBUTES=cardId,listId,oldListId,boardId,comment,user,card,commentId +WEBHOOKS_ATTRIBUTES='' + +#--------------------------------------------- +# ==== OAUTH2 AZURE ==== +# https://github.com/wekan/wekan/wiki/Azure +# 1) Register the application with Azure. Make sure you capture +# the application ID as well as generate a secret key. +# 2) Configure the environment variables. This differs slightly +# by installation type, but make sure you have the following: +#OAUTH2_ENABLED=true + +# Application GUID captured during app registration: +#OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx + +# Secret key generated during app registration: +#OAUTH2_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +#OAUTH2_SERVER_URL=https://login.microsoftonline.com/ +#OAUTH2_AUTH_ENDPOINT=/oauth2/v2.0/authorize +#OAUTH2_USERINFO_ENDPOINT=https://graph.microsoft.com/oidc/userinfo +#OAUTH2_TOKEN_ENDPOINT=/oauth2/v2.0/token + +# The claim name you want to map to the unique ID field: +#OAUTH2_ID_MAP=email + +# The claim name you want to map to the username field: +#OAUTH2_USERNAME_MAP=email + +# The claim name you want to map to the full name field: +#OAUTH2_FULLNAME_MAP=name + +# The claim name you want to map to the email field: +#OAUTH2_EMAIL_MAP=email + +#----------------------------------------------------------------- +# ==== OAUTH2 KEYCLOAK ==== +# https://github.com/wekan/wekan/wiki/Keycloak <== MAPPING INFO, REQUIRED +#OAUTH2_ENABLED=true +#OAUTH2_CLIENT_ID= +#OAUTH2_SERVER_URL=/auth +#OAUTH2_AUTH_ENDPOINT=/realms//protocol/openid-connect/auth +#OAUTH2_USERINFO_ENDPOINT=/realms//protocol/openid-connect/userinfo +#OAUTH2_TOKEN_ENDPOINT=/realms//protocol/openid-connect/token +#OAUTH2_SECRET= + +#----------------------------------------------------------------- +# ==== OAUTH2 DOORKEEPER ==== +# https://github.com/wekan/wekan/issues/1874 +# https://github.com/wekan/wekan/wiki/OAuth2 +# Enable the OAuth2 connection +#OAUTH2_ENABLED=true + +# OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2 +# OAuth2 Client ID. +#OAUTH2_CLIENT_ID=abcde12345 + +# OAuth2 Secret. +#OAUTH2_SECRET=54321abcde + +# OAuth2 Server URL. +#OAUTH2_SERVER_URL=https://chat.example.com + +# OAuth2 Authorization Endpoint. +#OAUTH2_AUTH_ENDPOINT=/oauth/authorize + +# OAuth2 Userinfo Endpoint. +#OAUTH2_USERINFO_ENDPOINT=/oauth/userinfo + +# OAuth2 Token Endpoint. +#OAUTH2_TOKEN_ENDPOINT=/oauth/token + +# OAuth2 ID Mapping +#OAUTH2_ID_MAP= + +# OAuth2 Username Mapping +#OAUTH2_USERNAME_MAP= + +# OAuth2 Fullname Mapping +#OAUTH2_FULLNAME_MAP= + +# OAuth2 Email Mapping +#OAUTH2_EMAIL_MAP= + +#--------------------------------------------- +# LDAP_ENABLE : Enable or not the connection by the LDAP +# example : LDAP_ENABLE=true +#LDAP_ENABLE=false + +# LDAP_PORT : The port of the LDAP server +# example : LDAP_PORT=389 +#LDAP_PORT=389 + +# LDAP_HOST : The host server for the LDAP server +# example : LDAP_HOST=localhost +#LDAP_HOST= + +# LDAP_BASEDN : The base DN for the LDAP Tree +# example : LDAP_BASEDN=ou=user,dc=example,dc=org +#LDAP_BASEDN= + +# LDAP_LOGIN_FALLBACK : Fallback on the default authentication method +# example : LDAP_LOGIN_FALLBACK=true +#LDAP_LOGIN_FALLBACK=false + +# LDAP_RECONNECT : Reconnect to the server if the connection is lost +# example : LDAP_RECONNECT=false +#LDAP_RECONNECT=true + +# LDAP_TIMEOUT : Overall timeout, in milliseconds +# example : LDAP_TIMEOUT=12345 +#LDAP_TIMEOUT=10000 + +# LDAP_IDLE_TIMEOUT : Specifies the timeout for idle LDAP connections in milliseconds +# example : LDAP_IDLE_TIMEOUT=12345 +#LDAP_IDLE_TIMEOUT=10000 + +# LDAP_CONNECT_TIMEOUT : Connection timeout, in milliseconds +# example : LDAP_CONNECT_TIMEOUT=12345 +#LDAP_CONNECT_TIMEOUT=10000 + +# LDAP_AUTHENTIFICATION : If the LDAP needs a user account to search +# example : LDAP_AUTHENTIFICATION=true +#LDAP_AUTHENTIFICATION=false + +# LDAP_AUTHENTIFICATION_USERDN : The search user DN +# example : LDAP_AUTHENTIFICATION_USERDN=cn=admin,dc=example,dc=org +#LDAP_AUTHENTIFICATION_USERDN= + +# LDAP_AUTHENTIFICATION_PASSWORD : The password for the search user +# example : AUTHENTIFICATION_PASSWORD=admin +#LDAP_AUTHENTIFICATION_PASSWORD= + +# LDAP_LOG_ENABLED : Enable logs for the module +# example : LDAP_LOG_ENABLED=true +#LDAP_LOG_ENABLED=false + +# LDAP_BACKGROUND_SYNC : If the sync of the users should be done in the background +# example : LDAP_BACKGROUND_SYNC=true +#LDAP_BACKGROUND_SYNC=false + +# LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds +# example : LDAP_BACKGROUND_SYNC_INTERVAL=12345 +#LDAP_BACKGROUND_SYNC_INTERVAL=100 + +# LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED : +# example : LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true +#LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=false + +# LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS : +# example : LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true +#LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=false + +# LDAP_ENCRYPTION : If using LDAPS +# example : LDAP_ENCRYPTION=ssl +#LDAP_ENCRYPTION=false + +# LDAP_CA_CERT : The certification for the LDAPS server. Certificate needs to be included in this docker-compose.yml file. +# example : LDAP_CA_CERT=-----BEGIN CERTIFICATE-----MIIE+zCCA+OgAwIBAgIkAhwR/6TVLmdRY6hHxvUFWc0+Enmu/Hu6cj+G2FIdAgIC...-----END CERTIFICATE----- +#LDAP_CA_CERT= + +# LDAP_REJECT_UNAUTHORIZED : Reject Unauthorized Certificate +# example : LDAP_REJECT_UNAUTHORIZED=true +#LDAP_REJECT_UNAUTHORIZED=false + +# LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed +# example : LDAP_USER_SEARCH_FILTER= +#LDAP_USER_SEARCH_FILTER= + +# LDAP_USER_SEARCH_SCOPE : base (search only in the provided DN), one (search only in the provided DN and one level deep), or sub (search the whole subtree) +# example : LDAP_USER_SEARCH_SCOPE=one +#LDAP_USER_SEARCH_SCOPE= + +# LDAP_USER_SEARCH_FIELD : Which field is used to find the user +# example : LDAP_USER_SEARCH_FIELD=uid +#LDAP_USER_SEARCH_FIELD= + +# LDAP_SEARCH_PAGE_SIZE : Used for pagination (0=unlimited) +# example : LDAP_SEARCH_PAGE_SIZE=12345 +#LDAP_SEARCH_PAGE_SIZE=0 + +# LDAP_SEARCH_SIZE_LIMIT : The limit number of entries (0=unlimited) +# example : LDAP_SEARCH_SIZE_LIMIT=12345 +#LDAP_SEARCH_SIZE_LIMIT=0 + +# LDAP_GROUP_FILTER_ENABLE : Enable group filtering +# example : LDAP_GROUP_FILTER_ENABLE=true +#LDAP_GROUP_FILTER_ENABLE=false + +# LDAP_GROUP_FILTER_OBJECTCLASS : The object class for filtering +# example : LDAP_GROUP_FILTER_OBJECTCLASS=group +#LDAP_GROUP_FILTER_OBJECTCLASS= + +# LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE : +# example : +#LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE= + +# LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE : +# example : +#LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE= + +# LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT : +# example : +#LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT= + +# LDAP_GROUP_FILTER_GROUP_NAME : +# example : +#LDAP_GROUP_FILTER_GROUP_NAME= + +# LDAP_UNIQUE_IDENTIFIER_FIELD : This field is sometimes class GUID (Globally Unique Identifier) +# example : LDAP_UNIQUE_IDENTIFIER_FIELD=guid +#LDAP_UNIQUE_IDENTIFIER_FIELD= + +# LDAP_UTF8_NAMES_SLUGIFY : Convert the username to utf8 +# example : LDAP_UTF8_NAMES_SLUGIFY=false +#LDAP_UTF8_NAMES_SLUGIFY=true + +# LDAP_USERNAME_FIELD : Which field contains the ldap username +# example : LDAP_USERNAME_FIELD=username +#LDAP_USERNAME_FIELD= + +# LDAP_FULLNAME_FIELD : Which field contains the ldap fullname +# example : LDAP_FULLNAME_FIELD=fullname +#LDAP_FULLNAME_FIELD= + +# LDAP_MERGE_EXISTING_USERS : +# example : LDAP_MERGE_EXISTING_USERS=true +#LDAP_MERGE_EXISTING_USERS=false + +# LDAP_EMAIL_MATCH_ENABLE : allow existing account matching by e-mail address when username does not match +# example: LDAP_EMAIL_MATCH_ENABLE=true +#LDAP_EMAIL_MATCH_ENABLE=false + +# LDAP_EMAIL_MATCH_REQUIRE : require existing account matching by e-mail address when username does match +# example: LDAP_EMAIL_MATCH_REQUIRE=true +#LDAP_EMAIL_MATCH_REQUIRE=false + +# LDAP_EMAIL_MATCH_VERIFIED : require existing account email address to be verified for matching +# example: LDAP_EMAIL_MATCH_VERIFIED=true +#LDAP_EMAIL_MATCH_VERIFIED=false + +# LDAP_EMAIL_FIELD : which field contains the LDAP e-mail address +# example: LDAP_EMAIL_FIELD=mail +#LDAP_EMAIL_FIELD= + +# LDAP_SYNC_USER_DATA : +# example : LDAP_SYNC_USER_DATA=true +#LDAP_SYNC_USER_DATA=false + +# LDAP_SYNC_USER_DATA_FIELDMAP : +# example : LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name", "mail":"email"} +#LDAP_SYNC_USER_DATA_FIELDMAP= + +# LDAP_SYNC_GROUP_ROLES : +# example : +#LDAP_SYNC_GROUP_ROLES= + +# LDAP_DEFAULT_DOMAIN : The default domain of the ldap it is used to create email if the field is not map correctly with the LDAP_SYNC_USER_DATA_FIELDMAP +# example : +#LDAP_DEFAULT_DOMAIN= + +# Enable/Disable syncing of admin status based on ldap groups: +#LDAP_SYNC_ADMIN_STATUS=true + +# Comma separated list of admin group names to sync. +#LDAP_SYNC_ADMIN_GROUPS=group1,group2 + +# LOGOUT_WITH_TIMER : Enables or not the option logout with timer +# example : LOGOUT_WITH_TIMER=true +#LOGOUT_WITH_TIMER= + +# LOGOUT_IN : The number of days +# example : LOGOUT_IN=1 +#LOGOUT_IN= +#LOGOUT_ON_HOURS= + +# LOGOUT_ON_MINUTES : The number of minutes +# example : LOGOUT_ON_MINUTES=55 +#LOGOUT_ON_MINUTES= From cfd7fbd818ddceff92862d28536bddf4a94ff3d9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 05:29:12 +0100 Subject: [PATCH 10/54] Nodejs upgrade from 8.9.3 to 8.15.1 --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 90daf64..a732f08 100755 --- a/scripts/install +++ b/scripts/install @@ -100,7 +100,7 @@ ynh_print_info "Installing dependencies..." ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script ynh_print_info "Installing nodejs ..." -ynh_install_nodejs 8.9.3 +ynh_install_nodejs 8.15.1 ynh_print_info "Installing mongodb dependencies ..." ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/restore b/scripts/restore index 11c87b7..eeba563 100644 --- a/scripts/restore +++ b/scripts/restore @@ -85,7 +85,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 ynh_print_info "Reinstalling dependencies..." # Define and install dependencies -ynh_install_nodejs 8.9.3 +ynh_install_nodejs 8.15.1 # Install mongodb ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/upgrade b/scripts/upgrade index 4f48cfa..0a9990f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,8 +68,9 @@ if ynh_version_gt "0.45-3" "${previous_version}" ; then fi if ynh_version_gt "0.77-2" "${previous_version}" ; then - ynh_install_nodejs 8.9.3 - ynh_use_nodejs + ynh_remove_nodejs + ynh_install_nodejs 8.15.1 + ynh_use_nodejs # Create a dedicated systemd config ynh_replace_string "__ENV_PATH__" "$nodejs_path" "../conf/systemd.service" ynh_replace_string "__DB_NAME__" "$db_name" "../conf/systemd.service" From d1ccc3322cb28fbf2ffdb5e2c5f8f2d7f84acec4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 05:39:46 +0100 Subject: [PATCH 11/54] upgrade to nodejs 8.14.1 --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index a732f08..9dff508 100755 --- a/scripts/install +++ b/scripts/install @@ -100,7 +100,7 @@ ynh_print_info "Installing dependencies..." ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script ynh_print_info "Installing nodejs ..." -ynh_install_nodejs 8.15.1 +ynh_install_nodejs 8.14.1 ynh_print_info "Installing mongodb dependencies ..." ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/restore b/scripts/restore index eeba563..1719c53 100644 --- a/scripts/restore +++ b/scripts/restore @@ -85,7 +85,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 ynh_print_info "Reinstalling dependencies..." # Define and install dependencies -ynh_install_nodejs 8.15.1 +ynh_install_nodejs 8.14.1 # Install mongodb ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/upgrade b/scripts/upgrade index 0a9990f..fb7948c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,7 +69,7 @@ fi if ynh_version_gt "0.77-2" "${previous_version}" ; then ynh_remove_nodejs - ynh_install_nodejs 8.15.1 + ynh_install_nodejs 8.14.1 ynh_use_nodejs # Create a dedicated systemd config ynh_replace_string "__ENV_PATH__" "$nodejs_path" "../conf/systemd.service" From bb504cbf3d4bd8e1a5403a8ab7857f9d7e4cd800 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 19:51:22 +0100 Subject: [PATCH 12/54] Upgrade to 2.40 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8cae7a8..f929164 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 Wekan is an open-source kanban board (task manager and organizer) -**Shipped version:** 2.37 +**Shipped version:** 2.40 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 990cf9d..e608dae 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://raw.githubusercontent.com/yalh76/wekan_ynh/2.37/conf/wekan-2.37.tar.gz -SOURCE_SUM=471c3c9190119da0b988a9ae0c28aa80388e07bd8d3720ff44e8a9ecac681c5b +SOURCE_URL=https://raw.githubusercontent.com/yalh76/wekan_ynh/2.40/conf/wekan-2.40.tar.gz +SOURCE_SUM=d49ca72918f979ad1488dfa0f23b099e241eef1eabcbc865fa42f32e6c490018 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index da2e4bc..0c2898b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "2.37~ynh1", + "version": "2.40~ynh1", "url": "https://wekan.io", "license": "MIT", "maintainer": { From 5a8506047763d79177fcb5da0b2778a8fc92f5cc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 6 Mar 2019 20:26:15 +0100 Subject: [PATCH 13/54] to nodejs 8.15.1 --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 9dff508..a732f08 100755 --- a/scripts/install +++ b/scripts/install @@ -100,7 +100,7 @@ ynh_print_info "Installing dependencies..." ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script ynh_print_info "Installing nodejs ..." -ynh_install_nodejs 8.14.1 +ynh_install_nodejs 8.15.1 ynh_print_info "Installing mongodb dependencies ..." ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/restore b/scripts/restore index 1719c53..eeba563 100644 --- a/scripts/restore +++ b/scripts/restore @@ -85,7 +85,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 ynh_print_info "Reinstalling dependencies..." # Define and install dependencies -ynh_install_nodejs 8.14.1 +ynh_install_nodejs 8.15.1 # Install mongodb ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/upgrade b/scripts/upgrade index fb7948c..0a9990f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,7 +69,7 @@ fi if ynh_version_gt "0.77-2" "${previous_version}" ; then ynh_remove_nodejs - ynh_install_nodejs 8.14.1 + ynh_install_nodejs 8.15.1 ynh_use_nodejs # Create a dedicated systemd config ynh_replace_string "__ENV_PATH__" "$nodejs_path" "../conf/systemd.service" From 0bd981e7780fc6851dcb3f071751b6c4dec18e03 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 00:49:05 +0100 Subject: [PATCH 14/54] Provide LDAP variables --- conf/.env | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index 17d1c80..73d8daa 100644 --- a/conf/.env +++ b/conf/.env @@ -14,7 +14,7 @@ MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ ROOT_URL=https://__DOMAIN_URI__ # Mail URL -MAIL_URL='smtp://user:pass@mailserver.example.com:25/' +MAIL_URL='smtp://localhost:25/' # This is local port where Wekan Node.js runs PORT=__PORT__ @@ -145,42 +145,52 @@ WEBHOOKS_ATTRIBUTES='' # LDAP_ENABLE : Enable or not the connection by the LDAP # example : LDAP_ENABLE=true #LDAP_ENABLE=false +LDAP_ENABLE=true # LDAP_PORT : The port of the LDAP server # example : LDAP_PORT=389 #LDAP_PORT=389 +LDAP_PORT=389 # LDAP_HOST : The host server for the LDAP server # example : LDAP_HOST=localhost #LDAP_HOST= +LDAP_HOST=localhost # LDAP_BASEDN : The base DN for the LDAP Tree # example : LDAP_BASEDN=ou=user,dc=example,dc=org #LDAP_BASEDN= +LDAP_BASEDN=dc=yunohost,dc=org # LDAP_LOGIN_FALLBACK : Fallback on the default authentication method # example : LDAP_LOGIN_FALLBACK=true #LDAP_LOGIN_FALLBACK=false +LDAP_LOGIN_FALLBACK=false # LDAP_RECONNECT : Reconnect to the server if the connection is lost # example : LDAP_RECONNECT=false #LDAP_RECONNECT=true +LDAP_RECONNECT=true # LDAP_TIMEOUT : Overall timeout, in milliseconds # example : LDAP_TIMEOUT=12345 #LDAP_TIMEOUT=10000 +LDAP_TIMEOUT=10000 # LDAP_IDLE_TIMEOUT : Specifies the timeout for idle LDAP connections in milliseconds # example : LDAP_IDLE_TIMEOUT=12345 #LDAP_IDLE_TIMEOUT=10000 +LDAP_IDLE_TIMEOUT=10000 # LDAP_CONNECT_TIMEOUT : Connection timeout, in milliseconds # example : LDAP_CONNECT_TIMEOUT=12345 #LDAP_CONNECT_TIMEOUT=10000 +LDAP_CONNECT_TIMEOUT=10000 # LDAP_AUTHENTIFICATION : If the LDAP needs a user account to search # example : LDAP_AUTHENTIFICATION=true #LDAP_AUTHENTIFICATION=false +LDAP_AUTHENTIFICATION=false # LDAP_AUTHENTIFICATION_USERDN : The search user DN # example : LDAP_AUTHENTIFICATION_USERDN=cn=admin,dc=example,dc=org @@ -193,22 +203,27 @@ WEBHOOKS_ATTRIBUTES='' # LDAP_LOG_ENABLED : Enable logs for the module # example : LDAP_LOG_ENABLED=true #LDAP_LOG_ENABLED=false +LDAP_LOG_ENABLED=true # LDAP_BACKGROUND_SYNC : If the sync of the users should be done in the background # example : LDAP_BACKGROUND_SYNC=true #LDAP_BACKGROUND_SYNC=false +LDAP_BACKGROUND_SYNC=true # LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds # example : LDAP_BACKGROUND_SYNC_INTERVAL=12345 #LDAP_BACKGROUND_SYNC_INTERVAL=100 +LDAP_BACKGROUND_SYNC_INTERVAL=100 # LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED : # example : LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true #LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=false +LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true # LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS : # example : LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true #LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=false +LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true # LDAP_ENCRYPTION : If using LDAPS # example : LDAP_ENCRYPTION=ssl @@ -225,90 +240,112 @@ WEBHOOKS_ATTRIBUTES='' # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed # example : LDAP_USER_SEARCH_FILTER= #LDAP_USER_SEARCH_FILTER= +LDAP_USER_SEARCH_FILTER="(&(|(objectclass=posixAccount))(uid=%uid))" # LDAP_USER_SEARCH_SCOPE : base (search only in the provided DN), one (search only in the provided DN and one level deep), or sub (search the whole subtree) # example : LDAP_USER_SEARCH_SCOPE=one #LDAP_USER_SEARCH_SCOPE= +LDAP_USER_SEARCH_SCOPE=sub # LDAP_USER_SEARCH_FIELD : Which field is used to find the user # example : LDAP_USER_SEARCH_FIELD=uid #LDAP_USER_SEARCH_FIELD= +LDAP_USER_SEARCH_FIELD=uid # LDAP_SEARCH_PAGE_SIZE : Used for pagination (0=unlimited) # example : LDAP_SEARCH_PAGE_SIZE=12345 #LDAP_SEARCH_PAGE_SIZE=0 +LDAP_SEARCH_PAGE_SIZE=0 # LDAP_SEARCH_SIZE_LIMIT : The limit number of entries (0=unlimited) # example : LDAP_SEARCH_SIZE_LIMIT=12345 #LDAP_SEARCH_SIZE_LIMIT=0 +LDAP_SEARCH_SIZE_LIMIT=0 # LDAP_GROUP_FILTER_ENABLE : Enable group filtering # example : LDAP_GROUP_FILTER_ENABLE=true #LDAP_GROUP_FILTER_ENABLE=false +LDAP_GROUP_FILTER_ENABLE=true # LDAP_GROUP_FILTER_OBJECTCLASS : The object class for filtering # example : LDAP_GROUP_FILTER_OBJECTCLASS=group #LDAP_GROUP_FILTER_OBJECTCLASS= +LDAP_GROUP_FILTER_OBJECTCLASS=posixGroup # LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE : # example : #LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE= +LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE=gidNumber # LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE : # example : #LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE= +LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=memberUid # LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT : # example : #LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT= +LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=dn # LDAP_GROUP_FILTER_GROUP_NAME : -# example : +# example : LDAP_GROUP_FILTER_GROUP_NAME=yourwekangroup #LDAP_GROUP_FILTER_GROUP_NAME= + # LDAP_UNIQUE_IDENTIFIER_FIELD : This field is sometimes class GUID (Globally Unique Identifier) # example : LDAP_UNIQUE_IDENTIFIER_FIELD=guid #LDAP_UNIQUE_IDENTIFIER_FIELD= +LDAP_UNIQUE_IDENTIFIER_FIELD=entryUUID # LDAP_UTF8_NAMES_SLUGIFY : Convert the username to utf8 # example : LDAP_UTF8_NAMES_SLUGIFY=false #LDAP_UTF8_NAMES_SLUGIFY=true +LDAP_UTF8_NAMES_SLUGIFY=true # LDAP_USERNAME_FIELD : Which field contains the ldap username # example : LDAP_USERNAME_FIELD=username #LDAP_USERNAME_FIELD= +LDAP_USERNAME_FIELD=uid # LDAP_FULLNAME_FIELD : Which field contains the ldap fullname # example : LDAP_FULLNAME_FIELD=fullname #LDAP_FULLNAME_FIELD= +LDAP_FULLNAME_FIELD=cn # LDAP_MERGE_EXISTING_USERS : # example : LDAP_MERGE_EXISTING_USERS=true #LDAP_MERGE_EXISTING_USERS=false +LDAP_MERGE_EXISTING_USERS=true # LDAP_EMAIL_MATCH_ENABLE : allow existing account matching by e-mail address when username does not match # example: LDAP_EMAIL_MATCH_ENABLE=true #LDAP_EMAIL_MATCH_ENABLE=false +LDAP_EMAIL_MATCH_ENABLE=true # LDAP_EMAIL_MATCH_REQUIRE : require existing account matching by e-mail address when username does match # example: LDAP_EMAIL_MATCH_REQUIRE=true #LDAP_EMAIL_MATCH_REQUIRE=false +LDAP_EMAIL_MATCH_REQUIRE=true # LDAP_EMAIL_MATCH_VERIFIED : require existing account email address to be verified for matching # example: LDAP_EMAIL_MATCH_VERIFIED=true #LDAP_EMAIL_MATCH_VERIFIED=false +LDAP_EMAIL_MATCH_VERIFIED=true # LDAP_EMAIL_FIELD : which field contains the LDAP e-mail address # example: LDAP_EMAIL_FIELD=mail #LDAP_EMAIL_FIELD= +LDAP_EMAIL_FIELD=mail # LDAP_SYNC_USER_DATA : # example : LDAP_SYNC_USER_DATA=true #LDAP_SYNC_USER_DATA=false +LDAP_SYNC_USER_DATA=true # LDAP_SYNC_USER_DATA_FIELDMAP : # example : LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name", "mail":"email"} #LDAP_SYNC_USER_DATA_FIELDMAP= +LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name","displayName":"Full name"} # LDAP_SYNC_GROUP_ROLES : # example : @@ -320,9 +357,11 @@ WEBHOOKS_ATTRIBUTES='' # Enable/Disable syncing of admin status based on ldap groups: #LDAP_SYNC_ADMIN_STATUS=true +LDAP_SYNC_ADMIN_STATUS=true # Comma separated list of admin group names to sync. #LDAP_SYNC_ADMIN_GROUPS=group1,group2 +LDAP_SYNC_ADMIN_GROUPS=admins # LOGOUT_WITH_TIMER : Enables or not the option logout with timer # example : LOGOUT_WITH_TIMER=true From ca68f74e37271ce96f39f968fc85257a25267a68 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 01:42:22 +0100 Subject: [PATCH 15/54] Ldap First Step --- conf/.env | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/conf/.env b/conf/.env index 73d8daa..88c0a52 100644 --- a/conf/.env +++ b/conf/.env @@ -213,7 +213,7 @@ LDAP_BACKGROUND_SYNC=true # LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds # example : LDAP_BACKGROUND_SYNC_INTERVAL=12345 #LDAP_BACKGROUND_SYNC_INTERVAL=100 -LDAP_BACKGROUND_SYNC_INTERVAL=100 +LDAP_BACKGROUND_SYNC_INTERVAL=600000 # LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED : # example : LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true @@ -240,7 +240,7 @@ LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed # example : LDAP_USER_SEARCH_FILTER= #LDAP_USER_SEARCH_FILTER= -LDAP_USER_SEARCH_FILTER="(&(|(objectclass=posixAccount))(uid=%uid))" +LDAP_USER_SEARCH_FILTER="" # LDAP_USER_SEARCH_SCOPE : base (search only in the provided DN), one (search only in the provided DN and one level deep), or sub (search the whole subtree) # example : LDAP_USER_SEARCH_SCOPE=one @@ -265,7 +265,7 @@ LDAP_SEARCH_SIZE_LIMIT=0 # LDAP_GROUP_FILTER_ENABLE : Enable group filtering # example : LDAP_GROUP_FILTER_ENABLE=true #LDAP_GROUP_FILTER_ENABLE=false -LDAP_GROUP_FILTER_ENABLE=true +LDAP_GROUP_FILTER_ENABLE=false # LDAP_GROUP_FILTER_OBJECTCLASS : The object class for filtering # example : LDAP_GROUP_FILTER_OBJECTCLASS=group @@ -288,9 +288,9 @@ LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=memberUid LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=dn # LDAP_GROUP_FILTER_GROUP_NAME : -# example : LDAP_GROUP_FILTER_GROUP_NAME=yourwekangroup +# example : #LDAP_GROUP_FILTER_GROUP_NAME= - +LDAP_GROUP_FILTER_GROUP_NAME=cn # LDAP_UNIQUE_IDENTIFIER_FIELD : This field is sometimes class GUID (Globally Unique Identifier) # example : LDAP_UNIQUE_IDENTIFIER_FIELD=guid @@ -300,7 +300,6 @@ LDAP_UNIQUE_IDENTIFIER_FIELD=entryUUID # LDAP_UTF8_NAMES_SLUGIFY : Convert the username to utf8 # example : LDAP_UTF8_NAMES_SLUGIFY=false #LDAP_UTF8_NAMES_SLUGIFY=true -LDAP_UTF8_NAMES_SLUGIFY=true # LDAP_USERNAME_FIELD : Which field contains the ldap username # example : LDAP_USERNAME_FIELD=username @@ -345,7 +344,7 @@ LDAP_SYNC_USER_DATA=true # LDAP_SYNC_USER_DATA_FIELDMAP : # example : LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name", "mail":"email"} #LDAP_SYNC_USER_DATA_FIELDMAP= -LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name","displayName":"Full name"} +LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name"} # LDAP_SYNC_GROUP_ROLES : # example : @@ -354,14 +353,13 @@ LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name","displayName":"Full name"} # LDAP_DEFAULT_DOMAIN : The default domain of the ldap it is used to create email if the field is not map correctly with the LDAP_SYNC_USER_DATA_FIELDMAP # example : #LDAP_DEFAULT_DOMAIN= +LDAP_DEFAULT_DOMAIN=yh03.yh.yalh.net # Enable/Disable syncing of admin status based on ldap groups: #LDAP_SYNC_ADMIN_STATUS=true -LDAP_SYNC_ADMIN_STATUS=true # Comma separated list of admin group names to sync. #LDAP_SYNC_ADMIN_GROUPS=group1,group2 -LDAP_SYNC_ADMIN_GROUPS=admins # LOGOUT_WITH_TIMER : Enables or not the option logout with timer # example : LOGOUT_WITH_TIMER=true @@ -374,4 +372,4 @@ LDAP_SYNC_ADMIN_GROUPS=admins # LOGOUT_ON_MINUTES : The number of minutes # example : LOGOUT_ON_MINUTES=55 -#LOGOUT_ON_MINUTES= +#LOGOUT_ON_MINUTES= \ No newline at end of file From a5378a6bafd9415225693c55bed601fa10aeda3f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 02:46:44 +0100 Subject: [PATCH 16/54] Configure LDAP for Yunohost --- conf/.env | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/conf/.env b/conf/.env index 88c0a52..3a664d8 100644 --- a/conf/.env +++ b/conf/.env @@ -165,7 +165,7 @@ LDAP_BASEDN=dc=yunohost,dc=org # LDAP_LOGIN_FALLBACK : Fallback on the default authentication method # example : LDAP_LOGIN_FALLBACK=true #LDAP_LOGIN_FALLBACK=false -LDAP_LOGIN_FALLBACK=false +LDAP_LOGIN_FALLBACK=true # LDAP_RECONNECT : Reconnect to the server if the connection is lost # example : LDAP_RECONNECT=false @@ -213,7 +213,7 @@ LDAP_BACKGROUND_SYNC=true # LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds # example : LDAP_BACKGROUND_SYNC_INTERVAL=12345 #LDAP_BACKGROUND_SYNC_INTERVAL=100 -LDAP_BACKGROUND_SYNC_INTERVAL=600000 +LDAP_BACKGROUND_SYNC_INTERVAL=100 # LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED : # example : LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true @@ -240,7 +240,7 @@ LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed # example : LDAP_USER_SEARCH_FILTER= #LDAP_USER_SEARCH_FILTER= -LDAP_USER_SEARCH_FILTER="" +LDAP_USER_SEARCH_FILTER="(objectclass=posixAccount)" # LDAP_USER_SEARCH_SCOPE : base (search only in the provided DN), one (search only in the provided DN and one level deep), or sub (search the whole subtree) # example : LDAP_USER_SEARCH_SCOPE=one @@ -265,7 +265,7 @@ LDAP_SEARCH_SIZE_LIMIT=0 # LDAP_GROUP_FILTER_ENABLE : Enable group filtering # example : LDAP_GROUP_FILTER_ENABLE=true #LDAP_GROUP_FILTER_ENABLE=false -LDAP_GROUP_FILTER_ENABLE=false +LDAP_GROUP_FILTER_ENABLE=true # LDAP_GROUP_FILTER_OBJECTCLASS : The object class for filtering # example : LDAP_GROUP_FILTER_OBJECTCLASS=group @@ -275,7 +275,7 @@ LDAP_GROUP_FILTER_OBJECTCLASS=posixGroup # LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE : # example : #LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE= -LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE=gidNumber +LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE=cn # LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE : # example : @@ -285,12 +285,12 @@ LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=memberUid # LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT : # example : #LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT= -LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=dn +LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=uid # LDAP_GROUP_FILTER_GROUP_NAME : -# example : +# example : LDAP_GROUP_FILTER_GROUP_NAME=wekan_user #LDAP_GROUP_FILTER_GROUP_NAME= -LDAP_GROUP_FILTER_GROUP_NAME=cn +LDAP_GROUP_FILTER_GROUP_NAME=sftpusers # LDAP_UNIQUE_IDENTIFIER_FIELD : This field is sometimes class GUID (Globally Unique Identifier) # example : LDAP_UNIQUE_IDENTIFIER_FIELD=guid @@ -300,6 +300,7 @@ LDAP_UNIQUE_IDENTIFIER_FIELD=entryUUID # LDAP_UTF8_NAMES_SLUGIFY : Convert the username to utf8 # example : LDAP_UTF8_NAMES_SLUGIFY=false #LDAP_UTF8_NAMES_SLUGIFY=true +LDAP_UTF8_NAMES_SLUGIFY=true # LDAP_USERNAME_FIELD : Which field contains the ldap username # example : LDAP_USERNAME_FIELD=username @@ -324,12 +325,12 @@ LDAP_EMAIL_MATCH_ENABLE=true # LDAP_EMAIL_MATCH_REQUIRE : require existing account matching by e-mail address when username does match # example: LDAP_EMAIL_MATCH_REQUIRE=true #LDAP_EMAIL_MATCH_REQUIRE=false -LDAP_EMAIL_MATCH_REQUIRE=true +LDAP_EMAIL_MATCH_REQUIRE=false # LDAP_EMAIL_MATCH_VERIFIED : require existing account email address to be verified for matching # example: LDAP_EMAIL_MATCH_VERIFIED=true #LDAP_EMAIL_MATCH_VERIFIED=false -LDAP_EMAIL_MATCH_VERIFIED=true +LDAP_EMAIL_MATCH_VERIFIED=false # LDAP_EMAIL_FIELD : which field contains the LDAP e-mail address # example: LDAP_EMAIL_FIELD=mail @@ -349,6 +350,7 @@ LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name"} # LDAP_SYNC_GROUP_ROLES : # example : #LDAP_SYNC_GROUP_ROLES= +LDAP_SYNC_GROUP_ROLES=admins # LDAP_DEFAULT_DOMAIN : The default domain of the ldap it is used to create email if the field is not map correctly with the LDAP_SYNC_USER_DATA_FIELDMAP # example : @@ -357,9 +359,11 @@ LDAP_DEFAULT_DOMAIN=yh03.yh.yalh.net # Enable/Disable syncing of admin status based on ldap groups: #LDAP_SYNC_ADMIN_STATUS=true +LDAP_SYNC_ADMIN_STATUS=true # Comma separated list of admin group names to sync. #LDAP_SYNC_ADMIN_GROUPS=group1,group2 +LDAP_SYNC_ADMIN_GROUPS=admins # LOGOUT_WITH_TIMER : Enables or not the option logout with timer # example : LOGOUT_WITH_TIMER=true From c0657961f82277e9405cedbaa6ef128c8897347f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 03:08:27 +0100 Subject: [PATCH 17/54] Update according LDAP implementation --- README.md | 7 ++++--- check_process | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8cae7a8..99fbc2d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Wekan is an open-source kanban board (task manager and organizer) - 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 integration** though it might be integrated at some point in the app, now that it's supported in Meteor/Wekan. 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 @@ -33,8 +33,6 @@ Wekan is an open-source kanban board (task manager and organizer) **Private/Public mode:** In private mode, only authorized YunoHost members can access to the wekan. -**SSO/LDAP:** SSO and LDAP are not configured. - ## Configuration First registered user will be admin, and next ones normal users. If you want other admins too, you can change their permission to admin at Wekan Admin Panel. @@ -45,6 +43,9 @@ First registered user will be admin, and next ones normal users. If you want oth ## YunoHost specific features +#### Multi-users support + +LDAP is supported but and HTTP auth is stil not supported #### Supported architectures * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wekan%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/wekan/) diff --git a/check_process b/check_process index 26fa846..6a85be0 100644 --- a/check_process +++ b/check_process @@ -22,7 +22,7 @@ Level 3=auto # Level 4: If the app supports LDAP and SSOwat, turn level 4 to '1' and add a link to an issue or a part of your code to show it. # If the app does not use LDAP nor SSOwat, and can't use them, turn level 4 to 'na' and explain as well. - #LDAP to be implemented in wekan_ynh: https://github.com/wekan/wekan/wiki/LDAP + #LDAP Implemented but not SSOwat Level 4=0 Level 5=auto Level 6=auto From 7dad072155fd728c49ce5379964307f578fd9b81 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 03:29:14 +0100 Subject: [PATCH 18/54] Add change_url script --- scripts/change_url | 111 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..93a67da --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,111 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +old_domain=$YNH_APP_OLD_DOMAIN +old_path=$YNH_APP_OLD_PATH + +new_domain=$YNH_APP_NEW_DOMAIN +new_path=$YNH_APP_NEW_PATH + +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# LOAD SETTINGS +#================================================= +ynh_print_info "Loading installation settings..." + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get $app final_path) + +# Add settings here as needed by your application +#db_name=$(ynh_app_setting_get "$app" db_name) +#db_pwd=$(ynh_app_setting_get $app db_pwd) + +#================================================= +# CHECK THE SYNTAX OF THE PATHS +#================================================= + +test -n "$old_path" || old_path="/" +test -n "$new_path" || new_path="/" +new_path=$(ynh_normalize_url_path $new_path) +old_path=$(ynh_normalize_url_path $old_path) + +#================================================= +# CHECK WHICH PARTS SHOULD BE CHANGED +#================================================= + +change_domain=0 +if [ "$old_domain" != "$new_domain" ] +then + change_domain=1 +fi + +change_path=0 +if [ "$old_path" != "$new_path" ] +then + change_path=1 +fi + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_print_info "Updating nginx web server configuration..." + +nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf + +# Change the path in the nginx config file +if [ $change_path -eq 1 ] +then + # Make a backup of the original nginx config file if modified + ynh_backup_if_checksum_is_different "$nginx_conf_path" + # Set global variables for nginx helper + domain="$old_domain" + path_url="$new_path" + # Create a dedicated nginx config + ynh_add_nginx_config +fi + +# Change the domain for nginx +if [ $change_domain -eq 1 ] +then + # Delete file checksum for the old conf file location + ynh_delete_file_checksum "$nginx_conf_path" + mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + # Store file checksum for the new config file location + ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf" +fi + +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +# ... +#================================================= + +#================================================= +# GENERIC FINALISATION +#================================================= +# RELOAD NGINX +#================================================= +ynh_print_info "Reloading nginx web server..." + +systemctl reload nginx + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Change of URL completed for $app" From c6fd2bf9af60624f229e47b2a00a45d59ac09424 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 03:58:49 +0100 Subject: [PATCH 19/54] fix node --- conf/systemd.service | 2 +- scripts/install | 1 + scripts/upgrade | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 5abbcbf..9fbf394 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ User=__APP__ Group=__APP__ EnvironmentFile=__FINALPATH__/.env WorkingDirectory=__FINALPATH__ -ExecStart=/opt/node_n/bin/node __FINALPATH__/main.js +ExecStart=__NODEJS_PATH__/node __FINALPATH__/main.js Restart=on-failure #StartLimitInterval=86400 #StartLimitBurst=5 diff --git a/scripts/install b/scripts/install index 972a8a2..d08fd8f 100755 --- a/scripts/install +++ b/scripts/install @@ -189,6 +189,7 @@ ynh_print_info "Configuring a systemd service..." ### - And the section "SETUP SYSTEMD" in the upgrade script # Create a dedicated systemd config +ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service" ynh_add_systemd_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 89329c1..067e9b3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,6 +72,7 @@ if ynh_version_gt "0.77-2" "${previous_version}" ; then ynh_install_nodejs 8.15.1 ynh_use_nodejs # Create a dedicated systemd config + ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service" ynh_add_systemd_config # Create a dedicated .env config ynh_backup_if_checksum_is_different "$final_path/.env" From 47225aa0b5add4617ec10803f471d294d8518e41 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 11:52:49 +0100 Subject: [PATCH 20/54] update mail url --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 3a664d8..dbf037d 100644 --- a/conf/.env +++ b/conf/.env @@ -14,7 +14,7 @@ MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ ROOT_URL=https://__DOMAIN_URI__ # Mail URL -MAIL_URL='smtp://localhost:25/' +MAIL_URL=smtp://localhost # This is local port where Wekan Node.js runs PORT=__PORT__ From 8ae6b881fbc7c6ad0f9268a0cb2469c19b1b7de5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 11:55:12 +0100 Subject: [PATCH 21/54] Upgarde to 2.42 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f929164..b41543d 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 Wekan is an open-source kanban board (task manager and organizer) -**Shipped version:** 2.40 +**Shipped version:** 2.42 ## Screenshots diff --git a/conf/app.src b/conf/app.src index e608dae..8cce057 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://raw.githubusercontent.com/yalh76/wekan_ynh/2.40/conf/wekan-2.40.tar.gz -SOURCE_SUM=d49ca72918f979ad1488dfa0f23b099e241eef1eabcbc865fa42f32e6c490018 +SOURCE_URL=https://raw.githubusercontent.com/yalh76/wekan_ynh/2.42/conf/wekan-2.42.tar.gz +SOURCE_SUM=7fe258fee129dfbea86db20f63ad0729a4c2bd8870796e89880a525942034c37 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 0c2898b..fbf2b4a 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "2.40~ynh1", + "version": "2.42~ynh1", "url": "https://wekan.io", "license": "MIT", "maintainer": { From 743021283c90d23ccc190e1370165be50daa2193 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 12:12:10 +0100 Subject: [PATCH 22/54] Fix change URL --- check_process | 2 +- scripts/change_url | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 6a85be0..d97cd59 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,7 @@ multi_instance=1 incorrect_path=1 port_already_use=1 - change_url=0 + change_url=1 ;;; Levels Level 1=auto Level 2=auto diff --git a/scripts/change_url b/scripts/change_url index 93a67da..7f39e9c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -92,8 +92,14 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... +# MODIFY URL IN .ENV #================================================= +ynh_print_info "Updating .env configuration..." + +ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" +ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" +ynh_replace_string "__DOMAIN_URI__" "$new_domain$new_path" "$final_path/.env" +ynh_replace_string "__PORT__" "$port" "$final_path/.env" #================================================= # GENERIC FINALISATION From b2c572811212914be31ba066fdba38818aee3ab1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 13:47:05 +0100 Subject: [PATCH 23/54] reboot services --- scripts/change_url | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 7f39e9c..453358f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_systemd_action source /usr/share/yunohost/helpers #================================================= @@ -96,10 +97,13 @@ fi #================================================= ynh_print_info "Updating .env configuration..." +ynh_systemd_action --action=stop --service_name=$app --log_path="systemd" ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" ynh_replace_string "__DOMAIN_URI__" "$new_domain$new_path" "$final_path/.env" ynh_replace_string "__PORT__" "$port" "$final_path/.env" +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" +sleep 10 #================================================= # GENERIC FINALISATION From f3582c9169cfd8f5ca8dba9826429e2455619333 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 17:54:57 +0100 Subject: [PATCH 24/54] fix service start --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 453358f..776135c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -102,7 +102,7 @@ ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" ynh_replace_string "__DOMAIN_URI__" "$new_domain$new_path" "$final_path/.env" ynh_replace_string "__PORT__" "$port" "$final_path/.env" -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" sleep 10 #================================================= From 10b14700d871a7ad087ad08e5a904f57960e254b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 17:59:51 +0100 Subject: [PATCH 25/54] Fix service startup --- scripts/install | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index d08fd8f..771a341 100755 --- a/scripts/install +++ b/scripts/install @@ -269,7 +269,7 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" sleep 10 #================================================= diff --git a/scripts/restore b/scripts/restore index eeba563..52f8756 100644 --- a/scripts/restore +++ b/scripts/restore @@ -128,7 +128,7 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" sleep 10 #================================================= From dccac47828db059ca6e206a3dd06abc8bc68a10a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:05:44 +0100 Subject: [PATCH 26/54] Fix upgrade --- scripts/change_url | 5 ++++- scripts/install | 1 + scripts/restore | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 776135c..30d2896 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -20,6 +20,9 @@ old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN new_path=$YNH_APP_NEW_PATH +db_name=$(ynh_app_setting_get $app db_name) +port=$(ynh_app_setting_get $app port) + app=$YNH_APP_INSTANCE_NAME #================================================= @@ -98,12 +101,12 @@ fi ynh_print_info "Updating .env configuration..." ynh_systemd_action --action=stop --service_name=$app --log_path="systemd" +ynh_use_nodejs ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" ynh_replace_string "__DOMAIN_URI__" "$new_domain$new_path" "$final_path/.env" ynh_replace_string "__PORT__" "$port" "$final_path/.env" ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" -sleep 10 #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 771a341..32199e9 100755 --- a/scripts/install +++ b/scripts/install @@ -101,6 +101,7 @@ ynh_print_info "Installing dependencies..." ynh_print_info "Installing nodejs ..." ynh_install_nodejs 8.15.1 +ynh_use_nodejs ynh_print_info "Installing mongodb dependencies ..." ynh_install_app_dependencies "mongodb mongodb-server" diff --git a/scripts/restore b/scripts/restore index 52f8756..67f0303 100644 --- a/scripts/restore +++ b/scripts/restore @@ -86,6 +86,7 @@ ynh_print_info "Reinstalling dependencies..." # Define and install dependencies ynh_install_nodejs 8.15.1 +ynh_use_nodejs # Install mongodb ynh_install_app_dependencies "mongodb mongodb-server" From 60fc6d9993298514ee30d04106b226bb90155233 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:23:00 +0100 Subject: [PATCH 27/54] Fix path --- conf/nginx.conf | 2 +- scripts/change_url | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d8cfae8..dd7559e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -22,7 +22,7 @@ location __PATH__ # on every applicaiton update the name of CSS and JS file is different, # so they can be cache infinitely (here: 30 days) # the root path MUST NOT be cached - if ($uri != '/wekan') + if ($uri != '/__PATH__') { expires 30d; } diff --git a/scripts/change_url b/scripts/change_url index 30d2896..f0e667b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -80,7 +80,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated nginx config - ynh_add_nginx_config + ynh_add_nginx_config port fi # Change the domain for nginx From c23ea33bd3f8314d99187ac42daa5b79dbaebd35 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:30:47 +0100 Subject: [PATCH 28/54] fix nginx --- scripts/change_url | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index f0e667b..f8b9da0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -20,9 +20,6 @@ old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN new_path=$YNH_APP_NEW_PATH -db_name=$(ynh_app_setting_get $app db_name) -port=$(ynh_app_setting_get $app port) - app=$YNH_APP_INSTANCE_NAME #================================================= @@ -36,6 +33,8 @@ final_path=$(ynh_app_setting_get $app final_path) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get "$app" db_name) #db_pwd=$(ynh_app_setting_get $app db_pwd) +db_name=$(ynh_app_setting_get $app db_name) +port=$(ynh_app_setting_get $app port) #================================================= # CHECK THE SYNTAX OF THE PATHS @@ -80,7 +79,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated nginx config - ynh_add_nginx_config port + ynh_add_nginx_config fi # Change the domain for nginx From fd4bf2330a0a70f2f856e0959b8cc69700c9a140 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:35:30 +0100 Subject: [PATCH 29/54] fix nginx port --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index f8b9da0..4ac44f9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -79,7 +79,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated nginx config - ynh_add_nginx_config + ynh_add_nginx_config port fi # Change the domain for nginx From c21f2dba105366d93eaa72673ec1e71dd4631a4e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:36:41 +0100 Subject: [PATCH 30/54] Fix change_url --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 4ac44f9..f8b9da0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -79,7 +79,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated nginx config - ynh_add_nginx_config port + ynh_add_nginx_config fi # Change the domain for nginx From 1944b69fd3b59e9c47cf7a26bb72d609c00d151b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:43:06 +0100 Subject: [PATCH 31/54] Fix Path --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index dd7559e..f89a679 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -22,7 +22,7 @@ location __PATH__ # on every applicaiton update the name of CSS and JS file is different, # so they can be cache infinitely (here: 30 days) # the root path MUST NOT be cached - if ($uri != '/__PATH__') + if ($uri != '__PATH__') { expires 30d; } From 24bccaab754c84c08540710fb5d0f995056bd722 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 18:52:06 +0100 Subject: [PATCH 32/54] Fix change url --- scripts/change_url | 6 +----- scripts/install | 1 - scripts/restore | 1 - scripts/upgrade | 3 +-- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index f8b9da0..80fa5af 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -100,11 +100,7 @@ fi ynh_print_info "Updating .env configuration..." ynh_systemd_action --action=stop --service_name=$app --log_path="systemd" -ynh_use_nodejs -ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" -ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" -ynh_replace_string "__DOMAIN_URI__" "$new_domain$new_path" "$final_path/.env" -ynh_replace_string "__PORT__" "$port" "$final_path/.env" +ynh_replace_string "$old_domain$old_path" "$new_domain$new_path" "$final_path/.env" ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" #================================================= diff --git a/scripts/install b/scripts/install index 32199e9..28e424c 100755 --- a/scripts/install +++ b/scripts/install @@ -271,7 +271,6 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" -sleep 10 #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 67f0303..3a728d6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -130,7 +130,6 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" -sleep 10 #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 067e9b3..a72141a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -162,8 +162,7 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=restart --service_name=$app --log_path="systemd" -sleep 10 +ynh_systemd_action --action=restart --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" #================================================= # END OF SCRIPT From 679db476ad9677a4e87acabbfdeb07ec06092307 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 20:19:25 +0100 Subject: [PATCH 34/54] Fix panel --- conf/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index f89a679..86ded79 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,6 +6,7 @@ location __PATH__ proxy_pass http://127.0.0.1:__PORT__; proxy_http_version 1.1; + proxy_set_header Accept-Encoding ""; # allow websockets proxy_set_header Upgrade $http_upgrade; From daaf7b9e5d90334b06248751cd98118fc6420e2d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 20:56:56 +0100 Subject: [PATCH 35/54] Fix release source --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index 8cce057..42e1328 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ # This is on YunoHost server just to avoid the file from disappearing # Original source is https://releases.wekan.team/ -SOURCE_URL=https://raw.githubusercontent.com/yalh76/wekan_ynh/2.42/conf/wekan-2.42.tar.gz +SOURCE_URL=https://github.com/yalh76/wekan_ynh/releases/download/v2.42/wekan-2.42.tar.gz SOURCE_SUM=7fe258fee129dfbea86db20f63ad0729a4c2bd8870796e89880a525942034c37 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz From 3379872d17d384fb3ad9548f745ad0caa8795220 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Mar 2019 21:26:59 +0100 Subject: [PATCH 36/54] Add additional time for service to start --- scripts/change_url | 1 + scripts/install | 1 + scripts/restore | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 80fa5af..b7a7530 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -102,6 +102,7 @@ ynh_print_info "Updating .env configuration..." ynh_systemd_action --action=stop --service_name=$app --log_path="systemd" ynh_replace_string "$old_domain$old_path" "$new_domain$new_path" "$final_path/.env" ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" +sleep 10 #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 28e424c..32199e9 100755 --- a/scripts/install +++ b/scripts/install @@ -271,6 +271,7 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" +sleep 10 #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 3a728d6..67f0303 100644 --- a/scripts/restore +++ b/scripts/restore @@ -130,6 +130,7 @@ systemctl reload nginx #================================================= ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" +sleep 10 #================================================= # END OF SCRIPT From aaaec38da5ed61323d3021176cf65f7cb4e838d6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 8 Mar 2019 12:03:00 +0100 Subject: [PATCH 37/54] fix LDAP_DEFAULT_DOMAIN --- conf/.env | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/.env b/conf/.env index dbf037d..f5164ee 100644 --- a/conf/.env +++ b/conf/.env @@ -355,7 +355,6 @@ LDAP_SYNC_GROUP_ROLES=admins # LDAP_DEFAULT_DOMAIN : The default domain of the ldap it is used to create email if the field is not map correctly with the LDAP_SYNC_USER_DATA_FIELDMAP # example : #LDAP_DEFAULT_DOMAIN= -LDAP_DEFAULT_DOMAIN=yh03.yh.yalh.net # Enable/Disable syncing of admin status based on ldap groups: #LDAP_SYNC_ADMIN_STATUS=true From 5bee6a9e84368460884f416138602c6e2b690b7b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 8 Mar 2019 12:35:31 +0100 Subject: [PATCH 38/54] fix upgrade step for 2.42~ynh1 --- scripts/upgrade | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1b37f5b..3c9fbe0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,20 +68,15 @@ if ynh_version_gt "0.45-3" "${previous_version}" ; then fi if ynh_version_gt "0.77-2" "${previous_version}" ; then - ynh_remove_nodejs - ynh_install_nodejs 8.15.1 - ynh_use_nodejs + ynh_install_nodejs 8.9.3 # Create a dedicated systemd config - ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/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 "__PORT__" "$port" "../conf/systemd.service" + ynh_replace_string "__DOMAIN__" "$domain" "../conf/systemd.service" ynh_add_systemd_config - # Create a dedicated .env config - ynh_backup_if_checksum_is_different "$final_path/.env" - cp "../conf/.env" "$final_path/.env" - ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" - ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" - ynh_replace_string "__DOMAIN_URI__" "$domain$path_url" "$final_path/.env" - ynh_replace_string "__PORT__" "$port" "$final_path/.env" - ynh_store_file_checksum "$final_path/.env" fi if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then @@ -103,6 +98,23 @@ if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then ynh_add_systemd_config fi +if ynh_version_gt "2.42~ynh1" "${previous_version}" ; then + ynh_remove_nodejs + ynh_install_nodejs 8.15.1 + ynh_use_nodejs + # Create a dedicated systemd config + ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service" + ynh_add_systemd_config + # Create a dedicated .env config + ynh_backup_if_checksum_is_different "$final_path/.env" + cp "../conf/.env" "$final_path/.env" + ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" + ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" + ynh_replace_string "__DOMAIN_URI__" "$domain$path_url" "$final_path/.env" + ynh_replace_string "__PORT__" "$port" "$final_path/.env" + ynh_store_file_checksum "$final_path/.env" +fi + #================================================= # CHECK THE PATH #================================================= From 8493cc60e1f44a8fabb67ab03a2f076d97757ccf Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Mar 2019 01:04:59 +0100 Subject: [PATCH 39/54] Update to last example_ynh --- scripts/_common.sh | 7 +++++++ scripts/install | 8 +++----- scripts/restore | 3 +-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b905339..000bced 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,12 @@ #!/bin/bash +#================================================= +# COMMON VARIABLES +#================================================= + +# dependencies used by the app +pkg_dependencies="mongodb mongodb-server" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 32199e9..4ab5fe7 100755 --- a/scripts/install +++ b/scripts/install @@ -99,19 +99,17 @@ ynh_print_info "Installing dependencies..." ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -ynh_print_info "Installing nodejs ..." ynh_install_nodejs 8.15.1 ynh_use_nodejs -ynh_print_info "Installing mongodb dependencies ..." -ynh_install_app_dependencies "mongodb mongodb-server" +ynh_install_app_dependencies $pkg_dependencies #================================================= -# Start MONGODB +# START MONGODB #================================================= +ynh_print_info "Starting mongodb ..." # Start mogodb -ynh_print_info "Starting mongodb ..." systemctl enable mongodb systemctl restart mongodb diff --git a/scripts/restore b/scripts/restore index 67f0303..6998671 100644 --- a/scripts/restore +++ b/scripts/restore @@ -88,8 +88,7 @@ ynh_print_info "Reinstalling dependencies..." ynh_install_nodejs 8.15.1 ynh_use_nodejs -# Install mongodb -ynh_install_app_dependencies "mongodb mongodb-server" +ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE MONGODB DATABASE From b32099ffa3d5dcaf0d8a71e6c6d4b8c7f52e40e9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 15 Mar 2019 19:26:47 +0100 Subject: [PATCH 40/54] Apply last example_ynh --- scripts/backup | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/backup b/scripts/backup index 6f2744f..9db7830 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers From 7b86821972b0a5c827adcb6a0af81cdb77616225 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 15 Mar 2019 19:27:33 +0100 Subject: [PATCH 41/54] Remove already started mongodb --- scripts/install | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/install b/scripts/install index 4ab5fe7..001e544 100755 --- a/scripts/install +++ b/scripts/install @@ -164,13 +164,6 @@ ynh_system_user_create $app "$final_path" #================================================= # SPECIFIC SETUP -#================================================= - -# Start mogodb -ynh_print_info "Starting mongodb ..." -systemctl enable mongodb -systemctl restart mongodb - #================================================= # SETUP SYSTEMD #================================================= From 25161d4bb9f04bd51765d587a650e000a72da928 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 15 Mar 2019 19:29:38 +0100 Subject: [PATCH 42/54] Spelling --- scripts/install | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 001e544..78ea13f 100755 --- a/scripts/install +++ b/scripts/install @@ -109,7 +109,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_print_info "Starting mongodb ..." -# Start mogodb +# Start mongodb systemctl enable mongodb systemctl restart mongodb diff --git a/scripts/restore b/scripts/restore index 6998671..cccd9a3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -95,7 +95,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_print_info "Restoring the MongoDB database..." -# Start mogodb +# Start mongodb systemctl enable mongodb systemctl start mongodb mongorestore --db $db_name ./dump/$db_name From 891e8e86310432f84d18289b8b1ca72a614f11db Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 02:46:20 +0100 Subject: [PATCH 43/54] upgrade to 2.48 --- README.md | 2 +- conf/app.src | 2 +- manifest.json | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1b655da..b76ef2a 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 Wekan is an open-source kanban board (task manager and organizer) -**Shipped version:** 2.42 +**Shipped version:** 2.48 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 42e1328..aecdd90 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ # This is on YunoHost server just to avoid the file from disappearing # Original source is https://releases.wekan.team/ -SOURCE_URL=https://github.com/yalh76/wekan_ynh/releases/download/v2.42/wekan-2.42.tar.gz +SOURCE_URL=https://github.com/yalh76/wekan_ynh/releases/download/v2.48/wekan-2.48.tar.gz SOURCE_SUM=7fe258fee129dfbea86db20f63ad0729a4c2bd8870796e89880a525942034c37 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz diff --git a/manifest.json b/manifest.json index fbf2b4a..24cee81 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "2.42~ynh1", + "version": "2.48~ynh1", "url": "https://wekan.io", "license": "MIT", "maintainer": { diff --git a/scripts/upgrade b/scripts/upgrade index c312b7b..c9b23c7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,7 +99,7 @@ if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then ynh_add_systemd_config fi -if ynh_version_gt "2.42~ynh1" "${previous_version}" ; then +if ynh_version_gt "2.48~ynh1" "${previous_version}" ; then ynh_remove_nodejs ynh_install_nodejs 8.15.1 ynh_use_nodejs From 0474e861ae34e0e0ee8acd02fb8719ce8ad81edd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Mar 2019 02:49:09 +0100 Subject: [PATCH 44/54] Fix source sum --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index aecdd90..4be1016 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://github.com/yalh76/wekan_ynh/releases/download/v2.48/wekan-2.48.tar.gz -SOURCE_SUM=7fe258fee129dfbea86db20f63ad0729a4c2bd8870796e89880a525942034c37 +SOURCE_SUM=1d6ae104487cb29029e6187531432a9c3dd2d9c4e1aef4f848ae48286010b0e8 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 6c3a8ca9b48dec09378d9b71aef9cf5419e6704d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Mar 2019 04:26:50 +0100 Subject: [PATCH 46/54] Update install --- scripts/install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index a8afc96..08952c6 100755 --- a/scripts/install +++ b/scripts/install @@ -38,11 +38,12 @@ ynh_print_info "Validating installation parameters..." # 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 :(" -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" +# Normalize the url path syntax +path_url=$(ynh_normalize_url_path $path_url) + # Register (book) web path ynh_webpath_register $app $domain $path_url From 437f1836b9628ef3bc9bf3ad7a07906ade821a44 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Mar 2019 04:27:40 +0100 Subject: [PATCH 47/54] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 24cee81..df397cd 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "url": "https://github.com/alexAubin/" }, "requirements": { - "yunohost": ">= 3.0.0" + "yunohost": ">= 3.4" }, "multi_instance": true, "services": [ From 31661c183dc0c74fdeac7ed6cea618942a49e219 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Mar 2019 04:36:31 +0100 Subject: [PATCH 48/54] Cleaning --- check_process | 1 + scripts/backup | 4 --- scripts/change_url | 3 +-- scripts/install | 65 ++++++++++------------------------------------ scripts/remove | 2 +- scripts/restore | 4 --- 6 files changed, 17 insertions(+), 62 deletions(-) diff --git a/check_process b/check_process index d97cd59..b249208 100644 --- a/check_process +++ b/check_process @@ -11,6 +11,7 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=4fe78843712dc1adc189830d2dde5f78bb17d747 backup_restore=1 multi_instance=1 incorrect_path=1 diff --git a/scripts/backup b/scripts/backup index 9db7830..e79f044 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/change_url b/scripts/change_url index b7a7530..4278d43 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -31,8 +31,7 @@ ynh_print_info "Loading installation settings..." final_path=$(ynh_app_setting_get $app final_path) # Add settings here as needed by your application -#db_name=$(ynh_app_setting_get "$app" db_name) -#db_pwd=$(ynh_app_setting_get $app db_pwd) + db_name=$(ynh_app_setting_get $app db_name) port=$(ynh_app_setting_get $app port) diff --git a/scripts/install b/scripts/install index 08952c6..e56e461 100755 --- a/scripts/install +++ b/scripts/install @@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -25,11 +21,12 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +app=$YNH_APP_INSTANCE_NAME + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -55,28 +52,23 @@ ynh_print_info "Storing installation settings..." ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url ynh_app_setting_set $app is_public $is_public -ynh_app_setting_set $app final_path $final_path + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# FIND AND OPEN A PORT +#================================================= +ynh_print_info "Configuring firewall..." # Find a free port port=$(ynh_find_port 8095) ynh_app_setting_set $app port $port -# Registering db name -db_name=$(ynh_sanitize_dbid $app) -ynh_app_setting_set $app db_name $db_name - #================================================= # INSTALL DEPENDENCIES #================================================= ynh_print_info "Installing dependencies..." -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - ynh_install_nodejs 8.15.1 ynh_use_nodejs @@ -91,15 +83,16 @@ ynh_print_info "Starting mongodb ..." systemctl enable mongodb systemctl restart mongodb +# Registering db name +db_name=$(ynh_sanitize_dbid $app) +ynh_app_setting_set $app db_name $db_name + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_print_info "Setting up wekan source files..." -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src - +ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" @@ -108,8 +101,6 @@ ynh_setup_source "$final_path" #================================================= ynh_print_info "Configuring nginx web server..." -### `ynh_add_nginx_config` will use the file conf/nginx.conf - # Create a dedicated nginx config ynh_add_nginx_config @@ -128,17 +119,6 @@ ynh_system_user_create $app "$final_path" #================================================= ynh_print_info "Configuring a systemd service..." -### `ynh_systemd_config` is used to configure a systemd script for an app. -### It can be used for apps that use sysvinit (with adaptation) or systemd. -### Have a look at the app to be sure this app needs a systemd script. -### `ynh_systemd_config` will use the file conf/systemd.service -### If you're not using these lines: -### - You can remove those files in conf/. -### - Remove the section "BACKUP SYSTEMD" in the backup script -### - Remove also the section "STOP AND REMOVE SERVICE" in the remove script -### - As well as the section "RESTORE SYSTEMD" in the restore script -### - And the section "SETUP SYSTEMD" in the upgrade script - # Create a dedicated systemd config ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service" ynh_add_systemd_config @@ -147,8 +127,6 @@ ynh_add_systemd_config # MODIFY A CONFIG FILE #================================================= -### `ynh_replace_string` is used to replace a string in a file. -### (It's compatible with sed regular expressions syntax) cp "../conf/.env" "$final_path/.env" ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" @@ -160,10 +138,6 @@ ynh_replace_string "__PORT__" "$port" "$final_path/.env" # STORE THE CONFIG FILE CHECKSUM #================================================= -### `ynh_store_file_checksum` is used to store the checksum of a file. -### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, -### you can make a backup of this file before modifying it again if the admin had modified it. - # Calculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/.env" @@ -174,9 +148,6 @@ ynh_store_file_checksum "$final_path/.env" #================================================= ynh_print_info "Configuring file permissions ..." -### For security reason, any app should set the permissions to root: before anything else. -### Then, if write authorization is needed, any access should be given only to directories -### that really need such authorization. # Set strong right permissions to app files chown -R $app: "$final_path" chmod -R 640 "$final_path" @@ -186,14 +157,6 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -### `yunohost service add` is a CLI yunohost command to add a service in the admin panel. -### You'll find the service in the 'services' section of YunoHost admin panel. -### This CLI command would be useless if the app does not have any services (systemd or sysvinit) -### If you're not using these lines: -### - You can remove these files in conf/. -### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script -### - As well as the section ADVERTISE SERVICE IN ADMIN PANEL" in the restore script - yunohost service add mongodb --log "/var/log/mongodb/mongodb.log" yunohost service add $app diff --git a/scripts/remove b/scripts/remove index 9e7b861..61ab06e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get $app final_path) #================================================= # Remove a service from the admin panel, added by `yunohost service add` -if yunohost service status | grep -q $app +if yunohost service status $app >/dev/null 2>&1 then ynh_print_info "Removing $app service" yunohost service remove $app diff --git a/scripts/restore b/scripts/restore index 9f0b9c1..c036dea 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors From 2d40624eec04472ac3e383a5ce170608f1108674 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Mar 2019 13:03:03 +0100 Subject: [PATCH 49/54] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index b249208..860b802 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,7 @@ backup_restore=1 multi_instance=1 incorrect_path=1 - port_already_use=1 + port_already_use=0 change_url=1 ;;; Levels Level 1=auto From 72e7df88acde19494a9116e7d4a160a6f6d4ef1f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 26 Mar 2019 22:02:39 +0100 Subject: [PATCH 50/54] Cleanup install script --- scripts/install | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index e56e461..c8da7cb 100755 --- a/scripts/install +++ b/scripts/install @@ -38,9 +38,6 @@ ynh_print_info "Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" -# Normalize the url path syntax -path_url=$(ynh_normalize_url_path $path_url) - # Register (book) web path ynh_webpath_register $app $domain $path_url @@ -81,7 +78,7 @@ ynh_print_info "Starting mongodb ..." # Start mongodb systemctl enable mongodb -systemctl restart mongodb +systemctl start mongodb # Registering db name db_name=$(ynh_sanitize_dbid $app) @@ -90,7 +87,7 @@ ynh_app_setting_set $app db_name $db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info "Setting up wekan source files..." +ynh_print_info "Setting up source files..." ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src From 63afcc460ee6dfa8245c6e94d5eeb78d61a958a4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 26 Mar 2019 22:03:01 +0100 Subject: [PATCH 51/54] remove not needed settings --- scripts/restore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index c036dea..9a957a3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,10 +26,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) -is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) db_name=$(ynh_app_setting_get $app db_name) -port=$(ynh_app_setting_get $app final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED From d4ef2dc6b2f93f0522b38a19d6b1b6f00584660e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 26 Mar 2019 22:10:40 +0100 Subject: [PATCH 52/54] cleanup change_url script --- scripts/change_url | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 4278d43..0c0f4af 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,18 +32,8 @@ final_path=$(ynh_app_setting_get $app final_path) # Add settings here as needed by your application -db_name=$(ynh_app_setting_get $app db_name) port=$(ynh_app_setting_get $app port) -#================================================= -# CHECK THE SYNTAX OF THE PATHS -#================================================= - -test -n "$old_path" || old_path="/" -test -n "$new_path" || new_path="/" -new_path=$(ynh_normalize_url_path $new_path) -old_path=$(ynh_normalize_url_path $old_path) - #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= From 768a9890413e8dbd00ac154eebfc58a619034898 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 27 Mar 2019 11:13:37 +0100 Subject: [PATCH 53/54] Spelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b76ef2a..acc19e8 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ First registered user will be admin, and next ones normal users. If you want oth #### Multi-users support -LDAP is supported but and HTTP auth is stil not supported +LDAP is supported but HTTP auth is still not supported #### Supported architectures * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wekan%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/wekan/) From 0ae6669c3bd7a25bc2ff47dedb51e436a57534e1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 28 Mar 2019 01:21:28 +0100 Subject: [PATCH 54/54] Add time to start after upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index c9b23c7..ff33c5c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -177,6 +177,7 @@ systemctl reload nginx ynh_print_info "Now restarting Wekan service..." ynh_systemd_action --action=restart --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" +sleep 10 #================================================= # END OF SCRIPT