add donations to config

This commit is contained in:
pluja 2024-02-10 13:47:44 +01:00
parent 1d0c1315d8
commit d6e6592171
2 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,13 @@ type Config struct {
Cache bool
Scraper bool
ListenAddr string
Donations Donations
}
type Donations struct {
Xmr string
Btc string
Lnn string
}
var Conf Config

View File

@ -70,6 +70,11 @@ func init() {
log.Info().Msg("No .env file found, using environment variables")
}
// Load donation addresses into config
config.Conf.Donations.Xmr = os.Getenv("XMR_ADDRESS")
config.Conf.Donations.Btc = os.Getenv("BTC_ADDRESS")
config.Conf.Donations.Lnn = os.Getenv("LNN_ADDRESS")
// Database init
log.Info().Msg("Initializing database.")
database.InitPocketbase()