semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Gitea with Semaphore

Open Flooxou opened this issue 1 year ago • 4 comments

Hello,

I have locally a Semaphore server and another Gitea server to have my directories. When I want to link the 2 with the Repositories tab of semaphore and I try to run a task then I get this error. Capture However I enter the public key on my Gitea and the private key on the Key Store tab.

Can you help me?

Thank you.

Flooxou avatar Apr 26 '23 09:04 Flooxou

Hey,

This could be more-or-less the same as #1195. It's hard-coded to use the username 'git', but by default Gitea expects the username to be 'gitea'.

I've submitted a PR to make Semaphore use the username in the optional username field when adding a SSH-key to the Key Store. ( #1221 )

Walkablenormal avatar Apr 26 '23 12:04 Walkablenormal

Thanks, I'm not sure I understand. When we want to link a Gitea repository to Semaphore we add the SSH link so: gitea@IPADDR:user/repo.git. Does it mean that this "gitea" is blocking? Or is it the user of the SSH key (the Semaphore user?)

Flooxou avatar Apr 26 '23 13:04 Flooxou

Hey,

It seems like it completly ignores the 'gitea' part of 'gitea@IPADDR:user/repo.git', and always uses 'git' as the username. By default, the gitea server expects Gitea as the username, so it wont authenticate the user git.

The PR that i've submitted (but isn't reviewed yet) checks if the optional 'username' field that you can set when adding a SSH key to the Key Store is set. If it is, it will use that username for the connection. In your case, that would be Gitea.

I havent tested it, but you can try the most recent release of Semaphore that reverted to using external git instead of go-git by default (https://github.com/ansible-semaphore/semaphore/releases/tag/v2.8.90).

Walkablenormal avatar Apr 26 '23 13:04 Walkablenormal

Thank you very much, it has become clear now. I updated semaphore, and still the same error. I didn't change the git_client parameter because I don't see what external git or go-git client is. I hope your PR will be accepted quickly to fix it.

Flooxou avatar Apr 26 '23 13:04 Flooxou