config: remove default macaroon path
Co-Authored-By: Karl Ranna <karl@karlranna.com>
This commit is contained in:
parent
9981fd8fa7
commit
e1726ecb2f
16
config.go
16
config.go
@ -76,10 +76,6 @@ var (
|
|||||||
defaultTLSCertPath = filepath.Join(defaultLndDir, defaultTLSCertFilename)
|
defaultTLSCertPath = filepath.Join(defaultLndDir, defaultTLSCertFilename)
|
||||||
defaultTLSKeyPath = filepath.Join(defaultLndDir, defaultTLSKeyFilename)
|
defaultTLSKeyPath = filepath.Join(defaultLndDir, defaultTLSKeyFilename)
|
||||||
|
|
||||||
defaultAdminMacPath = filepath.Join(defaultLndDir, defaultAdminMacFilename)
|
|
||||||
defaultReadMacPath = filepath.Join(defaultLndDir, defaultReadMacFilename)
|
|
||||||
defaultInvoiceMacPath = filepath.Join(defaultLndDir, defaultInvoiceMacFilename)
|
|
||||||
|
|
||||||
defaultBtcdDir = btcutil.AppDataDir("btcd", false)
|
defaultBtcdDir = btcutil.AppDataDir("btcd", false)
|
||||||
defaultBtcdRPCCertFile = filepath.Join(defaultBtcdDir, "rpc.cert")
|
defaultBtcdRPCCertFile = filepath.Join(defaultBtcdDir, "rpc.cert")
|
||||||
|
|
||||||
@ -256,9 +252,6 @@ func loadConfig() (*config, error) {
|
|||||||
DebugLevel: defaultLogLevel,
|
DebugLevel: defaultLogLevel,
|
||||||
TLSCertPath: defaultTLSCertPath,
|
TLSCertPath: defaultTLSCertPath,
|
||||||
TLSKeyPath: defaultTLSKeyPath,
|
TLSKeyPath: defaultTLSKeyPath,
|
||||||
AdminMacPath: defaultAdminMacPath,
|
|
||||||
InvoiceMacPath: defaultInvoiceMacPath,
|
|
||||||
ReadMacPath: defaultReadMacPath,
|
|
||||||
LogDir: defaultLogDir,
|
LogDir: defaultLogDir,
|
||||||
MaxLogFiles: defaultMaxLogFiles,
|
MaxLogFiles: defaultMaxLogFiles,
|
||||||
MaxLogFileSize: defaultMaxLogFileSize,
|
MaxLogFileSize: defaultMaxLogFileSize,
|
||||||
@ -347,9 +340,6 @@ func loadConfig() (*config, error) {
|
|||||||
preCfg.DataDir = filepath.Join(lndDir, defaultDataDirname)
|
preCfg.DataDir = filepath.Join(lndDir, defaultDataDirname)
|
||||||
preCfg.TLSCertPath = filepath.Join(lndDir, defaultTLSCertFilename)
|
preCfg.TLSCertPath = filepath.Join(lndDir, defaultTLSCertFilename)
|
||||||
preCfg.TLSKeyPath = filepath.Join(lndDir, defaultTLSKeyFilename)
|
preCfg.TLSKeyPath = filepath.Join(lndDir, defaultTLSKeyFilename)
|
||||||
preCfg.AdminMacPath = filepath.Join(lndDir, defaultAdminMacFilename)
|
|
||||||
preCfg.InvoiceMacPath = filepath.Join(lndDir, defaultInvoiceMacFilename)
|
|
||||||
preCfg.ReadMacPath = filepath.Join(lndDir, defaultReadMacFilename)
|
|
||||||
preCfg.LogDir = filepath.Join(lndDir, defaultLogDirname)
|
preCfg.LogDir = filepath.Join(lndDir, defaultLogDirname)
|
||||||
preCfg.Tor.V2PrivateKeyPath = filepath.Join(lndDir, defaultTorV2PrivateKeyFilename)
|
preCfg.Tor.V2PrivateKeyPath = filepath.Join(lndDir, defaultTorV2PrivateKeyFilename)
|
||||||
}
|
}
|
||||||
@ -777,17 +767,17 @@ func loadConfig() (*config, error) {
|
|||||||
// If a custom macaroon directory wasn't specified and the data
|
// If a custom macaroon directory wasn't specified and the data
|
||||||
// directory has changed from the default path, then we'll also update
|
// directory has changed from the default path, then we'll also update
|
||||||
// the path for the macaroons to be generated.
|
// the path for the macaroons to be generated.
|
||||||
if cfg.DataDir != defaultDataDir && cfg.AdminMacPath == defaultAdminMacPath {
|
if cfg.AdminMacPath == "" {
|
||||||
cfg.AdminMacPath = filepath.Join(
|
cfg.AdminMacPath = filepath.Join(
|
||||||
networkDir, defaultAdminMacFilename,
|
networkDir, defaultAdminMacFilename,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if cfg.DataDir != defaultDataDir && cfg.ReadMacPath == defaultReadMacPath {
|
if cfg.ReadMacPath == "" {
|
||||||
cfg.ReadMacPath = filepath.Join(
|
cfg.ReadMacPath = filepath.Join(
|
||||||
networkDir, defaultReadMacFilename,
|
networkDir, defaultReadMacFilename,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if cfg.DataDir != defaultDataDir && cfg.InvoiceMacPath == defaultInvoiceMacPath {
|
if cfg.InvoiceMacPath == "" {
|
||||||
cfg.InvoiceMacPath = filepath.Join(
|
cfg.InvoiceMacPath = filepath.Join(
|
||||||
networkDir, defaultInvoiceMacFilename,
|
networkDir, defaultInvoiceMacFilename,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user