DEVELOPMENT ENVIRONMENT

~liljamo/felu

abd47183d499531b2432de55b8971b7fdf949390 — Jonni Liljamo a month ago 35a4f24
feat: config DDNSDomain and SOAEmail
1 files changed, 8 insertions(+), 1 deletions(-)

M internal/config/config.go
M internal/config/config.go => internal/config/config.go +8 -1
@@ 16,9 16,12 @@ var FeluConfig *config
type config struct {
	ServiceName string

	DDNSDomain string
	// API url, where the API is served at (e.g. api.feluddns.tld)
	APIUrl string

	SOAEmail string

	// Initial email for the admin user, only used if no admin account (e.g. first boot)
	InitialAdminEmail string
	// Initial password for the admin user, only used if no admin account (e.g. first boot)


@@ 44,7 47,11 @@ func InitConfig() {
	FeluConfig = &config{
		ServiceName: util.LoadEnvStr("FELU_SERVICE_NAME", "FeluDDNS"),

		APIUrl: util.LoadEnvStr("FELU_API_URL", "MUST_SET"),
		// FIXME: panic without this, should do same for many of these
		DDNSDomain: util.LoadEnvStr("FELU_DDNS_DOMAIN", "ddns.staging.fuckdns.org"),
		APIUrl:     util.LoadEnvStr("FELU_API_URL", "MUST_SET"),

		SOAEmail: util.LoadEnvStr("FELU_SOA_EMAIL", "admin.felu.arpa"),

		InitialAdminEmail: util.LoadEnvStr("FELU_INITIAL_ADMIN_EMAIL", "admin@example.com"),
		InitialAdminPwd:   util.LoadEnvStr("FELU_INITIAL_ADMIN_PWD", "feluadmin"),