From b905db7a56dfd750899fb7128306e9561e13b1b6 Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Mon, 1 Aug 2022 14:36:55 -0700 Subject: [PATCH] cmd/derper: remove support for logtail logging (#5248) There aren't really any useful logs produced by derper. Signed-off-by: Joe Tsai --- cmd/derper/derper.go | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/cmd/derper/derper.go b/cmd/derper/derper.go index 5513a2062..f2573f504 100644 --- a/cmd/derper/derper.go +++ b/cmd/derper/derper.go @@ -29,7 +29,6 @@ import ( "tailscale.com/atomicfile" "tailscale.com/derp" "tailscale.com/derp/derphttp" - "tailscale.com/logpolicy" "tailscale.com/metrics" "tailscale.com/net/stun" "tailscale.com/tsweb" @@ -37,16 +36,15 @@ import ( ) var ( - dev = flag.Bool("dev", false, "run in localhost development mode") - addr = flag.String("a", ":443", "server HTTPS listen address, in form \":port\", \"ip:port\", or for IPv6 \"[ip]:port\". If the IP is omitted, it defaults to all interfaces.") - httpPort = flag.Int("http-port", 80, "The port on which to serve HTTP. Set to -1 to disable. The listener is bound to the same IP (if any) as specified in the -a flag.") - stunPort = flag.Int("stun-port", 3478, "The UDP port on which to serve STUN. The listener is bound to the same IP (if any) as specified in the -a flag.") - configPath = flag.String("c", "", "config file path") - certMode = flag.String("certmode", "letsencrypt", "mode for getting a cert. possible options: manual, letsencrypt") - certDir = flag.String("certdir", tsweb.DefaultCertDir("derper-certs"), "directory to store LetsEncrypt certs, if addr's port is :443") - hostname = flag.String("hostname", "derp.tailscale.com", "LetsEncrypt host name, if addr's port is :443") - logCollection = flag.String("logcollection", "", "If non-empty, logtail collection to log to") - runSTUN = flag.Bool("stun", true, "whether to run a STUN server. It will bind to the same IP (if any) as the --addr flag value.") + dev = flag.Bool("dev", false, "run in localhost development mode") + addr = flag.String("a", ":443", "server HTTPS listen address, in form \":port\", \"ip:port\", or for IPv6 \"[ip]:port\". If the IP is omitted, it defaults to all interfaces.") + httpPort = flag.Int("http-port", 80, "The port on which to serve HTTP. Set to -1 to disable. The listener is bound to the same IP (if any) as specified in the -a flag.") + stunPort = flag.Int("stun-port", 3478, "The UDP port on which to serve STUN. The listener is bound to the same IP (if any) as specified in the -a flag.") + configPath = flag.String("c", "", "config file path") + certMode = flag.String("certmode", "letsencrypt", "mode for getting a cert. possible options: manual, letsencrypt") + certDir = flag.String("certdir", tsweb.DefaultCertDir("derper-certs"), "directory to store LetsEncrypt certs, if addr's port is :443") + hostname = flag.String("hostname", "derp.tailscale.com", "LetsEncrypt host name, if addr's port is :443") + runSTUN = flag.Bool("stun", true, "whether to run a STUN server. It will bind to the same IP (if any) as the --addr flag value.") meshPSKFile = flag.String("mesh-psk-file", defaultMeshPSKFile(), "if non-empty, path to file containing the mesh pre-shared key file. It should contain some hex string; whitespace is trimmed.") meshWith = flag.String("mesh-with", "", "optional comma-separated list of hostnames to mesh with; the server's own hostname can be in the list") @@ -135,7 +133,6 @@ func main() { flag.Parse() if *dev { - *logCollection = "" *addr = ":3340" // above the keys DERP log.Printf("Running in dev mode.") tsweb.DevMode = true @@ -146,12 +143,6 @@ func main() { log.Fatalf("invalid server address: %v", err) } - var logPol *logpolicy.Policy - if *logCollection != "" { - logPol = logpolicy.New(*logCollection) - log.SetOutput(logPol.Logtail) - } - cfg := loadConfig() serveTLS := tsweb.IsProd443(*addr) || *certMode == "manual"