2020-09-28 23:39:05 +00:00
|
|
|
package options
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Server *ServerConfig
|
|
|
|
|
|
|
|
type ServerConfig struct {
|
2020-10-21 05:54:33 +00:00
|
|
|
Addr string
|
|
|
|
TrustProxy bool
|
|
|
|
RepoList string
|
|
|
|
Compress bool
|
|
|
|
ServePath string
|
|
|
|
ScriptsPath string
|
2020-09-28 23:39:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var ServerFlags *flag.FlagSet
|
|
|
|
var InitFlags *flag.FlagSet
|
|
|
|
var DefaultMaxBodySize int64 = 1024 * 1024
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
Server = &ServerConfig{}
|
|
|
|
ServerFlags = flag.NewFlagSet("run", flag.ExitOnError)
|
2020-10-21 05:54:33 +00:00
|
|
|
InitFlags = flag.NewFlagSet("init", flag.ExitOnError)
|
2020-09-28 23:39:05 +00:00
|
|
|
}
|