mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
Fix
This commit is contained in:
parent
6411872e9d
commit
1baace2d84
5 changed files with 38 additions and 35 deletions
|
@ -3,7 +3,6 @@
|
||||||
domain="domain.tld"
|
domain="domain.tld"
|
||||||
path="/path"
|
path="/path"
|
||||||
admin="john"
|
admin="john"
|
||||||
language="fr"
|
|
||||||
is_public=1
|
is_public=1
|
||||||
password="pass"
|
password="pass"
|
||||||
; Checks
|
; Checks
|
||||||
|
@ -24,5 +23,5 @@ Notification=none
|
||||||
;;; Upgrade options
|
;;; Upgrade options
|
||||||
; commit=CommitHash
|
; commit=CommitHash
|
||||||
name=Name and date of the commit.
|
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&
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,6 @@
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "language",
|
|
||||||
"type": "string",
|
|
||||||
"choices": ["English"],
|
|
||||||
"default": "English"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,4 +369,30 @@ ynh_remove_mongo() {
|
||||||
yunohost service remove $MONGODB_SERVICENAME
|
yunohost service remove $MONGODB_SERVICENAME
|
||||||
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE
|
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE
|
||||||
fi
|
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"
|
|
@ -74,19 +74,23 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
# Install Yarn
|
# 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 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"
|
ynh_print_info --message="Installing MongoDB..."
|
||||||
mongodb_servicename=$mongodb_buster
|
|
||||||
|
|
||||||
|
# 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
|
# CREATE A MONGODB DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Creating a MongoDB database..."
|
ynh_print_info --message="Creating a MongoDB database..."
|
||||||
|
|
||||||
# Start mongodb
|
|
||||||
systemctl enable $mongodb_servicename
|
|
||||||
systemctl start $mongodb_servicename
|
|
||||||
|
|
||||||
# Registering db name
|
# Registering db name
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
|
|
|
@ -27,12 +27,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
# CHECK VERSION
|
# 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)
|
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
|
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
|
||||||
fi
|
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
|
# 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
|
ynh_script_progression --message="Upgrade of $app completed" --time --last
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue