Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Basti-Fantasti opened this issue Jan 25, 2023 · 7 comments
Open

Comments

@Basti-Fantasti
Copy link

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

@viniciussanchez
Copy link
Member

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

@Basti-Fantasti
Copy link
Author

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
Copy link
Author

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

@Basti-Fantasti
Copy link
Author

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
Copy link
Author

any chance that this will be fixed?

@Basti-Fantasti
Copy link
Author

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants