boss icon indicating copy to clipboard operation
boss copied to clipboard

add dependency from self hosted gitlab server using SSH checkout

Open Basti-Fantasti opened this issue 2 years ago • 7 comments

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  [email protected]: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 [email protected]: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

Basti-Fantasti avatar Jan 25 '23 14:01 Basti-Fantasti

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

viniciussanchez avatar Feb 21 '23 20:02 viniciussanchez

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 avatar Feb 22 '23 07:02 Basti-Fantasti

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

Basti-Fantasti avatar Feb 22 '23 08:02 Basti-Fantasti

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 [email protected]/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 avatar Feb 23 '23 08:02 Basti-Fantasti

any chance that this will be fixed?

Basti-Fantasti avatar Jul 20 '23 11:07 Basti-Fantasti

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.

Basti-Fantasti avatar Mar 08 '24 14:03 Basti-Fantasti

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

viniciussanchez avatar May 08 '24 17:05 viniciussanchez