Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add Docker Registry and Images functionality #4187

Draft
wants to merge 61 commits into
base: next
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b57a439
chore: add registry auth to docker image apps
Nov 8, 2024
15653e6
chore: added registry url with default plus fixed functionality
Nov 8, 2024
5a1431c
chore: remove encrypting token since it should be editable and visibl…
Nov 8, 2024
5187324
fix: revert change
Nov 8, 2024
3130b44
fix: revert some more for less confusion
Nov 8, 2024
60d6189
Merge remote-tracking branch 'upstream/next' into docker-image-login
Nov 8, 2024
02d29d9
chore: info tooltip
Nov 8, 2024
ebf2072
chore: encrypt with casts + masking and interpolation + fixes
Nov 9, 2024
9d08eed
chore: small improvement
Nov 10, 2024
3cd185a
chore: changed migrations, created registries, initial progress
Nov 11, 2024
42de7ec
chore: database, navigation images
Nov 11, 2024
1fd8737
fix: navbar link color
Nov 11, 2024
653d0f3
Merge remote-tracking branch 'upstream/next' into docker-image-login
Nov 11, 2024
65eb856
chore: looks and validation
Nov 11, 2024
8787a9b
Merge branch 'next' into docker-image-login
peaklabs-dev Nov 14, 2024
063d420
chore: svg + new validations
Nov 18, 2024
80b5f92
Merge branch 'docker-image-login' of github.com:OSINTRoach/coolify in…
Nov 18, 2024
b7e00ce
Merge remote-tracking branch 'upstream/next' into docker-image-login
Nov 18, 2024
0e2820f
chore: dockerRegistry
Nov 28, 2024
9e1a78e
Merge branch 'next' into docker-image-login
OSINTRoach Nov 28, 2024
4f7631c
chore: Images
Nov 29, 2024
5167bbd
Merge branch 'docker-image-login' of github.com:OSINTRoach/coolify in…
Nov 29, 2024
557cd55
chore: add list docker images
Dec 3, 2024
03bfcfb
Merge branch 'docker-image-login-davidh' into docker-image-login
Dec 3, 2024
e75f704
Merge branch 'next' into docker-image-login
OSINTRoach Dec 3, 2024
0ff0cad
chore: progress select multiple registries
Dec 3, 2024
f1873ef
Merge branch 'docker-image-login' into budaydev
Dec 3, 2024
08d46bc
chore: multi select on dockerimage build
Dec 3, 2024
0308d36
chore: unique
Dec 3, 2024
37f9266
chore: small fix
Dec 3, 2024
8c32dda
Merge pull request #1 from OSINTRoach/budaydev
OSINTRoach Dec 3, 2024
885d852
chore: fillable bug solved
Dec 4, 2024
9e8cbca
Merge branch 'budaydev' into docker-image-login
Dec 4, 2024
40bf9e2
refactor: list docker images
Dec 5, 2024
8cab528
chore: add get_server_dcoker_image_details
Dec 5, 2024
6a16e71
chore: add container count to image details
Dec 5, 2024
20fcd43
chore: add delete_all_dangling_server_docker_images
Dec 5, 2024
80cedee
Merge remote-tracking branch 'origin/docker-image-login-davidh' into …
Dec 5, 2024
d529f8f
Merge branch 'next' into docker-image-login
peaklabs-dev Dec 6, 2024
dab2290
chore: add delete_server_docker_image
Dec 6, 2024
07c545a
chore: images page in progress
Dec 9, 2024
e7ac684
chore: revert
Dec 9, 2024
fad2b04
refactor: delete_server_docker_image
Dec 10, 2024
f8cff8c
refactor: ListServerDockerImages
Dec 11, 2024
0483f98
refactor: GetServerDockerImageDetails
Dec 11, 2024
58357b1
refactor: ListServerDockerImages
Dec 11, 2024
98e1b54
refactor: ListServerDockerImages
Dec 17, 2024
5e2f4de
refactor: ListServerDockerImages
Dec 19, 2024
c3ae14d
chore: red
Dec 19, 2024
710db04
Merge remote-tracking branch 'upstream/next' into docker-image-login
Dec 19, 2024
e67280d
Merge branch 'docker-image-login-davidh' into docker-image-login
Dec 19, 2024
3879c5a
Merge branch 'docker-image-login' into budaydev
Dec 19, 2024
5c2cf9f
chore: list and details progress
Dec 23, 2024
5f45d68
Merge branch 'next' into docker-image-login
peaklabs-dev Dec 23, 2024
3aca806
chore: progress
Jan 2, 2025
2d43f1e
chore: progress
Jan 2, 2025
61ce6d4
Merge branch 'next' into docker-image-login
peaklabs-dev Jan 10, 2025
d67d9fc
chore: updating tags, progress on deletion and list, todo (applicatio…
Jan 16, 2025
6213924
Merge branch 'docker-image-login' of github.com:OSINTRoach/coolify in…
Jan 16, 2025
0580a51
Merge branch 'next' into docker-image-login
peaklabs-dev Jan 22, 2025
54d185c
Merge branch 'next' into docker-image-login
OSINTRoach Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Images
David Buday committed Nov 29, 2024
commit 4f7631c976a51a1abe56bfe0374da2c0e80a4fc7
4 changes: 3 additions & 1 deletion app/Jobs/ApplicationDeploymentJob.php
Original file line number Diff line number Diff line change
@@ -174,7 +174,9 @@ public function __construct(int $application_deployment_queue_id)
$this->build_pack = data_get($this->application, 'build_pack');
$this->build_args = collect([]);

$this->dockerRegistry = DockerRegistry::find($this->application->docker_registry_id);
if ($this->application->docker_registry_id) {
$this->dockerRegistry = DockerRegistry::find($this->application->docker_registry_id);
}

$this->application_deployment_queue_id = $application_deployment_queue_id;
$this->deployment_uuid = $this->application_deployment_queue->deployment_uuid;
Empty file.
54 changes: 54 additions & 0 deletions app/Livewire/Images/Images/Index.php
Original file line number Diff line number Diff line change
@@ -2,10 +2,64 @@

namespace App\Livewire\Images\Images;

use App\Models\Server;
use Illuminate\Database\Eloquent\Collection;
use Livewire\Component;

class Index extends Component
{
public string $selected_uuid = 'default';
public array $serverImages = [];
public Collection $servers;
public bool $isLoadingImages = false;

public function mount()
{
if (!auth()->user()->isAdmin()) {
abort(403);
}
$this->servers = Server::isReachable()->get();
}

//Zove se automatski kad se na fronti selecta server
public function updatedSelectedUuid()
{
$this->loadServerImages();
}

public function loadServerImages()
{
$this->isLoadingImages = true;

try {
if ($this->selected_uuid === 'default') {
dd('Please select a server.');
return;
}

$server = $this->servers->firstWhere('uuid', $this->selected_uuid);
if (!$server) {
dd('Server not found');
return;
}

// 1. Koristi instant_remote_process "docker images"
// 2. Parse output u $serverImages array
// 3. repository, tag, id, size, created_at

} catch (\Exception $e) {
dd("Error loading docker images: " . $e->getMessage());
} finally {
$this->isLoadingImages = false;
}
}
public function getImageDetails($imageId) {}

public function deleteImage($imageId) {}

public function pruneUnused() {}


public function render()
{
return view('livewire.images.images.index');
81 changes: 70 additions & 11 deletions resources/views/livewire/images/images/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,75 @@
<div>
<x-images.navbar />
<div class="flex gap-2">
<h2 class="pb-4">Images</h2>
<x-modal-input buttonTitle="+ Add" disabled title="New Image">
<livewire:security.private-key.create />
</x-modal-input>
<div class="space-y-4">
<x-images.navbar />

</div>
{{-- Images Tab Content --}}
<div x-show="$wire.activeTab === 'images'" x-cloak>
<div class="text-gray-500">
Image management coming soon...
<div class="flex items-center justify-between gap-2">
<div class="flex items-center gap-2">
<h2>Docker Images</h2>
<form class="flex items-center gap-2" wire:submit="loadServerImages">
<x-forms.select id="server" required wire:model.live="selected_uuid">
@foreach ($servers as $server)
@if ($loop->first)
<option disabled value="default">Select a server</option>
@endif
<option value="{{ $server->uuid }}">{{ $server->name }}</option>
@endforeach
</x-forms.select>
<x-forms.button type="submit" wire:loading.attr="disabled">
<span wire:loading.remove wire:target="loadServerImages">Refresh</span>
<span wire:loading wire:target="loadServerImages">Loading...</span>
</x-forms.button>
</form>
</div>
</div>

<div class="space-y-4">
<div wire:loading.block wire:target="loadServerImages" class="text-center py-4">
<x-loading text="Loading images..." />
</div>

<div wire:loading.remove wire:target="loadServerImages">
@if ($selected_uuid !== 'default')
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead>
<tr>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Repository</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Tag</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Image ID</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
{{-- TODO: Implement image listing logic --}}
{{-- Example row structure:
<tr class="hover:bg-gray-50 dark:hover:bg-gray-800">
<td class="px-6 py-4 whitespace-nowrap">repository_name</td>
<td class="px-6 py-4 whitespace-nowrap">tag</td>
<td class="px-6 py-4 whitespace-nowrap font-mono text-sm">image_id</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex gap-2">
<x-forms.button>Details</x-forms.button>
</div>
</td>
</tr>
--}}
</tbody>
</table>
</div>
@else
<div class="text-center py-4 text-gray-500">
Please select a server to view images
</div>
@endif
</div>
</div>
</div>
</div>