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 #305 from YunoHost-Apps/fix-sudo-cd

This commit is contained in:
Pierre de La Morinerie 2021-11-07 12:35:21 +01:00 committed by GitHub
commit 03abf35049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View file

@ -37,7 +37,7 @@ To explore the benefits of Mattermosts enterprise features, you can replace t
- Multiple languages including U.S. English, Australian English, Bulgarian, Chinese (Simplified and Traditional), Dutch, French, German, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Romanian, Russian, Turkish, Spanish, Swedish, and Ukrainian
**Shipped version:** 6.0.2~ynh1
**Shipped version:** 6.0.2~ynh2

View file

@ -33,7 +33,7 @@ Pour explorer les avantages des fonctionnalités d'entreprise de Mattermost, vou
- Plusieurs langues dont l'anglais américain, l'anglais australien, le bulgare, le chinois (simplifié et traditionnel), le néerlandais, le français, l'allemand, le hongrois, l'italien, le japonais, le coréen, le polonais, le portugais brésilien, le roumain, le russe, le turc, l'espagnol, le suédois et l'ukrainien
**Version incluse :** 6.0.2~ynh1
**Version incluse :** 6.0.2~ynh2

View file

@ -6,7 +6,7 @@
"en": "Open source collaboration platform built for developers",
"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/",
"upstream": {
"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
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_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
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
# 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_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Started Mattermost"