-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Open
Labels
type/featureCompletely new functionality. Can only be merged if feature freeze is not active.Completely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.
Description
Feature Description
After setting Gitea up under a gitea user and group, it can be desirable to be able to use [email protected]:user/repo.git. This can be enabled by creating a git user with the same UID, e.g. via useradd -o -u $(id -u gitea) git.
At the moment, this causes issues because the user check is based on the name, not the UID.
gitea/modules/setting/setting.go
Lines 999 to 1005 in ff9b6fa
| // Does not check run user when the install lock is off. | |
| if InstallLock { | |
| currentUser, match := IsRunUserMatchCurrentUser(RunUser) | |
| if !match { | |
| log.Fatal("Expect user '%s' but current user is: %s", RunUser, currentUser) | |
| } | |
| } |
gitea/modules/setting/setting.go
Lines 512 to 523 in ff9b6fa
| // IsRunUserMatchCurrentUser returns false if configured run user does not match | |
| // actual user that runs the app. The first return value is the actual user name. | |
| // This check is ignored under Windows since SSH remote login is not the main | |
| // method to login on Windows. | |
| func IsRunUserMatchCurrentUser(runUser string) (string, bool) { | |
| if IsWindows || SSH.StartBuiltinServer { | |
| return "", true | |
| } | |
| currentUser := user.CurrentUsername() | |
| return currentUser, runUser == currentUser | |
| } |
Would it be possible to change this check to be based on the UID?
Screenshots
No response
balki and SunRed
Metadata
Metadata
Assignees
Labels
type/featureCompletely new functionality. Can only be merged if feature freeze is not active.Completely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.