2016-01-20 12:20:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-02-23 23:37:24 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-01-20 12:20:03 +01:00
|
|
|
|
2022-02-23 23:37:24 +01:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
|
|
#=================================================
|
|
|
|
|
2023-03-05 10:06:44 +01:00
|
|
|
password=$YNH_APP_ARG_PASSWORD
|
|
|
|
ynh_app_setting_set --app=$app --key=password --value=$password
|
2016-01-20 12:20:03 +01:00
|
|
|
|
2022-02-23 23:37:24 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring NGINX web server..."
|
|
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
|
|
|
# CONFIGURE RSPAMD
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring RSPAMD..."
|
|
|
|
|
|
|
|
encrypted_password=$(rspamadm pw -p $password)
|
|
|
|
|
|
|
|
ynh_replace_special_string --match_string="^password = .*" --replace_string="password = \"$encrypted_password\";" --target_file=/etc/rspamd/worker-controller.inc
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=rspamd --action="restart"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Installation of $app completed"
|