From ea0dc8eeb3dfe6bd66ccfddabd7fd5c1e98abd9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Collin?= Date: Thu, 20 Jul 2023 08:22:54 +0200 Subject: [PATCH 1/4] Mongo 4.4 buster & release 1.0.1 --- conf/amd64.src | 4 ++-- manifest.json | 2 +- scripts/ynh_mongo_db__2 | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index cf955ad..9ce63f1 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.0.tar.gz -SOURCE_SUM=584bed4033f4b8f2f16824ec1eabfb3919aa04dfef72673a4e5ca8f4ef9f3b92 +SOURCE_URL=https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.1.tar.gz +SOURCE_SUM=d48880bb296f150889a502096a71775f1b0066dec2d7f3f47b346382c13c76fb SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 9fe62d3..ba47205 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "An admin server for Mongo and optionally a Mongo database", "fr": "Un serveur d'administration pour Mongo ainsi qu'optionnellement une base Mongo" }, - "version": "1.0~ynh4", + "version": "1.0.1~ynh1", "url": "https://github.com/mongo-express/mongo-express", "upstream": { "license": "MIT", diff --git a/scripts/ynh_mongo_db__2 b/scripts/ynh_mongo_db__2 index e1c17a6..cb7317b 100644 --- a/scripts/ynh_mongo_db__2 +++ b/scripts/ynh_mongo_db__2 @@ -314,17 +314,19 @@ ynh_install_mongo() { ynh_print_info --message="Installing MongoDB Community Edition ..." local mongo_debian_release=$(ynh_get_debian_release) + local mongo_packages="mongodb-org-server mongodb-database-tools mongodb-org-shell" if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)." mongo_version="4.4" fi - if [[ "$mongo_version" == "4.4" && "$mongo_debian_release" != "buster" ]]; then - ynh_print_warn --message="Switched to buster install as Mongo 4.4 is not compatible with $mongo_debian_release." + if [[ "$mongo_version" == "4.4" ]]; then + ynh_print_warn --message="Switching to buster package install for Mongo 4.4." mongo_debian_release=buster + mongo_packages="mongodb-org-server mongodb-database-tools mongodb-mongosh-shared-openssl11" fi - ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" + ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="$mongo_packages" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" mongodb_servicename=mongod # Make sure MongoDB is started and enabled From d985f222693197adc37e02bd3ee50dcad2099c67 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 20 Jul 2023 06:23:29 +0000 Subject: [PATCH 2/4] Auto-update README --- README.md | 3 ++- README_fr.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a33b122..519a9bb 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Mongo Express for YunoHost [![Integration level](https://dash.yunohost.org/integration/mongo-express.svg)](https://dash.yunohost.org/appci/app/mongo-express) ![Working status](https://ci-apps.yunohost.org/ci/badges/mongo-express.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mongo-express.maintain.svg) + [![Install Mongo Express with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mongo-express) *[Lire ce readme en français.](./README_fr.md)* @@ -37,7 +38,7 @@ You can as well install a Mongo database - version 4, 5 or 6 in your yunohost se - Supports replica sets -**Shipped version:** 1.0~ynh4 +**Shipped version:** 1.0.1~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index de802a5..fa5d9de 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Mongo Express pour YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/mongo-express.svg)](https://dash.yunohost.org/appci/app/mongo-express) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mongo-express.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mongo-express.maintain.svg) + [![Installer Mongo Express avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mongo-express) *[Read this readme in english.](./README.md)* @@ -37,7 +38,7 @@ You can as well install a Mongo database - version 4, 5 or 6 in your yunohost se - Supports replica sets -**Version incluse :** 1.0~ynh4 +**Version incluse :** 1.0.1~ynh1 ## Captures d’écran From 84d9e79edd2f16ff4a8f7f4ad02f02fad70379c9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 13 Jan 2024 18:37:35 +0000 Subject: [PATCH 3/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 76e2b4e..04e8ac1 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You can as well install a Mongo database - version 4, 5 or 6 in your yunohost se - Supports replica sets -**Shipped version:** 1.0.1~ynh1 +**Shipped version:** 1.0~ynh5 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5b225ff..48e6174 100644 --- a/README_fr.md +++ b/README_fr.md @@ -38,7 +38,7 @@ You can as well install a Mongo database - version 4, 5 or 6 in your yunohost se - Supports replica sets -**Version incluse :** 1.0.1~ynh1 +**Version incluse :** 1.0~ynh5 ## Captures d’écran From 0562e56037941744bc1d4d9dce9ad6ddaf18a5b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Collin?= Date: Sun, 21 Jan 2024 12:19:03 +0100 Subject: [PATCH 4/4] Upgrade to v1.02 --- conf/.env | 1 + manifest.toml | 8 ++++---- scripts/_common.sh | 5 +++++ scripts/install | 14 ++++++++++---- scripts/upgrade | 12 +++++++++--- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/conf/.env b/conf/.env index f8eb9ff..bf9a919 100644 --- a/conf/.env +++ b/conf/.env @@ -2,4 +2,5 @@ ME_CONFIG_SITE_BASEURL=__PATH__ ME_CONFIG_BASICAUTH=false ME_CONFIG_BASICAUTH_USERNAME= ME_CONFIG_MONGODB_ENABLE_ADMIN=true +ME_CONFIG_SITE_SESSIONSECRET=SomeSecret6533 PORT=__PORT__ diff --git a/manifest.toml b/manifest.toml index 4249026..b40efd1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Mongo Express" description.en = "Admin server for Mongo and optionally Mongo database" description.fr = "Serveur d'administration pour Mongo ainsi qu'optionnellement une base Mongo" -version = "1.0~ynh5" +version = "1.0.2~ynh1" maintainers = ["Gerard Collin"] @@ -39,7 +39,7 @@ ram.runtime = "50M" [install.init_main_permission] type = "group" - default = false + default = "visitors" [install.mongo_version] ask.en = "Select the major version of Mongo to install or 'None' if already installed" @@ -50,8 +50,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.0.tar.gz" - sha256 = "584bed4033f4b8f2f16824ec1eabfb3919aa04dfef72673a4e5ca8f4ef9f3b92" + url = "https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.2.tar.gz" + sha256 = "c60a764aa71d37c18ec2bb6db8fe77356ca3bdbd91fa70a893106de1632640a1" autoupdate.strategy = "latest_github_release" autoupdate.asset = ".*.tar.gz" diff --git a/scripts/_common.sh b/scripts/_common.sh index b818f0f..334340f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -13,6 +13,11 @@ nodejs_version=16 #================================================= # EXPERIMENTAL HELPERS #================================================= +_install_yarn () { + ynh_exec_as "$app" "$ynh_node_load_PATH" npm install yarn + ynh_yarn="$install_dir/node_modules/.bin/yarn" + alias ynh_yarn="$ynh_yarn" +} #================================================= # FUTURE OFFICIAL HELPERS diff --git a/scripts/install b/scripts/install index 483cab4..2086fa5 100755 --- a/scripts/install +++ b/scripts/install @@ -13,10 +13,15 @@ source /usr/share/yunohost/helpers #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing NodeJS..." --weight=3 +ynh_script_progression --message="Installing NodeJS & Yarn..." --weight=3 ynh_install_nodejs --nodejs_version="$nodejs_version" +pushd "$install_dir" + ynh_use_nodejs + _install_yarn +popd + # Install mongo server only if asked to if [ "$mongo_version" != "None" ]; then ynh_script_progression --message="Installing MongoDB..." --weight=3 @@ -46,12 +51,13 @@ chown "$app:$app" "$install_dir/.env" #================================================= # BUILD NODEJS CODE #================================================= -ynh_script_progression --message="Building NodeJS code and dependencies..." --weight=6 +ynh_script_progression --message="Building NodeJS code ..." --weight=6 -# Install Nodejs dependencies +# Build using Yarn pushd "$install_dir" ynh_use_nodejs - ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install + ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_yarn" install + ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d6d6637..64b53bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,10 +22,15 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing NodeJS..." --weight=3 +ynh_script_progression --message="Installing NodeJS & Yarn" --weight=3 ynh_install_nodejs --nodejs_version="$nodejs_version" +pushd "$install_dir" + ynh_use_nodejs + _install_yarn +popd + # Install mongo server only if asked to if [ "$mongo_version" != "None" ]; then ynh_script_progression --message="Installing MongoDB..." --weight=3 @@ -57,10 +62,11 @@ chown "$app:$app" "$install_dir/.env" #================================================= ynh_script_progression --message="Building NodeJS code and dependencies..." --weight=6 -# Install Nodejs dependencies +# Build using Yarn pushd "$install_dir" ynh_use_nodejs - ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install + ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_yarn" install + ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build popd #=================================================