aboutsummaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-07-10 01:07:32 +0200
committeryalh76 <yalh@yahoo.com>2019-07-10 01:07:32 +0200
commitfeab0450d821b21cdc8a8fc0ee9ae9b1e9913d33 (patch)
tree16ce9dbb3cb6116b2904daf4abda8addcab3ba56 /scripts/install
parente0d8fa20c3694523b15e5602001a2727314698d9 (diff)
downloadmastodon_ynh-feab0450d821b21cdc8a8fc0ee9ae9b1e9913d33.tar.gz
mastodon_ynh-feab0450d821b21cdc8a8fc0ee9ae9b1e9913d33.tar.bz2
mastodon_ynh-feab0450d821b21cdc8a8fc0ee9ae9b1e9913d33.zip
Implement LDAP
Diffstat (limited to 'scripts/install')
-rw-r--r--scripts/install15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/install b/scripts/install
index 0991cbc..97bbc0b 100644
--- a/scripts/install
+++ b/scripts/install
@@ -36,6 +36,9 @@ admin_mail=$(ynh_user_get_info $admin 'mail')
app=$YNH_APP_INSTANCE_NAME
+ldap_user="svc_${app}_ldap"
+ldap_password=$(ynh_string_random --length=8)
+
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@@ -68,6 +71,8 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language
+ynh_app_setting_set --app=$app --key=ldap_user --value=$ldap_user
+ynh_app_setting_set --app=$app --key=ldap_password --value=$ldap_password
#=================================================
# STANDARD MODIFICATIONS
@@ -135,6 +140,13 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# SPECIFIC SETUP
#=================================================
+# CREATING LDAP USER
+#=================================================
+ynh_script_progression --message="Creating LDAP user..." --weight=424
+
+yunohost user create $ldap_user --firstname "SvcMastodonLdap" --lastname "SvcMastodonLdap" --mail ${ldap_user}@$domain --password $ldap_password -q 0
+
+#=================================================
# INSTALLING RUBY AND BUNDLER
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424
@@ -170,6 +182,9 @@ otp_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c
ynh_replace_string --match_string="__OTP_SECRET__" --replace_string="$otp_secret" --target_file="$final_path/live/.env.production"
ynh_app_setting_set --app="$app" --key=otp_secret --value="$otp_secret"
+ynh_replace_string --match_string="__LDAP_USER__" --replace_string="$ldap_user" --target_file="$final_path/live/.env.production"
+ynh_replace_string --match_string="__LDAP_PASSWORD__" --replace_string="$ldap_password" --target_file="$final_path/live/.env.production"
+
#=================================================
# INSTALLING MASTODON
#=================================================