mirror of
https://github.com/coollabsio/coolify.git
synced 2026-06-14 03:19:51 +00:00
fix(git-import): explicitly specify ssh key and remove duplicate validation rules
- Add -i flag to explicitly specify ssh key path in git ls-remote operations - Remove static $rules properties in favor of dynamic rules() method - Fix test syntax error
This commit is contained in:
@@ -2133,7 +2133,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
executeInDocker($this->deployment_uuid, 'chmod 600 /root/.ssh/id_rsa'),
|
||||
],
|
||||
[
|
||||
executeInDocker($this->deployment_uuid, "GIT_SSH_COMMAND=\"ssh -o ConnectTimeout=30 -p {$this->customPort} -o Port={$this->customPort} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null\" git ls-remote {$this->fullRepoUrl} {$lsRemoteRef}"),
|
||||
executeInDocker($this->deployment_uuid, "GIT_SSH_COMMAND=\"ssh -o ConnectTimeout=30 -p {$this->customPort} -o Port={$this->customPort} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /root/.ssh/id_rsa\" git ls-remote {$this->fullRepoUrl} {$lsRemoteRef}"),
|
||||
'hidden' => true,
|
||||
'save' => 'git_commit_sha',
|
||||
]
|
||||
|
||||
@@ -57,16 +57,6 @@ class GithubPrivateRepositoryDeployKey extends Component
|
||||
|
||||
private ?string $git_repository = null;
|
||||
|
||||
protected $rules = [
|
||||
'repository_url' => ['required', 'string'],
|
||||
'branch' => ['required', 'string'],
|
||||
'port' => 'required|numeric',
|
||||
'is_static' => 'required|boolean',
|
||||
'publish_directory' => 'nullable|string',
|
||||
'build_pack' => 'required|string',
|
||||
'docker_compose_location' => \App\Support\ValidationPatterns::filePathRules(),
|
||||
];
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -63,16 +63,6 @@ class PublicGitRepository extends Component
|
||||
|
||||
public bool $new_compose_services = false;
|
||||
|
||||
protected $rules = [
|
||||
'repository_url' => ['required', 'string'],
|
||||
'port' => 'required|numeric',
|
||||
'isStatic' => 'required|boolean',
|
||||
'publish_directory' => 'nullable|string',
|
||||
'build_pack' => 'required|string',
|
||||
'base_directory' => 'nullable|string',
|
||||
'docker_compose_location' => \App\Support\ValidationPatterns::filePathRules(),
|
||||
];
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -169,7 +169,6 @@ describe('API validation rules for path fields', function () {
|
||||
|
||||
expect($validator->fails())->toBeFalse();
|
||||
});
|
||||
});
|
||||
|
||||
test('dockerfile_location validation allows paths with @ for scoped packages', function () {
|
||||
$rules = sharedDataApplications();
|
||||
|
||||
Reference in New Issue
Block a user