mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 08:41:42 +02:00
Merge pull request #2428 from joostjager/letsencrypt
lnrpc: let's encrypt certificates
This commit is contained in:
17
config.go
17
config.go
@@ -64,6 +64,8 @@ const (
|
||||
defaultMaxLogFileSize = 10
|
||||
defaultMinBackoff = time.Second
|
||||
defaultMaxBackoff = time.Hour
|
||||
defaultLetsEncryptDirname = "letsencrypt"
|
||||
defaultLetsEncryptPort = 80
|
||||
|
||||
defaultTorSOCKSPort = 9050
|
||||
defaultTorDNSHost = "soa.nodes.lightning.directory"
|
||||
@@ -127,8 +129,9 @@ var (
|
||||
|
||||
defaultTowerDir = filepath.Join(defaultDataDir, defaultTowerSubDirname)
|
||||
|
||||
defaultTLSCertPath = filepath.Join(DefaultLndDir, defaultTLSCertFilename)
|
||||
defaultTLSKeyPath = filepath.Join(DefaultLndDir, defaultTLSKeyFilename)
|
||||
defaultTLSCertPath = filepath.Join(DefaultLndDir, defaultTLSCertFilename)
|
||||
defaultTLSKeyPath = filepath.Join(DefaultLndDir, defaultTLSKeyFilename)
|
||||
defaultLetsEncryptDir = filepath.Join(DefaultLndDir, defaultLetsEncryptDirname)
|
||||
|
||||
defaultBtcdDir = btcutil.AppDataDir("btcd", false)
|
||||
defaultBtcdRPCCertFile = filepath.Join(defaultBtcdDir, "rpc.cert")
|
||||
@@ -179,6 +182,10 @@ type Config struct {
|
||||
MaxLogFileSize int `long:"maxlogfilesize" description:"Maximum logfile size in MB"`
|
||||
AcceptorTimeout time.Duration `long:"acceptortimeout" description:"Time after which an RPCAcceptor will time out and return false if it hasn't yet received a response"`
|
||||
|
||||
LetsEncryptDir string `long:"letsencryptdir" description:"The directory to store Let's Encrypt certificates within"`
|
||||
LetsEncryptPort int `long:"letsencryptport" description:"The port on which lnd will listen for Let's Encrypt challenges. Let's Encrypt will always try to contact on port 80. Often non-root processes are not allowed to bind to ports lower than 1024. This configuration option allows a different port to be used, but must be used in combination with port forwarding from port 80."`
|
||||
LetsEncryptDomain string `long:"letsencryptdomain" description:"Request a Let's Encrypt certificate for this domain. Note that the certicate is only requested and stored when the first rpc connection comes in."`
|
||||
|
||||
// We'll parse these 'raw' string arguments into real net.Addrs in the
|
||||
// loadConfig function. We need to expose the 'raw' strings so the
|
||||
// command line library can access them.
|
||||
@@ -318,6 +325,8 @@ func DefaultConfig() Config {
|
||||
DebugLevel: defaultLogLevel,
|
||||
TLSCertPath: defaultTLSCertPath,
|
||||
TLSKeyPath: defaultTLSKeyPath,
|
||||
LetsEncryptDir: defaultLetsEncryptDir,
|
||||
LetsEncryptPort: defaultLetsEncryptPort,
|
||||
LogDir: defaultLogDir,
|
||||
MaxLogFiles: defaultMaxLogFiles,
|
||||
MaxLogFileSize: defaultMaxLogFileSize,
|
||||
@@ -520,6 +529,9 @@ func ValidateConfig(cfg Config, usageMessage string) (*Config, error) {
|
||||
lndDir := CleanAndExpandPath(cfg.LndDir)
|
||||
if lndDir != DefaultLndDir {
|
||||
cfg.DataDir = filepath.Join(lndDir, defaultDataDirname)
|
||||
cfg.LetsEncryptDir = filepath.Join(
|
||||
lndDir, defaultLetsEncryptDirname,
|
||||
)
|
||||
cfg.TLSCertPath = filepath.Join(lndDir, defaultTLSCertFilename)
|
||||
cfg.TLSKeyPath = filepath.Join(lndDir, defaultTLSKeyFilename)
|
||||
cfg.LogDir = filepath.Join(lndDir, defaultLogDirname)
|
||||
@@ -558,6 +570,7 @@ func ValidateConfig(cfg Config, usageMessage string) (*Config, error) {
|
||||
cfg.DataDir = CleanAndExpandPath(cfg.DataDir)
|
||||
cfg.TLSCertPath = CleanAndExpandPath(cfg.TLSCertPath)
|
||||
cfg.TLSKeyPath = CleanAndExpandPath(cfg.TLSKeyPath)
|
||||
cfg.LetsEncryptDir = CleanAndExpandPath(cfg.LetsEncryptDir)
|
||||
cfg.AdminMacPath = CleanAndExpandPath(cfg.AdminMacPath)
|
||||
cfg.ReadMacPath = CleanAndExpandPath(cfg.ReadMacPath)
|
||||
cfg.InvoiceMacPath = CleanAndExpandPath(cfg.InvoiceMacPath)
|
||||
|
Reference in New Issue
Block a user