Skip to content

Commit a34a7b6

Browse files
committed
Fix local setup and typo in loading user agent
1 parent 06dcbd1 commit a34a7b6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $cache = new RedisAdapter(/** Configuration here. */);
4343
// or
4444
$cache = new MemcachedAdapter(/** Configuration here. */);
4545

46-
$siteProvider->setCache($cache);
46+
$provider->setCache($cache);
4747
```
4848

4949
### LocalSiteProvider
@@ -86,7 +86,7 @@ The orch site provider loads sites and clusters from a remote orchestration http
8686
```env
8787
ORCH_TYPE="orchestration"
8888
ORCH_BASE_URL="https://orchestration.vanilladev.com"
89-
ORCH_TOKEN="SECRET_HERE"
89+
ORCH_SECRET="SECRET_HERE"
9090
# Optional hostname to force for orchestration (Force Proxy from localhost)
9191
ORCH_HOSTNAME="ORCH_HOSTNAME";
9292
# CSV of region IDs to accept sites from.
@@ -104,7 +104,7 @@ The orch site provider loads sites and clusters from a remote management-dashboa
104104
ORCH_TYPE="dashboard"
105105
ORCH_BASE_URL="https://management-dashboard.vanilladev.com"
106106
# JWT secret for management dashboard
107-
ORCH_TOKEN="SECRET_HERE"
107+
ORCH_SECRET="SECRET_HERE"
108108
# Optional hostname to force for management dashboard (Force Proxy from localhost)
109109
ORCH_HOSTNAME="ORCH_HOSTNAME";
110110
# CSV of region IDs to accept sites from.

src/LaravelProviderFactory.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function createLaravelConfigFromEnv(callable $envFunction): array
3838
self::ORCH_REGION_IDS => ["array"],
3939
],
4040
"local" => [
41-
self::ORCH_TYPE => ["required", "in:dashboard,orchestration"],
41+
self::ORCH_TYPE => ["required", "in:local"],
4242
self::ORCH_LOCAL_DIRECTORY_PATH => ["string", "required"],
4343
],
4444
default => throw new \Exception("Unknown orch type: $orchType"),
@@ -47,7 +47,7 @@ public static function createLaravelConfigFromEnv(callable $envFunction): array
4747
return [
4848
self::ORCH_TYPE => $orchType,
4949
self::ORCH_BASE_URL => $envFunction(self::ORCH_BASE_URL),
50-
self::ORCH_HOSTNAME => $envFunction(self::ORCH_HOSTNAME),
50+
self::ORCH_HOSTNAME => $envFunction(self::ORCH_HOSTNAME) ?: null,
5151
self::ORCH_SECRET => $envFunction(self::ORCH_SECRET),
5252
self::ORCH_REGION_IDS => array_filter(explode(",", $envFunction("ORCH_REGION_IDS", "")), "trim"),
5353
self::ORCH_USER_AGENT => $envFunction(self::ORCH_USER_AGENT),
@@ -69,7 +69,7 @@ public static function providerFromLaravelConfig(callable $configFunction): Site
6969
$orchHostname = $configFunction("orch." . self::ORCH_HOSTNAME);
7070
$secret = $configFunction("orch." . self::ORCH_SECRET);
7171
$regionIDs = $configFunction("orch." . self::ORCH_REGION_IDS);
72-
$userAgent = $configFunction("orch" . self::ORCH_USER_AGENT);
72+
$userAgent = $configFunction("orch." . self::ORCH_USER_AGENT);
7373

7474
$provider = match ($orchType) {
7575
"dashboard" => new Dashboard\DashboardSiteProvider(
@@ -80,6 +80,9 @@ public static function providerFromLaravelConfig(callable $configFunction): Site
8080
new Clients\OrchHttpClient($orchBaseUrl, $secret, $orchHostname),
8181
$regionIDs,
8282
),
83+
"local" => new Local\LocalSiteProvider(
84+
$configFunction("orch." . self::ORCH_LOCAL_DIRECTORY_PATH),
85+
),
8386
default => throw new \InvalidArgumentException("Unknown orch type: $orchType"),
8487
};
8588

0 commit comments

Comments
 (0)