aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.go b/main.go
index 23743c4..dae5ccd 100644
--- a/main.go
+++ b/main.go
@@ -69,12 +69,12 @@ func main() {
listenHttps := flag.String("https", "", "address to listen on for HTTPS")
cert := flag.String("cert", "", "path to TLS certificate (for HTTPS)")
key := flag.String("key", "", "path to TLS key (for HTTPS)")
- maxSize := flag.Int64("max-size", 50*1024*1024, "max filesize in bytes")
+ maxSize := flag.Int64("max-size", DefaultMaxSize, "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")
+ idLength := flag.Int("id-length", DefaultIdLength, "length of uploaded file IDs")
idCharset := flag.String("id-charset", "", "charset for uploaded file IDs (default lowercase letters a-z)")
flag.Parse()
@@ -83,11 +83,12 @@ func main() {
initWebsite()
- storage = NewStorage("upload", *maxSize)
+ storage = NewStorage("upload")
storage.FilterExt = strings.Split(*filterExt, ",")
storage.FilterMime = strings.Split(*filterMime, ",")
storage.Whitelist = *whitelist
storage.IdLength = *idLength
+ storage.MaxSize = *maxSize
if *idCharset != "" {
storage.IdCharset = *idCharset
}