1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00
This commit is contained in:
ericgaspar 2021-06-07 17:13:37 +02:00
parent 6411872e9d
commit 1baace2d84
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 38 additions and 35 deletions

View file

@ -3,7 +3,6 @@
domain="domain.tld"
path="/path"
admin="john"
language="fr"
is_public=1
password="pass"
; Checks
@ -24,5 +23,5 @@ Notification=none
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&password=pass&port=666&

View file

@ -38,12 +38,6 @@
"name": "is_public",
"type": "boolean",
"default": true
},
{
"name": "language",
"type": "string",
"choices": ["English"],
"default": "English"
}
]
}

View file

@ -369,4 +369,30 @@ ynh_remove_mongo() {
yunohost service remove $MONGODB_SERVICENAME
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE
fi
}
}
ynh_install_mongo() {
ynh_print_info --message="Installing MongoDB..."
# Define Mongo Service Name
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" --package="mongodb-org mongodb-org-server mongodb-org-tools" --key="https://www.mongodb.org/static/pgp/server-4.4.asc"
# Make sure MongoDB is started and enabled
systemctl is-enabled mongod -q || systemctl enable mongod --quiet
systemctl is-active mongod -q || ynh_systemd_action --service_name=mongod --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/mongod.log"
# Integrate MongoDB service in YunoHost
yunohost service add mongod --description "MongoDB daemon" --log "/var/log/mongodb/mongod.log"
}
MONGO_SERVICENAME_STRETCH="mongodb"
MONGO_SERVICENAME_BUSTER="mongod"
MONGO_DEPENDENCIES_STRETCH="mongodb mongodb-server mongo-tools"
MONGO_DEPENDENCIES_BUSTER="mongodb-org mongodb-org-server mongodb-org-tools"
MONGO_CONFIG_STRETCH="/etc/mongodb.conf"
MONGO_CONFIG_BUSTER="/etc/mongod.conf"
MONGO_REPO_BUSTER="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main"
MONGO_KEY_BUSTER="https://www.mongodb.org/static/pgp/server-4.4.asc"

View file

@ -74,19 +74,23 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn
#ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" --package="mongod mongodb-org mongodb-org-server mongodb-org-tools" --key="https://www.mongodb.org/static/pgp/server-4.2.asc"
mongodb_servicename=$mongodb_buster
ynh_print_info --message="Installing MongoDB..."
# Define Mongo Service Name
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" --package="mongodb-org mongodb-org-server mongodb-org-tools" --key="https://www.mongodb.org/static/pgp/server-4.4.asc"
# Make sure MongoDB is started and enabled
systemctl is-enabled mongod -q || systemctl enable mongod --quiet
systemctl is-active mongod -q || ynh_systemd_action --service_name=mongod --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/mongod.log"
# Integrate MongoDB service in YunoHost
yunohost service add mongod --description "MongoDB daemon" --log "/var/log/mongodb/mongod.log"
#=================================================
# CREATE A MONGODB DATABASE
#=================================================
ynh_print_info --message="Creating a MongoDB database..."
# Start mongodb
systemctl enable $mongodb_servicename
systemctl start $mongodb_servicename
# Registering db name
db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name

View file

@ -27,12 +27,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
# CHECK VERSION
#=================================================
### This helper will compare the version of the currently installed app and the version of the upstream package.
### $upgrade_type can have 2 different values
### - UPGRADE_APP if the upstream app version has changed
### - UPGRADE_PACKAGE if only the YunoHost package has changed
### ynh_check_app_version_changed will stop the upgrade if the app is up to date.
### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do.
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
@ -73,11 +67,6 @@ if ! ynh_permission_exists --permission="admin"; then
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
fi
# Create a permission if needed
if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true"
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -223,15 +212,6 @@ ynh_systemd_action --service_name=nginx --action=reload
ynh_script_progression --message="Upgrade of $app completed" --time --last
#=================================================
# GENERIC START
#=================================================