2022-08-13 13:12:38 +08:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import "github.com/kelseyhightower/envconfig"
|
|
|
|
|
|
|
|
type (
|
|
|
|
// Config provides the system configuration.
|
|
|
|
Config struct {
|
2022-08-13 14:15:21 +08:00
|
|
|
Debug bool `envconfig:"GITEA_DEBUG"`
|
|
|
|
Trace bool `envconfig:"GITEA_TRACE"`
|
2022-08-13 13:12:38 +08:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
// fromEnviron returns the settings from the environment.
|
|
|
|
func fromEnviron() (Config, error) {
|
|
|
|
cfg := Config{}
|
|
|
|
err := envconfig.Process("", &cfg)
|
|
|
|
return cfg, err
|
|
|
|
}
|