config: expose watchtower conf
This commit is contained in:
parent
bd5b8700d8
commit
c1f24feb8b
17
config.go
17
config.go
@ -40,6 +40,7 @@ const (
|
||||
defaultDataDirname = "data"
|
||||
defaultChainSubDirname = "chain"
|
||||
defaultGraphSubDirname = "graph"
|
||||
defaultTowerSubDirname = "watchtower"
|
||||
defaultTLSCertFilename = "tls.cert"
|
||||
defaultTLSKeyFilename = "tls.key"
|
||||
defaultAdminMacFilename = "admin.macaroon"
|
||||
@ -133,6 +134,8 @@ var (
|
||||
defaultDataDir = filepath.Join(defaultLndDir, defaultDataDirname)
|
||||
defaultLogDir = filepath.Join(defaultLndDir, defaultLogDirname)
|
||||
|
||||
defaultTowerDir = filepath.Join(defaultDataDir, defaultTowerSubDirname)
|
||||
|
||||
defaultTLSCertPath = filepath.Join(defaultLndDir, defaultTLSCertFilename)
|
||||
defaultTLSKeyPath = filepath.Join(defaultLndDir, defaultTLSKeyFilename)
|
||||
|
||||
@ -318,6 +321,8 @@ type config struct {
|
||||
Prometheus lncfg.Prometheus `group:"prometheus" namespace:"prometheus"`
|
||||
|
||||
WtClient *lncfg.WtClient `group:"wtclient" namespace:"wtclient"`
|
||||
|
||||
Watchtower *lncfg.Watchtower `group:"watchtower" namespace:"watchtower"`
|
||||
}
|
||||
|
||||
// loadConfig initializes and parses the config using a config file and command
|
||||
@ -413,6 +418,9 @@ func loadConfig() (*config, error) {
|
||||
ChannelCacheSize: channeldb.DefaultChannelCacheSize,
|
||||
},
|
||||
Prometheus: lncfg.DefaultPrometheus(),
|
||||
Watchtower: &lncfg.Watchtower{
|
||||
TowerDir: defaultTowerDir,
|
||||
},
|
||||
}
|
||||
|
||||
// Pre-parse the command line options to pick up an alternative config
|
||||
@ -473,6 +481,14 @@ func loadConfig() (*config, error) {
|
||||
cfg.TLSCertPath = filepath.Join(lndDir, defaultTLSCertFilename)
|
||||
cfg.TLSKeyPath = filepath.Join(lndDir, defaultTLSKeyFilename)
|
||||
cfg.LogDir = filepath.Join(lndDir, defaultLogDirname)
|
||||
|
||||
// If the watchtower's directory is set to the default, i.e. the
|
||||
// user has not requested a different location, we'll move the
|
||||
// location to be relative to the specified lnd directory.
|
||||
if cfg.Watchtower.TowerDir == defaultTowerDir {
|
||||
cfg.Watchtower.TowerDir =
|
||||
filepath.Join(cfg.DataDir, defaultTowerSubDirname)
|
||||
}
|
||||
}
|
||||
|
||||
// Create the lnd directory if it doesn't already exist.
|
||||
@ -509,6 +525,7 @@ func loadConfig() (*config, error) {
|
||||
cfg.BitcoindMode.Dir = cleanAndExpandPath(cfg.BitcoindMode.Dir)
|
||||
cfg.LitecoindMode.Dir = cleanAndExpandPath(cfg.LitecoindMode.Dir)
|
||||
cfg.Tor.PrivateKeyPath = cleanAndExpandPath(cfg.Tor.PrivateKeyPath)
|
||||
cfg.Watchtower.TowerDir = cleanAndExpandPath(cfg.Watchtower.TowerDir)
|
||||
|
||||
// Ensure that the user didn't attempt to specify negative values for
|
||||
// any of the autopilot params.
|
||||
|
Loading…
Reference in New Issue
Block a user