From ee30d0528c824136aeac68f603692324990fae19 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Wed, 15 Jul 2020 23:35:39 +0200 Subject: [PATCH] Fix preflight CORS redirect issue --- containers/backend/lesspass/settings.py | 2 ++ containers/docker-compose.yml | 4 ++-- containers/webserver/httpd-ssl.conf | 10 +++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/containers/backend/lesspass/settings.py b/containers/backend/lesspass/settings.py index a4c1f2f..229a96f 100644 --- a/containers/backend/lesspass/settings.py +++ b/containers/backend/lesspass/settings.py @@ -150,6 +150,8 @@ REST_FRAMEWORK = { 'TEST_REQUEST_DEFAULT_FORMAT': 'json' } +SITE_NAME = "LessPass" +DOMAIN = env("FRONTEND_HOST", default="www.lesspass.com") class DisableMigrations(object): def __contains__(self, item): diff --git a/containers/docker-compose.yml b/containers/docker-compose.yml index f2d578c..05f36c8 100644 --- a/containers/docker-compose.yml +++ b/containers/docker-compose.yml @@ -6,8 +6,8 @@ services: volumes: - postgresql:/var/lib/postgresql/data environment: - - POSTGRES_DB - - POSTGRES_USER + - POSTGRES_DB=${DATABASE_NAME} + - POSTGRES_USER=${DATABASE_USER} - POSTGRES_PASSWORD=${DATABASE_PASSWORD} backend: restart: always diff --git a/containers/webserver/httpd-ssl.conf b/containers/webserver/httpd-ssl.conf index 73253fe..bf0db99 100644 --- a/containers/webserver/httpd-ssl.conf +++ b/containers/webserver/httpd-ssl.conf @@ -153,13 +153,9 @@ ServerAdmin EMAIL - ServerName FQDN + ServerName FQDN + ServerAlias www.FQDN - Redirect / https://www.FQDN/ - - - - ServerName www.FQDN ProxyPass /api/ http://backend:8000/api/ ProxyPassReverse /api/ http://backend:8000/api/ ProxyPass / http://frontend/ @@ -167,4 +163,4 @@ ServerAdmin EMAIL SSLEngine on SSLCertificateFile "/usr/local/apache2/conf/CRT_PATH" SSLCertificateKeyFile "/usr/local/apache2/conf/KEY_PATH" - +