From fd1ada509b2fecfe1b75f754ff4dade0a04693e1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 8 Jun 2022 23:52:20 +0200 Subject: [PATCH 1/4] Upgrade to 6.27.1~ynh1 --- .gitignore | 3 -- conf/amd64.src | 4 +- conf/arm64.src | 4 +- conf/nginx.conf | 1 + manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/backup | 2 +- scripts/install | 4 +- scripts/remove | 2 +- scripts/restore | 18 +++---- scripts/upgrade | 65 +++++------------------ scripts/{ynh_mongo_db => ynh_mongo_db__2} | 39 ++++---------- scripts/ynh_package_version | 27 ---------- 13 files changed, 42 insertions(+), 131 deletions(-) delete mode 100644 .gitignore rename scripts/{ynh_mongo_db => ynh_mongo_db__2} (85%) delete mode 100644 scripts/ynh_package_version diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e961147..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.swp -*.swo - diff --git a/conf/amd64.src b/conf/amd64.src index eae6571..05bd279 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.27/wekan-6.27-amd64.zip -SOURCE_SUM=2447075b30d3283cec39b531359b8cba5a815b57b37e60b6d9c6a97026ef8687 +SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.26/wekan-6.26-amd64.zip +SOURCE_SUM=3e83de1fe5a77db6f7ec6a3f9b2a7ea401dbbc4fd57931dbb9b4a02aef9974ec SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src index 13b06f0..872141d 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.27/wekan-6.27-arm64.zip -SOURCE_SUM=4df0e24ecc8587638077b7e5ae512364798407689775adc90d534ccde253a9f6 +SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.26/wekan-6.26-arm64.zip +SOURCE_SUM=0f85b0e90e4dba6a0545ac1fa264c43a6e1b2d85bf227ffe0dc9a8d6ce84357f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 26774a9..bdda5e9 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,6 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { + client_max_body_size 100M; proxy_pass http://127.0.0.1:__PORT__; diff --git a/manifest.json b/manifest.json index 8a1ba92..d9e7528 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "6.27~ynh1", + "version": "6.27.1~ynh1", "url": "https://wekan.github.io", "upstream": { "license": "MIT", diff --git a/scripts/_common.sh b/scripts/_common.sh index 80cc2e8..36ecbcb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="" -NODEJS_VERSION="14.19.2" +nodejs_version="14.19.3" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 09fc3d1..821ad88 100644 --- a/scripts/backup +++ b/scripts/backup @@ -8,7 +8,7 @@ # 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 ../settings/scripts/ynh_mongo_db__2 source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/install b/scripts/install index 2413193..de6d01b 100644 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,7 @@ #================================================= source _common.sh -source ynh_mongo_db +source ynh_mongo_db__2 source /usr/share/yunohost/helpers #================================================= @@ -73,7 +73,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=$NODEJS_VERSION +ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs ynh_install_mongo diff --git a/scripts/remove b/scripts/remove index 3e232b9..0a3323a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -7,7 +7,7 @@ #================================================= source _common.sh -source ynh_mongo_db +source ynh_mongo_db__2 source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index 1f8e274..c5ca449 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,7 @@ # 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 ../settings/scripts/ynh_mongo_db__2 source /usr/share/yunohost/helpers #================================================= @@ -44,13 +44,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE 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" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -79,10 +72,17 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION +ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs ynh_install_mongo +#================================================= +# RESTORE 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 MONGODB DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ea832d1..e240fa9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,8 +7,7 @@ #================================================= source _common.sh -source ynh_package_version -source ynh_mongo_db +source ynh_mongo_db__2 source /usr/share/yunohost/helpers #================================================= @@ -46,17 +45,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK VERSION NUMBER -#================================================= - -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - sleep 60 -fi -abort_if_up_to_date -# previous function is what defines 'version', more precisely the 'previous version' -previous_version="${version}" - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -83,36 +71,7 @@ if ! ynh_permission_exists --permission="admin"; then ynh_permission_create --permission="admin" --allowed=$admin fi -#================================================= -# MANAGE UPGRADE FROM PREVIOUS VERSION -#================================================= -ynh_script_progression --message="Managing upgrade from previous version..." - -if ynh_version_gt "0.45-2" "${previous_version}" ; then - ynh_script_progression --message="Upgrading to 0.45-2..." - ynh_replace_string --match_string="Environment=ROOT_URL=http://127.0.0.1:$port$path_url" --replace_string="Environment=ROOT_URL=https://$domain$path_url/" --target_file="/etc/systemd/system/$app.service" - systemctl daemon-reload -fi - -if ynh_version_gt "0.45-3" "${previous_version}" ; then - ynh_script_progression --message="Upgrading to 0.45-3..." -fi - -if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then - ynh_script_progression --message="Upgrading to 1.07~ynh2..." - - # Replace mongodb packages - # Assume no other app needs it >.> - rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list - ynh_remove_app_dependencies - ynh_install_app_dependencies "mongodb mongodb-server" -fi - -if ynh_version_gt "2.56~ynh1" "${previous_version}" ; then - # Create a dedicated .env config - config_file="$final_path/.env" - touch $config_file -fi +ynh_secure_remove --file="/etc/apt/sources.list.d/mongodb-org-3.2.list" #================================================= # CREATE DEDICATED USER @@ -138,6 +97,16 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:$app "$final_path" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_install_app_dependencies $pkg_dependencies +ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_use_nodejs +ynh_install_mongo + #================================================= # NGINX CONFIGURATION #================================================= @@ -146,16 +115,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." - -ynh_install_app_dependencies $pkg_dependencies -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_use_nodejs -ynh_install_mongo - #================================================= # SPECIFIC UPGRADE #================================================= diff --git a/scripts/ynh_mongo_db b/scripts/ynh_mongo_db__2 similarity index 85% rename from scripts/ynh_mongo_db rename to scripts/ynh_mongo_db__2 index cca1338..d392475 100644 --- a/scripts/ynh_mongo_db +++ b/scripts/ynh_mongo_db__2 @@ -1,13 +1,10 @@ #!/bin/bash -MONGO_DEBIAN_SERVICENAME="mongodb" MONGO_CE_SERVICENAME="mongod" -MONGO_DEBIAN_DEPENDENCIES="mongodb mongodb-server mongo-tools" MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools" -MONGO_DEBIAN_CONFIG="/etc/mongodb.conf" MONGO_CE_CONFIG="/etc/mongod.conf" -MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" -MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-4.4.asc" +MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" +MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-5.0.asc" # Execute a mongo command # @@ -307,27 +304,16 @@ ynh_mongo_remove_db() { # # ynh_install_mongo() { - ynh_print_info --message="Installing MongoDB..." - - # Define Mongo Service Name - if dpkg --compare-versions $(cat /etc/debian_version) ge 10.0 - then - ynh_print_info --message="Installing MongoDB Community Edition..." - ynh_install_extra_app_dependencies --repo="$MONGO_CE_REPO" --package="$MONGO_CE_DEPENDENCIES" --key="$MONGO_CE_KEY" - MONGODB_SERVICENAME=$MONGO_CE_SERVICENAME - else - ynh_print_info --message="Installing MongoDB Debian..." - ynh_install_app_dependencies $MONGO_DEBIAN_DEPENDENCIES - MONGODB_SERVICENAME=$MONGO_DEBIAN_SERVICENAME - fi - mongodb_servicename=$MONGODB_SERVICENAME + ynh_print_info --message="Installing MongoDB Community Edition..." + ynh_install_extra_app_dependencies --repo="$MONGO_CE_REPO" --package="$MONGO_CE_DEPENDENCIES" --key="$MONGO_CE_KEY" + mongodb_servicename=$MONGO_CE_SERVICENAME # Make sure MongoDB is started and enabled - systemctl is-enabled $MONGODB_SERVICENAME -q || systemctl enable $MONGODB_SERVICENAME --quiet - 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" + systemctl is-enabled $mongodb_servicename -q || systemctl enable $mongodb_servicename --quiet + 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 @@ -342,14 +328,9 @@ ynh_remove_mongo() { if ! ynh_package_is_installed --package="mongodb*" then ynh_print_info --message="Removing MongoDB service..." - # Define Mongo Service Name - if [ "$(lsb_release --codename --short)" = "buster" ]; then - MONGODB_SERVICENAME=$MONGO_CE_SERVICENAME - else - MONGODB_SERVICENAME=$MONGO_DEBIAN_SERVICENAME - fi + mongodb_servicename=$MONGO_CE_SERVICENAME # Remove the mongodb service - yunohost service remove $MONGODB_SERVICENAME + yunohost service remove $mongodb_servicename # ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE fi } diff --git a/scripts/ynh_package_version b/scripts/ynh_package_version deleted file mode 100644 index de13ae8..0000000 --- a/scripts/ynh_package_version +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -read_json () { - sudo python3 -c "import sys, json;print(json.load(open('$1'))['$2'])" -} - -read_manifest () { - if [ -f '../manifest.json' ] ; then - read_json '../manifest.json' "$1" - else - read_json '../settings/manifest.json' "$1" - fi -} - -abort_if_up_to_date () { - version=$(read_json "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" 'version' 2> /dev/null || echo '20160501-7') - last_version=$(read_manifest 'version') - if [ "${version}" = "${last_version}" ]; then - ynh_script_progression --message="Up-to-date, nothing to do" - ynh_die "" 0 - fi -} - -ynh_version_gt () -{ - dpkg --compare-versions "$1" gt "$2" -} From 3db95c7968bcea3910405b824eeba189a6d95679 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Jun 2022 21:52:24 +0000 Subject: [PATCH 2/4] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eeae4f0..714358b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in WeKan ® is an completely Open Source and Free software collaborative kanban board application with MIT license. -**Shipped version:** 6.27~ynh1 +**Shipped version:** 6.27.1~ynh1 **Demo:** https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h diff --git a/README_fr.md b/README_fr.md index 1379071..8c7c348 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour WeKan ® is an completely Open Source and Free software collaborative kanban board application with MIT license. -**Version incluse :** 6.27~ynh1 +**Version incluse :** 6.27.1~ynh1 **Démo :** https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h From 5bc7c9491b508d5cb4882fe2cbb8a8e061ce2dcb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 9 Jun 2022 00:18:39 +0200 Subject: [PATCH 3/4] Update ynh_mongo_db__2 --- scripts/ynh_mongo_db__2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ynh_mongo_db__2 b/scripts/ynh_mongo_db__2 index d392475..44b7bb6 100644 --- a/scripts/ynh_mongo_db__2 +++ b/scripts/ynh_mongo_db__2 @@ -1,7 +1,7 @@ #!/bin/bash MONGO_CE_SERVICENAME="mongod" -MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools" +MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" MONGO_CE_CONFIG="/etc/mongod.conf" MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-5.0.asc" @@ -90,7 +90,7 @@ ynh_mongo_exec() { database="" fi - mongo --quiet $user $password $authenticationdatabase $host $port < Date: Mon, 13 Jun 2022 01:04:18 +0200 Subject: [PATCH 4/4] Going back to ynh_mongo_db --- scripts/backup | 2 +- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- scripts/{ynh_mongo_db__2 => ynh_mongo_db} | 45 ++++++++++++++++------- 6 files changed, 37 insertions(+), 18 deletions(-) rename scripts/{ynh_mongo_db__2 => ynh_mongo_db} (84%) diff --git a/scripts/backup b/scripts/backup index 821ad88..09fc3d1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -8,7 +8,7 @@ # 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__2 +source ../settings/scripts/ynh_mongo_db source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/install b/scripts/install index de6d01b..3e2f01d 100644 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,7 @@ #================================================= source _common.sh -source ynh_mongo_db__2 +source ynh_mongo_db source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/remove b/scripts/remove index 0a3323a..3e232b9 100755 --- a/scripts/remove +++ b/scripts/remove @@ -7,7 +7,7 @@ #================================================= source _common.sh -source ynh_mongo_db__2 +source ynh_mongo_db source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index c5ca449..f10a08a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,7 @@ # 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__2 +source ../settings/scripts/ynh_mongo_db source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e240fa9..7147009 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,7 @@ #================================================= source _common.sh -source ynh_mongo_db__2 +source ynh_mongo_db source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/ynh_mongo_db__2 b/scripts/ynh_mongo_db similarity index 84% rename from scripts/ynh_mongo_db__2 rename to scripts/ynh_mongo_db index 44b7bb6..cca1338 100644 --- a/scripts/ynh_mongo_db__2 +++ b/scripts/ynh_mongo_db @@ -1,10 +1,13 @@ #!/bin/bash +MONGO_DEBIAN_SERVICENAME="mongodb" MONGO_CE_SERVICENAME="mongod" -MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" +MONGO_DEBIAN_DEPENDENCIES="mongodb mongodb-server mongo-tools" +MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools" +MONGO_DEBIAN_CONFIG="/etc/mongodb.conf" MONGO_CE_CONFIG="/etc/mongod.conf" -MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" -MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-5.0.asc" +MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" +MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-4.4.asc" # Execute a mongo command # @@ -90,7 +93,7 @@ ynh_mongo_exec() { database="" fi - mongosh --quiet --username $user --password $password --authenticationDatabase $authenticationdatabase --host $host --port $port <