From 044a4c0a688eb9d895dce37858b4c4fb635905a7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 16 Aug 2023 10:46:32 +0200 Subject: [PATCH] FEATURE: send email to admins when a new user subscribe #41 --- README.md | 9 ++++++++- docker-compose.override.yml | 2 +- patches/back/default_config.toml | 17 +++++++++++------ vendor/GeoNature-citizen | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 77f09a0..335243e 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,14 @@ or `npm run build:fr` for speeding up. ### Back-end development -When developing the app and serving it with `docker-compose up`, the changes are automatically loaded (meaning, the app is watching the changes). However, it is more practical to change the command of the backend container from `command: bash start_gunicorn.sh` to `command: python wsgi.py` in order to have some logs. +When developing the app and serving it with `docker-compose up`, the changes should be automatically loaded (meaning, the app is watching the changes) (Note that this is not the case anymore). However, it is more practical to change the command of the backend container from `command: bash start_gunicorn.sh` to `command: python wsgi.py` in order to have some logs. + +You can access a flask shell terminal with the following: + +```bash +docker-compose exec citizen-back bash +appuser@5d4fc6b169b2:~/citizen/backend$ flask shell +``` ## Deploiement sur un serveur distant diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 6c2d590..c6061cd 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -4,7 +4,7 @@ services: db: image: postgis/postgis:12-3.1-alpine ports: - - "5432:5432" + - "5434:5432" volumes: - "pg-data:/var/lib/postgresql/data" environment: diff --git a/patches/back/default_config.toml b/patches/back/default_config.toml index c9de5a8..b10c960 100644 --- a/patches/back/default_config.toml +++ b/patches/back/default_config.toml @@ -17,7 +17,7 @@ DEBUG = false SQLALCHEMY_DEBUG_LEVEL = 'WARNING' # URL_APPLICATION = "http://mydomain.org" # Replace mydomain.org by your domain -URL_APPLICATION = "http://taxhub:5000" +URL_APPLICATION = "https://localhost:8080/" API_TAXHUB = "http://taxhub:5000/api/" # API_TAXHUB = "http://mytaxhub.org/api/" # Replace mytaxhub.org by your TaxHub url @@ -48,7 +48,7 @@ REWARDS_ENABLED = false USE_CONFIRM_EMAIL = true SUBJECT = "Activez votre compte" FROM = '"Biommap" ' - HTML_TEMPLATE = '''

Bonjour,


Nous vous confirmons que votre compte a bien été créé.

+ HTML_TEMPLATE = '''

Bonjour,


Nous vous confirmons que votre compte Biommap a bien été créé.

Afin d'activer votre compte veuillez cliquer ici.

Nous vous souhaitons la bienvenue sur notre site.


Bien à vous.

@@ -61,10 +61,15 @@ REWARDS_ENABLED = false [MAIL] MAIL_USE_SSL = false MAIL_STARTTLS = true - MAIL_HOST = 'smtpd host' - MAIL_PORT = 493 # mandatory SSL port - MAIL_AUTH_LOGIN = 'smtpd/relay host username' - MAIL_AUTH_PASSWD = 'smtpd/relay host password' + MAIL_HOST = 'mail.easter-eggs.com' + MAIL_PORT = 587 # mandatory SSL port + MAIL_AUTH_LOGIN = 'julien.minet@champs-libres.coop' + MAIL_AUTH_PASSWD = 'Bomel2164' + ADMIN_MESSAGE = '''

Bonjour administrateur,


+

Un nouvel utilisateur de Biommap avec le nom d'utilisateur "{newuser_username}" a été créé!

+

Vous pouvez gérer cet utilisateur dans l'espace d'administration.


+

Bonne journée

+ ''' # API flasgger main config \ No newline at end of file diff --git a/vendor/GeoNature-citizen b/vendor/GeoNature-citizen index f9cb6fa..ac2f8e8 160000 --- a/vendor/GeoNature-citizen +++ b/vendor/GeoNature-citizen @@ -1 +1 @@ -Subproject commit f9cb6faf966d7f4572f845e4f10fe1a88b95a7c0 +Subproject commit ac2f8e8a1eb80ecbc902b59d897df9df95dae11e