From eb88a3a5f518c6ac5468da4b2c1dd7edbeea77b2 Mon Sep 17 00:00:00 2001 From: Mike Little Date: Tue, 17 Dec 2024 15:54:42 +0000 Subject: [PATCH] Adjust the Regex If the hyphen is the last in the character class it does not need to be escaped. --- inc/composer/class-docker-compose-generator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/composer/class-docker-compose-generator.php b/inc/composer/class-docker-compose-generator.php index 4242161..7257c36 100644 --- a/inc/composer/class-docker-compose-generator.php +++ b/inc/composer/class-docker-compose-generator.php @@ -372,7 +372,7 @@ protected function get_service_nginx() : array { 'traefik.port=8080', 'traefik.protocol=https', 'traefik.docker.network=proxy', - "traefik.frontend.rule=HostRegexp:{$this->hostname},{subdomain:[A-Za-z0-9-_]+}.{$this->hostname}{$domains}", + "traefik.frontend.rule=HostRegexp:{$this->hostname},{subdomain:[A-Za-z0-9.-]+}.{$this->hostname}{$domains}", "traefik.domain={$this->hostname},*.{$this->hostname}{$domains}", ], 'environment' => [ @@ -643,7 +643,7 @@ protected function get_service_s3() : array { 'traefik.client.port=9000', 'traefik.client.protocol=http', 'traefik.client.frontend.passHostHeader=false', - "traefik.client.frontend.rule=HostRegexp:{$this->hostname},{subdomain:[A-Za-z0-9-_]+}.{$this->hostname},s3-{$this->hostname},localhost,s3-{$this->project_name}.localhost;PathPrefix:/uploads;AddPrefix:/{$this->bucket_name}", + "traefik.client.frontend.rule=HostRegexp:{$this->hostname},{subdomain:[A-Za-z0-9.-]+}.{$this->hostname},s3-{$this->hostname},localhost,s3-{$this->project_name}.localhost;PathPrefix:/uploads;AddPrefix:/{$this->bucket_name}", "traefik.domain=s3-{$this->hostname},s3-console-{$this->hostname}", ], ], @@ -688,7 +688,7 @@ protected function get_service_tachyon() : array { 'traefik.port=8080', 'traefik.protocol=http', 'traefik.docker.network=proxy', - "traefik.frontend.rule=HostRegexp:{$this->hostname},{subdomain:[A-Za-z0-9-_]+}.{$this->hostname};PathPrefix:/tachyon;ReplacePathRegex:^/tachyon/(.*) /uploads/$$1", + "traefik.frontend.rule=HostRegexp:{$this->hostname},{subdomain:[A-Za-z0-9.-]+}.{$this->hostname};PathPrefix:/tachyon;ReplacePathRegex:^/tachyon/(.*) /uploads/$$1", ], 'environment' => [ 'AWS_REGION' => 'us-east-1',