mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
a7e867a699
This commit replaces github.com/spf13/viper with github.com/knadh/koanf. Koanf is very similar library to viper, with less dependencies and several quality of life differences. This also allows most config options to be defined by ENV. Lastly it also enables the use of split configuration files which can be configured by setting the --config flag multiple times. Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
31 lines
814 B
Go
31 lines
814 B
Go
package configuration
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
// DefaultEnvPrefix is the default environment prefix.
|
|
const DefaultEnvPrefix = "AUTHELIA_"
|
|
|
|
// DefaultEnvDelimiter is the default environment delimiter.
|
|
const DefaultEnvDelimiter = "_"
|
|
|
|
const (
|
|
constSecretSuffix = "_FILE"
|
|
|
|
constDelimiter = "."
|
|
|
|
constWindows = "windows"
|
|
)
|
|
|
|
const (
|
|
errFmtSecretAlreadyDefined = "secrets: error loading secret into key '%s': it's already defined in other " +
|
|
"configuration sources"
|
|
errFmtSecretIOIssue = "secrets: error loading secret path %s into key '%s': %v"
|
|
errFmtGenerateConfiguration = "error occurred generating configuration: %+v"
|
|
)
|
|
|
|
var secretSuffixes = []string{"key", "secret", "password", "token"}
|
|
var errNoSources = errors.New("no sources provided")
|
|
var errNoValidator = errors.New("no validator provided")
|