diff --git a/check_process b/check_process index d370e8a..a10ac09 100644 --- a/check_process +++ b/check_process @@ -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& diff --git a/manifest.json b/manifest.json index b499c79..78c49c1 100644 --- a/manifest.json +++ b/manifest.json @@ -38,12 +38,6 @@ "name": "is_public", "type": "boolean", "default": true - }, - { - "name": "language", - "type": "string", - "choices": ["English"], - "default": "English" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 16abd72..36d8bb8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -369,4 +369,30 @@ ynh_remove_mongo() { yunohost service remove $MONGODB_SERVICENAME # ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE fi -} \ No newline at end of file +} + + + +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" \ No newline at end of file diff --git a/scripts/install b/scripts/install index ec54901..c5e78a8 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index ab29fac..c5c9c37 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #=================================================