1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/overleaf_ynh.git synced 2024-09-03 19:56:27 +02:00
This commit is contained in:
Thomas 2024-05-05 12:35:23 +02:00 committed by GitHub
parent 5ece985195
commit dd18eaf181
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES
#=================================================
nodejs_version=18.20.2
nodejs_version="14.21.3"
#=================================================
# PERSONAL HELPERS
@ -15,7 +15,7 @@ nodejs_version=18.20.2
#=================================================
readonly YNH_DEFAULT_MONGO_VERSION=7.0
# Declare the actual MongoDB version to use: 7.0 ; 8.0
# Declare the actual MongoDB version to use: 4.4; 5.0; 6.0
# A packager willing to use another version of MongoDB can override the variable into its _common.sh.
YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION}
@ -326,20 +326,36 @@ ynh_install_mongo() {
ynh_handle_getopts_args "$@"
mongo_version="${mongo_version:-$YNH_MONGO_VERSION}"
debian=$(lsb_release --codename --short)
ynh_print_info --message="Installing MongoDB Community Edition..."
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian buster/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
local mongo_debian_release=bullseye #$(ynh_get_debian_release)
# 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="/var/log/mongodb/$mongodb_servicename.log"
if [ "$mongo_debian_release" == buster ] ; then
ubuntu_version="bionic"
elif [ "$mongo_debian_release" == bullseye ] ; then
ubuntu_version="focal"
elif [ "$mongo_debian_release" == bookworm ] ; then
ubuntu_version="jammy"
fi
# Integrate MongoDB service in YunoHost
yunohost service add $mongodb_servicename --description="MongoDB daemon" --log="/var/log/mongodb/$mongodb_servicename.log"
ynh_install_extra_app_dependencies \
--repo="deb https://repo.mongodb.org/apt/ubuntu $ubuntu_version/mongodb-org/$mongo_version multiverse" \
--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
# Store mongo_version into the config of this app
ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version
# 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="/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"
# Store mongo_version into the config of this app
ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version
}
# Remove MongoDB