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

Update install

This commit is contained in:
Éric Gaspar 2023-03-26 17:01:23 +02:00
parent 84be692436
commit 7e7b43391b

View file

@ -75,15 +75,12 @@ team_name=$(echo "$team_display_name" | iconv -f utf8 -t ascii//TRANSLIT//IGNORE
bin_mmctl="$install_dir/bin/mmctl"
email=$(ynh_user_get_info --username=$admin --key=mail)
# mmctl is not packaged with ARM versions yet
if [[ -f "$bin_mmctl" ]]; then
export MMCTL_LOCAL=true
export MMCTL_LOCAL_SOCKET_PATH="/var/run/${app}/mattermost_local.socket"
export MMCTL_LOCAL=true
export MMCTL_LOCAL_SOCKET_PATH="/var/run/${app}/mattermost_local.socket"
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"
fi
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"
# Disable mmctl passwordless access
ynh_replace_string '"EnableLocalMode": true' '"EnableLocalMode": false' "$install_dir/config/config.json"