From 5a57899bb23302c0fc764f75306e09370803aee6 Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 17 Jun 2016 18:18:12 +0200 Subject: Add --whitelist --- main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index ae2c9f5..2dcac62 100644 --- a/main.go +++ b/main.go @@ -70,6 +70,7 @@ func main() { maxSize := flag.Int64("max-size", 50*1024*1024, "max filesize in bytes") filterMime := flag.String("filter-mime", "application/x-dosexec,application/x-msdos-program", "comma-separated list of filtered MIME types") filterExt := flag.String("filter-ext", "exe,dll,msi,scr,com,pif", "comma-separated list of filtered file extensions") + whitelist := flag.Bool("whitelist", false, "use filter as a whitelist instead of blacklist") grill := flag.Bool("grill", false, "enable grills") idLength := flag.Int("id-length", 6, "length of uploaded file IDs") idCharset := flag.String("id-charset", "", "charset for uploaded file IDs (default lowercase letters a-z)") @@ -83,6 +84,7 @@ func main() { storage = NewStorage("upload", *maxSize) storage.FilterExt = strings.Split(*filterExt, ",") storage.FilterMime = strings.Split(*filterMime, ",") + storage.Whitelist = *whitelist storage.IdLength = *idLength if *idCharset != "" { storage.IdCharset = *idCharset -- cgit