From 6e319a9f367121099e728412b065f43f4c4af2d7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 1 Jul 2018 17:04:35 +0000 Subject: [PATCH] Change way mongodb is installed (use official debian builds in stretch) --- conf/systemd.service | 4 ++-- manifest.json | 4 ++-- scripts/install | 13 ++++--------- scripts/remove | 11 ----------- scripts/restore | 11 ++++------- 5 files changed, 12 insertions(+), 31 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 70c3e2f..d60488e 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,7 +1,7 @@ [Unit] Description=Wekan, task board -Wants=mongod.service -After=network.target mongod.service +Wants=mongodb.service +After=network.target mongodb.service [Service] Type=simple diff --git a/manifest.json b/manifest.json index b188bad..98c2599 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "Wekan", "id": "wekan", "packaging_format": 1, - "version": "1.07~ynh1", + "version": "1.07~ynh2", "description": { "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" @@ -15,7 +15,7 @@ "url": "https://github.com/alexAubin/" }, "requirements": { - "yunohost": ">= 2.7.2" + "yunohost": ">= 3.0.0" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index ff9bb84..b70bef8 100755 --- a/scripts/install +++ b/scripts/install @@ -50,12 +50,7 @@ ynh_app_setting_set $app port $port #================================================= ynh_install_nodejs 8.9.3 -# Install mongodb -wget https://www.mongodb.org/static/pgp/server-3.2.asc -O - | apt-key add - -echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list - -ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools" - +ynh_install_app_dependencies "mongodb mongodb-server" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -89,8 +84,8 @@ npm install popd # Start mogodb -systemctl enable mongod -systemctl restart mongod +systemctl enable mongodb +systemctl restart mongodb #================================================= # SETUP SYSTEMD @@ -117,7 +112,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # ADD SERVICE IN ADMIN PANEL #================================================= -yunohost service add mongod --log "/var/log/mongodb.log" +yunohost service add mongodb --log "/var/log/mongodb/mongodb.log" yunohost service add $app #================================================= diff --git a/scripts/remove b/scripts/remove index f032562..f0cfa95 100755 --- a/scripts/remove +++ b/scripts/remove @@ -49,23 +49,12 @@ ynh_remove_app_dependencies ynh_remove_nodejs - -#================================================= -# REMOVE MONGODB -#================================================= -# TODO / FIXME : remove the keys added ? -#apt-key del EA312927 -#apt-key del 0C49F3730359A14518585931BC711F9BA15703C6 - -#rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list - #================================================= # REMOVE THE MAIN DIR OF THE APP #================================================= ynh_secure_remove "/var/www/$app" - #================================================= # REMOVE THE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index e986596..9649ae7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -55,17 +55,14 @@ ynh_system_user_create $app "$final_path" ynh_install_nodejs 4.8.7 # Install mongodb -wget https://www.mongodb.org/static/pgp/server-3.2.asc -O - | apt-key add - -echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list - -ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools" +ynh_install_app_dependencies "mongodb mongodb-server" #================================================= # RESTORE DB #================================================= # Start mogodb -systemctl enable mongod -systemctl start mongod +systemctl enable mongodb +systemctl start mongodb mongorestore --db $app ./dump #================================================= @@ -92,7 +89,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # ADD SERVICE IN ADMIN PANEL #================================================= -yunohost service add mongod --log "/var/log/mongodb.log" +yunohost service add mongodb --log "/var/log/mongodb/mongodb.log" yunohost service add $app #=================================================