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

Merge pull request #303 from YunoHost-Apps/fix-6.0-install

This commit is contained in:
Pierre de La Morinerie 2021-11-02 22:52:49 +01:00 committed by GitHub
commit 4b3d8ae83f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -84,7 +84,7 @@
"EnableLatex": false,
"EnableAPIChannelDeletion": false,
"EnableLocalMode": true,
"LocalModeSocketLocation": "/var/tmp/mattermost_local.socket",
"LocalModeSocketLocation": "__LOCAL_SOCKET_PATH__",
"EnableAWSMetering": false,
"SplitKey": "",
"FeatureFlagSyncIntervalSeconds": 30,

View file

@ -11,6 +11,7 @@ TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__
RuntimeDirectory=__APP__
User=__APP__
Group=__APP__
LimitNOFILE=49152

View file

@ -144,6 +144,7 @@ ynh_script_progression --message="Modifying a config file..." --weight=3
smtp_user_pwd=$(ynh_string_random --length=24)
url=https://$domain$path_url
local_socket_path="/var/run/${app}/mattermost_local.socket"
ynh_add_config --template="../conf/config.json" --destination="$final_path/config/config.json"
@ -186,10 +187,12 @@ ynh_script_progression --message="Create the first administrator and team..." --
team_name=$(echo "$team_display_name" | iconv -f utf8 -t ascii//TRANSLIT//IGNORE | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z)
pushd "$final_path"
ynh_exec_warn_less ynh_exec_as $app bin/mmctl user create --local --username "$admin" --email "$email" --password "$password" --locale "$language" --system_admin
ynh_exec_warn_less ynh_exec_as $app bin/mmctl user verify --local "$admin"
ynh_exec_warn_less ynh_exec_as $app bin/mmctl team create --local --name "$team_name" --display_name "$team_display_name" --email "$email"
ynh_exec_warn_less ynh_exec_as $app bin/mmctl team add --local "$team_name" "$admin"
export MMCTL_LOCAL=true
export MMCTL_LOCAL_SOCKET_PATH="$local_socket_path"
ynh_exec_warn_less sudo --preserve-env -u $app bin/mmctl user create --username "$admin" --email "$email" --password "$password" --locale "$language" --email-verified --system-admin
ynh_exec_warn_less sudo --preserve-env -u $app bin/mmctl team create --name "$team_name" --display_name "$team_display_name" --email "$email"
ynh_exec_warn_less sudo --preserve-env -u $app bin/mmctl team users add "$team_name" "$admin"
popd
# Now that the first user is created, disable mmctl passwordless access