diff --git a/Server.go b/Server.go index f9bae8c..eaa02d8 100644 --- a/Server.go +++ b/Server.go @@ -20,9 +20,12 @@ var staticAssets embed.FS var SERVER_HEADER string = `contented/0.0.0-dev` -const DEFAULT_MAX_CONCURRENT_THUMBS = 16 +const ( + DEFAULT_MAX_CONCURRENT_THUMBS = 16 -const ALBUM_MIMETYPE = `contented/album` + ALBUM_MIMETYPE = `contented/album` + +) type ServerPublicProperties struct { AppTitle string diff --git a/cmd/contented/main.go b/cmd/contented/main.go index 25c5044..45b9d3f 100644 --- a/cmd/contented/main.go +++ b/cmd/contented/main.go @@ -12,17 +12,19 @@ import ( func main() { cwd, _ := os.Getwd() - listenAddr := flag.String("listen", "127.0.0.1:80", "IP/Port to bind server") - dataDir := flag.String("data", cwd, "Directory for stored content") - dbPath := flag.String("db", "contented.db", "Path for metadata database") - appTitle := flag.String("title", "contented", "Title used in web interface") - maxUploadMb := flag.Int("max", 8, "Maximum size of uploaded files in MiB (set zero for unlimited)") - maxUploadSpeed := flag.Int("speed", 0, "Maximum upload speed in bytes/sec (set zero for unlimited)") - trustXForwardedFor := flag.Bool("trustXForwardedFor", false, "Trust X-Forwarded-For reverse proxy headers") - enableHomepage := flag.Bool("enableHomepage", true, "Enable homepage (disable for embedded use only)") - enableUpload := flag.Bool("enableUpload", true, "Enable uploads (disable for read-only mode)") - diskFilesWorldReadable := flag.Bool("diskFilesWorldReadable", false, "Save files as 0644 instead of 0600") - maxConcurrentThumbs := flag.Int("concurrentthumbs", contented.DEFAULT_MAX_CONCURRENT_THUMBS, "Simultaneous thumbnail generation") + var ( + listenAddr = flag.String("listen", "127.0.0.1:80", "IP/Port to bind server") + dataDir = flag.String("data", cwd, "Directory for stored content") + dbPath = flag.String("db", "contented.db", "Path for metadata database") + appTitle = flag.String("title", "contented", "Title used in web interface") + maxUploadMb = flag.Int("max", 8, "Maximum size of uploaded files in MiB (set zero for unlimited)") + maxUploadSpeed = flag.Int("speed", 0, "Maximum upload speed in bytes/sec (set zero for unlimited)") + trustXForwardedFor = flag.Bool("trustXForwardedFor", false, "Trust X-Forwarded-For reverse proxy headers") + enableHomepage = flag.Bool("enableHomepage", true, "Enable homepage (disable for embedded use only)") + enableUpload = flag.Bool("enableUpload", true, "Enable uploads (disable for read-only mode)") + diskFilesWorldReadable = flag.Bool("diskFilesWorldReadable", false, "Save files as 0644 instead of 0600") + maxConcurrentThumbs = flag.Int("concurrentthumbs", contented.DEFAULT_MAX_CONCURRENT_THUMBS, "Simultaneous thumbnail generation") + ) flag.Parse()