From 97c3a9facff8d7676e228eacdc9e1c099afad476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Thu, 4 Jun 2026 10:11:58 +0200 Subject: [PATCH] :whale: Add improvements related to Docker and Podman compatibility (#10012) * :paperclip: Add tests for boolean parser coverage * :whale: Normalize boolean handling in nginx entrypoint * :whale: Quote boolean env vars in compose example (add Podman compatibility) * :fire: Remove deprecated and duplicated nginx.conf file for Storybook --- common/test/common_tests/schema_test.cljc | 17 ++++++++++++++ docker/images/docker-compose.yaml | 7 +++--- docker/images/files/nginx-entrypoint.sh | 13 ++++++++++- docker/images/nginx.storybook.conf | 27 ----------------------- 4 files changed, 33 insertions(+), 31 deletions(-) delete mode 100644 docker/images/nginx.storybook.conf diff --git a/common/test/common_tests/schema_test.cljc b/common/test/common_tests/schema_test.cljc index 6206d5d38b..b94d4ae4a4 100644 --- a/common/test/common_tests/schema_test.cljc +++ b/common/test/common_tests/schema_test.cljc @@ -171,3 +171,20 @@ (t/is (= candidate-2 (encode-j expected))))) +(t/deftest test-boolean + (let [decode-s (sm/decoder ::sm/boolean sm/string-transformer)] + (t/is (= true (decode-s "true"))) + (t/is (= true (decode-s "True"))) + (t/is (= true (decode-s "TrUe"))) + (t/is (= true (decode-s "TRUE"))) + (t/is (= false (decode-s "false"))) + (t/is (= false (decode-s "False"))) + (t/is (= false (decode-s "fAlSe"))) + (t/is (= false (decode-s "FALSE"))) + + (t/is (= true (decode-s "T"))) + (t/is (= false (decode-s "F"))) + (t/is (= true (decode-s "t"))) + (t/is (= false (decode-s "f"))) + (t/is (= true (decode-s "1"))) + (t/is (= false (decode-s "0"))))) diff --git a/docker/images/docker-compose.yaml b/docker/images/docker-compose.yaml index cd5c9bf113..f6979e5e43 100644 --- a/docker/images/docker-compose.yaml +++ b/docker/images/docker-compose.yaml @@ -109,6 +109,7 @@ services: << : [*penpot-flags, *penpot-http-body-size, *penpot-public-uri] # Set to "true" on hosts where IPv6 is disabled at kernel boot level. # PENPOT_DISABLE_IPV6_LISTEN: "true" + penpot-backend: image: "penpotapp/backend:${PENPOT_VERSION:-2.15}" restart: always @@ -161,7 +162,7 @@ services: ## based on real scenarios. If you want to help us, please leave it enabled. You can ## audit what data we send with the code available on github. - PENPOT_TELEMETRY_ENABLED: true + PENPOT_TELEMETRY_ENABLED: "true" PENPOT_TELEMETRY_REFERER: compose ## Example SMTP/Email configuration. By default, emails are sent to the mailcatch @@ -175,8 +176,8 @@ services: PENPOT_SMTP_PORT: 1025 PENPOT_SMTP_USERNAME: PENPOT_SMTP_PASSWORD: - PENPOT_SMTP_TLS: false - PENPOT_SMTP_SSL: false + PENPOT_SMTP_TLS: "false" + PENPOT_SMTP_SSL: "false" penpot-mcp: image: "penpotapp/mcp:${PENPOT_VERSION:-2.15}" diff --git a/docker/images/files/nginx-entrypoint.sh b/docker/images/files/nginx-entrypoint.sh index 813d587199..999e14ad3f 100644 --- a/docker/images/files/nginx-entrypoint.sh +++ b/docker/images/files/nginx-entrypoint.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash +is_truthy() { + local value="${1,,}" + [[ "$value" == "true" || "$value" == "t" || "$value" == "1" ]] +} + +is_falsy() { + local value="${1,,}" + [[ "$value" == "false" || "$value" == "f" || "$value" == "0" ]] +} + + ######################################### ## Air Gapped config ######################################### @@ -45,7 +56,7 @@ export PENPOT_EXPORTER_URI=${PENPOT_EXPORTER_URI:-http://penpot-exporter:6061} export PENPOT_NITRATE_URI=${PENPOT_NITRATE_URI:-http://penpot-nitrate:3000} export PENPOT_HTTP_SERVER_MAX_BODY_SIZE=${PENPOT_HTTP_SERVER_MAX_BODY_SIZE:-367001600} # Default to 350MiB export PENPOT_IPV6_LISTEN_DIRECTIVE=${PENPOT_IPV6_LISTEN_DIRECTIVE:-"listen [::]:8080 default_server reuseport backlog=16384;"} -if [ "${PENPOT_DISABLE_IPV6_LISTEN}" = "true" ]; then +if is_truthy "${PENPOT_DISABLE_IPV6_LISTEN:-}"; then export PENPOT_IPV6_LISTEN_DIRECTIVE="" fi envsubst "\$PENPOT_BACKEND_URI,\$PENPOT_EXPORTER_URI,\$PENPOT_NITRATE_URI,\$PENPOT_HTTP_SERVER_MAX_BODY_SIZE,\$PENPOT_IPV6_LISTEN_DIRECTIVE" \ diff --git a/docker/images/nginx.storybook.conf b/docker/images/nginx.storybook.conf deleted file mode 100644 index fb7106dc90..0000000000 --- a/docker/images/nginx.storybook.conf +++ /dev/null @@ -1,27 +0,0 @@ -server { - listen 8080 default_server; - server_name _; - - charset utf-8; - etag off; - - gzip on; - gzip_static on; - gzip_types text/plain text/css application/javascript application/json application/vnd.api+json application/xml application/x-javascript text/xml image/svg+xml; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_min_length 256; - gzip_vary on; - - error_log /dev/stderr; - access_log /dev/stdout; - - root /var/www; - index index.html; - - location / { - try_files $uri $uri/ /index.html; - } -}