diff options
Diffstat (limited to 'input.go')
-rw-r--r-- | input.go | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -33,9 +33,14 @@ func getFlags() (Flags, error) { // Config holds the main configuration data for the server type Config struct { + // can be relative or absolute path SourceDir string `toml:"source"` - TLSCert string `toml:"tls_certificate"` - TLSKey string `toml:"tls_key"` + + // default to ["index.gmi"] + IndexFiles []string `toml:"index_files"` + + TLSCert string `toml:"tls_certificate"` + TLSKey string `toml:"tls_key"` } func getConfig(path string) (Config, error) { @@ -55,5 +60,9 @@ func getConfig(path string) (Config, error) { return cfg, fmt.Errorf("failed to get absolute source dir: %v", err) } + if len(cfg.IndexFiles) == 0 { + cfg.IndexFiles = []string{"index.gmi"} + } + return cfg, nil } |