Skip to content

Commit 82b7188

Browse files
authored
Ensure repoNames are lowercased in serv (#12668)
#12624 missed lowering the provided repoPath. (Additionally make a few fixes to the way the debug flag works.) Fix #12659 Fix #12667 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 807a41c commit 82b7188

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/serv.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ var CmdServ = cli.Command{
5151
}
5252

5353
func setup(logPath string, debug bool) {
54-
if !debug {
55-
_ = log.DelLogger("console")
54+
_ = log.DelLogger("console")
55+
if debug {
56+
_ = log.NewLogger(1000, "console", "console", `{"level":"trace","stacktracelevel":"NONE","stderr":true}`)
5657
}
5758
setting.NewContext()
5859
if debug {
@@ -117,6 +118,8 @@ func runServ(c *cli.Context) error {
117118
}
118119
println("If this is unexpected, please log in with password and setup Gitea under another user.")
119120
return nil
121+
} else if c.Bool("debug") {
122+
log.Debug("SSH_ORIGINAL_COMMAND: %s", os.Getenv("SSH_ORIGINAL_COMMAND"))
120123
}
121124

122125
words, err := shellquote.Split(cmd)
@@ -145,6 +148,9 @@ func runServ(c *cli.Context) error {
145148
}
146149
}
147150

151+
// LowerCase and trim the repoPath as that's how they are stored.
152+
repoPath = strings.ToLower(strings.TrimSpace(repoPath))
153+
148154
rr := strings.SplitN(repoPath, "/", 2)
149155
if len(rr) != 2 {
150156
fail("Invalid repository path", "Invalid repository path: %v", repoPath)

0 commit comments

Comments
 (0)