1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dont-code_ynh.git synced 2024-09-03 18:26:34 +02:00

Merge pull request #21 from YunoHost-Apps/main

New version with Mongo correctly installed
This commit is contained in:
Gérard Collin 2023-01-26 16:56:49 +01:00 committed by GitHub
commit 0c601486db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 14 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Dont-code Services for YunoHost
[![Integration level](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Working status](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Working status](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
[![Install Dont-code Services with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dont-code)
*[Lire ce readme en français.](./README_fr.md)*
@ -31,7 +31,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
- As well any documents or images uploaded by users will be backed up
**Shipped version:** 0.2~ynh2
**Shipped version:** 0.2~ynh3
**Demo:** https://dont-code.net/apps.html

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Dont-code Services pour YunoHost
[![Niveau dintégration](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
[![Niveau dintégration](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
[![Installer Dont-code Services avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dont-code)
*[Read this readme in english.](./README.md)*
@ -31,7 +31,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
- As well any documents or images uploaded by users will be backed up
**Version incluse :** 0.2~ynh2
**Version incluse :** 0.2~ynh3
**Démo :** https://dont-code.net/apps.html

View file

@ -12,10 +12,10 @@
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=0
setup_private=1
setup_public=1
upgrade=0
upgrade=0 from_commit=CommitHash
upgrade=1
upgrade=1 from_commit=7852cc4bf44ff20ee51fe35f3f53dc105e0f6d79
backup_restore=1
multi_instance=0
port_already_use=1 (8083)
@ -24,6 +24,6 @@
Email=ger@shared.collin.best
Notification=Down
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.
; commit=7852cc4bf44ff20ee51fe35f3f53dc105e0f6d79
name=2023-01-07 - Added Ssh support for dev.
manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666&

View file

@ -6,7 +6,7 @@
"en": "Install services and databases needed to support Dont-code platform",
"fr": "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code"
},
"version": "0.2~ynh2",
"version": "0.2~ynh3",
"url": "https://dont-code.net",
"upstream": {
"license": "AGPL-3.0-or-later",

View file

@ -128,8 +128,6 @@ ynh_install_java --java_version=$java_version --jdk_type=jre
ynh_install_app_dependencies $pkg_dependencies
ynh_print_info --message="Debian release is $(ynh_get_debian_release)"
# Install the required version of Mongo
ynh_install_mongo --mongo_version=$mongo_version

View file

@ -313,14 +313,25 @@ ynh_install_mongo() {
mongo_version="${mongo_version:-$YNH_MONGO_VERSION}"
ynh_print_info --message="Installing MongoDB Community Edition ..."
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $(ynh_get_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"
local mongo_debian_release=$(ynh_get_debian_release)
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."
mongo_debian_release=buster
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"
mongodb_servicename=mongod
# Make sure MongoDB is started and enabled
systemctl enable $mongodb_servicename --quiet
systemctl daemon-reload --quiet
ynh_systemd_action --service_name=$mongodb_servicename --action=restart --line_match="aiting for connections" --log_path="systemd" --length=100 --timeout=60
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"