mirror of
https://github.com/YunoHost-Apps/wekan_ynh.git
synced 2024-09-03 20:36:09 +02:00
Update ynh_mongo_db__2
This commit is contained in:
parent
f5a9e7b0d0
commit
ad9df68199
1 changed files with 20 additions and 19 deletions
|
@ -12,14 +12,14 @@ MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-5.0.asc"
|
||||||
# example: ynh_mongo_exec --command="db.getMongo().getDBNames().indexOf(\"wekan\")"
|
# example: ynh_mongo_exec --command="db.getMongo().getDBNames().indexOf(\"wekan\")"
|
||||||
#
|
#
|
||||||
# usage: ynh_mongo_exec [--user=user] [--password=password] [--authenticationdatabase=authenticationdatabase] [--database=database] [--host=host] [--port=port] --command="command" [--eval]
|
# usage: ynh_mongo_exec [--user=user] [--password=password] [--authenticationdatabase=authenticationdatabase] [--database=database] [--host=host] [--port=port] --command="command" [--eval]
|
||||||
# | arg: -u, --user= - The user name to connect as
|
# | arg: -u, --user= - The user name to connect as
|
||||||
# | arg: -p, --password= - The user password
|
# | arg: -p, --password= - The user password
|
||||||
# | arg: -d, --authenticationdatabase= - The authenticationdatabase to connect to
|
# | arg: -d, --authenticationdatabase= - The authenticationdatabase to connect to
|
||||||
# | arg: -d, --database= - The database to connect to
|
# | arg: -d, --database= - The database to connect to
|
||||||
# | arg: -h, --host= - The host to connect to
|
# | arg: -h, --host= - The host to connect to
|
||||||
# | arg: -P, --port= - The port to connect to
|
# | arg: -P, --port= - The port to connect to
|
||||||
# | arg: -c, --command= - The command to evaluate
|
# | arg: -c, --command= - The command to evaluate
|
||||||
# | arg: -e, --eval - Evaluate instead of execute the command.
|
# | arg: -e, --eval - Evaluate instead of execute the command.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
ynh_mongo_exec() {
|
ynh_mongo_exec() {
|
||||||
|
@ -155,9 +155,9 @@ ynh_mongo_dump_db() {
|
||||||
# [internal]
|
# [internal]
|
||||||
#
|
#
|
||||||
# usage: ynh_mongo_create_user --db_user=user --db_pwd=pwd --db_name=name
|
# usage: ynh_mongo_create_user --db_user=user --db_pwd=pwd --db_name=name
|
||||||
# | arg: -u, --db_user= - The user name to create
|
# | arg: -u, --db_user= - The user name to create
|
||||||
# | arg: -p, --db_pwd= - The password to identify user by
|
# | arg: -p, --db_pwd= - The password to identify user by
|
||||||
# | arg: -n, --db_name= - Name of the database to grant privilegies
|
# | arg: -n, --db_name= - Name of the database to grant privilegies
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
ynh_mongo_create_user() {
|
ynh_mongo_create_user() {
|
||||||
|
@ -224,8 +224,8 @@ ynh_mongo_restore_db() {
|
||||||
# [internal]
|
# [internal]
|
||||||
#
|
#
|
||||||
# usage: ynh_mongo_drop_user --db_user=user --db_name=name
|
# usage: ynh_mongo_drop_user --db_user=user --db_name=name
|
||||||
# | arg: -u, --db_user= - The user to drop
|
# | arg: -u, --db_user= - The user to drop
|
||||||
# | arg: -n, --db_name= - Name of the database
|
# | arg: -n, --db_name= - Name of the database
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
ynh_mongo_drop_user() {
|
ynh_mongo_drop_user() {
|
||||||
|
@ -243,9 +243,9 @@ ynh_mongo_drop_user() {
|
||||||
# Create a database, an user and its password. Then store the password in the app's config
|
# Create a database, an user and its password. Then store the password in the app's config
|
||||||
#
|
#
|
||||||
# usage: ynh_mongo_setup_db --db_user=user --db_name=name [--db_pwd=pwd]
|
# usage: ynh_mongo_setup_db --db_user=user --db_name=name [--db_pwd=pwd]
|
||||||
# | arg: -u, --db_user= - Owner of the database
|
# | arg: -u, --db_user= - Owner of the database
|
||||||
# | arg: -n, --db_name= - Name of the database
|
# | arg: -n, --db_name= - Name of the database
|
||||||
# | arg: -p, --db_pwd= - Password of the database. If not provided, a password will be generated
|
# | arg: -p, --db_pwd= - Password of the database. If not provided, a password will be generated
|
||||||
#
|
#
|
||||||
# After executing this helper, the password of the created database will be available in $db_pwd
|
# After executing this helper, the password of the created database will be available in $db_pwd
|
||||||
# It will also be stored as "mongopwd" into the app settings.
|
# It will also be stored as "mongopwd" into the app settings.
|
||||||
|
@ -275,8 +275,8 @@ ynh_mongo_setup_db() {
|
||||||
# Remove a database if it exists, and the associated user
|
# Remove a database if it exists, and the associated user
|
||||||
#
|
#
|
||||||
# usage: ynh_mongo_remove_db --db_user=user --db_name=name
|
# usage: ynh_mongo_remove_db --db_user=user --db_name=name
|
||||||
# | arg: -u, --db_user= - Owner of the database
|
# | arg: -u, --db_user= - Owner of the database
|
||||||
# | arg: -n, --db_name= - Name of the database
|
# | arg: -n, --db_name= - Name of the database
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
ynh_mongo_remove_db() {
|
ynh_mongo_remove_db() {
|
||||||
|
@ -331,6 +331,7 @@ ynh_remove_mongo() {
|
||||||
mongodb_servicename=$MONGO_CE_SERVICENAME
|
mongodb_servicename=$MONGO_CE_SERVICENAME
|
||||||
# Remove the mongodb service
|
# Remove the mongodb service
|
||||||
yunohost service remove $mongodb_servicename
|
yunohost service remove $mongodb_servicename
|
||||||
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE
|
ynh_secure_remove --file="/var/lib/mongodb"
|
||||||
|
ynh_secure_remove --file="/var/log/mongodb"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue