diff options
| author | Alexander Hunt <me@liz.coffee> | 2026-06-21 17:11:32 -0700 |
|---|---|---|
| committer | Alexander Hunt <me@liz.coffee> | 2026-06-21 17:11:32 -0700 |
| commit | 6f3ba344c1f8413a463dc6274f24ef00bf47e534 (patch) | |
| tree | 2e260c52f1ecf89ece4fad131a91cde7b3500921 /args/args.go | |
| parent | df7b13a248853880e50743757caedcfbc2b7eb6d (diff) | |
| download | penguins.lan-main.tar.gz penguins.lan-main.zip | |
Diffstat (limited to 'args/args.go')
| -rw-r--r-- | args/args.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/args/args.go b/args/args.go index 6c79fe9..a488929 100644 --- a/args/args.go +++ b/args/args.go @@ -17,6 +17,11 @@ type Arguments struct { Port int Server bool + // Socket, when set, makes the HTTP server listen on this unix socket path + // instead of the TCP Port — handy behind a reverse proxy. Port is ignored + // when Socket is set. + Socket string + // Dns runs the authoritative DNS server for the LAN. DnsZone is the suffix // it owns (e.g. penguins.lan); queries outside it are forwarded to // DnsResolvers (empty = no forwarding, since the LAN has no outside @@ -51,6 +56,7 @@ func GetArgs() (*Arguments, error) { port := flag.Int("port", 8080, "Port to listen on") server := flag.Bool("server", false, "Run the HTTP server") + socket := flag.String("socket", "", "Serve HTTP on this unix socket instead of the TCP port") dns := flag.Bool("dns", false, "Run the authoritative DNS server") dnsPort := flag.Int("dns-port", 8053, "Port for the DNS server to listen on") @@ -74,6 +80,7 @@ func GetArgs() (*Arguments, error) { Scheduler: *scheduler, Port: *port, Server: *server, + Socket: *socket, Dns: *dns, DnsPort: *dnsPort, DnsResolvers: resolvers, |
