1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paheko_ynh.git synced 2024-09-03 19:56:22 +02:00

come back to first test where upgrade works, but not install

This commit is contained in:
rodinux 2024-08-18 21:20:45 +02:00
parent 6bf6262d96
commit f3759c3503
4 changed files with 21 additions and 4 deletions

View file

@ -583,7 +583,7 @@ const SMTP_SECURITY = '__SMTP_SECURITY__';
* Défaut : null * Défaut : null
*/ */
//const MAIL_RETURN_PATH = 'returns@monserveur.com'; const MAIL_RETURN_PATH = '__MAIL_RETURN_PATH__';
/** /**
* Adresse e-mail expéditrice des messages (Sender) * Adresse e-mail expéditrice des messages (Sender)
@ -600,7 +600,7 @@ const SMTP_SECURITY = '__SMTP_SECURITY__';
* Défaut : null * Défaut : null
*/ */
//const MAIL_SENDER = 'associations@monserveur.com'; const MAIL_SENDER = '__MAIL_SENDER__';
/** /**
* Mot de passe pour l'accès à l'API permettant de gérer les mails d'erreur * Mot de passe pour l'accès à l'API permettant de gérer les mails d'erreur

View file

@ -50,3 +50,13 @@ name.fr = "Configuration SMTP"
choices.STARTTLS = "STARTTLS, utilisation de STARTTLS (moyennement sécurisé)" choices.STARTTLS = "STARTTLS, utilisation de STARTTLS (moyennement sécurisé)"
bind = "SMTP_SECURITY:__INSTALL_DIR__/config.local.php" bind = "SMTP_SECURITY:__INSTALL_DIR__/config.local.php"
[main.smtp.mail_sender]
ask.fr = "Adresse e-mail expéditrice des messages"
type = "string"
bind = "MAIL_SENDER:__INSTALL_DIR__/config.local.php"
[main.smtp.mail_return_path]
ask.fr = "Adresse e-mail expéditrice des messages"
type = "string"
bind = "MAIL_RETURN_PATH:__INSTALL_DIR__/config.local.php"

View file

@ -17,6 +17,8 @@ ynh_app_setting_set --app=$app --key=smtp_port --value=25
ynh_app_setting_set --app=$app --key=smtp_user --value=$app ynh_app_setting_set --app=$app --key=smtp_user --value=$app
ynh_app_setting_set --app=$app --key=smtp_password --value=$mail_pwd ynh_app_setting_set --app=$app --key=smtp_password --value=$mail_pwd
ynh_app_setting_set --app=$app --key=smtp_security --value=STARTTLS ynh_app_setting_set --app=$app --key=smtp_security --value=STARTTLS
ynh_app_setting_set --app=$app --key=mail_return_path --value=$app@$domain
ynh_app_setting_set --app=$app --key=mail_sender --value=$app@$domain
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -32,7 +34,6 @@ chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
@ -58,7 +59,6 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config.
chmod 440 "$install_dir/config.local.php" chmod 440 "$install_dir/config.local.php"
chown $app:$app "$install_dir/config.local.php" chown $app:$app "$install_dir/config.local.php"
#================================================= #=================================================
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================

View file

@ -37,19 +37,26 @@ if [ -z "${smtp_host:-}" ]; then
smtp_user=$(ynh_read_var_in_file --file=$user_conf --key=SMTP_USER) smtp_user=$(ynh_read_var_in_file --file=$user_conf --key=SMTP_USER)
smtp_password=$(ynh_read_var_in_file --file=$user_conf --key=SMTP_PASSWORD) smtp_password=$(ynh_read_var_in_file --file=$user_conf --key=SMTP_PASSWORD)
smtp_security=$(ynh_read_var_in_file --file=$user_conf --key=SMTP_SECURITY) smtp_security=$(ynh_read_var_in_file --file=$user_conf --key=SMTP_SECURITY)
mail_return_path=$(ynh_read_var_in_file --file=$user_conf --key=MAIL_RETURN_PATH)
mail_sender=$(ynh_read_var_in_file --file=$user_conf --key=MAIL_SENDER)
ynh_replace_string --match_string="const SMTP_" --replace_string="//const SMTP_" --target_file=$user_conf ynh_replace_string --match_string="const SMTP_" --replace_string="//const SMTP_" --target_file=$user_conf
ynh_replace_string --match_string="const MAIL_" --replace_string="//const MAIL_" --target_file=$user_conf
else else
smtp_host=$domain smtp_host=$domain
smtp_port=25 smtp_port=25
smtp_user=$app smtp_user=$app
smtp_password=$mail_pwd smtp_password=$mail_pwd
smtp_security=STARTTLS smtp_security=STARTTLS
mail_return_path=$app@$domain
mail_sender=$app@$domain
fi fi
ynh_app_setting_set --app=$app --key=smtp_host --value=$smtp_host ynh_app_setting_set --app=$app --key=smtp_host --value=$smtp_host
ynh_app_setting_set --app=$app --key=smtp_port --value=$smtp_port ynh_app_setting_set --app=$app --key=smtp_port --value=$smtp_port
ynh_app_setting_set --app=$app --key=smtp_user --value=$smtp_user ynh_app_setting_set --app=$app --key=smtp_user --value=$smtp_user
ynh_app_setting_set --app=$app --key=smtp_password --value=$smtp_password ynh_app_setting_set --app=$app --key=smtp_password --value=$smtp_password
ynh_app_setting_set --app=$app --key=smtp_security --value=$smtp_security ynh_app_setting_set --app=$app --key=smtp_security --value=$smtp_security
ynh_app_setting_set --app=$app --key=mail_return_path --value=$mail_return_path
ynh_app_setting_set --app=$app --key=mail_sender --value=$mail_sender
fi fi
#================================================= #=================================================