Compare commits

...

4 commits

Author SHA1 Message Date
Diogo Carvalho
2563e2fda6
Merge 0164ad5c94 into 5b701ebb07 2026-03-09 19:38:04 +01:00
Andras Bacsai
5b701ebb07 refactor(application-source): use Laravel helpers for null checks
Some checks are pending
Staging Build / build-push (aarch64, linux/aarch64, ubuntu-24.04-arm) (push) Waiting to run
Staging Build / build-push (amd64, linux/amd64, ubuntu-24.04) (push) Waiting to run
Staging Build / merge-manifest (push) Blocked by required conditions
Replace is_null() and !is_null() with blank() and filled() helper functions
for better readability and Laravel idiomatic style.
2026-03-09 17:23:34 +01:00
Andras Bacsai
01aa534556 fix(application-source): support localhost key with id=0
Previously, the view checked $privateKeyId with ! operator, which
incorrectly treats 0 (localhost key) as falsy. Changed to explicit
is_null() checks to distinguish between null (no key) and 0 (localhost).
Added test coverage for both cases.
2026-03-09 17:20:33 +01:00
Diogo Carvalho
0164ad5c94 feat(service): add retroassembly 2026-02-24 20:21:50 +00:00
6 changed files with 90 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -28,7 +28,7 @@
<div class="pb-4">Code source of your application.</div>
<div class="flex flex-col gap-2">
@if (!$privateKeyId)
@if (blank($privateKeyId))
<div>Currently connected source: <span
class="font-bold text-warning">{{ data_get($application, 'source.name', 'No source connected') }}</span>
</div>
@ -44,7 +44,7 @@
</div>
</div>
@if ($privateKeyId)
@if (filled($privateKeyId))
<h3 class="pt-4">Deploy Key</h3>
<div class="py-2 pt-4">Currently attached Private Key: <span
class="dark:text-warning">{{ $privateKeyName }}</span>

View file

@ -0,0 +1,23 @@
# documentation: https://github.com/arianrhodsandlot/retroassembly
# slogan: The personal retro game collection cabinet in your browser.
# category: games
# tags: retroassembly, retro-games, arcade, self-hosted, gaming
# logo: svgs/retroassembly.png
# ports: 8000
services:
retroassembly:
image: 'arianrhodsandlot/retroassembly:v5.260124.0752'
environment:
- SERVICE_URL_RETROASSEMBLY_8000
volumes:
- 'retroassembly-data:/app/data'
healthcheck:
test:
- CMD-SHELL
- 'nc -z 127.0.0.1 8000'
interval: 10s
timeout: 5s
retries: 3
start_period: 90s

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,59 @@
<?php
use App\Livewire\Project\Application\Source;
use App\Models\Application;
use App\Models\Environment;
use App\Models\PrivateKey;
use App\Models\Project;
use App\Models\Team;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;
uses(RefreshDatabase::class);
beforeEach(function () {
$this->team = Team::factory()->create();
$this->user = User::factory()->create();
$this->team->members()->attach($this->user->id, ['role' => 'owner']);
$this->actingAs($this->user);
session(['currentTeam' => $this->team]);
$this->project = Project::factory()->create(['team_id' => $this->team->id]);
$this->environment = Environment::factory()->create(['project_id' => $this->project->id]);
});
describe('Application Source with localhost key (id=0)', function () {
test('renders deploy key section when private_key_id is 0', function () {
$privateKey = PrivateKey::create([
'id' => 0,
'name' => 'localhost',
'private_key' => 'test-key-content',
'team_id' => $this->team->id,
]);
$application = Application::factory()->create([
'environment_id' => $this->environment->id,
'private_key_id' => 0,
]);
Livewire::test(Source::class, ['application' => $application])
->assertSuccessful()
->assertSet('privateKeyId', 0)
->assertSee('Deploy Key');
});
test('shows no source connected section when private_key_id is null', function () {
$application = Application::factory()->create([
'environment_id' => $this->environment->id,
'private_key_id' => null,
]);
Livewire::test(Source::class, ['application' => $application])
->assertSuccessful()
->assertSet('privateKeyId', null)
->assertDontSee('Deploy Key')
->assertSee('No source connected');
});
});