mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 16:17:10 +00:00
feat(storage): persist local images and unify clipboard copying
Add a private images disk with persistent container mounts and installation/upgrade setup, while routing avatar and project icon storage through it. Reuse the copy button component for API tokens and support clipboard copying through the shared helper.
This commit is contained in:
1 parent
5872cc095c
commit
a5dedc07cd
13 files changed
+79
-40
No files matched your search
@@ -31,7 +31,7 @@ beforeEach(function () {
|
||||
});
|
||||
|
||||
it('stores a project icon using the instance image storage setting', function () {
|
||||
Storage::fake('local');
|
||||
Storage::fake('images');
|
||||
|
||||
$upload = UploadedFile::fake()->createWithContent('project.jpg', file_get_contents(base_path('tests/Fixtures/project-icon.jpg')));
|
||||
|
||||
@@ -47,16 +47,16 @@ it('stores a project icon using the instance image storage setting', function ()
|
||||
->and($this->project->icon_storage_type)->toBe('local')
|
||||
->and($this->project->icon_s3_storage_id)->toBeNull();
|
||||
|
||||
Storage::disk('local')->assertExists($this->project->icon_path);
|
||||
Storage::disk('images')->assertExists($this->project->icon_path);
|
||||
});
|
||||
|
||||
it('serves a project icon only to a member of its team', function () {
|
||||
Storage::fake('local');
|
||||
Storage::fake('images');
|
||||
$this->project->forceFill([
|
||||
'icon_path' => "project-icons/{$this->project->uuid}/icon.jpg",
|
||||
'icon_storage_type' => 'local',
|
||||
])->save();
|
||||
Storage::disk('local')->put($this->project->icon_path, 'icon-content');
|
||||
Storage::disk('images')->put($this->project->icon_path, 'icon-content');
|
||||
|
||||
$this->withoutMiddleware()->get(route('project.icon', ['project_uuid' => $this->project->uuid]))
|
||||
->assertSuccessful()
|
||||
@@ -73,20 +73,20 @@ it('serves a project icon only to a member of its team', function () {
|
||||
});
|
||||
|
||||
it('removes a project icon', function () {
|
||||
Storage::fake('local');
|
||||
Storage::fake('images');
|
||||
$path = "project-icons/{$this->project->uuid}/icon.jpg";
|
||||
$this->project->forceFill([
|
||||
'icon_path' => $path,
|
||||
'icon_storage_type' => 'local',
|
||||
])->save();
|
||||
Storage::disk('local')->put($path, 'icon-content');
|
||||
Storage::disk('images')->put($path, 'icon-content');
|
||||
|
||||
Livewire::test(Edit::class, ['project_uuid' => $this->project->uuid])
|
||||
->call('removeIcon')
|
||||
->assertHasNoErrors();
|
||||
|
||||
expect($this->project->refresh()->icon_path)->toBeNull();
|
||||
Storage::disk('local')->assertMissing($path);
|
||||
Storage::disk('images')->assertMissing($path);
|
||||
});
|
||||
|
||||
it('exposes the icon URL on the projects index', function () {
|
||||
|
||||
Reference in new issue
Block a user