diff options
author | zeripath <art27@cantab.net> | 2019-12-10 12:23:26 +0000 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-12-10 13:23:26 +0100 |
commit | 2c83dac5d47195b7589a9e879598d00c00f1b302 (patch) | |
tree | 1d5007bcfbc7781521986fb7d777e53087c133c6 /modules | |
parent | 4dc3993b221cf7b321e578e1f542891a49714b2d (diff) | |
download | gitea-2c83dac5d47195b7589a9e879598d00c00f1b302.tar.gz gitea-2c83dac5d47195b7589a9e879598d00c00f1b302.zip |
FCGI: Allow FCGI over unix sockets (#9298)
* FCGI: Allow FCGI over unix sockets
* fixup! FCGI: Allow FCGI over unix sockets
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 11 |
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" { |