diff --git a/docker-compose.yml b/docker-compose.yml index 42b23852b7..77a503cff7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -232,15 +232,15 @@ services: - traefik.constraint-label-stack=appwrite - traefik.docker.network=appwrite - traefik.http.services.appwrite_console.loadbalancer.server.port=3000 - - traefik.http.middlewares.appwrite_console_compat.redirectregex.regex=^(https?://[^/]+)/console(?:/(.*))?$$ - - traefik.http.middlewares.appwrite_console_compat.redirectregex.replacement=$${1}/$${2} + - traefik.http.middlewares.appwrite_console_compat.redirectregex.regex=^(https?://[^/]+)/console(/.*|\?.*)?$$ + - traefik.http.middlewares.appwrite_console_compat.redirectregex.replacement=$${1}$${2} - traefik.http.middlewares.appwrite_console_compat.redirectregex.permanent=false - traefik.http.routers.appwrite_console_http.entrypoints=appwrite_web - - traefik.http.routers.appwrite_console_http.rule=(Host(`${_APP_DOMAIN:-localhost}`) || Host(`${_APP_CONSOLE_DOMAIN:-localhost}`)) && !PathPrefix(`/v1`) && !PathPrefix(`/.well-known`) + - traefik.http.routers.appwrite_console_http.rule=(Host(`${_APP_DOMAIN:-localhost}`) || Host(`${_APP_CONSOLE_DOMAIN:-localhost}`)) && !PathPrefix(`/v1`) && !PathPrefix(`/.well-known`) && !HeaderRegexp(`x-appwrite-hostname`, `.+`) - traefik.http.routers.appwrite_console_http.middlewares=appwrite_console_compat - traefik.http.routers.appwrite_console_http.service=appwrite_console - traefik.http.routers.appwrite_console_https.entrypoints=appwrite_websecure - - traefik.http.routers.appwrite_console_https.rule=(Host(`${_APP_DOMAIN:-localhost}`) || Host(`${_APP_CONSOLE_DOMAIN:-localhost}`)) && !PathPrefix(`/v1`) && !PathPrefix(`/.well-known`) + - traefik.http.routers.appwrite_console_https.rule=(Host(`${_APP_DOMAIN:-localhost}`) || Host(`${_APP_CONSOLE_DOMAIN:-localhost}`)) && !PathPrefix(`/v1`) && !PathPrefix(`/.well-known`) && !HeaderRegexp(`x-appwrite-hostname`, `.+`) - traefik.http.routers.appwrite_console_https.middlewares=appwrite_console_compat - traefik.http.routers.appwrite_console_https.service=appwrite_console - traefik.http.routers.appwrite_console_https.tls=true diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 925b040a7d..68331ae47f 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -194,6 +194,6 @@ final class HTTPTest extends Scope $response = $this->client->call(Client::METHOD_GET, '/'); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertStringContainsString('text/html', $response['headers']['content-type']); + $this->assertStringContainsString('text/html', (string) $response['headers']['content-type']); } } diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index cd2ef30d50..0440d7afb7 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -2214,7 +2214,7 @@ final class SitesCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $deploymentDomain); $response = $proxyClient->call(Client::METHOD_GET, '/', followRedirects: false); $this->assertEquals(301, $response['headers']['status-code']); - $this->assertStringContainsString('/console/auth/preview', (string) $response['headers']['location']); + $this->assertStringContainsString('/auth/preview', (string) $response['headers']['location']); $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 0); $apiKey = $jwtObj->encode([ @@ -2546,7 +2546,7 @@ final class SitesCustomServerTest extends Scope $response = $proxyClient->call(Client::METHOD_GET, '/contact', followRedirects: false); $this->assertEquals(301, $response['headers']['status-code']); - $this->assertStringContainsString('/console/auth/preview', (string) $response['headers']['location']); + $this->assertStringContainsString('/auth/preview', (string) $response['headers']['location']); $this->assertStringContainsString('projectId=' . $this->getProject()['$id'], (string) $response['headers']['location']); $this->assertStringContainsString('origin=', (string) $response['headers']['location']); $this->assertStringContainsString('path=%2Fcontact', (string) $response['headers']['location']); @@ -2609,7 +2609,7 @@ final class SitesCustomServerTest extends Scope 'cookie' => 'a_jwt_console=' . $jwt['body']['jwt'] ], followRedirects: false); $this->assertEquals(301, $response['headers']['status-code']); - $this->assertStringContainsString('/console/auth/preview', (string) $response['headers']['location']); + $this->assertStringContainsString('/auth/preview', (string) $response['headers']['location']); // Failure: User missing $cookie = 'a_session_console=' .$this->getRoot()['session']; @@ -2644,7 +2644,7 @@ final class SitesCustomServerTest extends Scope 'cookie' => 'a_jwt_console=' . $jwt['body']['jwt'] ], followRedirects: false); $this->assertEquals(301, $response['headers']['status-code']); - $this->assertStringContainsString('/console/auth/preview', (string) $response['headers']['location']); + $this->assertStringContainsString('/auth/preview', (string) $response['headers']['location']); // Failure: Membership missing $email = \uniqid() . 'newuser@appwrite.io'; @@ -2684,7 +2684,7 @@ final class SitesCustomServerTest extends Scope 'cookie' => 'a_jwt_console=' . $jwt['body']['jwt'] ], followRedirects: false); $this->assertEquals(301, $response['headers']['status-code']); - $this->assertStringContainsString('/console/auth/preview', (string) $response['headers']['location']); + $this->assertStringContainsString('/auth/preview', (string) $response['headers']['location']); $this->cleanupSite($siteId); }