From cd7ee83b5765f29db8a5f022e13b92d97ca10100 Mon Sep 17 00:00:00 2001 From: positiveblue Date: Wed, 5 Jul 2023 09:18:04 -0700 Subject: [PATCH] config: set default mailbox address Make the LNC authenticator use the default mailbox address whenever the config does not specify a custom one. --- aperture.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aperture.go b/aperture.go index cdcd2e0..95a3193 100644 --- a/aperture.go +++ b/aperture.go @@ -82,6 +82,10 @@ const ( // invoiceMacaroonName is the name of the invoice macaroon belonging // to the target lnd node. invoiceMacaroonName = "invoice.macaroon" + + // defaultMailboxAddress is the default address of the mailbox server + // that will be used if none is specified. + defaultMailboxAddress = "mailbox.terminal.lightning.today:443" ) var ( @@ -591,6 +595,11 @@ func getConfig() (*Config, error) { cfg.Authenticator.MacDir, ) + // Set default mailbox address if none is set. + if cfg.Authenticator.MailboxAddress == "" { + cfg.Authenticator.MailboxAddress = defaultMailboxAddress + } + // Then check the configuration that we got from the config file, all // required values need to be set at this point. if err := cfg.validate(); err != nil {