|
|
@ -14,21 +14,22 @@ import ( |
|
|
|
|
|
|
|
|
// Configuration are the available config values
|
|
|
// Configuration are the available config values
|
|
|
type Configuration struct { |
|
|
type Configuration struct { |
|
|
ListenAddr string `yaml:"ListenAddr" env:"LISTEN_ADDR"` |
|
|
ListenAddr string `yaml:"ListenAddr" env:"LISTEN_ADDR"` |
|
|
BaseURL string `yaml:"BaseURL" env:"BASE_URL"` |
|
|
BaseURL string `yaml:"BaseURL" env:"BASE_URL"` |
|
|
DataDir string `yaml:"DataDir" env:"DATA_DIR"` |
|
|
DataDir string `yaml:"DataDir" env:"DATA_DIR"` |
|
|
Backend string `yaml:"Backend" env:"BACKEND"` |
|
|
Backend string `yaml:"Backend" env:"BACKEND"` |
|
|
RedisHost string `yaml:"RedisHost" env:"REDIS_HOST"` |
|
|
RedisHost string `yaml:"RedisHost" env:"REDIS_HOST"` |
|
|
RedisPassword string `yaml:"RedisPassword" env:"REDIS_PASSWORD"` |
|
|
RedisPassword string `yaml:"RedisPassword" env:"REDIS_PASSWORD"` |
|
|
AuthBackend string `yaml:"AuthBackend" env:"AUTH_BACKEND"` |
|
|
AuthBackend string `yaml:"AuthBackend" env:"AUTH_BACKEND"` |
|
|
UseSSL bool `yaml:"EnableSSL" env:"USE_SSL"` |
|
|
UseSSL bool `yaml:"EnableSSL" env:"USE_SSL"` |
|
|
EnableDebugMode bool `yaml:"EnableDebugMode" env:"ENABLE_DEBUG_MODE"` |
|
|
EnableDebugMode bool `yaml:"EnableDebugMode" env:"ENABLE_DEBUG_MODE"` |
|
|
EnableColorLogs bool `yaml:"EnableColorLogs" env:"ENABLE_COLOR_LOGS"` |
|
|
EnableAccessLogs bool `yaml:"EnableAccessLogs" env:"ENABLE_ACCESS_LOGS"` |
|
|
ShortedIDLength int `yaml:"ShortedIDLength" env:"SHORTED_ID_LENGTH"` |
|
|
EnableColorLogs bool `yaml:"EnableColorLogs" env:"ENABLE_COLOR_LOGS"` |
|
|
Google oAuthConf `yaml:"Google" env:"GOOGLE"` |
|
|
ShortedIDLength int `yaml:"ShortedIDLength" env:"SHORTED_ID_LENGTH"` |
|
|
GitHub oAuthConf `yaml:"GitHub" env:"GITHUB"` |
|
|
Google oAuthConf `yaml:"Google" env:"GOOGLE"` |
|
|
Microsoft oAuthConf `yaml:"Microsoft" env:"MICROSOFT"` |
|
|
GitHub oAuthConf `yaml:"GitHub" env:"GITHUB"` |
|
|
Proxy proxyAuthConf `yaml:"Proxy" env:"PROXY"` |
|
|
Microsoft oAuthConf `yaml:"Microsoft" env:"MICROSOFT"` |
|
|
|
|
|
Proxy proxyAuthConf `yaml:"Proxy" env:"PROXY"` |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
type oAuthConf struct { |
|
|
type oAuthConf struct { |
|
|
@ -44,15 +45,16 @@ type proxyAuthConf struct { |
|
|
|
|
|
|
|
|
// config contains the default values
|
|
|
// config contains the default values
|
|
|
var Config = Configuration{ |
|
|
var Config = Configuration{ |
|
|
ListenAddr: ":8080", |
|
|
ListenAddr: ":8080", |
|
|
BaseURL: "http://localhost:3000", |
|
|
BaseURL: "http://localhost:3000", |
|
|
DataDir: "data", |
|
|
DataDir: "data", |
|
|
Backend: "boltdb", |
|
|
Backend: "boltdb", |
|
|
EnableDebugMode: false, |
|
|
EnableDebugMode: false, |
|
|
EnableColorLogs: true, |
|
|
EnableAccessLogs: true, |
|
|
UseSSL: false, |
|
|
EnableColorLogs: true, |
|
|
ShortedIDLength: 4, |
|
|
UseSSL: false, |
|
|
AuthBackend: "oauth", |
|
|
ShortedIDLength: 4, |
|
|
|
|
|
AuthBackend: "oauth", |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// ReadInConfig loads the Configuration and other needed folders for further usage
|
|
|
// ReadInConfig loads the Configuration and other needed folders for further usage
|
|
|
|