HashLoad / boss

Dependency Manager for Delphi and Lazarus
https://t.me/hashload
MIT License
529 stars 94 forks source link

add dependency from self hosted gitlab server using SSH checkout #129

Open Basti-Fantasti opened 1 year ago

Basti-Fantasti commented 1 year ago

How can I configure boss to fetch dependencies from my locally hosted gitlab server using SSH instead of HTTPS? I have logged in with boss to my gitlab instance:

>boss login
Url to login (ex: github.com): gitlab.mygitlab.com
Use SSH(y or n): y
Path of ssh private key(C:\Users\MyUser\.ssh\id_rsa): c:\users\MyUser\.ssh\mygitlabkey
PassPhrase: ***

When I now try to install a dependency using the repo path as I would with git clone

boss install  git@gitlab.mygitlab.com:mygroup/myrepo.git
[DEBUG] DEBUG MODE
[DEBUG]         Initializing delphi version
[DEBUG]         Executing migrations
[DEBUG]                 Update to version 1 already performed
[DEBUG]                 Update to version 2 already performed
[DEBUG]                 Update to version 3 already performed
[DEBUG]                 Update to version 5 already performed
[DEBUG]                 Update to version 6 already performed
[DEBUG]         Adjusting paths
[DEBUG]         Installing internal modules
[DEBUG]         Creating paths
[DEBUG] finish boss system initialization
[INFO ] Installing modules in project path
[INFO ] Building cache files...
[INFO ] Updating cache of dependency myrepo
[INFO ] Downloading dependency git@gitlab.mygitlab.com:mygroup/myrepo
[ERROR]   Cloning into 'X:\git_local\boss_demo\modules\myrepo'...
[ERROR]   fatal: unable to access 'https://gitlab.mygitlab.com:mygroup/myrepo/': URL using bad/illegal format or missing URL
[ERROR] exit status 128

It can not be cloned because it's trying to clone using HTTPS instead of SSH which is not available on my github server. How can this be changed?

Best regards Bastian

viniciussanchez commented 1 year ago

I also use private gitlab with SSH. The boss login, try to perform in Power Shell as an administrator.

Basti-Fantasti commented 1 year ago

Thanks for the reply.

when trying to clone a repo using the boss install command it asks for an OAuth configuration over `https://mygitlab.url' so it seems not to do the authentication based on my stored rsa keys which I normally use with git cli on our gitlab instance.

Basti-Fantasti commented 1 year ago

oh and I just found out that on our self hosted gitlab server ouath is deactivated 😢

Basti-Fantasti commented 1 year ago

I tried it now several times in different ways in PowerShell, Admin PowerShell and cmder with the same result. It always asks for the OAuth token via https

I tried to setup the login again like stated in the readme.

boss login
Url to login (ex: github.com): mygitlab.url
Use SSH(y or n): y
Path of ssh private key(C:\Users\Bastian\.ssh\id_rsa): C:\Users\Bastian\.ssh\rsa-key-gitlab
PassPhrase: ***

I also tried to install the dependy by supplying the credentials directly after calling the login on the repo directly supplying the path to the key file

boss login git@mygitlab.url/repo.git -k "pathtokeyfile" -p ...

But also when I now try to install a dependency from our gitlab server it asks for the OAuth token so the private key authentication seems to be inactive.

Basti-Fantasti commented 1 year ago

any chance that this will be fixed?

Basti-Fantasti commented 7 months ago

I found and fixed the problem. If you want I can make a PR then you can add it to the next version

It was an issue with handling the filename passed in as the privatekey path.

viniciussanchez commented 5 months ago

Cool @Basti-Fantasti... Please, if possible, send us the Pull request.