mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 12:16:45 +00:00
feat(registry): add configurable docker registry url (#9017)
This commit is contained in:
1 parent
d32d7cf3d2
commit
cf6f5a2678
27 files changed
+465
-91
No files matched your search
@@ -26,7 +26,7 @@ test('non-admin user is redirected from settings updates page', function () {
|
||||
test('instance admin can access settings updates page', function () {
|
||||
$rootTeam = Team::find(0) ?? Team::factory()->create(['id' => 0]);
|
||||
Server::factory()->create(['id' => 0, 'team_id' => $rootTeam->id]);
|
||||
InstanceSettings::create(['id' => 0]);
|
||||
InstanceSettings::forceCreate(['id' => 0]);
|
||||
Once::flush();
|
||||
|
||||
$user = User::factory()->create();
|
||||
@@ -39,3 +39,24 @@ test('instance admin can access settings updates page', function () {
|
||||
->assertOk()
|
||||
->assertNoRedirect();
|
||||
});
|
||||
|
||||
test('instance admin cannot save an invalid docker registry url', function () {
|
||||
config()->set('constants.coolify.self_hosted', false);
|
||||
|
||||
$rootTeam = Team::find(0) ?? Team::factory()->create(['id' => 0]);
|
||||
$settings = InstanceSettings::forceCreate(['id' => 0]);
|
||||
Once::flush();
|
||||
|
||||
$user = User::factory()->create();
|
||||
$rootTeam->members()->attach($user->id, ['role' => 'admin']);
|
||||
|
||||
$this->actingAs($user);
|
||||
session(['currentTeam' => ['id' => $rootTeam->id]]);
|
||||
|
||||
Livewire::test(Updates::class)
|
||||
->set('docker_registry_url', 'docker.io; touch /tmp/pwned')
|
||||
->call('instantSave')
|
||||
->assertHasErrors(['docker_registry_url' => 'in']);
|
||||
|
||||
expect($settings->fresh()->docker_registry_url)->toBe('docker.io');
|
||||
});
|
||||
Reference in new issue
Block a user