multi: configure and start hashmail server

With this commit we make it possible to enable the Lightning Node
Connect mailbox server to be enabled and started as a local service
within aperture.
This commit is contained in:
Oliver Gugger
2021-11-22 16:30:50 +01:00
parent c45cd3a317
commit 7bcc8355d0
7 changed files with 233 additions and 29 deletions

View File

@@ -3,6 +3,7 @@ package aperture
import (
"errors"
"fmt"
"time"
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/aperture/proxy"
@@ -59,6 +60,12 @@ func (a *AuthConfig) validate() error {
return nil
}
type HashMailConfig struct {
Enabled bool `long:"enabled"`
MessageRate time.Duration `long:"messagerate" description:"The average minimum time that should pass between each message."`
MessageBurstAllowance int `long:"messageburstallowance" description:"The burst rate we allow for messages."`
}
type TorConfig struct {
Control string `long:"control" description:"The host:port of the Tor instance."`
ListenPort uint16 `long:"listenport" description:"The port we should listen on for client requests over Tor. Note that this port should not be exposed to the outside world, it is only intended to be reached by clients through the onion service."`
@@ -101,6 +108,10 @@ type Config struct {
// each backend service to Aperture.
Services []*proxy.Service `long:"service" description:"Configurations for each Aperture backend service."`
// HashMail is the configuration section for configuring the Lightning
// Node Connect mailbox server.
HashMail *HashMailConfig `long:"hashmail" description:"Configuration for the Lightning Node Connect mailbox server."`
// DebugLevel is a string defining the log level for the service either
// for all subsystems the same or individual level by subsystem.
DebugLevel string `long:"debuglevel" description:"Debug level for the Aperture application and its subsystems."`