aboutsummaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-03-23 01:54:06 +0100
committeryalh76 <yalh@yahoo.com>2019-03-23 01:54:06 +0100
commitd4eac065f751c0f7f566ee41d689d9232654b8e7 (patch)
treed3d6756328237635dfc66b4e86714b01f925a6c3 /scripts/install
parent86301f170d2d0b3de9943561f37c3015faf732ce (diff)
downloadmastodon_ynh-d4eac065f751c0f7f566ee41d689d9232654b8e7.tar.gz
mastodon_ynh-d4eac065f751c0f7f566ee41d689d9232654b8e7.tar.bz2
mastodon_ynh-d4eac065f751c0f7f566ee41d689d9232654b8e7.zip
Fix LDAP User
Diffstat (limited to 'scripts/install')
-rw-r--r--scripts/install13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/install b/scripts/install
index fc6afcc..1e8ee50 100644
--- a/scripts/install
+++ b/scripts/install
@@ -163,26 +163,31 @@ ynh_replace_string "__DB_USER__" "$app" "$final_path/live/.env.production"
ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/live/.env.production"
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/live/.env.production"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/live/.env.production"
+ynh_replace_string "__SMTP_FROM_ADDRESS__" "$admin_mail" "${final_path}/live/.env.production"
language="$(echo $language | head -c 2)"
ynh_replace_string "__LANGUAGE__" "$language" "$final_path/live/.env.production"
paperclip_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
ynh_replace_string "PAPERCLIP_SECRET=" "PAPERCLIP_SECRET=$paperclip_secret" "${final_path}/live/.env.production"
+ynh_app_setting_set "$app" paperclip_secret "$paperclip_secret"
secret_key_base=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
ynh_replace_string "__SECRET_KEY_BASE__" "$secret_key_base" "$final_path/live/.env.production"
+ynh_app_setting_set "$app" secret_key_base "$secret_key_base"
otp_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
ynh_replace_string "__OTP_SECRET__" "$otp_secret" "$final_path/live/.env.production"
+ynh_app_setting_set "$app" otp_secret "$otp_secret"
-ynh_replace_string "__SMTP_FROM_ADDRESS__" "$admin_mail" "${final_path}/live/.env.production"
-
-ynh_user_exists $app || ynh_die "LDAP User $app already exist"
+ldap_user="$app_ldap"
+ynh_user_exists $ldap_user || ynh_die "LDAP User $app already exist"
ldap_password=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
yunohost user create username f $app -l $app -m $app@$domain -p $ldap_password -q 0
-ynh_replace_string "__APP__" "$app" "${final_path}/live/.env.production"
+ynh_replace_string "__LDAP_USER__" "$ldap_user" "${final_path}/live/.env.production"
ynh_replace_string "__LDAP_PASSWORD__" "$ldap_password" "${final_path}/live/.env.production"
+ynh_app_setting_set "$app" ldap_user "$ldap_user"
+ynh_app_setting_set "$app" ldap_password "$ldap_password"
#=================================================
# INSTALLING MASTODON