mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
removing dedicated ldap user creation
This commit is contained in:
parent
6c7a10d5c3
commit
6f5fec437c
5 changed files with 2 additions and 50 deletions
|
@ -160,8 +160,8 @@ LDAP_HOST=localhost
|
||||||
LDAP_PORT=389
|
LDAP_PORT=389
|
||||||
LDAP_METHOD=start_tls
|
LDAP_METHOD=start_tls
|
||||||
LDAP_BASE=ou=users,dc=yunohost,dc=org
|
LDAP_BASE=ou=users,dc=yunohost,dc=org
|
||||||
LDAP_BIND_DN=uid=__LDAP_USER__,ou=users,dc=yunohost,dc=org
|
LDAP_BIND_DN=uid=uid=local,ou=users,dc=yunohost,dc=org
|
||||||
LDAP_PASSWORD=__LDAP_PASSWORD__
|
LDAP_PASSWORD=
|
||||||
LDAP_UID=uid
|
LDAP_UID=uid
|
||||||
LDAP_SEARCH_FILTER="%{uid}=%{email}"
|
LDAP_SEARCH_FILTER="%{uid}=%{email}"
|
||||||
LDAP_TLS_NO_VERIFY=true
|
LDAP_TLS_NO_VERIFY=true
|
||||||
|
|
|
@ -36,9 +36,6 @@ admin_mail=$(ynh_user_get_info $admin 'mail')
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
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
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -71,8 +68,6 @@ 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=admin --value=$admin
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
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=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
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -139,13 +134,6 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# 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
|
# INSTALLING RUBY AND BUNDLER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -182,9 +170,6 @@ 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_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_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
|
# INSTALLING MASTODON
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,7 +22,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$app
|
db_user=$app
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -96,13 +95,6 @@ ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
|
||||||
# REMOVE LDAP USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing ldap user..." --weight=2
|
|
||||||
|
|
||||||
yunohost user delete $ldap_user --purge
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE CRON FILE
|
# REMOVE THE CRON FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -35,8 +35,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$app
|
db_user=$app
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||||
ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
|
|
||||||
ldap_password=$(ynh_app_setting_get --app=$app --key=ldap_password)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -91,13 +89,6 @@ ynh_install_nodejs --nodejs_version="8"
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# 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
|
# INSTALLING RUBY AND BUNDLER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -37,9 +37,6 @@ otp_secret=$(ynh_app_setting_get --app=$app --key=otp_secret)
|
||||||
vapid_private_key=$(ynh_app_setting_get --app=$app --key=vapid_private_key)
|
vapid_private_key=$(ynh_app_setting_get --app=$app --key=vapid_private_key)
|
||||||
vapid_public_key=$(ynh_app_setting_get --app=$app --key=vapid_public_key)
|
vapid_public_key=$(ynh_app_setting_get --app=$app --key=vapid_public_key)
|
||||||
|
|
||||||
ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
|
|
||||||
ldap_password=$(ynh_app_setting_get --app=$app --key=ldap_password)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -125,16 +122,6 @@ if [[ -z "$vapid_private_key" ]]; then
|
||||||
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
|
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If ldap_user doesn't exist, retrieve it or create it
|
|
||||||
if [[ -z "$ldap_user" ]]; then
|
|
||||||
ldap_user="svc_${app}_ldap"
|
|
||||||
ldap_password==$(ynh_string_random --length=8)
|
|
||||||
ynh_app_setting_set "$app" ldap_user "$ldap_user"
|
|
||||||
ynh_app_setting_set "$app" ldap_password "$ldap_password"
|
|
||||||
|
|
||||||
yunohost user create $ldap_user --firstname "SvcMastodonLdap" --lastname "SvcMastodonLdap" --mail ${ldap_user}@$domain --password $ldap_password -q 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Remove previous added repository
|
#Remove previous added repository
|
||||||
ynh_remove_extra_repo
|
ynh_remove_extra_repo
|
||||||
|
|
||||||
|
@ -252,9 +239,6 @@ ynh_replace_string --match_string="__OTP_SECRET__" --replace_string="$otp_secret
|
||||||
ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "$final_path/live/.env.production"
|
ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "$final_path/live/.env.production"
|
||||||
ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "$final_path/live/.env.production"
|
ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "$final_path/live/.env.production"
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE MASTODON
|
# UPGRADE MASTODON
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue