add env var to specify config location

This commit is contained in:
Jiang Zhu 2022-08-21 16:22:15 +08:00
parent 84a5edf345
commit 81f91f03b4
4 changed files with 113 additions and 0 deletions

View file

@ -25,6 +25,9 @@ func init() {
}
func initConfig() {
if cfgFile == "" {
cfgFile = os.Getenv("HEADSCALE_CONFIG")
}
if cfgFile != "" {
err := headscale.LoadConfig(cfgFile, true)
if err != nil {