fix: read Coolify config via config() (env() unreliable with config:cache + Octane)
This commit is contained in:
@@ -83,8 +83,8 @@ class CompanyProvisioner
|
|||||||
|
|
||||||
// Add subdomain to Coolify FQDN list + trigger redeploy.
|
// Add subdomain to Coolify FQDN list + trigger redeploy.
|
||||||
$deployTriggered = false;
|
$deployTriggered = false;
|
||||||
if ($this->coolify->isConfigured() && env('COOLIFY_APP_UUID')) {
|
$appUuid = (string) config('services.coolify.app_uuid');
|
||||||
$appUuid = (string) env('COOLIFY_APP_UUID');
|
if ($this->coolify->isConfigured() && $appUuid !== '') {
|
||||||
$url = $company->url('');
|
$url = $company->url('');
|
||||||
$url = rtrim($url, '/') . ':8000'; // internal port suffix Coolify expects
|
$url = rtrim($url, '/') . ':8000'; // internal port suffix Coolify expects
|
||||||
if ($this->coolify->addDomain($appUuid, $url)) {
|
if ($this->coolify->addDomain($appUuid, $url)) {
|
||||||
|
|||||||
@@ -20,8 +20,10 @@ class CoolifyClient
|
|||||||
protected ?string $base = null,
|
protected ?string $base = null,
|
||||||
protected ?string $token = null,
|
protected ?string $token = null,
|
||||||
) {
|
) {
|
||||||
$this->base = rtrim($base ?? (string) env('COOLIFY_API_URL'), '/');
|
// Use config() not env() — env() returns null when config is cached
|
||||||
$this->token = $token ?? (string) env('COOLIFY_API_TOKEN');
|
// in production. Octane workers also cache env at boot.
|
||||||
|
$this->base = rtrim($base ?? (string) config('services.coolify.url'), '/');
|
||||||
|
$this->token = $token ?? (string) config('services.coolify.token');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isConfigured(): bool
|
public function isConfigured(): bool
|
||||||
|
|||||||
@@ -35,4 +35,10 @@ return [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'coolify' => [
|
||||||
|
'url' => env('COOLIFY_API_URL'),
|
||||||
|
'token' => env('COOLIFY_API_TOKEN'),
|
||||||
|
'app_uuid' => env('COOLIFY_APP_UUID'),
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user