@ -51,8 +51,9 @@ var CmdServ = cli.Command{
}
}
func setup ( logPath string , debug bool ) {
func setup ( logPath string , debug bool ) {
if ! debug {
_ = log . DelLogger ( "console" )
_ = log . DelLogger ( "console" )
if debug {
_ = log . NewLogger ( 1000 , "console" , "console" , ` { "level":"trace","stacktracelevel":"NONE","stderr":true} ` )
}
}
setting . NewContext ( )
setting . NewContext ( )
if debug {
if debug {
@ -117,6 +118,8 @@ func runServ(c *cli.Context) error {
}
}
println ( "If this is unexpected, please log in with password and setup Gitea under another user." )
println ( "If this is unexpected, please log in with password and setup Gitea under another user." )
return nil
return nil
} else if c . Bool ( "debug" ) {
log . Debug ( "SSH_ORIGINAL_COMMAND: %s" , os . Getenv ( "SSH_ORIGINAL_COMMAND" ) )
}
}
words , err := shellquote . Split ( cmd )
words , err := shellquote . Split ( cmd )
@ -145,6 +148,9 @@ func runServ(c *cli.Context) error {
}
}
}
}
// LowerCase and trim the repoPath as that's how they are stored.
repoPath = strings . ToLower ( strings . TrimSpace ( repoPath ) )
rr := strings . SplitN ( repoPath , "/" , 2 )
rr := strings . SplitN ( repoPath , "/" , 2 )
if len ( rr ) != 2 {
if len ( rr ) != 2 {
fail ( "Invalid repository path" , "Invalid repository path: %v" , repoPath )
fail ( "Invalid repository path" , "Invalid repository path: %v" , repoPath )