diff --git a/.env b/.env index 487479a..8271caf 100644 --- a/.env +++ b/.env @@ -46,20 +46,20 @@ HTTP_CACHE_STALE_WHILE_REVALIDATE=60 # # 127.0.0.1 roadiz-skeleton.test roadiz-skeleton.local varnish.roadiz-skeleton.test varnish.roadiz-skeleton.local pma.roadiz-skeleton.test pma.roadiz-skeleton.local solr.roadiz-skeleton.test solr.roadiz-skeleton.local mail.roadiz-skeleton.test mail.roadiz-skeleton.local # -#HOSTNAME=`roadiz-skeleton.test`,`roadiz-skeleton.local` +#HOSTNAME=`^roadiz\-skeleton\.(test|local)$` # Default dev env use varnish -HOSTNAME_VARNISH=`roadiz-skeleton.test`,`roadiz-skeleton.local` +HOSTNAME_VARNISH=`^roadiz\-skeleton\.(test|local)$` # Use traefik path_prefix to host API and NuxtJS on the same domain -PATH_PREFIX=`/rz-admin`,`/files`,`/assets`,`/themes`,`/bundles`,`/api`,`/_wdt`,`/_profiler`,`/css/main-color.css`,`/custom-form`,`/css/login/image` +PATH_PREFIX=`(?i)^/(rz\-admin|files|assets|themes|bundles|api|_wdt|_profiler|css/main\-color\.css|custom\-form|css/login/image)` REDIRECT_REGEX=^(https?)://api\.roadiz\-skeleton\.test/(.*) ## Dollar char may be interpolated or not depending your system ## check docker inspect your container to see final label value REDIRECT_REPLACEMENT=$1://roadiz\-skeleton\.test/$2 -HOSTNAME_PMA=`pma.roadiz-skeleton.test`,`pma.roadiz-skeleton.local` -HOSTNAME_SOLR=`solr.roadiz-skeleton.test`,`solr.roadiz-skeleton.local` -HOSTNAME_MAILER=`mail.roadiz-skeleton.test`,`mail.roadiz-skeleton.local` +HOSTNAME_PMA=`^pma\.roadiz\-skeleton\.(test|local)$` +HOSTNAME_SOLR=`^solr\.roadiz\-skeleton\.(test|local)$` +HOSTNAME_MAILER=`^(mail|mailer)\.roadiz\-skeleton\.(test|local)$` ###> symfony/lock ### # Choose one of the stores below diff --git a/CHANGELOG.md b/CHANGELOG.md index b03f9db..093d034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to project will be documented in this file. +## [2.4.3](https://github.com/roadiz/skeleton/compare/v2.4.2...v2.4.3) - 2024-12-16 + +### Bug Fixes + +- Use `HostRegexp` and `PathRegexp` for Traefik v3 compatibility - ([b924d22](https://github.com/roadiz/skeleton/commit/b924d22ccc1b95412972a6c1ba58d056eedfa04f)) - Ambroise Maupate + ## [2.4.2](https://github.com/roadiz/skeleton/compare/v2.4.1...v2.4.2) - 2024-12-11 ### Bug Fixes diff --git a/compose.prod.yml b/compose.prod.yml index 4a42b6d..ab13759 100644 --- a/compose.prod.yml +++ b/compose.prod.yml @@ -46,8 +46,6 @@ services: - default labels: - "traefik.enable=true" - - "com.centurylinklabs.watchtower.enable=true" - - "com.centurylinklabs.watchtower.depends-on=/skeleton-nginx-1,/skeleton-worker-1,/skeleton-cron-1" # Traefik v2 ----------------------------------------------------- - "traefik.http.services.${APP_NAMESPACE}.loadbalancer.server.scheme=http" - "traefik.http.services.${APP_NAMESPACE}.loadbalancer.server.port=80" @@ -59,19 +57,19 @@ services: # - "traefik.http.services.${APP_NAMESPACE}.loadbalancer.healthcheck.headers.x-health-check=${APP_HEALTH_CHECK_TOKEN}" # Listen HTTP - "traefik.http.routers.${APP_NAMESPACE}.entrypoints=http" - # Always use higher priority for your API app with PathPrefix rule + # Always use higher priority for your API app with PathRegexp rule - "traefik.http.routers.${APP_NAMESPACE}.priority=11" - # Combine Host and PathPrefix to allow API and Frontend to share same domain name - - "traefik.http.routers.${APP_NAMESPACE}.rule=Host(${HOSTNAME}) && PathPrefix(${PATH_PREFIX})" + # Combine Host and PathRegexp to allow API and Frontend to share same domain name + - "traefik.http.routers.${APP_NAMESPACE}.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})" - "traefik.http.routers.${APP_NAMESPACE}.service=${APP_NAMESPACE}" # Listen HTTPS - "traefik.http.routers.${APP_NAMESPACE}_secure.entrypoints=https" - "traefik.http.routers.${APP_NAMESPACE}_secure.tls=true" - # Always use higher priority for your API app with PathPrefix rule + # Always use higher priority for your API app with PathRegexp rule - "traefik.http.routers.${APP_NAMESPACE}_secure.priority=11" - "traefik.http.routers.${APP_NAMESPACE}_secure.tls.certresolver=letsencrypt" - # Combine Host and PathPrefix to allow API and Frontend to share same domain name - - "traefik.http.routers.${APP_NAMESPACE}_secure.rule=Host(${HOSTNAME}) && PathPrefix(${PATH_PREFIX})" + # Combine Host and PathRegexp to allow API and Frontend to share same domain name + - "traefik.http.routers.${APP_NAMESPACE}_secure.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})" - "traefik.http.routers.${APP_NAMESPACE}_secure.service=${APP_NAMESPACE}" # # Apply middlewares @@ -106,9 +104,6 @@ services: #- ./robots.txt:/app/public/robots.txt:ro - app_file_data:/app/public/files:ro - app_assets_data:/app/public/assets:ro - labels: - - "com.centurylinklabs.watchtower.enable=true" - - "com.centurylinklabs.watchtower.depends-on=/skeleton-app-1" app: &app_template image: my-registry/roadiz_skeleton:latest @@ -133,9 +128,6 @@ services: APP_ENV: prod APP_RUNTIME_ENV: prod APP_DEBUG: 0 - labels: - - "com.centurylinklabs.watchtower.enable=true" - - "com.centurylinklabs.watchtower.depends-on=/skeleton-redis-1" worker: <<: *app_template diff --git a/compose.yml b/compose.yml index de5403a..b0a2688 100644 --- a/compose.yml +++ b/compose.yml @@ -38,12 +38,12 @@ services: - "traefik.http.services.${APP_NAMESPACE}_pma.loadbalancer.passhostheader=true" # Listen HTTP - "traefik.http.routers.${APP_NAMESPACE}_pma.entrypoints=http" - - "traefik.http.routers.${APP_NAMESPACE}_pma.rule=Host(${HOSTNAME_PMA})" + - "traefik.http.routers.${APP_NAMESPACE}_pma.rule=HostRegexp(${HOSTNAME_PMA})" - "traefik.http.routers.${APP_NAMESPACE}_pma.service=${APP_NAMESPACE}_pma" # Listen HTTPS - "traefik.http.routers.${APP_NAMESPACE}_pma_secure.entrypoints=https" - "traefik.http.routers.${APP_NAMESPACE}_pma_secure.tls=true" - - "traefik.http.routers.${APP_NAMESPACE}_pma_secure.rule=Host(${HOSTNAME_PMA})" + - "traefik.http.routers.${APP_NAMESPACE}_pma_secure.rule=HostRegexp(${HOSTNAME_PMA})" - "traefik.http.routers.${APP_NAMESPACE}_pma_secure.service=${APP_NAMESPACE}_pma" app: &app_template @@ -94,14 +94,14 @@ services: # #- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.healthcheck.headers.x-health-check=${APP_HEALTH_CHECK_TOKEN}" # # Listen HTTP # - "traefik.http.routers.${APP_NAMESPACE}.entrypoints=http" -# # Combine Host and PathPrefix to allow API and Frontend to share same domain name -# - "traefik.http.routers.${APP_NAMESPACE}.rule=Host(${HOSTNAME}) && PathPrefix(${PATH_PREFIX})" +# # Combine Host and PathRegexp to allow API and Frontend to share same domain name +# - "traefik.http.routers.${APP_NAMESPACE}.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})" # - "traefik.http.routers.${APP_NAMESPACE}.service=${APP_NAMESPACE}" # # Listen HTTPS # - "traefik.http.routers.${APP_NAMESPACE}_secure.entrypoints=https" # - "traefik.http.routers.${APP_NAMESPACE}_secure.tls=true" -# # Combine Host and PathPrefix to allow API and Frontend to share same domain name -# - "traefik.http.routers.${APP_NAMESPACE}_secure.rule=Host(${HOSTNAME}) && PathPrefix(${PATH_PREFIX})" +# # Combine Host and PathRegexp to allow API and Frontend to share same domain name +# - "traefik.http.routers.${APP_NAMESPACE}_secure.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})" # - "traefik.http.routers.${APP_NAMESPACE}_secure.service=${APP_NAMESPACE}" worker: @@ -148,12 +148,12 @@ services: - "traefik.http.services.${APP_NAMESPACE}_solr.loadbalancer.passhostheader=true" # Listen HTTP - "traefik.http.routers.${APP_NAMESPACE}_solr.entrypoints=http" - - "traefik.http.routers.${APP_NAMESPACE}_solr.rule=Host(${HOSTNAME_SOLR})" + - "traefik.http.routers.${APP_NAMESPACE}_solr.rule=HostRegexp(${HOSTNAME_SOLR})" - "traefik.http.routers.${APP_NAMESPACE}_solr.service=${APP_NAMESPACE}_solr" # Listen HTTPS - "traefik.http.routers.${APP_NAMESPACE}_solr_secure.entrypoints=https" - "traefik.http.routers.${APP_NAMESPACE}_solr_secure.tls=true" - - "traefik.http.routers.${APP_NAMESPACE}_solr_secure.rule=Host(${HOSTNAME_SOLR})" + - "traefik.http.routers.${APP_NAMESPACE}_solr_secure.rule=HostRegexp(${HOSTNAME_SOLR})" - "traefik.http.routers.${APP_NAMESPACE}_solr_secure.service=${APP_NAMESPACE}_solr" mailer: @@ -169,12 +169,12 @@ services: - "traefik.http.services.${APP_NAMESPACE}_mailer.loadbalancer.passhostheader=true" # Listen HTTP - "traefik.http.routers.${APP_NAMESPACE}_mailer.entrypoints=http" - - "traefik.http.routers.${APP_NAMESPACE}_mailer.rule=Host(${HOSTNAME_MAILER})" + - "traefik.http.routers.${APP_NAMESPACE}_mailer.rule=HostRegexp(${HOSTNAME_MAILER})" - "traefik.http.routers.${APP_NAMESPACE}_mailer.service=${APP_NAMESPACE}_mailer" # Listen HTTPS - "traefik.http.routers.${APP_NAMESPACE}_mailer_secure.entrypoints=https" - "traefik.http.routers.${APP_NAMESPACE}_mailer_secure.tls=true" - - "traefik.http.routers.${APP_NAMESPACE}_mailer_secure.rule=Host(${HOSTNAME_MAILER})" + - "traefik.http.routers.${APP_NAMESPACE}_mailer_secure.rule=HostRegexp(${HOSTNAME_MAILER})" - "traefik.http.routers.${APP_NAMESPACE}_mailer_secure.service=${APP_NAMESPACE}_mailer" # Use Redis for Cache, Messaging and Sessions @@ -221,14 +221,14 @@ services: #- "traefik.http.services.${APP_NAMESPACE}_varnish.loadbalancer.healthcheck.headers.x-health-check=${APP_HEALTH_CHECK_TOKEN}" # Listen HTTP - "traefik.http.routers.${APP_NAMESPACE}_varnish.entrypoints=http" - # Combine Host and PathPrefix to allow API and Frontend to share same domain name - - "traefik.http.routers.${APP_NAMESPACE}_varnish.rule=Host(${HOSTNAME_VARNISH}) && PathPrefix(${PATH_PREFIX})" + # Combine Host and PathRegexp to allow API and Frontend to share same domain name + - "traefik.http.routers.${APP_NAMESPACE}_varnish.rule=HostRegexp(${HOSTNAME_VARNISH}) && PathRegexp(${PATH_PREFIX})" - "traefik.http.routers.${APP_NAMESPACE}_varnish.service=${APP_NAMESPACE}_varnish" # Listen HTTPS - "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.entrypoints=https" - "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.tls=true" - # Combine Host and PathPrefix to allow API and Frontend to share same domain name - - "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.rule=Host(${HOSTNAME_VARNISH}) && PathPrefix(${PATH_PREFIX})" + # Combine Host and PathRegexp to allow API and Frontend to share same domain name + - "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.rule=HostRegexp(${HOSTNAME_VARNISH}) && PathRegexp(${PATH_PREFIX})" - "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.service=${APP_NAMESPACE}_varnish" networks: