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

[add] language

This commit is contained in:
magikcypress 2017-04-15 04:20:28 +02:00
parent 4ff6c990cc
commit 9bddc797b4
2 changed files with 18 additions and 4 deletions

View file

@ -9,12 +9,12 @@
"en": "Mastodon is a free, open-source social network.",
"fr": "Mastodon est un réseau social gratuit et open source."
},
"version": "0.6 dev",
"version": "1.1.1",
"url": "https://github.com/tootsuite/mastodon",
"license": "AGPL",
"license": "AGPL v3.0",
"maintainer": {
"name": "cyp",
"email": "cyp@rouquin.me"
"name": "cyp, nemsia",
"email": "cyp@rouquin.me, nemsia@nemsia.org"
},
"multi_instance": false,
"services": [
@ -58,6 +58,15 @@
"fr": "Ajouter le mot de passe l'Administrateur YunoHost"
},
"example": "adminpassword"
},
{
"name": "language",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": ["en_EN", "fr_FR"],
"default": "fr_FR"
},
{
"name": "is_public",

View file

@ -17,6 +17,7 @@ domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
admin_mastodon=$YNH_APP_ARG_ADMIN
admin_pass=$YNH_APP_ARG_PASSWD
language=$YNH_APP_ARG_LANGUAGE
is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
@ -35,6 +36,7 @@ ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path $path
ynh_app_setting_set $app admin $admin_mastodon
ynh_app_setting_set $app pass $admin_pass
ynh_app_setting_set $app language $language
ynh_app_setting_set $app is_public $is_public
# Create user unix
@ -136,6 +138,9 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ
sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production"
sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production"
language="$(echo $language | head -c 2)"
sudo sed -i "s@# DEFAULT_LOCALE=de@DEFAULT_LOCALE=${language}@g" "${final_path}/live/.env.production"
sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"