summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-11-03 21:04:00 -0500
committer无闻 <joe2010xtmf@163.com>2014-11-03 21:04:00 -0500
commit6588ce52fe2278c4089b1fc8a0a8f4801a59529a (patch)
treebf89e0b35a1e7d4e60ae39a40e0b935ce2397f93
parente9875edcade5992df68f0467c110f22affa2434a (diff)
parent5094e9501ce3c5476cb5ad1b2b392f5e8b60ddff (diff)
downloadgitea-6588ce52fe2278c4089b1fc8a0a8f4801a59529a.tar.gz
gitea-6588ce52fe2278c4089b1fc8a0a8f4801a59529a.zip
Merge pull request #602 from andyleap/fcgi
Add basic FCGI support
-rw-r--r--cmd/web.go3
-rw-r--r--modules/setting/setting.go4
2 files changed, 7 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go
index d2ab01f1de..d59ab52ee2 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -9,6 +9,7 @@ import (
"html/template"
"io/ioutil"
"net/http"
+ "net/http/fcgi"
"os"
"path"
"strings"
@@ -416,6 +417,8 @@ func runWeb(*cli.Context) {
err = http.ListenAndServe(listenAddr, m)
case setting.HTTPS:
err = http.ListenAndServeTLS(listenAddr, setting.CertFile, setting.KeyFile, m)
+ case setting.FCGI:
+ err = fcgi.Serve(nil, m)
default:
log.Fatal(4, "Invalid protocol: %s", setting.Protocol)
}
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index b8fc4dec2e..64c32ec73a 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -28,6 +28,7 @@ type Scheme string
const (
HTTP Scheme = "http"
HTTPS Scheme = "https"
+ FCGI Scheme = "fcgi"
)
var (
@@ -181,6 +182,9 @@ func NewConfigContext() {
CertFile = Cfg.MustValue("server", "CERT_FILE")
KeyFile = Cfg.MustValue("server", "KEY_FILE")
}
+ if Cfg.MustValue("server", "PROTOCOL") == "fcgi" {
+ Protocol = FCGI
+ }
Domain = Cfg.MustValue("server", "DOMAIN", "localhost")
HttpAddr = Cfg.MustValue("server", "HTTP_ADDR", "0.0.0.0")
HttpPort = Cfg.MustValue("server", "HTTP_PORT", "3000")