1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

scripts: use a per-instance db username

The scripts still uses "mmuser" by default, for retro-compatibility.
This commit is contained in:
Pierre de La Morinerie 2020-02-18 22:31:15 +01:00
parent 24261f8b7f
commit 6826e253b4
3 changed files with 7 additions and 4 deletions

View file

@ -96,10 +96,11 @@ logs_path="/var/log/$app"
#=================================================
db_name="$app"
db_user="mmuser"
db_user="$YNH_APP_INSTANCE_NAME"
db_password=$(ynh_string_random --length=24)
ynh_mysql_create_db "$db_name" "$db_user" "$db_password"
ynh_app_setting_set "$app" mysqlpwd "$db_password"
ynh_app_setting_set "$app" mysqluser "$db_user"
ynh_app_setting_set "$app" mysqlpwd "$db_password"
#=================================================
# CREATE USER FOR EMAIL NOTIFICATIONS

View file

@ -16,7 +16,8 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
db_name="$app"
db_user="mmuser"
db_user=$(ynh_app_setting_get $app mysqluser)
db_user=${db_user:-"mmuser"}
mattermost_user="$app"
final_path="/var/www/$app"
data_path="/home/yunohost.app/$app"

View file

@ -26,7 +26,8 @@ final_path="/var/www/$app"
data_path="/home/yunohost.app/$app"
logs_path="/var/log/$app"
db_name="$app"
db_user="mmuser"
db_user=$(ynh_app_setting_get $app mysqluser)
db_user=${db_user:-"mmuser"}
mattermost_user="$app"
#=================================================