fix: support host storage paths and clean up cancelled deployments

Allow validated host file and directory mounts outside resource directories
while protecting external paths from deletion.

Clean up cancelled deployment containers and clear tracked process IDs.
Preserve legacy KeyDB and Dragonfly password parsing, accept server backup
paths without extension restrictions, and allow Compose variable proxy ports.
This commit is contained in:
Andras Bacsai
2026-10-05 11:08:52 +02:00
parent 774e6bf178
commit 554bd354bf
94 changed files with 2922 additions and 357 deletions
+20
View File
@@ -3,6 +3,8 @@
namespace App\Models;
use App\Enums\GithubRunnerStatus;
use App\Jobs\DeregisterGithubRunnerJob;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class GithubRunnerExecution extends BaseModel
@@ -19,6 +21,7 @@ class GithubRunnerExecution extends BaseModel
'job_name',
'repository_full_name',
'labels',
'is_pull_request',
'runner_name',
'runner_id',
'conclusion',
@@ -39,6 +42,7 @@ class GithubRunnerExecution extends BaseModel
'runner_id' => 'integer',
'provision_attempts' => 'integer',
'labels' => 'array',
'is_pull_request' => 'boolean',
'queued_at' => 'datetime',
'ready_at' => 'datetime',
'started_at' => 'datetime',
@@ -61,6 +65,22 @@ class GithubRunnerExecution extends BaseModel
return $this->belongsTo(Server::class);
}
/**
* Deregistering the runners from GitHub is best effort and never blocks the deletion.
*
* @param Builder<GithubRunnerExecution> $query
*/
public static function deleteAndDeregister(Builder $query): void
{
(clone $query)
->whereIn('status', GithubRunnerStatus::occupying())
->whereNotNull('runner_id')
->get(['github_app_id', 'runner_id'])
->each(fn (GithubRunnerExecution $execution) => DeregisterGithubRunnerJob::dispatch($execution->github_app_id, $execution->runner_id));
(clone $query)->delete();
}
public function isActive(): bool
{
return $this->status->isActive();