From 5c05c18fbadff24eebb6c5aaeef2d5658be35dd1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Nov 2021 15:55:19 +0100 Subject: [PATCH] Set env file --- conf/.env | 4 ++-- conf/systemd.service | 5 +---- scripts/install | 14 +++++++------- scripts/upgrade | 8 ++++---- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/conf/.env b/conf/.env index 10b62d3..c42bf84 100644 --- a/conf/.env +++ b/conf/.env @@ -11,9 +11,9 @@ COMMENTO_POSTGRES=postgres://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__?s # Set the SMTP credentials COMMENTO_SMTP_HOST=localhost COMMENTO_SMTP_PORT=25 -COMMENTO_SMTP_USERNAME=example@__DOMAIN__ +COMMENTO_SMTP_USERNAME=admin@__DOMAIN__ COMMENTO_SMTP_PASSWORD= -COMMENTO_SMTP_FROM_ADDRESS=no-reply@commento.io +COMMENTO_SMTP_FROM_ADDRESS=no-reply@__DOMAIN__ # Set Google OAuth credentials COMMENTO_GOOGLE_KEY= diff --git a/conf/systemd.service b/conf/systemd.service index 011de8c..c5e7ee4 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,11 +6,8 @@ After=network.target postgresql.service Type=simple User=__APP__ Group=__APP__ +Environment=COMMENTO_CONFIG_FILE=__FINALPATH__/commento.env ExecStart=__FINALPATH__/commento -Environment=COMMENTO_ORIGIN=https://__DOMAIN__ -Environment=COMMENTO_PORT=__PORT__ -Environment=COMMENTO_POSTGRES=postgres://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__?sslmode=disable -Environment=COMMENTO_STATIC=__FINALPATH__ [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index 69dda17..684d510 100755 --- a/scripts/install +++ b/scripts/install @@ -106,15 +106,15 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -# #================================================= -# # ADD A CONFIGURATION -# #================================================= -# ynh_script_progression --message="Adding a configuration file..." --weight=1 +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 -# ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$final_path/commento.env" -# chmod 400 "$final_path/.env" -# chown $app:$app "$final_path/.env" +chmod 400 "$final_path/commento.env" +chown $app:$app "$final_path/commento.env" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index cacdf7c..9422b5c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,7 +80,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/commento.env" fi chmod 750 "$final_path" @@ -107,10 +107,10 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # #================================================= # ynh_script_progression --message="Updating a configuration file..." --weight=1 -# ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +# ynh_add_config --template="../conf/.env" --destination="$final_path/commento.env" -# chmod 400 "$final_path/.env" -# chown $app:$app "$final_path/.env" +# chmod 400 "$final_path/commento.env" +# chown $app:$app "$final_path/commento.env" #================================================= # SETUP SYSTEMD