redirect to server show page if a gateway is not installed on a given server
This commit is contained in:
@@ -15,4 +15,8 @@ abstract class DatabaseDriver extends Driver
|
||||
?string $containerId = null,
|
||||
?array $credentials = null,
|
||||
);
|
||||
|
||||
abstract public function createUser(string $user, string $password): string;
|
||||
|
||||
// abstract public function createDatabase(string $db, string $user): string;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class Postgres17Driver extends DatabaseDriver
|
||||
}
|
||||
),
|
||||
new Step(
|
||||
name: 'Configure firewall',
|
||||
name: 'Configure firewall', // @todo this should create a Firewallrule
|
||||
script: 'ufw allow 5432/tcp || true',
|
||||
),
|
||||
]);
|
||||
@@ -69,4 +69,9 @@ class Postgres17Driver extends DatabaseDriver
|
||||
'db' => 'keystone',
|
||||
];
|
||||
}
|
||||
|
||||
public function createUser(string $user, string $password): string
|
||||
{
|
||||
return "psql -U {$this->credentials['user']} -d {$this->credentials['db']} -c \"CREATE USER {$user} WITH PASSWORD '{$password}';\"";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,13 @@ class EnvironmentController extends Controller
|
||||
return inertia('environments/Show', [
|
||||
'environment' => $environment,
|
||||
'servers' => inertia()->optional(function () use ($environment) {
|
||||
return $environment->application?->organisation?->servers->where('status', ServerStatus::ACTIVE)?->values() ?? [];
|
||||
return $environment
|
||||
->application
|
||||
?->organisation
|
||||
?->servers()
|
||||
->where('status', ServerStatus::ACTIVE)
|
||||
->with('services')
|
||||
->get() ?? [];
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user