|
|
|
@ -99,7 +99,7 @@ func checkVersion() {
|
|
|
|
|
for _, c := range checkers { |
|
|
|
|
if !version.Compare(c.Version(), c.Expected, ">=") { |
|
|
|
|
log.Fatal(4, `Dependency outdated! |
|
|
|
|
Package '%s' current version (%s) is below requirement (%s),
|
|
|
|
|
Package '%s' current version (%s) is below requirement (%s), |
|
|
|
|
please use following command to update this package and recompile Gogs: |
|
|
|
|
go get -u %[1]s`, c.ImportPath, c.Version(), c.Expected) |
|
|
|
|
} |
|
|
|
@ -116,7 +116,7 @@ func newMacaron() *macaron.Macaron {
|
|
|
|
|
if setting.EnableGzip { |
|
|
|
|
m.Use(gzip.Gziper()) |
|
|
|
|
} |
|
|
|
|
if setting.Protocol == setting.FCGI { |
|
|
|
|
if setting.Protocol == setting.SCHEME_FCGI { |
|
|
|
|
m.SetURLPrefix(setting.AppSubUrl) |
|
|
|
|
} |
|
|
|
|
m.Use(macaron.Static( |
|
|
|
@ -640,7 +640,7 @@ func runWeb(ctx *cli.Context) error {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var listenAddr string |
|
|
|
|
if setting.Protocol == setting.UNIX_SOCKET { |
|
|
|
|
if setting.Protocol == setting.SCHEME_UNIX_SOCKET { |
|
|
|
|
listenAddr = fmt.Sprintf("%s", setting.HTTPAddr) |
|
|
|
|
} else { |
|
|
|
|
listenAddr = fmt.Sprintf("%s:%s", setting.HTTPAddr, setting.HTTPPort) |
|
|
|
@ -649,14 +649,14 @@ func runWeb(ctx *cli.Context) error {
|
|
|
|
|
|
|
|
|
|
var err error |
|
|
|
|
switch setting.Protocol { |
|
|
|
|
case setting.HTTP: |
|
|
|
|
case setting.SCHEME_HTTP: |
|
|
|
|
err = http.ListenAndServe(listenAddr, m) |
|
|
|
|
case setting.HTTPS: |
|
|
|
|
case setting.SCHEME_HTTPS: |
|
|
|
|
server := &http.Server{Addr: listenAddr, TLSConfig: &tls.Config{MinVersion: tls.VersionTLS10}, Handler: m} |
|
|
|
|
err = server.ListenAndServeTLS(setting.CertFile, setting.KeyFile) |
|
|
|
|
case setting.FCGI: |
|
|
|
|
case setting.SCHEME_FCGI: |
|
|
|
|
err = fcgi.Serve(nil, m) |
|
|
|
|
case setting.UNIX_SOCKET: |
|
|
|
|
case setting.SCHEME_UNIX_SOCKET: |
|
|
|
|
os.Remove(listenAddr) |
|
|
|
|
|
|
|
|
|
var listener *net.UnixListener |
|
|
|
|