fix: realtime connection?!
This commit is contained in:
@@ -36,6 +36,7 @@ class Init extends Command
|
||||
}
|
||||
$this->cleanup_in_progress_application_deployments();
|
||||
$this->cleanup_stucked_helper_containers();
|
||||
setup_dynamic_configuration();
|
||||
}
|
||||
private function cleanup_stucked_helper_containers()
|
||||
{
|
||||
|
||||
@@ -93,6 +93,14 @@ class Configuration extends Component
|
||||
'service' => 'coolify',
|
||||
'rule' => "Host(`{$host}`)",
|
||||
],
|
||||
'coolify-realtime-ws' =>
|
||||
[
|
||||
'entryPoints' => [
|
||||
0 => 'http',
|
||||
],
|
||||
'service' => 'coolify-realtime',
|
||||
'rule' => "Host(`{$host}`) && PathPrefix(`/realtime/`)",
|
||||
],
|
||||
],
|
||||
'services' =>
|
||||
[
|
||||
@@ -109,6 +117,19 @@ class Configuration extends Component
|
||||
],
|
||||
],
|
||||
],
|
||||
'coolify-realtime' =>
|
||||
[
|
||||
'loadBalancer' =>
|
||||
[
|
||||
'servers' =>
|
||||
[
|
||||
0 =>
|
||||
[
|
||||
'url' => 'http://coolify-realtime:6001',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -117,6 +138,9 @@ class Configuration extends Component
|
||||
$traefik_dynamic_conf['http']['routers']['coolify-http']['middlewares'] = [
|
||||
0 => 'redirect-to-https@docker',
|
||||
];
|
||||
$traefik_dynamic_conf['http']['routers']['coolify-realtime-wss']['middlewares'] = [
|
||||
0 => 'redirect-to-https@docker',
|
||||
];
|
||||
$traefik_dynamic_conf['http']['routers']['coolify-https'] = [
|
||||
'entryPoints' => [
|
||||
0 => 'https',
|
||||
@@ -127,6 +151,16 @@ class Configuration extends Component
|
||||
'certresolver' => 'letsencrypt',
|
||||
],
|
||||
];
|
||||
$traefik_dynamic_conf['http']['routers']['coolify-realtime-wss'] = [
|
||||
'entryPoints' => [
|
||||
0 => 'https',
|
||||
],
|
||||
'service' => 'coolify-realtime',
|
||||
'rule' => "Host(`{$host}`) && PathPrefix(`/realtime/`)",
|
||||
'tls' => [
|
||||
'certresolver' => 'letsencrypt',
|
||||
],
|
||||
];
|
||||
}
|
||||
$this->save_configuration_to_disk($traefik_dynamic_conf, $file);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Notifications\Channels\SendsEmail;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Spatie\Url\Url;
|
||||
|
||||
class InstanceSettings extends Model implements SendsEmail
|
||||
@@ -30,6 +31,18 @@ class InstanceSettings extends Model implements SendsEmail
|
||||
}
|
||||
);
|
||||
}
|
||||
public static function realtimePort() {
|
||||
$envDefined = env('PUSHER_PORT');
|
||||
if ($envDefined != '6001') {
|
||||
return $envDefined;
|
||||
}
|
||||
$url = Url::fromString(Request::getSchemeAndHttpHost());
|
||||
if ($url->getScheme() === 'https') {
|
||||
return 443;
|
||||
} else {
|
||||
return 6001;
|
||||
}
|
||||
}
|
||||
public static function get()
|
||||
{
|
||||
return InstanceSettings::findOrFail(0);
|
||||
|
||||
Reference in New Issue
Block a user