Skip to content

Change displayed SSH_USER to logged in user #33086

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

Closed
prologic opened this issue Jan 2, 2025 · 9 comments · Fixed by #33091
Closed

Change displayed SSH_USER to logged in user #33086

prologic opened this issue Jan 2, 2025 · 9 comments · Fixed by #33091
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@prologic
Copy link

prologic commented Jan 2, 2025

Feature Description

I think it would be great if Gitea would allow me to customize the display of the SSH_USER in any ssh clone urls displayed.

Why? I've setup an SSH reverse proxy that checks against my Gitea instance to see if there is a valid user with a matching key, before reverse proxying them through to my Gitea instance with the built in git@ user and their public key credentials passed through an agent forwarder.

This way I can add an additional layer of protection in front of my Gitea instance.

Screenshots

N/A

@prologic prologic added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jan 2, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 2, 2025

But in SSH world, the "username" isn't that important, you could always identify a user by their public key, even in your "SSH reverse proxy"

@prologic
Copy link
Author

prologic commented Jan 3, 2025

But in SSH world, the "username" isn't that important, you could always identify a user by their public key, even in your "SSH reverse proxy"

Do you mind collaborating on this a little bit? I actually do this the other way around where I lookup the presented user to see if it exists in the first place,then match the presented public key.

@wxiaoguang
Copy link
Contributor

Do you mind collaborating on this a little bit? I actually do this the other way around where I lookup the presented user to see if it exists in the first place,then match the presented public key.

Hmm, I guess I know what you are doing ......

I could help to propose a demo to show the current user name on the UI for the SSH clone URL, but I am not sure whether it is suitable to merge into Gitea, since it doesn't seem to be a need of a majority.

@wxiaoguang
Copy link
Contributor

OK, I think I get some ideas about how to make it neat and merge it into Gitea.

@wxiaoguang
Copy link
Contributor

-> Make git clone URL could use current signed-in user #33091

TBH, much more complicated than I thought .... 🤣

@prologic
Copy link
Author

Hey just checking, did this get into the GItea 1.23.1 release? 🤔

@prologic
Copy link
Author

Looks like it didn't. Just tested this:

[server]
...
SSH_USER = %(DOER_USERNAME)s

@wxiaoguang
Copy link
Contributor

Hey just checking, did this get into the GItea 1.23.1 release? 🤔

No, it is a new feature and only in 1.24

Looks like it didn't. Just tested this:

[server]
...
SSH_USER = %(DOER_USERNAME)s

But it does work, see the document:

image

SSH_USER = %(DOER_USERNAME)s is wrong. Use SSH_USER = (DOER_USERNAME)

@prologic
Copy link
Author

Ahh! Thanks!

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Apr 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants