mirror of
https://github.com/YunoHost-Apps/mobilizon_ynh.git
synced 2024-09-03 19:46:19 +02:00
Implement LDAP
This commit is contained in:
parent
e27075e3c8
commit
ea32d93e8e
3 changed files with 29 additions and 0 deletions
11
conf/ldap.exs
Normal file
11
conf/ldap.exs
Normal file
|
@ -0,0 +1,11 @@
|
|||
config :mobilizon, Mobilizon.Service.Auth.Authenticator, Mobilizon.Service.Auth.LDAPAuthenticator
|
||||
config :mobilizon, :ldap,
|
||||
enabled: true,
|
||||
host: "localhost",
|
||||
port: 389,
|
||||
ssl: false,
|
||||
# sslopts: [],
|
||||
tls: false,
|
||||
# tlsopts: [],
|
||||
base: "ou=users,dc=yunohost,dc=org",
|
||||
uid: "uid"
|
|
@ -155,6 +155,7 @@ pushd $final_path/$app
|
|||
sudo -u "$app" MIX_ENV=prod mix deps.get
|
||||
sudo -u "$app" MIX_ENV=prod mix compile
|
||||
sudo -u "$app" MIX_ENV=prod mix mobilizon.instance gen --force --output $config --output-psql /tmp/setup_db.psql --domain $domain --instance-name $name --admin-email $admin_email --dbhost localhost --dbname $db_name --dbuser $db_user --dbpass $db_pwd --listen-port $port
|
||||
cat "../conf/ldap.exs" >> "$config"
|
||||
ynh_secure_remove --file="/tmp/setup_db.psql"
|
||||
sudo -u "$app" MIX_ENV=prod mix ecto.migrate
|
||||
sudo -u "$app" MIX_ENV=prod mix mobilizon.users.new "$admin_email" --admin --password "$password"
|
||||
|
|
|
@ -91,6 +91,23 @@ ynh_script_progression --message="Stopping a systemd service..."
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE FROM PREVIOUS VERSION
|
||||
#=================================================
|
||||
|
||||
if ynh_version_gt "1.0.0-rc1~ynh1" "${previous_version}" ; then
|
||||
ynh_script_progression --message="Upgrade configuration to 1.0.0-rc1~ynh1..."
|
||||
|
||||
config="$final_path/$app/config/prod.secret.exs"
|
||||
ynh_backup_if_checksum_is_different --file="$config"
|
||||
|
||||
# Implement ldap
|
||||
cat "../conf/ldap.exs" >> "$config"
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum --file="$config"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue