You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
2.0 KiB
Go
35 lines
2.0 KiB
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
)
|
|
|
|
var (
|
|
/* Base server settings */
|
|
ServerRoot = flag.String("root", "/var/gopher", "Change server root directory.")
|
|
ServerHostname = flag.String("hostname", "127.0.0.1", "Change server hostname (FQDN).")
|
|
ServerPort = flag.Int("port", 70, "Change server port (0 to disable unencrypted traffic).")
|
|
ServerBindAddr = flag.String("bind-addr", "127.0.0.1", "Change server socket bind address")
|
|
ExecAsUid = flag.Int("uid", 1000, "Change UID to drop executable privileges to.")
|
|
ExecAsGid = flag.Int("gid", 100, "Change GID to drop executable privileges to.")
|
|
|
|
/* User supplied caps.txt information */
|
|
ServerDescription = flag.String("description", "Gophor: a Gopher server in GoLang", "Change server description in auto-generated caps.txt.")
|
|
ServerAdmin = flag.String("admin-email", "", "Change admin email in auto-generated caps.txt.")
|
|
ServerGeoloc = flag.String("geoloc", "", "Change server gelocation string in auto-generated caps.txt.")
|
|
|
|
/* Content settings */
|
|
PageWidth = flag.Int("page-width", 80, "Change page width used when formatting output.")
|
|
RestrictedFiles = flag.String("restrict-files", "", "New-line separated list of regex statements restricting files from showing in directory listings.")
|
|
|
|
/* Logging settings */
|
|
SystemLog = flag.String("system-log", "", "Change server system log file (blank outputs to stderr).")
|
|
AccessLog = flag.String("access-log", "", "Change server access log file (blank outputs to stderr).")
|
|
LoggingType = flag.Int("log-type", 0, "Change server log file handling -- 0:default 1:disable")
|
|
|
|
/* Cache settings */
|
|
CacheCheckFreq = flag.String("cache-check", "60s", "Change file cache freshness check frequency.")
|
|
CacheSize = flag.Int("cache-size", 50, "Change file cache size, measured in file count.")
|
|
CacheFileSizeMax = flag.Float64("cache-file-max", 0.5, "Change maximum file size to be cached (in megabytes).")
|
|
)
|