aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-03-23 03:33:44 +0100
committeryalh76 <yalh@yahoo.com>2019-03-23 03:33:44 +0100
commit37e462d1adacc1f011aedac4209bccae36535275 (patch)
treeae8517e7a0e533ef178a0c2da6708f6eacd7ce85
parentd1a1e67008d0838257528344d56b285ad7a39f34 (diff)
downloadmastodon_ynh-37e462d1adacc1f011aedac4209bccae36535275.tar.gz
mastodon_ynh-37e462d1adacc1f011aedac4209bccae36535275.tar.bz2
mastodon_ynh-37e462d1adacc1f011aedac4209bccae36535275.zip
removed LDAP
Mastodon LDAP need authentication Wasn't able to create a dedicated user
-rw-r--r--conf/.env.production.sample14
-rw-r--r--scripts/install8
-rw-r--r--scripts/remove7
-rw-r--r--scripts/upgrade15
4 files changed, 7 insertions, 37 deletions
diff --git a/conf/.env.production.sample b/conf/.env.production.sample
index 6606352..d6bd0c6 100644
--- a/conf/.env.production.sample
+++ b/conf/.env.production.sample
@@ -154,14 +154,14 @@ STREAMING_CLUSTER_NUM=1
# GID=1000
# LDAP authentication (optional)
-LDAP_ENABLED=true
-LDAP_HOST=localhost
-LDAP_PORT=389
+# LDAP_ENABLED=true
+# LDAP_HOST=localhost
+# LDAP_PORT=389
# LDAP_METHOD=simple_tls
-LDAP_BASE=ou=users,dc=yunohost,dc=org
-LDAP_BIND_DN=uid=__LDAP_USER__,ou=users,dc=yunohost,dc=org
-LDAP_PASSWORD=__LDAP_PASSWORD__
-LDAP_UID=uid
+# LDAP_BASE=ou=users,dc=yunohost,dc=org
+# LDAP_BIND_DN=uid=__LDAP_USER__,ou=users,dc=yunohost,dc=org
+# LDAP_PASSWORD=__LDAP_PASSWORD__
+# LDAP_UID=uid
# LDAP_SEARCH_FILTER="%{uid}=%{email}"
# PAM authentication (optional)
diff --git a/scripts/install b/scripts/install
index 2d43ce7..feb0a70 100644
--- a/scripts/install
+++ b/scripts/install
@@ -180,14 +180,6 @@ otp_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c
ynh_replace_string "__OTP_SECRET__" "$otp_secret" "$final_path/live/.env.production"
ynh_app_setting_set "$app" otp_secret "$otp_secret"
-ldap_user="${app}ldap"
-ldap_password=$(head -n32 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c32)
-yunohost user create $ldap_user -f $ldap_user -l $ldap_user -m $app@$domain -p $ldap_password -q 0
-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
#=================================================
diff --git a/scripts/remove b/scripts/remove
index 73a9bf7..3436bce 100644
--- a/scripts/remove
+++ b/scripts/remove
@@ -100,13 +100,6 @@ ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
-# REMOVE LDAP USER
-#=================================================
-
-# Remove $app LDAP User
-yunohost user delete $app --purge
-
-#=================================================
# REMOVE THE CRON FILE
#=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index c906570..c5f19f3 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -34,8 +34,6 @@ port_stream=$(ynh_app_setting_get "$app" port_stream)
paperclip_secret=$(ynh_app_setting_get "$app" paperclip_secret)
secret_key_base=$(ynh_app_setting_get "$app" secret_key_base)
otp_secret=$(ynh_app_setting_get "$app" otp_secret)
-ldap_user=$(ynh_app_setting_get "$app" ldap_user)
-ldap_password=$(ynh_app_setting_get "$app" ldap_password)
vapid_private_key=$(ynh_app_setting_get "$app" vapid_private_key)
vapid_public_key=$(ynh_app_setting_get "$app" vapid_public_key)
@@ -98,16 +96,6 @@ if [[ -z "$otp_secret" ]]; then
ynh_app_setting_set "$app" otp_secret "$otp_secret"
fi
-# If ldap_password doesn't exist, retrieve it or create it
-if [[ -z "$ldap_user" ]]; then
- ldap_user="${app}ldap"
- ynh_user_exists $ldap_user || ynh_die "LDAP User $ldap_user already exist"
- ldap_password=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
- yunohost user create username -f $ldap_user -l $ldap_user -m $app@$domain -p $ldap_password -q 0
- ynh_app_setting_set "$app" ldap_user "$ldap_user"
- ynh_app_setting_set "$app" ldap_password "$ldap_password"
-fi
-
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@@ -222,9 +210,6 @@ ynh_replace_string "__SECRET_KEY_BASE__" "$secret_key_base" "$final_path/live/.e
ynh_replace_string "__OTP_SECRET__" "$otp_secret" "$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"
-
#=================================================
# UPGRADE MASTODON
#=================================================