.env.example, addr config, working on banned mime types
This commit is contained in:
@@ -16,10 +16,12 @@ type Config struct {
|
||||
MaxFileBytes int64
|
||||
Expiries []Expiry
|
||||
NormalizeMIMETypes bool
|
||||
BannedMIMETypes []string
|
||||
|
||||
DatabasePath string
|
||||
// public host like "https://bin.zip", NOT the address minbin listens on
|
||||
Host string
|
||||
Addr string
|
||||
}
|
||||
|
||||
func loadConfig() (Config, error) {
|
||||
@@ -61,10 +63,12 @@ func loadConfig() (Config, error) {
|
||||
MaxPasteBytes: maxPasteKiB * 1024,
|
||||
MaxFileBytes: maxFileKiB * 1024,
|
||||
Expiries: expiries,
|
||||
NormalizeMIMETypes: envOrDefault("MINIBIN_NORMALIZE_MIME_TYPE", "true") == "true",
|
||||
NormalizeMIMETypes: envOrDefault("MINIBIN_NORMALIZE_MIME_TYPES", "true") == "true",
|
||||
BannedMIMETypes: strings.Split(envOrDefault("MINIBIN_BANNED_MIME_TYPES", ""), ","),
|
||||
|
||||
DatabasePath: envOrDefault("MINIBIN_DATABASE_PATH", "minibin.sqlite"),
|
||||
Host: envOrDefault("MINIBIN_HOST", "http://localhost:8080"),
|
||||
Addr: envOrDefault("MINIBIN_ADDR", "localhost:8080"),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user