зеркало из https://github.com/mozilla/protodash.git
Add support for specifying the config file
This commit is contained in:
Родитель
ad48c2bd3c
Коммит
8ffee273c0
|
@ -63,6 +63,8 @@ These environment variables control how ProtoDash operates in production. It sho
|
|||
| `PROTODASH_SHOW_PRIVATE` | Whether to show the list of private dashboards if not authenticated | `false` |
|
||||
| `PROTODASH_REDIRECT_TO_LOGIN` | Whether to redirect to the login pagee if a user is not authenticated and accesses a private dashboard | `false` |
|
||||
| `PROTODASH_BASE_DOMAIN` | The domain to use when building subdomains and handling redirects | `localhost:8080` |
|
||||
| `PROTODASH_DEFAULT_BUCKET` | Default GCS bucket to use for dashboards if none is defined in the config | |
|
||||
| `PROTODASH_CONFIG_FILE` | Config file for the dashboards | `config.yml` |
|
||||
|
||||
## Thanks
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ type Config struct {
|
|||
ShowPrivate bool `split_words:"true"`
|
||||
RedirectToLogin bool `split_words:"true"`
|
||||
DefaultBucket string `split_words:"true"`
|
||||
ConfigFile string `split_words:"true" default:"config.yml"`
|
||||
}
|
||||
|
||||
// HTTPClient returns an HTTP client with the proper authentication config
|
||||
|
|
2
main.go
2
main.go
|
@ -31,7 +31,7 @@ func main() {
|
|||
configureLogging(cfg.LogLevel)
|
||||
|
||||
// load dashboard configs
|
||||
dashboards, err := loadDashboards("config.yml", cfg)
|
||||
dashboards, err := loadDashboards(cfg.ConfigFile, cfg)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Send()
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче