Skip to content

Commit 25073fd

Browse files
authored
Switch to using vanilla.local instead of vanilla.localhost (#10)
1 parent ab96631 commit 25073fd

22 files changed

+33
-33
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ Notably the path to the site configs must be a readable directory to the PHP pro
6262
The local site provider works be reading php-based config files from a given directory. This reads all sites recognized by the `vnla docker` setup. For a site config to be recognized it must meet the following criteria
6363

6464
- The file has name matching one of the following patterns
65-
- `/*.php` - Becomes `*.vanilla.localhost`
66-
- `/vanilla.localhost/*.php` - Becomes `vanilla.localhost/*`
67-
- `/e2e-tests.vanilla.localhost/*.php` - Becomes `e2e-tests.vanilla.localhost/*`
65+
- `/*.php` - Becomes `*.vanilla.local`
66+
- `/vanilla.local/*.php` - Becomes `vanilla.local/*`
67+
- `/e2e-tests.vanilla.local/*.php` - Becomes `e2e-tests.vanilla.local/*`
6868
- The file contains a valid PHP configuration files.
6969
- The configuration contains the following values
7070
- `Vanilla.SiteID`

src/Local/LocalSiteProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,18 @@ private function domainForConfigPath(string $configPath): ?string
180180
{
181181
$configPath = str_replace($this->siteConfigFsBasePath, "", $configPath);
182182
if (preg_match("/^\\/config.php$/", $configPath)) {
183-
return "http://dev.vanilla.localhost";
184-
} elseif (preg_match("/^\\/vanilla\.localhost\\/(.*)\\.php$/", $configPath, $matches)) {
183+
return "http://dev.vanilla.local";
184+
} elseif (preg_match("/^\\/vanilla\.local\\/(.*)\\.php$/", $configPath, $matches)) {
185185
$nodeName = $matches[1];
186186

187-
return "http://vanilla.localhost/$nodeName";
188-
} elseif (preg_match("/^\\/e2e-tests\.vanilla\.localhost\\/(.*)\\.php$/", $configPath, $matches)) {
187+
return "http://vanilla.local/$nodeName";
188+
} elseif (preg_match("/^\\/e2e-tests\.vanilla\.local\\/(.*)\\.php$/", $configPath, $matches)) {
189189
$siteName = $matches[1];
190190

191-
return "http://e2e-tests.vanilla.localhost/$siteName";
191+
return "http://e2e-tests.vanilla.local/$siteName";
192192
} elseif (preg_match("/^\\/([^\/]+)\.php$/", $configPath, $matches)) {
193193
$siteName = $matches[1];
194-
return "http://{$siteName}.vanilla.localhost";
194+
return "http://{$siteName}.vanilla.local";
195195
}
196196

197197
return null;

src/Site.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getQueueServiceBaseUrl(): string
222222

223223
switch ($this->getCluster()->getRegionID()) {
224224
case Cluster::REGION_LOCALHOST:
225-
return "http://queue.vanilla.localhost";
225+
return "http://queue.vanilla.local";
226226
case Cluster::REGION_YUL1_DEV1:
227227
return "https://yul1-vanillaqueue-dev1.v-fabric.net";
228228
case Cluster::REGION_YUL1_PROD1:

tests/DashboardSitesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function setUp(): void
4444
*/
4545
public function siteProvider(): DashboardSiteProvider
4646
{
47-
$baseUrl = "https://dashboard.vanilla.localhost";
47+
$baseUrl = "https://dashboard.vanilla.local";
4848
$dashboardClient = new DashboardHttpClient($baseUrl, "tokenhere");
4949
if ($this->mockHandler === null) {
5050
$this->fail("Mock handler wasn't configured");

tests/LocalSitesTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ private function expectedSites(): array
4040
self::SID_CFG_PHP,
4141
100,
4242
"cl00000",
43-
"http://dev.vanilla.localhost",
43+
"http://dev.vanilla.local",
4444
$commonConfig,
4545
),
4646
self::SID_VALID => new ExpectedSite(
4747
self::SID_VALID,
4848
101,
4949
"cl00000",
50-
"http://vanilla.localhost/valid",
50+
"http://vanilla.local/valid",
5151
$commonConfig + [
5252
"SomeArr" => [3, 4, 5],
5353
"ClusterConfig.SomeKey" => "cluster1",
@@ -59,21 +59,21 @@ private function expectedSites(): array
5959
self::SID_NO_SYS_TOKEN,
6060
101,
6161
"cl00000",
62-
"http://vanilla.localhost/no-system-token",
62+
"http://vanilla.local/no-system-token",
6363
$commonConfig,
6464
))->expectNoSystemToken(),
6565
self::SID_E2E => new ExpectedSite(
6666
self::SID_E2E,
6767
102,
6868
"cl00000",
69-
"http://e2e-tests.vanilla.localhost/site1",
69+
"http://e2e-tests.vanilla.local/site1",
7070
$commonConfig,
7171
),
7272
self::SID_OTHER_CLUSTER => new ExpectedSite(
7373
self::SID_OTHER_CLUSTER,
7474
105,
7575
"cl00001",
76-
"http://other-cluster.vanilla.localhost",
76+
"http://other-cluster.vanilla.local",
7777
$commonConfig + [
7878
"ClusterConfig.SomeKey" => "cluster2",
7979
],
@@ -82,17 +82,17 @@ private function expectedSites(): array
8282
self::SID_HUB,
8383
10000,
8484
"cl00000",
85-
"http://vanilla.localhost/hub",
85+
"http://vanilla.local/hub",
8686
$commonConfig + [],
87-
294952213, // crc32(vanilla.localhost)
87+
3913469086, // crc32(vanilla.local)
8888
),
8989
self::SID_NODE1 => new ExpectedSite(
9090
self::SID_NODE1,
9191
10000,
9292
"cl00000",
93-
"http://vanilla.localhost/node1",
93+
"http://vanilla.local/node1",
9494
$commonConfig + [],
95-
294952213, // crc32(vanilla.localhost)
95+
3913469086, // crc32(vanilla.local)
9696
),
9797
];
9898
}
@@ -166,9 +166,9 @@ public function testSerializeSite(): void
166166
$expected = <<<JSON
167167
{
168168
"siteID": 101,
169-
"baseUrl": "http:\/\/vanilla.localhost\/valid",
169+
"baseUrl": "http:\/\/vanilla.local\/valid",
170170
"clusterID": "cl00000",
171-
"configPath": "\/vanilla.localhost\/valid.php"
171+
"configPath": "\/vanilla.local\/valid.php"
172172
}
173173
JSON;
174174

tests/OrchClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class OrchClientTest extends TestCase
2222
*/
2323
public function testForcedIpAddress()
2424
{
25-
$client = new OrchHttpClient("https://orch.vanilla.localhost", "secret");
25+
$client = new OrchHttpClient("https://orch.vanilla.local", "secret");
2626
$client->setHandler(new MockHttpHandler());
2727
$client->setThrowExceptions(false);
2828
$client->forceIpAddress("12.34.56.78");
2929

3030
$request = $client->get("/hello")->getRequest();
3131
$this->assertEquals("https://12.34.56.78/hello", $request->getUrl());
32-
$this->assertEquals("orch.vanilla.localhost", $request->getHeader("Host"));
32+
$this->assertEquals("orch.vanilla.local", $request->getHeader("Host"));
3333
}
3434
}

tests/OrchSitesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function setUp(): void
4242
*/
4343
public function siteProvider(): OrchSiteProvider
4444
{
45-
$baseUrl = "https://orch.vanilla.localhost";
45+
$baseUrl = "https://orch.vanilla.local";
4646
$orchClient = new OrchHttpClient($baseUrl, "tokenhere");
4747
if ($this->mockHandler === null) {
4848
$this->fail("Mock handler wasn't configured");

0 commit comments

Comments
 (0)