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

Fixes ansible-semaphore/semaphore#1195 #1221

Merged
merged 5 commits into from
Apr 1, 2024

Conversation

Walkablenormal
Copy link
Contributor

When using a self-hosted Git service like Gitea there is a need for the SSH-connection to use a different username then 'git'.

This fix will check if the optional username field of the configured SSH-key is set. If it is, it will use the set username when establishing the SSH-connection. When it is not set, it falls back to using 'git' as the username.

This was referenced Apr 24, 2023
@Walkablenormal
Copy link
Contributor Author

Tested this against a locally set up Gitea Git-service.

It fails to fetch the repository from the Gitea Git-service when no username is set in the key because it falls back to 'git' as the username. Gitea expects the username to be Gitea.

image
Key without username

image
Gitea logs showing that the authentication fails

image
Ansible Semaphore task log showing that the fetch fails

The fetch succeeds when the username is set to 'Gitea'.

image
Key with username set to gitea

image
Gitea logs shows that the authentication succeeds

image
Ansible Semaphore task log shows that it succeeds in fetching the repository from the Gitea Git-service

@fiftin Can you review the PR please?

@Yuri-Lima
Copy link

has that isuue fixed?

@abcd678
Copy link

abcd678 commented Mar 31, 2024

any update on this? not being able to use gitea makes semaphore unusable for me

@Walkablenormal
Copy link
Contributor Author

Walkablenormal commented Apr 1, 2024

any update on this? not being able to use gitea makes semaphore unusable for me

Hey,

This PR should fix this issue. The maintainers need to merge this PR into the codebase.

@Walkablenormal
Copy link
Contributor Author

@fiftin I've merged the latest version of the codebase into this PR to solve any merge conflicts. All tests run without any problems. Can you look into this PR and merge it? People really seem to need this fix.

@fiftin fiftin merged commit 5e40043 into semaphoreui:develop Apr 1, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

5 participants