Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: private repository

Andras Bacsai4e94b4a0c1ef
diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
index 0397b822fb..522eb8845e 100644
--- a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
+++ b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
@@ -146,18 +146,19 @@ class GithubPrivateRepositoryDeployKey extends Component
private function get_git_source()
{
- if (Str::of($this->repository_url)->startsWith('http')) {
- $this->repository_url_parsed = Url::fromString($this->repository_url);
- $this->git_host = $this->repository_url_parsed->getHost();
- $this->git_repository = $this->repository_url_parsed->getSegment(1) . '/' . $this->repository_url_parsed->getSegment(2);
- } else {
- $this->git_repository = $this->repository_url;
- }
+ $this->repository_url_parsed = Url::fromString($this->repository_url);
+ $this->git_host = $this->repository_url_parsed->getHost();
+ $this->git_repository = $this->repository_url_parsed->getSegment(1) . '/' . $this->repository_url_parsed->getSegment(2);
if ($this->git_host == 'github.com') {
$this->git_source = GithubApp::where('name', 'Public GitHub')->first();
return;
}
+ if (Str::of($this->repository_url)->startsWith('http')) {
+ $this->git_host = $this->repository_url_parsed->getHost();
+ $this->git_repository = $this->repository_url_parsed->getSegment(1) . '/' . $this->repository_url_parsed->getSegment(2);
+ $this->git_repository = Str::finish("git@$this->git_host:$this->git_repository", '.git');
+ }
$this->git_source = 'other';
}
}
diff --git a/lang/en.json b/lang/en.json
index a0a62155f5..1f4fbdb745 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -20,5 +20,5 @@
"input.code": "One-time code",
"input.recovery_code": "Recovery code",
"button.save": "Save",
- "repository.url": "<span class='text-helper'>Examples</span><br>https://github.com/coollabsio/coolify-examples <span class='text-helper'>main</span> branch will be selected<br><br>https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify <span class='text-helper'>nodejs-fastify</span> branch will be selected.<br><br>https://gitea.com/sedlav/expressjs.git <span class='text-helper'>main</span> branch will be selected.<br><br>https://gitlab.com/andrasbacsai/nodejs-example.git <span class='text-helper'>main</span> branch will be selected."
+ "repository.url": "<span class='text-helper'>Examples</span><br>For Public repositories, use <span class='text-helper'>https://...</span>.<br>For Private repositories, use <span class='text-helper'>git@...</span>.<br><br>https://github.com/coollabsio/coolify-examples <span class='text-helper'>main</span> branch will be selected<br>https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify <span class='text-helper'>nodejs-fastify</span> branch will be selected.<br>https://gitea.com/sedlav/expressjs.git <span class='text-helper'>main</span> branch will be selected.<br>https://gitlab.com/andrasbacsai/nodejs-example.git <span class='text-helper'>main</span> branch will be selected."
}