From d6f225e2321af8f284c04d0e8ae8e3bf2a29bc05 Mon Sep 17 00:00:00 2001 From: Remco Date: Wed, 22 Mar 2017 23:14:01 +0100 Subject: [PATCH] Virustotal arguments --- cmd/cmd.go | 10 ++++++++++ server/server.go | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/cmd/cmd.go b/cmd/cmd.go index 40a16af..9163071 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -117,6 +117,12 @@ var globalFlags = []cli.Flag{ Value: "", EnvVar: "CLAMAV_HOST", }, + cli.StringFlag{ + Name: "virustotal-key", + Usage: "virustotal-key", + Value: "", + EnvVar: "VIRUSTOTAL_KEY", + }, cli.BoolFlag{ Name: "profiler", Usage: "enable profiling", @@ -176,6 +182,10 @@ func New() *Cmd { options = append(options, server.UseLetsEncrypt(strings.Split(v, ","))) } + if v := c.String("virustotal-key"); v != "" { + options = append(options, server.VirustotalKey(v)) + } + if v := c.String("clamav-host"); v != "" { options = append(options, server.ClamavHost(v)) } diff --git a/server/server.go b/server/server.go index 2d5ad59..a1c37a5 100644 --- a/server/server.go +++ b/server/server.go @@ -66,6 +66,12 @@ func ClamavHost(s string) OptionFn { } } +func VirustotalKey(s string) OptionFn { + return func(srvr *Server) { + srvr.VirusTotalKey = s + } +} + func Listener(s string) OptionFn { return func(srvr *Server) { srvr.ListenerString = s