|
|
@ -44,6 +44,7 @@ func ParseFlagsAndSetup(proto string, errorMessageFunc func(ErrorCode) string) {
|
|
|
|
cacheMax := flag.Float64(cacheFileMaxFlagStr, 1.0, cacheFileMaxDescStr)
|
|
|
|
cacheMax := flag.Float64(cacheFileMaxFlagStr, 1.0, cacheFileMaxDescStr)
|
|
|
|
cacheSize := flag.Uint(cacheSizeFlagStr, 100, cacheSizeDescStr)
|
|
|
|
cacheSize := flag.Uint(cacheSizeFlagStr, 100, cacheSizeDescStr)
|
|
|
|
restrictedPathsList := flag.String(restrictPathsFlagStr, "", restrictPathsDescStr)
|
|
|
|
restrictedPathsList := flag.String(restrictPathsFlagStr, "", restrictPathsDescStr)
|
|
|
|
|
|
|
|
hiddenPathsList := flag.String(hiddenPathsFlagStr, "", hiddenPathsDescStr)
|
|
|
|
remapRequestsList := flag.String(remapRequestsFlagStr, "", remapRequestsDescStr)
|
|
|
|
remapRequestsList := flag.String(remapRequestsFlagStr, "", remapRequestsDescStr)
|
|
|
|
cgiDir := flag.String(cgiDirFlagStr, "", cgiDirDescStr)
|
|
|
|
cgiDir := flag.String(cgiDirFlagStr, "", cgiDirDescStr)
|
|
|
|
flag.DurationVar(&maxCGIRunTime, maxCGITimeFlagStr, time.Duration(time.Second*3), maxCGITimeDescStr)
|
|
|
|
flag.DurationVar(&maxCGIRunTime, maxCGITimeFlagStr, time.Duration(time.Second*3), maxCGITimeDescStr)
|
|
|
@ -114,7 +115,7 @@ func ParseFlagsAndSetup(proto string, errorMessageFunc func(ErrorCode) string) {
|
|
|
|
fileSizeMax = int64(1048576.0 * *cacheMax) // gets megabytes value in bytes
|
|
|
|
fileSizeMax = int64(1048576.0 * *cacheMax) // gets megabytes value in bytes
|
|
|
|
FileSystem = newFileSystemObject(int(*cacheSize))
|
|
|
|
FileSystem = newFileSystemObject(int(*cacheSize))
|
|
|
|
|
|
|
|
|
|
|
|
// If no restricted files provided, set to the disabled function. Else, compile and enable
|
|
|
|
// If no restricted paths provided, set to the disabled function. Else, compile and enable
|
|
|
|
if *restrictedPathsList == "" {
|
|
|
|
if *restrictedPathsList == "" {
|
|
|
|
SystemLog.Info(pathRestrictionsDisabledStr)
|
|
|
|
SystemLog.Info(pathRestrictionsDisabledStr)
|
|
|
|
IsRestrictedPath = isRestrictedPathDisabled
|
|
|
|
IsRestrictedPath = isRestrictedPathDisabled
|
|
|
@ -124,7 +125,17 @@ func ParseFlagsAndSetup(proto string, errorMessageFunc func(ErrorCode) string) {
|
|
|
|
IsRestrictedPath = isRestrictedPathEnabled
|
|
|
|
IsRestrictedPath = isRestrictedPathEnabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If no remapped files provided, set to the disabled function. Else, compile and enable
|
|
|
|
// If no hidden paths provided, set to the disabled function. Else, compile and enable
|
|
|
|
|
|
|
|
if *hiddenPathsList == "" {
|
|
|
|
|
|
|
|
SystemLog.Info(pathHidingDisableStr)
|
|
|
|
|
|
|
|
IsHiddenPath = isHiddenPathDisabled
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
SystemLog.Info(pathHidingEnabledStr)
|
|
|
|
|
|
|
|
hiddenPaths = compileHiddenPathsRegex(*hiddenPathsList)
|
|
|
|
|
|
|
|
IsHiddenPath = isHiddenPathEnabled
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If no remapped paths provided, set to the disabled function. Else, compile and enable
|
|
|
|
if *remapRequestsList == "" {
|
|
|
|
if *remapRequestsList == "" {
|
|
|
|
SystemLog.Info(requestRemapDisabledStr)
|
|
|
|
SystemLog.Info(requestRemapDisabledStr)
|
|
|
|
RemapRequest = remapRequestDisabled
|
|
|
|
RemapRequest = remapRequestDisabled
|
|
|
|