Skip to content

fix(git): preserve ssh scheme URLs with custom ports#9425

Open
Iisyourdad wants to merge 1 commit intocoollabsio:nextfrom
Iisyourdad:fix/ssh_url_stripped
Open

fix(git): preserve ssh scheme URLs with custom ports#9425
Iisyourdad wants to merge 1 commit intocoollabsio:nextfrom
Iisyourdad:fix/ssh_url_stripped

Conversation

@Iisyourdad
Copy link
Copy Markdown

@Iisyourdad Iisyourdad commented Apr 4, 2026

Changes

  • Preserve full ssh:// repository URLs with non-standard ports for custom Git sources instead of rewriting them into invalid ssh:/... URLs.

Issues

Category

  • Bug fix
  • Improvement
  • New feature
  • Adding new one click service
  • Fixing or updating existing one click service

AI Assistance

  • AI was NOT used to create this PR
  • AI was used (please describe below)

Testing

php artisan test tests/Feature/ConvertingGitUrlsTest.php tests/Unit/ApplicationGitSecurityTest.php and by launching up an instance.

Contributor Agreement

Important

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn't a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

@ShadowArcanist
Copy link
Copy Markdown
Member

Can you share the steps to test this? (without using those test files)

@ShadowArcanist ShadowArcanist added the 💤 Waiting for feedback Issues awaiting a response from the author. label Apr 5, 2026
@Iisyourdad
Copy link
Copy Markdown
Author

Howdy @ShadowArcanist I completely understand why you want the exact step by step process on how to test it yourself instead of just relying on the test files.

I tested this on my own personal VPS running coolify just by plugging the file and testing.

Create your own git instance and test the bug.

If you know how to set up your own git instance ect and have been able to see the bug and the temporary fix then skip below.

  • Use the one click deploy for Gitea to setup your own custom git. Follow the basic setup and create an account ect. launch it to git.example.com
  • On Coolify, create a new ssh key and put it in your account ssh settings, not just an individual repo.

Run this command to fix ssh on gitea so that it listens on the correct port after running

docker exec -it <your_gitea_name> sh

sed -i 's/^SSH_PORT *= *.*/SSH_PORT = 22222/' /data/gitea/conf/app.ini

grep -E '^(SSH_PORT|SSH_LISTEN_PORT)' /data/gitea/conf/app.ini
exit

Make sure that your firewall allows ssh connection to gitea.

via ufw status

22222/tcp (v6) | ALLOW | Anywhere (v6)

Test out a custom git source via ssh://git@129.xxx.xxx.xx:22222/User/repo_name.git and make sure that it fails.

Test out a custom git source with the temporary fix viassh:///git@129.xxx.xxx.xx:22222/User/repo_name.git and make sure that it works.

If you are using cloudflare make sure that your DNS records are set to DNS only and not proxy.

Apply the patch.

Go into your coolify container

docker exec -u 0 -it coolify sh

rm bootstrap/helpers/shared.php
nano bootstrap/helpers/shared.php

and copy and paste the whole file in with my edits. Then,

exit

docker restart coolify

Test out custom git source again via ssh://git@129.xxx.xxx.xx:22222/User/repo_name.git and it should work!

Note

I personally had quite a few issues with recreating OP's original problem so I am 100% willing to answer any questions that you have about testing.

I have this patch running on my own VPS running coolify and its working on my machine (dangerous words ik.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💤 Waiting for feedback Issues awaiting a response from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants