From f8b40179a514f8621232c099627c27f0028b7467 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:53:50 +0200 Subject: [PATCH] refactor to use config_panel --- conf/.env.production | 4 ++-- config_panel.toml | 24 ++++++++++++++++++++++++ scripts/install | 6 +++--- scripts/upgrade | 3 --- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 5990646..1d9dca1 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MAIN_DOMAIN__:587/?tls=True -SENDER_EMAIL=__ADMIN__@__MAIN_DOMAIN__ +EMAIL_URL=smtp://__USER_MAIL__:__MAIL_PASSWORD__@__MAIL_DOMAIN__:587/?tls=True +SENDER_EMAIL=__USER_MAIL__@__MAIL_DOMAIN__ # WORKERS_PROCESSES= # Workouts diff --git a/config_panel.toml b/config_panel.toml index b9ad4bc..11fef63 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -44,4 +44,28 @@ services = ["__APP__", "__APP___workers"] help.fr = "Insérer la clé api donnée par le fournisseur météo choisi" bind = "WEATHER_API_KEY:/var/www/__APP__/.env" + [main.config.USER_MAIL] + ask.en = "Configure the user mail" + ask.fr = "Configurer le courriel utilisateur" + type = "string" + bind = "USER_MAIL:/var/www/__APP__/.env" + + [main.config.MAIL_PASSWORD] + ask.en = "Configure the password of the determined mail user" + ask.fr = "Configurer le mot de passe de l’utilisateur mail choisi" + type = "string" + bind = "MAIL_PASSWORD:/var/www/__APP__/.env" + + [main.config.MAIL_DOMAIN] + ask.en = "Configure the server address" + ask.fr = "Configurer l’adresse du serveur" + type = "string" + help.en = "e.g. mydomain.com" + help.fr = "ex. : mondomain.com" + bind = "MAIL_DOMAIN:/var/www/__APP__/.env" + + + + + \ No newline at end of file diff --git a/scripts/install b/scripts/install index 7a65281..b64e986 100755 --- a/scripts/install +++ b/scripts/install @@ -11,9 +11,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) - -# Retrieve YunoHost main domain -main_domain=$(cat /etc/yunohost/current_host) +user_mail=$($app) +mail_password=$($mail_pwd) +mail_domain=$($domain) #================================================= # LOGROTATE diff --git a/scripts/upgrade b/scripts/upgrade index ced38d6..c4b7b25 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -# Retrieve YunoHost main domain -main_domain=$(cat /etc/yunohost/current_host) - #================================================= # CHECK VERSION #=================================================