From 158190de1a9205d3bccd16610bef231850167e57 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Thu, 1 Aug 2024 12:00:52 +0200 Subject: [PATCH] Codesstyle enhancements --- db.env.tpl | 2 +- docker-compose/docker-compose.development.yml | 2 +- docker-compose/docker-compose.scale.yml | 2 +- docker-compose/docker-compose.traefik.yml | 23 ++++++++----------- nopaque.env.tpl | 11 ++++----- 5 files changed, 18 insertions(+), 22 deletions(-) diff --git a/db.env.tpl b/db.env.tpl index 6e5f2765..a5de72e4 100644 --- a/db.env.tpl +++ b/db.env.tpl @@ -1,5 +1,5 @@ ############################################################################## -# Environment variables to configure the db service in docker-compose.yml. # +# Environment variables used by the Docker db service. # # # # More information about the environment variables can be found here: # # https://hub.docker.com/_/postgres # diff --git a/docker-compose/docker-compose.development.yml b/docker-compose/docker-compose.development.yml index ffdceddd..f8d0ca85 100644 --- a/docker-compose/docker-compose.development.yml +++ b/docker-compose/docker-compose.development.yml @@ -1,7 +1,7 @@ services: nopaque: environment: - - FLASK_DEBUG=True + FLASK_DEBUG: "True" ports: - "5000:5000" volumes: diff --git a/docker-compose/docker-compose.scale.yml b/docker-compose/docker-compose.scale.yml index e0dfa48c..37fecc8b 100644 --- a/docker-compose/docker-compose.scale.yml +++ b/docker-compose/docker-compose.scale.yml @@ -1,4 +1,4 @@ services: nopaque: environment: - - NOPAQUE_IS_PRIMARY_INSTANCE=False + NOPAQUE_IS_PRIMARY_INSTANCE: "False" diff --git a/docker-compose/docker-compose.traefik.yml b/docker-compose/docker-compose.traefik.yml index d3e4fbb9..ea64c15e 100644 --- a/docker-compose/docker-compose.traefik.yml +++ b/docker-compose/docker-compose.traefik.yml @@ -6,29 +6,26 @@ networks: services: nopaque: environment: - - NOPAQUE_PROXY_FIX_ENABLED=True - - NOPAQUE_PROXY_FIX_X_FOR=1 - - NOPAQUE_PROXY_FIX_X_HOST=1 - - NOPAQUE_PROXY_FIX_X_PORT=1 - - NOPAQUE_PROXY_FIX_X_PREFIX=0 - - NOPAQUE_PROXY_FIX_X_PROTO=1 + NOPAQUE_PROXY_FIX_ENABLED: "True" + NOPAQUE_PROXY_FIX_X_FOR: "1" + NOPAQUE_PROXY_FIX_X_HOST: "1" + NOPAQUE_PROXY_FIX_X_PORT: "1" + NOPAQUE_PROXY_FIX_X_PREFIX: "0" + NOPAQUE_PROXY_FIX_X_PROTO: "1" labels: - - "traefik.docker.network=traefik" - "traefik.enable=true" - ### ### + # HTTP - "traefik.http.routers.http-nopaque.entrypoints=http" - "traefik.http.routers.http-nopaque.middlewares=redirect-to-https@file" # Replace with your domain - "traefik.http.routers.http-nopaque.rule=Host(``)" - ### ### - ### ### + # HTTPS - "traefik.http.routers.https-nopaque.entrypoints=https" - "traefik.http.routers.https-nopaque.middlewares=hsts-header@file" # Replace with your domain - "traefik.http.routers.https-nopaque.rule=Host(``)" - "traefik.http.routers.https-nopaque.tls.certresolver=" - "traefik.http.routers.https-nopaque.tls.options=intermediate@file" - ### ### networks: - - default - - traefik + - "nopaque" + - "traefik" diff --git a/nopaque.env.tpl b/nopaque.env.tpl index 49fcb306..74699e62 100644 --- a/nopaque.env.tpl +++ b/nopaque.env.tpl @@ -1,9 +1,5 @@ ############################################################################## -# Environment variables to configure the nopaque. # -# - When running nopaque with Docker Compose, these variables are set in the # -# `docker-compose.yml` file. # -# - When running nopaque without Docker, these variables are loaded by # -# nopaque in the config.py file # +# Environment variables used by nopaque. # ############################################################################## @@ -11,6 +7,9 @@ # Flask # # https://flask.palletsprojects.com/en/1.1.x/config/ # ############################################################################## +# DEFAULT: / +# APPLICATION_ROOT= + # CHOOSE ONE: http, https # DEFAULT: http # PREFERRED_URL_SCHEME= @@ -112,7 +111,7 @@ SQLALCHEMY_DATABASE_URI= NOPAQUE_ADMIN= # DEFAULT: /mnt/nopaque -# NOTES: +# NOTES: # - This must be a network share and it must be available on all # Docker Swarm nodes, mounted to the same path with the same # user and group ownership