Skip to content

Commit

Permalink
Merge pull request #4505 from coollabsio/quickfix
Browse files Browse the repository at this point in the history
v4.0.0-beta.376
  • Loading branch information
andrasbacsai authored Dec 7, 2024
2 parents 227bd0a + 946ab81 commit 8d779c8
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 62 deletions.
111 changes: 56 additions & 55 deletions app/Http/Controllers/Api/ApplicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ private function removeSensitiveData($application)
items: new OA\Items(ref: '#/components/schemas/Application')
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -180,8 +181,10 @@ public function applications(Request $request)
'watch_paths' => ['type' => 'string', 'description' => 'The watch paths.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand Down Expand Up @@ -284,8 +287,10 @@ public function create_public_application(Request $request)
'watch_paths' => ['type' => 'string', 'description' => 'The watch paths.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand Down Expand Up @@ -388,8 +393,10 @@ public function create_private_gh_app_application(Request $request)
'watch_paths' => ['type' => 'string', 'description' => 'The watch paths.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand Down Expand Up @@ -476,8 +483,10 @@ public function create_private_deploy_key_application(Request $request)
'instant_deploy' => ['type' => 'boolean', 'description' => 'The flag to indicate if the application should be deployed instantly.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand Down Expand Up @@ -561,8 +570,10 @@ public function create_dockerfile_application(Request $request)
'instant_deploy' => ['type' => 'boolean', 'description' => 'The flag to indicate if the application should be deployed instantly.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand Down Expand Up @@ -612,8 +623,10 @@ public function create_dockerimage_application(Request $request)
'instant_deploy' => ['type' => 'boolean', 'description' => 'The flag to indicate if the application should be deployed instantly.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand Down Expand Up @@ -1268,7 +1281,8 @@ private function create_application(Request $request, $type)
ref: '#/components/schemas/Application'
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -1340,7 +1354,8 @@ public function application_by_uuid(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -1466,8 +1481,10 @@ public function delete_by_uuid(Request $request)
'watch_paths' => ['type' => 'string', 'description' => 'The watch paths.'],
'use_build_server' => ['type' => 'boolean', 'nullable' => true, 'description' => 'Use build server.'],
],
)),
]),
)
),
]
),
responses: [
new OA\Response(
response: 200,
Expand All @@ -1482,7 +1499,8 @@ public function delete_by_uuid(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -1598,9 +1616,10 @@ public function update_by_uuid(Request $request)
$errors = [];
$fqdn = str($fqdn)->trim()->explode(',')->map(function ($domain) use (&$errors) {
$domain = trim($domain);
if (filter_var($domain, FILTER_VALIDATE_URL) === false || !preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}/', $domain)) {
if (filter_var($domain, FILTER_VALIDATE_URL) === false || ! preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}/', $domain)) {
$errors[] = 'Invalid domain: '.$domain;
}

return $domain;
});
if (count($errors) > 0) {
Expand Down Expand Up @@ -1706,7 +1725,8 @@ public function update_by_uuid(Request $request)
items: new OA\Items(ref: '#/components/schemas/EnvironmentVariable')
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -1812,7 +1832,8 @@ public function envs(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -2000,7 +2021,8 @@ public function update_env_by_uuid(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -2181,7 +2203,8 @@ public function create_bulk_envs(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -2330,7 +2353,8 @@ public function create_env(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -2422,9 +2446,11 @@ public function delete_env_by_uuid(Request $request)
properties: [
'message' => ['type' => 'string', 'example' => 'Deployment request queued.', 'description' => 'Message.'],
'deployment_uuid' => ['type' => 'string', 'example' => 'doogksw', 'description' => 'UUID of the deployment.'],
])
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -2510,7 +2536,8 @@ public function action_deploy(Request $request)
]
)
),
]),
]
),
new OA\Response(
response: 401,
ref: '#/components/responses/401',
Expand Down Expand Up @@ -2584,7 +2611,8 @@ public function action_stop(Request $request)
]
)
),
]),
]
),

new OA\Response(
response: 401,
Expand Down Expand Up @@ -2827,30 +2855,3 @@ private function validateDataApplications(Request $request, Server $server)
}
}
}

$fqdn = str($fqdn)->replaceStart(',', '')->trim();
$errors = [];
$fqdn = str($fqdn)->trim()->explode(',')->map(function ($domain) use (&$errors) {
if (filter_var($domain, FILTER_VALIDATE_URL) === false) {
$errors[] = 'Invalid domain: ' . $domain;
}

return str($domain)->trim()->lower();
});
if (count($errors) > 0) {
return response()->json([
'message' => 'Validation failed.',
'errors' => $errors,
], 422);
}
if (checkIfDomainIsAlreadyUsed($fqdn, $teamId, $uuid)) {
return response()->json([
'message' => 'Validation failed.',
'errors' => [
'domains' => 'One of the domain is already used.',
],
], 422);
}
}
}
}
3 changes: 3 additions & 0 deletions app/Livewire/Project/Shared/EnvironmentVariable/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public function serialize()
public function lock()
{
$this->env->is_shown_once = true;
if ($this->isSharedVariable) {
unset($this->env->is_required);
}
$this->serialize();
$this->env->save();
$this->checkEnvs();
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/SharedVariables/Environment/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Show extends Component

public array $parameters;

protected $listeners = ['refreshEnvs' => '$refresh', 'saveKey'];
protected $listeners = ['refreshEnvs' => '$refresh', 'saveKey', 'environmentVariableDeleted' => '$refresh'];

public function saveKey($data)
{
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/SharedVariables/Project/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Show extends Component
{
public Project $project;

protected $listeners = ['refreshEnvs' => '$refresh', 'saveKey' => 'saveKey'];
protected $listeners = ['refreshEnvs' => '$refresh', 'saveKey' => 'saveKey', 'environmentVariableDeleted' => '$refresh'];

public function saveKey($data)
{
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/SharedVariables/Team/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Index extends Component
{
public Team $team;

protected $listeners = ['refreshEnvs' => '$refresh', 'saveKey' => 'saveKey'];
protected $listeners = ['refreshEnvs' => '$refresh', 'saveKey' => 'saveKey', 'environmentVariableDeleted' => '$refresh'];

public function saveKey($data)
{
Expand Down
2 changes: 1 addition & 1 deletion config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [
'coolify' => [
'version' => '4.0.0-beta.375',
'version' => '4.0.0-beta.376',
'self_hosted' => env('SELF_HOSTED', true),
'autoupdate' => env('AUTOUPDATE'),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
Expand Down
6 changes: 3 additions & 3 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.375"
"version": "4.0.0-beta.376"
},
"nightly": {
"version": "4.0.0-beta.376"
"version": "4.0.0-beta.377"
},
"helper": {
"version": "1.0.4"
Expand All @@ -16,4 +16,4 @@
"version": "0.0.15"
}
}
}
}

0 comments on commit 8d779c8

Please sign in to comment.