From cbca1a059c330020ffaabf46d05888ca463449c2 Mon Sep 17 00:00:00 2001 From: Oliver Christen Date: Wed, 16 Aug 2023 16:27:47 +0200 Subject: [PATCH 1/3] Added environment variables allowing to disable haproxy logging and overwrite the logging options. --- doc/integrator/docker.rst | 3 +++ docker/config/haproxy/haproxy.cfg.tmpl | 6 ++---- .../create/{{cookiecutter.project}}/docker-compose-lib.yaml | 2 ++ .../scaffolds/create/{{cookiecutter.project}}/env.default | 5 +++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/integrator/docker.rst b/doc/integrator/docker.rst index 74b49ddd06..d2c62bc23a 100644 --- a/doc/integrator/docker.rst +++ b/doc/integrator/docker.rst @@ -170,6 +170,9 @@ Config: * ``TILECLOUDCHAIN_INTERNAL_URL``: Used by the print in non mutualize mode. * ``ST_JOIN``: Can be ``ST_Collect`` (default) or ``ST_Union``, ``ST_Collect`` is better for performance but does not support restriction area intersection. + * ``DISABLE_HAPROXY_LOGGING``: Set to # to disable haproxy logging. By default haproxy redirect logs to the + host /dev/log socket and they are visible with journalctl + * ``HAPROXY_LOGGING_OPTIONS``: Allow to overwrite or add new logging options to haproxy. Geoportal: diff --git a/docker/config/haproxy/haproxy.cfg.tmpl b/docker/config/haproxy/haproxy.cfg.tmpl index f029a5927b..6d0183375d 100644 --- a/docker/config/haproxy/haproxy.cfg.tmpl +++ b/docker/config/haproxy/haproxy.cfg.tmpl @@ -1,5 +1,5 @@ global - log /dev/log local2 + ${DISABLE_HAPROXY_LOGGING}log /dev/log local2 maxconn 4000 max-spread-checks 500 #ms between heathchecks of different services tune.ssl.default-dh-param 2048 # remove warning @@ -13,9 +13,7 @@ resolvers dns defaults mode http - log global - option httplog - option dontlognull + ${HAPROXY_LOGGING_OPTIONS} option http-server-close option forwardfor except 127.0.0.0/8 option redispatch diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml index 347f3332a5..64e1cf9b80 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml @@ -65,6 +65,8 @@ services: - AZURE_STORAGE_SAS_TOKEN - TILEGENERATION_AZURE_CONTAINER - RASTER_BASE_PATH + - DISABLE_HAPROXY_LOGGING + - HAPROXY_LOGGING_OPTIONS print: image: camptocamp/mapfish_print:3.30 diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/env.default b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/env.default index 36755ed415..3da893d4b1 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/env.default +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/env.default @@ -30,6 +30,11 @@ DISABLE_LOCAL= # For backward compatibility DISABLE_MUTUALIZED_PRINT=# DISABLE_LOCAL_PRINT= +# Set DISABLE_HAPROXY_LOGGING to # to disable logging +DISABLE_HAPROXY_LOGGING= +HAPROXY_LOGGING_OPTIONS="log global + option httplog + option dontlognull" GEOPORTAL_INTERNAL_URL=http://geoportal:8080 GEOPORTAL_INTERNAL_HOST=geoportal From bd6a04714a40168476e892d23e8065a8c4e3b5c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:33:32 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/integrator/docker.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/integrator/docker.rst b/doc/integrator/docker.rst index d2c62bc23a..20d05d0eff 100644 --- a/doc/integrator/docker.rst +++ b/doc/integrator/docker.rst @@ -170,7 +170,7 @@ Config: * ``TILECLOUDCHAIN_INTERNAL_URL``: Used by the print in non mutualize mode. * ``ST_JOIN``: Can be ``ST_Collect`` (default) or ``ST_Union``, ``ST_Collect`` is better for performance but does not support restriction area intersection. - * ``DISABLE_HAPROXY_LOGGING``: Set to # to disable haproxy logging. By default haproxy redirect logs to the + * ``DISABLE_HAPROXY_LOGGING``: Set to # to disable haproxy logging. By default haproxy redirect logs to the host /dev/log socket and they are visible with journalctl * ``HAPROXY_LOGGING_OPTIONS``: Allow to overwrite or add new logging options to haproxy. From f9babf79256b982b2554b541601d0be29d730824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 17 Aug 2023 17:54:01 +0200 Subject: [PATCH 3/3] Requires docker-compose>=1.26.0 --- .github/workflows/main.yaml | 2 +- doc/integrator/requirements.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0ae8b00913..b603bdc3f8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -135,7 +135,7 @@ jobs: python-version: '3.7' # When we upgrade this we should also upgrade the requirements # in the documentation: doc/integrator/requirements.rst - - run: pip install --user PyYAML==3.13 docker-compose==1.25.0 urllib3==1.26.15 + - run: pip install --user PyYAML==3.13 docker-compose==1.26.0 urllib3==1.26.15 # Test App - run: ci/test-app diff --git a/doc/integrator/requirements.rst b/doc/integrator/requirements.rst index 4ae866f164..47fbca04f3 100644 --- a/doc/integrator/requirements.rst +++ b/doc/integrator/requirements.rst @@ -17,7 +17,7 @@ Required Python packages ~~~~~~~~~~~~~~~~~~~~~~~~ * ``PyYAML>=3.12`` -* ``docker-compose>=1.25.0`` +* ``docker-compose>=1.26.0`` They can be install in your user directory with: