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

Merge branch 'fix-sudo-cd' into testing

This commit is contained in:
Pierre de La Morinerie 2021-11-07 12:36:20 +01:00
commit 43a22caee1
2 changed files with 9 additions and 7 deletions

View file

@ -6,7 +6,7 @@
"en": "Open source collaboration platform built for developers", "en": "Open source collaboration platform built for developers",
"fr": "Plateforme de collaboration open source conçue pour les développeurs" "fr": "Plateforme de collaboration open source conçue pour les développeurs"
}, },
"version": "6.0.2~ynh1", "version": "6.0.2~ynh2",
"url": "http://www.mattermost.org/", "url": "http://www.mattermost.org/",
"upstream": { "upstream": {
"license": "GPL-3.0-only", "license": "GPL-3.0-only",

View file

@ -185,17 +185,19 @@ ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_
ynh_script_progression --message="Create the first administrator and team..." --weight=1 ynh_script_progression --message="Create the first administrator and team..." --weight=1
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) 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)
bin_mmctl="$final_path/bin/mmctl"
pushd "$final_path" # mmctl is not packaged with ARM versions yet
if [[ -f $"bin_mmctl" ]]; then
export MMCTL_LOCAL=true export MMCTL_LOCAL=true
export MMCTL_LOCAL_SOCKET_PATH="$local_socket_path" 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" 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 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" ynh_exec_warn_less sudo --preserve-env -u $app "$bin_mmctl" team users add "$team_name" "$admin"
popd fi
# Now that the first user is created, disable mmctl passwordless access # Disable mmctl passwordless access
ynh_replace_string '"EnableLocalMode": true' '"EnableLocalMode": false' "$final_path/config/config.json" ynh_replace_string '"EnableLocalMode": true' '"EnableLocalMode": false' "$final_path/config/config.json"
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Started Mattermost" ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Started Mattermost"