diff --git a/scripts/change_url b/scripts/change_url index fe3970e..a401e68 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -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 diff --git a/scripts/install b/scripts/install index 7463851..b67bbaa 100755 --- a/scripts/install +++ b/scripts/install @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index f5f7a58..cfaafe3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 -password_hash=$(echo $($install_dir/galene-password-generator $password)) - +# 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"