multi: add disable authenticator option

To make it easier to use aperture in a setup where we only need its
proxy functionality but not its LSAT capabilities, we add the option to
disable the authenticator. This makes it possible to run aperture
without needing to connect it to an lnd node.
This commit is contained in:
Elle Mouton
2021-06-30 10:40:41 +02:00
committed by Oliver Gugger
parent 5061b659c9
commit 0206ecb031
2 changed files with 17 additions and 10 deletions

View File

@@ -161,15 +161,18 @@ func (a *Aperture) Start(errChan chan error) error {
Value: price,
}, nil
}
a.challenger, err = NewLndChallenger(
a.cfg.Authenticator, genInvoiceReq, errChan,
)
if err != nil {
return err
}
err = a.challenger.Start()
if err != nil {
return err
if !a.cfg.Authenticator.Disable {
a.challenger, err = NewLndChallenger(
a.cfg.Authenticator, genInvoiceReq, errChan,
)
if err != nil {
return err
}
err = a.challenger.Start()
if err != nil {
return err
}
}
// Create the proxy and connect it to lnd.
@@ -267,7 +270,9 @@ func (a *Aperture) UpdateServices(services []*proxy.Service) error {
func (a *Aperture) Stop() error {
var returnErr error
a.challenger.Stop()
if a.challenger != nil {
a.challenger.Stop()
}
// Shut down our client and server connections now. This should cause
// the first goroutine to quit.

View File

@@ -31,6 +31,8 @@ type AuthConfig struct {
MacDir string `long:"macdir"`
Network string `long:"network"`
Disable bool `long:"disable"`
}
type TorConfig struct {