1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00
This commit is contained in:
Éric Gaspar 2023-03-18 23:44:14 +01:00
parent acecca2585
commit 784cb684b4
3 changed files with 7 additions and 11 deletions

View file

@ -15,10 +15,8 @@ source /usr/share/yunohost/helpers
ynh_script_progression --message="Loading installation settings..." --weight=1
# Add settings here as needed by your application
password=$(ynh_app_setting_get --app=$app --key=password)
group_name=$(ynh_app_setting_get --app=$app --key=group_name)
port_ldap=$(ynh_app_setting_get --app=$app --key=ldap_port)
key=$(ynh_app_setting_get --app=$app --key=key)
password_hash=$(ynh_app_setting_get --app=$app --key=password_hash)
#=================================================
# STANDARD MODIFICATIONS

View file

@ -96,6 +96,7 @@ chown -R $app:www-data "$data_dir"
ynh_script_progression --message="Adding a configuration file..." --weight=1
password_hash=$(echo $($install_dir/galene-password-generator $password))
ynh_app_setting_set --app=$app --key=password_hash --value="$password_hash"
# Configure Galène
ynh_add_config --template="../conf/config.json" --destination="$install_dir/live/data/config.json"

View file

@ -37,12 +37,6 @@ ynh_systemd_action --service_name=${app}_ldap --action="stop" --log_path="system
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If open, close direct access to $port in firewall
if yunohost firewall list | grep -q "\- $port$"
then
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
# For version 0.6~ynh1 and before
if [[ ! -d "$install_dir/live" ]]
then
@ -114,8 +108,11 @@ fi
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=2
# If password_hash doesn't exist, create it
if [ -z "$password_hash" ]; then
password_hash=$(echo $($install_dir/galene-password-generator $password))
ynh_app_setting_set --app=$app --key=password_hash --value="$password_hash"
fi
# Configure Galène
ynh_add_config --template="../conf/config.json" --destination="$install_dir/live/data/config.json"
chmod 400 "$install_dir/live/data/config.json"