summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 832403e20f..4354d8cdb8 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -42,6 +42,7 @@ const (
HTTP Scheme = "http"
HTTPS Scheme = "https"
FCGI Scheme = "fcgi"
+ FCGIUnix Scheme = "fcgi+unix"
UnixSocket Scheme = "unix"
)
@@ -553,6 +554,14 @@ func NewContext() {
KeyFile = sec.Key("KEY_FILE").String()
case "fcgi":
Protocol = FCGI
+ case "fcgi+unix":
+ Protocol = FCGIUnix
+ UnixSocketPermissionRaw := sec.Key("UNIX_SOCKET_PERMISSION").MustString("666")
+ UnixSocketPermissionParsed, err := strconv.ParseUint(UnixSocketPermissionRaw, 8, 32)
+ if err != nil || UnixSocketPermissionParsed > 0777 {
+ log.Fatal("Failed to parse unixSocketPermission: %s", UnixSocketPermissionRaw)
+ }
+ UnixSocketPermission = uint32(UnixSocketPermissionParsed)
case "unix":
Protocol = UnixSocket
UnixSocketPermissionRaw := sec.Key("UNIX_SOCKET_PERMISSION").MustString("666")
@@ -607,6 +616,8 @@ func NewContext() {
defaultLocalURL = "http://unix/"
case FCGI:
defaultLocalURL = AppURL
+ case FCGIUnix:
+ defaultLocalURL = AppURL
default:
defaultLocalURL = string(Protocol) + "://"
if HTTPAddr == "0.0.0.0" {