6
6
"encoding/base64"
7
7
"errors"
8
8
"fmt"
9
+ "github.com/lightningnetwork/lnd/lncfg"
9
10
"io/ioutil"
10
11
"net"
11
12
"net/http"
@@ -22,7 +23,6 @@ import (
22
23
"github.com/lightninglabs/loop/loopd"
23
24
"github.com/lightninglabs/loop/looprpc"
24
25
"github.com/lightningnetwork/lnd"
25
- "github.com/lightningnetwork/lnd/lncfg"
26
26
"github.com/lightningnetwork/lnd/lnrpc"
27
27
"github.com/lightningnetwork/lnd/lntest/wait"
28
28
"github.com/lightningnetwork/lnd/macaroons"
@@ -100,7 +100,19 @@ func (g *Shushtar) Run() error {
100
100
return err
101
101
}
102
102
103
+ // Load the configuration, and parse any command line options. This
104
+ // function will also set up logging properly.
105
+ g .cfg .Lnd , err = loadLndConfig (g .cfg )
106
+ if err != nil {
107
+ return err
108
+ }
109
+
103
110
// Validate the shushtar config options.
111
+ if g .cfg .LetsEncryptDir == "" {
112
+ g .cfg .LetsEncryptDir = filepath .Join (
113
+ g .cfg .Lnd .LndDir , defaultLetsEncryptDir ,
114
+ )
115
+ }
104
116
g .cfg .LetsEncryptDir = lncfg .CleanAndExpandPath (g .cfg .LetsEncryptDir )
105
117
if g .cfg .LetsEncrypt && g .cfg .LetsEncryptHost == "" {
106
118
return fmt .Errorf ("host must be set when using let's encrypt" )
@@ -113,14 +125,7 @@ func (g *Shushtar) Run() error {
113
125
return fmt .Errorf ("please set a strong password for the UI, " +
114
126
"at least %d characters long" , uiPasswordMinLength )
115
127
}
116
-
117
- // Load the configuration, and parse any command line options. This
118
- // function will also set up logging properly.
119
- g .cfg .Lnd , err = loadLndConfig (g .cfg )
120
- if err != nil {
121
- return err
122
- }
123
-
128
+
124
129
// Initiate our listeners. For now, we only support listening on one
125
130
// port at a time because we can only pass in one pre-configured RPC
126
131
// listener into lnd.
0 commit comments