pcmt/app/settings/api-keys.go
surtur 5d494fca8d
All checks were successful
continuous-integration/drone/push Build is passing
go,tmpl(api-keys): add tooltips, disable buttons
2023-09-04 15:00:41 +02:00

21 lines
465 B
Go

// Copyright 2023 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: AGPL-3.0-only
package settings
import (
"os"
)
func (s *Settings) setAPIKeys() {
if hibpK := os.Getenv("PCMT_HIBP_API_KEY"); hibpK != "" {
log.Info("setting HIBP API key from env var")
s.SetAPIKeyHIBP(hibpK)
}
if dehashedK := os.Getenv("PCMT_DEHASHED_API_KEY"); dehashedK != "" {
log.Info("setting dehashed.com API key from env var")
s.SetAPIKeyDehashed(dehashedK)
}
}