Skip to content

Commit c9a52c5

Browse files
authored
Merge pull request coollabsio#3389 from coollabsio/next
v4.0.0-beta.333
2 parents bae9ea7 + 72f0118 commit c9a52c5

File tree

13 files changed

+449
-226
lines changed

13 files changed

+449
-226
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Special thanks to our biggest sponsors!
5454
* [Latitude](https://latitude.sh/?ref=coolify.io) - A cloud computing platform offering bare metal servers and cloud instances for developers and businesses.
5555
* [Brand Dev](https://brand.dev/?ref=coolify.io) - A web development agency specializing in creating custom digital experiences and brand identities.
5656
* [Jobscollider](https://jobscollider.com/remote-jobs?ref=coolify.io) - A job search platform connecting professionals with remote work opportunities across various industries.
57-
* [Hostinger](https://hostinger.com?ref=coolify.io) - A web hosting provider offering affordable hosting solutions, domain registration, and website building tools.
57+
* [Hostinger](https://www.hostinger.com/vps/coolify-hosting?ref=coolify.io) - A web hosting provider offering affordable hosting solutions, domain registration, and website building tools.
5858
* [Glueops](https://www.glueops.dev/?ref=coolify.io) - A DevOps consulting company providing infrastructure automation and cloud optimization services.
5959
* [Ubicloud](https://ubicloud.com/?ref=coolify.io) - An open-source alternative to hyperscale cloud providers, offering high-performance cloud computing services.
6060
* [Juxtdigital](https://juxtdigital.dev/?ref=coolify.io) - A digital agency offering web development, design, and digital marketing services for businesses.

app/Jobs/ServerCheckJob.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public function __construct(public Server $server) {}
4747

4848
public function middleware(): array
4949
{
50-
return [(new WithoutOverlapping($this->server->uuid))];
50+
return [(new WithoutOverlapping($this->server->id))];
5151
}
5252

5353
public function uniqueId(): int
5454
{
55-
return $this->server->uuid;
55+
return $this->server->id;
5656
}
5757

5858
public function handle()

app/Livewire/Boarding/Index.php

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public function mount()
7373
}
7474
$this->privateKeyName = generate_random_name();
7575
$this->remoteServerName = generate_random_name();
76+
$this->remoteServerPort = $this->remoteServerPort;
77+
$this->remoteServerUser = $this->remoteServerUser;
7678
if (isDev()) {
7779
$this->privateKey = '-----BEGIN OPENSSH PRIVATE KEY-----
7880
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
@@ -154,6 +156,7 @@ public function setServerType(string $type)
154156
$this->servers = Server::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get();
155157
if ($this->servers->count() > 0) {
156158
$this->selectedExistingServer = $this->servers->first()->id;
159+
$this->updateServerDetails();
157160
$this->currentState = 'select-existing-server';
158161

159162
return;
@@ -173,9 +176,18 @@ public function selectExistingServer()
173176
}
174177
$this->selectedExistingPrivateKey = $this->createdServer->privateKey->id;
175178
$this->serverPublicKey = $this->createdServer->privateKey->publicKey();
179+
$this->updateServerDetails();
176180
$this->currentState = 'validate-server';
177181
}
178182

183+
private function updateServerDetails()
184+
{
185+
if ($this->createdServer) {
186+
$this->remoteServerPort = $this->createdServer->port;
187+
$this->remoteServerUser = $this->createdServer->user;
188+
}
189+
}
190+
179191
public function getProxyType()
180192
{
181193
// Set Default Proxy Type
@@ -235,11 +247,12 @@ public function savePrivateKey()
235247
public function saveServer()
236248
{
237249
$this->validate([
238-
'remoteServerName' => 'required',
239-
'remoteServerHost' => 'required',
250+
'remoteServerName' => 'required|string',
251+
'remoteServerHost' => 'required|string',
240252
'remoteServerPort' => 'required|integer',
241-
'remoteServerUser' => 'required',
253+
'remoteServerUser' => 'required|string',
242254
]);
255+
243256
$this->privateKey = formatPrivateKey($this->privateKey);
244257
$foundServer = Server::whereIp($this->remoteServerHost)->first();
245258
if ($foundServer) {
@@ -277,9 +290,12 @@ public function validateServer()
277290
$this->createdServer->settings()->update([
278291
'is_reachable' => true,
279292
]);
293+
$this->serverReachable = true;
280294
} catch (\Throwable $e) {
281295
$this->serverReachable = false;
282-
$this->createdServer->delete();
296+
$this->createdServer->settings()->update([
297+
'is_reachable' => false,
298+
]);
283299

284300
return handleError(error: $e, livewire: $this);
285301
}
@@ -296,6 +312,10 @@ public function validateServer()
296312
]);
297313
$this->getProxyType();
298314
} catch (\Throwable $e) {
315+
$this->createdServer->settings()->update([
316+
'is_usable' => false,
317+
]);
318+
299319
return handleError(error: $e, livewire: $this);
300320
}
301321
}
@@ -349,6 +369,21 @@ public function showNewResource()
349369
);
350370
}
351371

372+
public function saveAndValidateServer()
373+
{
374+
$this->validate([
375+
'remoteServerPort' => 'required|integer|min:1|max:65535',
376+
'remoteServerUser' => 'required|string',
377+
]);
378+
379+
$this->createdServer->update([
380+
'port' => $this->remoteServerPort,
381+
'user' => $this->remoteServerUser,
382+
'timezone' => 'UTC',
383+
]);
384+
$this->validateServer();
385+
}
386+
352387
private function createNewPrivateKey()
353388
{
354389
$this->privateKeyName = generate_random_name();

app/Models/Server.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ protected static function booted()
112112
'proxy',
113113
];
114114

115+
protected $fillable = [
116+
'name',
117+
'ip',
118+
'port',
119+
'user',
120+
'description',
121+
'private_key_id',
122+
'team_id',
123+
];
124+
115125
protected $guarded = [];
116126

117127
public static function isReachable()

bootstrap/helpers/constants.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
'centos fedora rhel ol rocky amzn almalinux',
4747
'sles opensuse-leap opensuse-tumbleweed',
4848
'arch',
49+
'alpine',
4950
];
5051

5152
const SHARED_VARIABLE_TYPES = ['team', 'project', 'environment'];

config/sentry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// The release version of your application
99
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
10-
'release' => '4.0.0-beta.332',
10+
'release' => '4.0.0-beta.333',
1111
// When left empty or `null` the Laravel environment will be used
1212
'environment' => config('app.env'),
1313

config/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return '4.0.0-beta.332';
3+
return '4.0.0-beta.333';

0 commit comments

Comments
 (0)