Merge branch 'next' into vaultwarden-fix

This commit is contained in:
Evan
2024-05-27 17:45:00 +08:00
committed by GitHub
86 changed files with 1475 additions and 2302 deletions

View File

@@ -10,6 +10,7 @@ use Illuminate\Support\Collection;
use Spatie\Activitylog\Models\Activity;
use Illuminate\Support\Str;
use RuntimeException;
use Spatie\Url\Url;
use Symfony\Component\Yaml\Yaml;
use Visus\Cuid2\Cuid2;
@@ -213,6 +214,13 @@ class Application extends BaseModel
$git_repository = str_replace(['git@', ':', '.git'], ['', '/', ''], $this->git_repository);
return "https://{$git_repository}/commit/{$link}";
}
if (str($this->git_repository)->contains('bitbucket')) {
$git_repository = str_replace('.git', '', $this->git_repository);
$url = Url::fromString($git_repository);
$url = $url->withUserInfo('');
$url = $url->withPath($url->getPath() . '/commits/' . $link);
return $url->__toString();
}
return $this->git_repository;
}
public function dockerfileLocation(): Attribute

View File

@@ -525,7 +525,7 @@ $schema://$host {
// Reached max number of retries
if ($this->unreachable_notification_sent === false) {
ray('Server unreachable, sending notification...');
$this->team?->notify(new Unreachable($this));
// $this->team?->notify(new Unreachable($this));
$this->update(['unreachable_notification_sent' => true]);
}
if ($this->settings->is_reachable === true) {
@@ -825,7 +825,7 @@ $schema://$host {
'unreachable_count' => 0,
]);
if (data_get($server, 'unreachable_notification_sent') === true) {
$server->team?->notify(new Revived($server));
// $server->team?->notify(new Revived($server));
$server->update(['unreachable_notification_sent' => false]);
}
return ['uptime' => true, 'error' => null];
@@ -927,4 +927,7 @@ $schema://$host {
}
return $this->user !== 'root';
}
public function isBuildServer() {
return $this->settings->is_build_server;
}
}

View File

@@ -755,7 +755,7 @@ class Service extends BaseModel
return route('project.service.scheduled-tasks', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
'environment_name' => data_get($this, 'environment.name'),
'application_uuid' => data_get($this, 'uuid'),
'service_uuid' => data_get($this, 'uuid'),
'task_uuid' => $task_uuid
]);
}
@@ -763,7 +763,7 @@ class Service extends BaseModel
}
public function documentation()
{
$services = getServiceTemplates();
$services = get_service_templates();
$service = data_get($services, str($this->name)->beforeLast('-')->value, []);
return data_get($service, 'documentation', config('constants.docs.base_url'));
}

View File

@@ -40,6 +40,9 @@ class ServiceApplication extends BaseModel
{
return 'service';
}
public function workdir() {
return service_configuration_dir() . "/{$this->service->uuid}";
}
public function serviceType()
{
$found = str(collect(SPECIFIC_SERVICES)->filter(function ($service) {

View File

@@ -59,6 +59,9 @@ class ServiceDatabase extends BaseModel
}
return "{$realIp}:{$port}";
}
public function workdir() {
return service_configuration_dir() . "/{$this->service->uuid}";
}
public function service()
{
return $this->belongsTo(Service::class);