diff --git a/config.go b/config.go index 14c9534..ba39b4f 100644 --- a/config.go +++ b/config.go @@ -5,6 +5,10 @@ import ( "fmt" ) +const ( + DefaultProductionStorage = "burlesque.kch#opts=c#zcomp=gz#msiz=524288000" +) + type ( Config struct { Storage string @@ -19,11 +23,15 @@ var ( ) func SetupConfig() { - cfg.Storage = *flag.String("storage", "-", "Kyoto Cabinet storage path (e.g. storage.kch#zcomp=gz#capsiz=524288000)") + cfg.Storage = *flag.String("storage", "-", "Kyoto Cabinet storage path (e.g. "+DefaultProductionStorage+")") cfg.Env = *flag.String("environment", "development", "Process environment: development or production") cfg.Port = *flag.Int("port", 4401, "Server HTTP port") cfg.Rollbar = *flag.String("rollbar", "", "Rollbar token") flag.Parse() + + if cfg.Env == "production" && cfg.Storage == "-" { + cfg.Storage = DefaultProductionStorage + } } func (c Config) PortString() string {