From 56716dc594c1de06fafb22ff75e29ff6dc3cea9c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 8 Apr 2021 20:03:17 +0200 Subject: [PATCH 01/15] Upgrade to 5.17 --- README.md | 2 +- check_process | 4 ++++ conf/arm64.src | 10 +++++----- conf/x86-64.src | 10 +++++----- manifest.json | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 70ae87a..b4e3821 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Wekan is an open-source kanban board (task manager and organizer) -**Shipped version:** 5.00 +**Shipped version:** 5.17 ## Screenshots diff --git a/check_process b/check_process index 2d87cf2..2df1a3f 100644 --- a/check_process +++ b/check_process @@ -26,6 +26,8 @@ upgrade=1 from_commit=32fe3a7c342e5f29d7a7534125151723f916de46 # 4.64~ynh2 upgrade=1 from_commit=9e698d094c29fc6ab12ac60cd1d0e68b56bfc953 + # 5.00~ynh1 + upgrade=1 from_commit=8655e8062d1bc6e90b01b98ca9a0dea15d60119e backup_restore=1 multi_instance=1 port_already_use=0 @@ -48,3 +50,5 @@ Notification=down name=4.64~ynh1 ; commit=9e698d094c29fc6ab12ac60cd1d0e68b56bfc953 name=4.64~ynh2 + ; commit=8655e8062d1bc6e90b01b98ca9a0dea15d60119e + name=5.00~ynh1 diff --git a/conf/arm64.src b/conf/arm64.src index 3b02552..56be87b 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,9 +1,9 @@ # This is on YunoHost server just to avoid the file from disappearing -# Original source is https://releases.wekan.team/raspi3/wekan-5.00-arm64.zip -# YunoHost source is https://build.yunohost.org/apps/wekan-5.00-arm64.zip -SOURCE_URL=https://build.yunohost.org/apps/wekan-5.00-arm64.zip -SOURCE_SUM=156b9578766d4f133c8078bec1433fe5147e7fc594f0fbb8bdb000df2a269c89 +# Original source is https://releases.wekan.team/raspi3/wekan-5.17-arm64.zip +# YunoHost source is https://build.yunohost.org/apps/wekan-5.17-arm64.zip +SOURCE_URL=https://build.yunohost.org/apps/wekan-5.17-arm64.zip +SOURCE_SUM=3137fa9fb079e42f33405d77738bec7ceae00c3e332394b4a79524552eb4fb3e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=wekan-5.00-arm64.zip +SOURCE_FILENAME=wekan-5.17-arm64.zip diff --git a/conf/x86-64.src b/conf/x86-64.src index a8fc702..d43e2dc 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,9 +1,9 @@ # This is on YunoHost server just to avoid the file from disappearing -# Original source is https://releases.wekan.team/wekan-5.00.zip -# YunoHost source is https://build.yunohost.org/apps/wekan-5.00.zip -SOURCE_URL=https://build.yunohost.org/apps/wekan-5.00.zip -SOURCE_SUM=815a6893185c4f063582afe13a63b78f3bfd5bd8bfe290ba002117657426b5cf +# Original source is https://releases.wekan.team/wekan-5.17.zip +# YunoHost source is https://build.yunohost.org/apps/wekan-5.17.zip +SOURCE_URL=https://build.yunohost.org/apps/wekan-5.17.zip +SOURCE_SUM=42b41c5c774cbc58ef64718040a5c0306ea8e42980c1e25636d16dab831f32c3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=wekan-5.00.zip +SOURCE_FILENAME=wekan-5.17.zip diff --git a/manifest.json b/manifest.json index 99d6698..2f637f3 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "5.00~ynh1", + "version": "5.17~ynh1", "url": "https://wekan.io", "license": "MIT", "maintainer": [ From 46dc4c7b9b7ec072245b3ee2dad9b06b31341530 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 8 Apr 2021 20:35:40 +0200 Subject: [PATCH 02/15] Apply example_ynh --- manifest.json | 22 +++++----------------- scripts/backup | 2 +- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/manifest.json b/manifest.json index 2f637f3..145409f 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,11 @@ }, { "name": "ljf" - }], + }, + { + "name": "yalh76" + } + ], "requirements": { "yunohost": ">= 4.1.3" }, @@ -30,38 +34,22 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Wekan", - "fr": "Choisissez un nom de domaine pour Wekan" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Wekan", - "fr": "Choisissez un chemin pour Wekan" - }, "example": "/wekan", "default": "/wekan" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l'administrateur" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": false } ] diff --git a/scripts/backup b/scripts/backup index 8dd3e4a..1346f79 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source ../settings/scripts/ynh_mongo_db source /usr/share/yunohost/helpers From 6d93ffaa173d52f390df46f42527a762e0fcf8cb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 8 Apr 2021 20:36:28 +0200 Subject: [PATCH 03/15] Change to NODEJS_VERSION var --- scripts/_common.sh | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d531f63..87ae0be 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="" -nodejsversion=12.16.3 +NODEJS_VERSION=12.16.3 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index c94c5a8..e9e1a32 100644 --- a/scripts/install +++ b/scripts/install @@ -75,7 +75,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies -ynh_install_nodejs --nodejs_version=$nodejsversion +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ynh_install_mongo diff --git a/scripts/restore b/scripts/restore index a509e8f..80e6388 100644 --- a/scripts/restore +++ b/scripts/restore @@ -87,7 +87,7 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -ynh_install_nodejs --nodejs_version=$nodejsversion +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ynh_install_mongo diff --git a/scripts/upgrade b/scripts/upgrade index 34ce41e..3a30be3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -175,7 +175,7 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies ynh_remove_nodejs -ynh_install_nodejs --nodejs_version=$nodejsversion +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ynh_install_mongo From 3d85a1a0fad8e9538032f5cb40d485c5acff9f55 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 8 Apr 2021 20:49:54 +0200 Subject: [PATCH 04/15] Apply last example_ynh --- conf/systemd.service | 2 +- scripts/change_url | 18 +++++------ scripts/install | 50 ++++++++++++++---------------- scripts/remove | 6 ++-- scripts/restore | 29 ++++++++---------- scripts/upgrade | 73 ++++++++++++++++---------------------------- 6 files changed, 75 insertions(+), 103 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 31b859d..145be59 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Type=simple User=__APP__ Group=__APP__ EnvironmentFile=__FINALPATH__/.env -WorkingDirectory=__FINALPATH__ +WorkingDirectory=__FINALPATH__/ ExecStart=__YNH_NODE__ __FINALPATH__/main.js Restart=on-failure #StartLimitInterval=86400 diff --git a/scripts/change_url b/scripts/change_url index f0ef135..eb3d563 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -38,7 +38,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -46,7 +46,7 @@ ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -80,23 +80,23 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." +ynh_script_progression --message="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 +# 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 + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -134,7 +134,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index e9e1a32..fb18194 100644 --- a/scripts/install +++ b/scripts/install @@ -79,12 +79,19 @@ ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ynh_install_mongo +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # CREATE A MONGODB DATABASE #================================================= ynh_script_progression --message="Creating a MongoDB database..." -# Registering db name db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name @@ -99,22 +106,19 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R root: "$final_path" +chown root:$app "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # SPECIFIC SETUP #================================================= @@ -126,25 +130,17 @@ ynh_script_progression --message="Configuring a systemd service..." ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" #================================================= -# MODIFY A CONFIG FILE +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Adding a config file..." -# Create a dedicated .env config ynh_add_config --template=".env" --destination="$final_path/.env" +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set strong right permissions to app files -chown -R $app: "$final_path" -chmod -R 640 "$final_path" -find "$final_path" -type d -print0 | xargs -0 chmod 750 - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -169,8 +165,6 @@ fi #================================================= ynh_script_progression --message="Configuring permissions..." -ynh_permission_create --permission="admin" --allowed "$admin" - # Make app public if necessary if [ $is_public -eq 1 ] then @@ -179,10 +173,12 @@ then ynh_permission_update --permission="main" --add="visitors" fi +ynh_permission_create --permission="admin" --allowed=$admin + #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 120e182..ec3ccf0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service integration..." @@ -73,9 +73,9 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= diff --git a/scripts/restore b/scripts/restore index 80e6388..5e973d2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source ../settings/scripts/ynh_mongo_db source /usr/share/yunohost/helpers @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -49,17 +49,10 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the NGINX web server configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -69,14 +62,16 @@ ynh_script_progression --message="Recreating the dedicated system user..." ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring user rights..." +ynh_script_progression --message="Restoring the app main directory..." -# Restore permissions on app files -chown -R $app: "$final_path" -chmod -R 640 "$final_path" -find "$final_path" -type d -print0 | xargs -0 chmod 750 +ynh_restore_file --origin_path="$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R root: "$final_path" +chown root:$app "$final_path" #================================================= # SPECIFIC RESTORATION @@ -131,7 +126,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 3a30be3..5dccff0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,7 +46,7 @@ fi if ! ynh_permission_exists --permission="admin"; then # Create the required permissions - ynh_permission_create --permission="admin" --allowed "$admin" + ynh_permission_create --permission="admin" --allowed=$admin fi #================================================= @@ -68,7 +68,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -114,23 +114,13 @@ if ynh_version_gt "2.56~ynh1" "${previous_version}" ; then touch $config_file fi -# Create the permission "admin" only if it doesn't exist. -if ! ynh_permission_exists --permission="admin" -then - ynh_script_progression --message="Upgrading Permission configuration..." +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." - ynh_app_setting_delete --app=$app --key=unprotected_uris - - is_public=$(ynh_app_setting_get --app=$app --key=is_public) - - if [ $is_public -eq 1 ]; then - ynh_permission_update --permission "main" --add "visitors" - fi - - ynh_app_setting_delete --app=$app --key=is_public - - ynh_permission_create --permission="admin" -fi +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -160,12 +150,17 @@ then ynh_secure_remove --file="$tmpdir" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R root: "$final_path" +chown root:$app "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -180,21 +175,7 @@ ynh_use_nodejs ynh_install_mongo #================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying a config file..." - -# Create a dedicated .env config -ynh_add_config --template=".env" --destination="$final_path/.env" - +# SPECIFIC UPGRADE #================================================= # SETUP SYSTEMD #================================================= @@ -203,18 +184,18 @@ ynh_script_progression --message="Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a config file..." + +ynh_add_config --template=".env" --destination="$final_path/.env" + +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions on app files -chown -R $app: "$final_path" -chmod -R 640 "$final_path" -find "$final_path" -type d -print0 | xargs -0 chmod 750 - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -236,7 +217,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload From 73bb96cf2c79fc4d88c244bf5bbc9a85b59289a1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 8 Apr 2021 20:56:50 +0200 Subject: [PATCH 05/15] Update nginx.conf --- conf/nginx.conf | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e271a09..e35471d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,30 +5,15 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } + client_max_body_size 100M; + proxy_pass http://127.0.0.1:__PORT__; proxy_http_version 1.1; - client_max_body_size 100M; - proxy_set_header Accept-Encoding ""; - - # allow websockets proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; # preserve client IP - proxy_set_header X-Forwarded-For $remote_addr; - - proxy_set_header Host $host; - #proxy_buffering off; - - # this setting allows the browser to cache the application in - # a way compatible with Meteor. - # 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__') - { - expires 30d; - } + proxy_set_header X-Forwarded-For $remote_addr; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From 16b28a7bea01d1ac866966a74157820c35e9c843 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 9 Apr 2021 00:56:35 +0200 Subject: [PATCH 06/15] Fix rights --- scripts/install | 3 +-- scripts/restore | 3 +-- scripts/upgrade | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index fb18194..eadbd11 100644 --- a/scripts/install +++ b/scripts/install @@ -108,8 +108,7 @@ ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root: "$final_path" -chown root:$app "$final_path" +chown -R root:$app "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 5e973d2..1262b52 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,8 +70,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root: "$final_path" -chown root:$app "$final_path" +chown -R root:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 5dccff0..68f537f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -152,8 +152,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root: "$final_path" -chown root:$app "$final_path" +chown -R root:$app "$final_path" #================================================= # NGINX CONFIGURATION From 74ecc4deb4ccda35e5d4c32b5e4255f558a4a536 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 9 Apr 2021 08:22:08 +0200 Subject: [PATCH 07/15] reduce the number of tests --- check_process | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/check_process b/check_process index 2df1a3f..b4df23a 100644 --- a/check_process +++ b/check_process @@ -13,15 +13,15 @@ setup_public=1 upgrade=1 # 3.79~ynh2 - upgrade=1 from_commit=2843d504bcdb0402939f87ebeeda3417de02a9e4 + #upgrade=1 from_commit=2843d504bcdb0402939f87ebeeda3417de02a9e4 # 3.95~ynh1 - upgrade=1 from_commit=46f4b540cb99090a3fe1d35828094dbbfb34b692 + #upgrade=1 from_commit=46f4b540cb99090a3fe1d35828094dbbfb34b692 # 3.95~ynh1 - upgrade=1 from_commit=3cd252289f4fd138879872658762f4c6ae415cc4 + #upgrade=1 from_commit=3cd252289f4fd138879872658762f4c6ae415cc4 # 4.09~ynh1 - upgrade=1 from_commit=c2b4715e8591031f3054cedb1220e7619607bb36 + #upgrade=1 from_commit=c2b4715e8591031f3054cedb1220e7619607bb36 # 4.43~ynh1 - upgrade=1 from_commit=2cf63bd4d660eae4526221c1a68efede499e3ee6 + #upgrade=1 from_commit=2cf63bd4d660eae4526221c1a68efede499e3ee6 # 4.64~ynh1 upgrade=1 from_commit=32fe3a7c342e5f29d7a7534125151723f916de46 # 4.64~ynh2 From 7022269933f6b818f19ffc64294fea3fe19f5c7f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 9 Apr 2021 21:35:37 +0200 Subject: [PATCH 08/15] Apply last example_ynh --- README.md | 4 ++-- scripts/change_url | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b4e3821..02f1b14 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ LDAP is supported but HTTP auth is still not supported #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wekan%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/wekan/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/wekan%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/wekan/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wekan.svg)](https://ci-apps.yunohost.org/ci/apps/wekan/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/wekan.svg)](https://ci-apps-arm.yunohost.org/ci/apps/wekan/) ## Links diff --git a/scripts/change_url b/scripts/change_url index eb3d563..97ba059 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -36,7 +36,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." From d59ebd748d5369ed6b939ddab20b6aa0672bac41 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 9 Apr 2021 22:19:28 +0200 Subject: [PATCH 09/15] Update ynh_mongo_db --- scripts/ynh_mongo_db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ynh_mongo_db b/scripts/ynh_mongo_db index a5a152c..60fc40c 100644 --- a/scripts/ynh_mongo_db +++ b/scripts/ynh_mongo_db @@ -324,7 +324,7 @@ ynh_install_mongo() { systemctl is-active $MONGODB_SERVICENAME -q || ynh_systemd_action --service_name=$MONGODB_SERVICENAME --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/$MONGODB_SERVICENAME.log" # Integrate MongoDB service in YunoHost - yunohost service add $MONGODB_SERVICENAME --description "MongoDB daemon" --log "/var/log/mongodb/$MONGODB_SERVICENAME.log" + yunohost service add $MONGODB_SERVICENAME --description="MongoDB daemon" --log="/var/log/mongodb/$MONGODB_SERVICENAME.log" } # Remove MongoDB From c35a79290bc6b6098f124d78b405109f9be9be74 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 9 Apr 2021 23:07:08 +0200 Subject: [PATCH 10/15] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 68f537f..1ba190e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,7 +61,7 @@ abort_if_up_to_date previous_version="${version}" #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." From 565f4ed122d714712d004679c1b9ec297f51ea2c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 10 Apr 2021 17:01:36 +0200 Subject: [PATCH 11/15] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1ba190e..68f537f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,7 +61,7 @@ abort_if_up_to_date previous_version="${version}" #================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." From 288edf81e242786bef3fae3e086fcf5449068813 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 20:01:40 +0200 Subject: [PATCH 12/15] Fix start line_match --- scripts/install | 18 +++++++++--------- scripts/upgrade | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index eadbd11..7ba4879 100644 --- a/scripts/install +++ b/scripts/install @@ -120,14 +120,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" - #================================================= # ADD A CONFIGURATION #================================================= @@ -138,6 +130,14 @@ ynh_add_config --template=".env" --destination="$final_path/.env" chmod 400 "$final_path/.env" chown $app:$app "$final_path/.env" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" + #================================================= # GENERIC FINALIZATION #================================================= @@ -153,7 +153,7 @@ yunohost service add $app --description="Wekan daemon" ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Meteor APM: completed instrumenting the app" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Enabling LDAP Background Sync" if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 diff --git a/scripts/upgrade b/scripts/upgrade index 68f537f..e427579 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -175,14 +175,6 @@ ynh_install_mongo #================================================= # SPECIFIC UPGRADE -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -193,6 +185,14 @@ ynh_add_config --template=".env" --destination="$final_path/.env" chmod 400 "$final_path/.env" chown $app:$app "$final_path/.env" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" + #================================================= # GENERIC FINALIZATION #================================================= From cca5dcde1be189736e13cc44200259ebbbc3eb6e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 22:17:47 +0200 Subject: [PATCH 13/15] Fix rights --- 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 7ba4879..80022b4 100644 --- a/scripts/install +++ b/scripts/install @@ -108,7 +108,7 @@ ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 1262b52..d395ff3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,7 +70,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index e427579..b1321f9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -152,7 +152,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION From cbe521866e860bb5443295e0d986309a59b02947 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Apr 2021 20:56:05 +0200 Subject: [PATCH 14/15] Fix cp --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b1321f9..f3abe04 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -134,7 +134,7 @@ then tmpdir="$(mktemp -d)" # Backup the env file in the temp dir - cp -a "$final_path/.env" "$tmpdir/.env" + cp -af "$final_path/.env" "$tmpdir/.env" # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -144,7 +144,7 @@ then ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/.env" "$final_path/.env" + cp -af "$tmpdir/.env" "$final_path/.env" # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" From b88fc562d691923626cf2d1d52e61bf41f7aecc3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 15 Apr 2021 20:30:02 +0200 Subject: [PATCH 15/15] Fix chmod --- 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 80022b4..b9d0789 100644 --- a/scripts/install +++ b/scripts/install @@ -106,7 +106,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" diff --git a/scripts/restore b/scripts/restore index d395ff3..07898f9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index f3abe04..c2bc0ae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -150,7 +150,7 @@ then ynh_secure_remove --file="$tmpdir" fi -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path"