/*
* Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
*
* This file is licensed under AGPL-3.0-or-later, see NOTICE and LICENSE for
* more information.
*/
package config
import "git.src.quest/~skye/erya-go/util"
var FeluConfig *config
type config struct {
ServiceName string
// Data directory, with trailing slash
DataDir string
FrontendBindAddr string
BackendBindAddr string
DNSBindIP string
DNSBindPort int32
DNSPattern string
}
func InitConfig() {
FeluConfig = &config {
ServiceName: util.LoadEnvStr("FELU_SERVICE_NAME", "FeluDDNS"),
DataDir: util.LoadEnvStr("FELU_DB_PATH", "/var/felu/"),
FrontendBindAddr: util.LoadEnvStr("FELU_FRONTEND_BIND_ADDR", "0.0.0.0:8080"),
BackendBindAddr: util.LoadEnvStr("FELU_BACKEND_BIND_ADDR", "0.0.0.0:8081"),
DNSBindIP: util.LoadEnvStr("FELU_DNS_BIND_IP", "0.0.0.0"),
DNSBindPort: util.LoadEnvInt32("FELU_DNS_BIND_PORT", 53),
DNSPattern: util.LoadEnvStr("FELU_DNS_PATTERN", "."),
}
}