From afdffffc3cfc548dd5eedf7f8e6fd2a6ee9e9795 Mon Sep 17 00:00:00 2001 From: Adrian Amaglio Date: Thu, 30 Apr 2020 17:24:13 +0200 Subject: [PATCH] worknig --- Dockerfile | 3 ++- build_docker.sh | 5 +++++ main.py | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 build_docker.sh diff --git a/Dockerfile b/Dockerfile index 27c07e3..045b53e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,5 @@ COPY ./main.py ./list.tpl ./ # I juste wanted to change the socket owner but it turned out I needed to change thu uwsgi user #CMD uwsgi --exec-asap 'chown $UID:$UID /tmp/uwsgi/ ; mkdir -p $BASE_PATH && chown $UID:$UID $BASE_PATH' -s /tmp/uwsgi/uwsgi.sock --uid $UID --manage-script-name --mount /=server:app -CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --mount $MOUNT=main:app +# --log-master makes 500 error on 30s timeout for every valid http request +CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --manage-script-name --mount $MOUNT=main:app diff --git a/build_docker.sh b/build_docker.sh new file mode 100755 index 0000000..99159bc --- /dev/null +++ b/build_docker.sh @@ -0,0 +1,5 @@ +set -e +version=2.0.1 +docker build -t registry.jean-cloud.net/contact-mailer:latest -t registry.jean-cloud.net/contact-mailer:$version . +docker push registry.jean-cloud.net/contact-mailer:latest +docker push registry.jean-cloud.net/contact-mailer:$version diff --git a/main.py b/main.py index 9f6abe5..df63eeb 100755 --- a/main.py +++ b/main.py @@ -132,7 +132,8 @@ def submission (): # Redirection #redirect(success_redirect_default) - return 'Mail envoyé !' + origin = request.headers.get('origin') + return 'Mail envoyé !' + ('Retour au formulaire de contact'.format(origin) if origin else '') def get_fields (string): """ Parse the string looking for template elements and create an array with template to fill and their default values. None if mandatory. """