mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-29 19:22:40 +01:00
Merge pull request #7693 from gcaracuel/lncli_env_global_flags
lncli: Global flags to accept ENV vars overrides
This commit is contained in:
commit
8c58730c34
@ -34,6 +34,18 @@ const (
|
|||||||
defaultMacaroonFilename = "admin.macaroon"
|
defaultMacaroonFilename = "admin.macaroon"
|
||||||
defaultRPCPort = "10009"
|
defaultRPCPort = "10009"
|
||||||
defaultRPCHostPort = "localhost:" + defaultRPCPort
|
defaultRPCHostPort = "localhost:" + defaultRPCPort
|
||||||
|
|
||||||
|
envVarRPCServer = "LNCLI_RPCSERVER"
|
||||||
|
envVarLNDDir = "LNCLI_LNDDIR"
|
||||||
|
envVarSOCKSProxy = "LNCLI_SOCKSPROXY"
|
||||||
|
envVarTLSCertPath = "LNCLI_TLSCERTPATH"
|
||||||
|
envVarChain = "LNCLI_CHAIN"
|
||||||
|
envVarNetwork = "LNCLI_NETWORK"
|
||||||
|
envVarMacaroonPath = "LNCLI_MACAROONPATH"
|
||||||
|
envVarMacaroonTimeout = "LNCLI_MACAROONTIMEOUT"
|
||||||
|
envVarMacaroonIP = "LNCLI_MACAROONIP"
|
||||||
|
envVarProfile = "LNCLI_PROFILE"
|
||||||
|
envVarMacFromJar = "LNCLI_MACFROMJAR"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -342,38 +354,44 @@ func main() {
|
|||||||
app.Usage = "control plane for your Lightning Network Daemon (lnd)"
|
app.Usage = "control plane for your Lightning Network Daemon (lnd)"
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "rpcserver",
|
Name: "rpcserver",
|
||||||
Value: defaultRPCHostPort,
|
Value: defaultRPCHostPort,
|
||||||
Usage: "The host:port of LN daemon.",
|
Usage: "The host:port of LN daemon.",
|
||||||
|
EnvVar: envVarRPCServer,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "lnddir",
|
Name: "lnddir",
|
||||||
Value: defaultLndDir,
|
Value: defaultLndDir,
|
||||||
Usage: "The path to lnd's base directory.",
|
Usage: "The path to lnd's base directory.",
|
||||||
TakesFile: true,
|
TakesFile: true,
|
||||||
|
EnvVar: envVarLNDDir,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "socksproxy",
|
Name: "socksproxy",
|
||||||
Usage: "The host:port of a SOCKS proxy through " +
|
Usage: "The host:port of a SOCKS proxy through " +
|
||||||
"which all connections to the LN " +
|
"which all connections to the LN " +
|
||||||
"daemon will be established over.",
|
"daemon will be established over.",
|
||||||
|
EnvVar: envVarSOCKSProxy,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "tlscertpath",
|
Name: "tlscertpath",
|
||||||
Value: defaultTLSCertPath,
|
Value: defaultTLSCertPath,
|
||||||
Usage: "The path to lnd's TLS certificate.",
|
Usage: "The path to lnd's TLS certificate.",
|
||||||
TakesFile: true,
|
TakesFile: true,
|
||||||
|
EnvVar: envVarTLSCertPath,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "chain, c",
|
Name: "chain, c",
|
||||||
Usage: "The chain lnd is running on, e.g. bitcoin.",
|
Usage: "The chain lnd is running on, e.g. bitcoin.",
|
||||||
Value: "bitcoin",
|
Value: "bitcoin",
|
||||||
|
EnvVar: envVarChain,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "network, n",
|
Name: "network, n",
|
||||||
Usage: "The network lnd is running on, e.g. mainnet, " +
|
Usage: "The network lnd is running on, e.g. mainnet, " +
|
||||||
"testnet, etc.",
|
"testnet, etc.",
|
||||||
Value: "mainnet",
|
Value: "mainnet",
|
||||||
|
EnvVar: envVarNetwork,
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "no-macaroons",
|
Name: "no-macaroons",
|
||||||
@ -383,15 +401,19 @@ func main() {
|
|||||||
Name: "macaroonpath",
|
Name: "macaroonpath",
|
||||||
Usage: "The path to macaroon file.",
|
Usage: "The path to macaroon file.",
|
||||||
TakesFile: true,
|
TakesFile: true,
|
||||||
|
EnvVar: envVarMacaroonPath,
|
||||||
},
|
},
|
||||||
cli.Int64Flag{
|
cli.Int64Flag{
|
||||||
Name: "macaroontimeout",
|
Name: "macaroontimeout",
|
||||||
Value: 60,
|
Value: 60,
|
||||||
Usage: "Anti-replay macaroon validity time in seconds.",
|
Usage: "Anti-replay macaroon validity time in " +
|
||||||
|
"seconds.",
|
||||||
|
EnvVar: envVarMacaroonTimeout,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "macaroonip",
|
Name: "macaroonip",
|
||||||
Usage: "If set, lock macaroon to specific IP address.",
|
Usage: "If set, lock macaroon to specific IP address.",
|
||||||
|
EnvVar: envVarMacaroonIP,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "profile, p",
|
Name: "profile, p",
|
||||||
@ -401,12 +423,14 @@ func main() {
|
|||||||
"a default profile is set, this flag can be " +
|
"a default profile is set, this flag can be " +
|
||||||
"set to an empty string to disable reading " +
|
"set to an empty string to disable reading " +
|
||||||
"values from the profiles file.",
|
"values from the profiles file.",
|
||||||
|
EnvVar: envVarProfile,
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "macfromjar",
|
Name: "macfromjar",
|
||||||
Usage: "Use this macaroon from the profile's " +
|
Usage: "Use this macaroon from the profile's " +
|
||||||
"macaroon jar instead of the default one. " +
|
"macaroon jar instead of the default one. " +
|
||||||
"Can only be used if profiles are defined.",
|
"Can only be used if profiles are defined.",
|
||||||
|
EnvVar: envVarMacFromJar,
|
||||||
},
|
},
|
||||||
cli.StringSliceFlag{
|
cli.StringSliceFlag{
|
||||||
Name: "metadata",
|
Name: "metadata",
|
||||||
|
@ -77,6 +77,10 @@ unlock or create.
|
|||||||
* [Added fuzz tests](https://github.com/lightningnetwork/lnd/pull/7649) for
|
* [Added fuzz tests](https://github.com/lightningnetwork/lnd/pull/7649) for
|
||||||
signature parsing and conversion.
|
signature parsing and conversion.
|
||||||
|
|
||||||
|
## `lncli`
|
||||||
|
|
||||||
|
* Added ability to use [ENV variables to override `lncli` global flags](https://github.com/lightningnetwork/lnd/pull/7693). Flags will have preference over ENVs.
|
||||||
|
|
||||||
# Contributors (Alphabetical Order)
|
# Contributors (Alphabetical Order)
|
||||||
|
|
||||||
* Carla Kirk-Cohen
|
* Carla Kirk-Cohen
|
||||||
@ -84,6 +88,7 @@ unlock or create.
|
|||||||
* Elle Mouton
|
* Elle Mouton
|
||||||
* Erik Arvstedt
|
* Erik Arvstedt
|
||||||
* ErikEk
|
* ErikEk
|
||||||
|
* Guillermo Caracuel
|
||||||
* hieblmi
|
* hieblmi
|
||||||
* Jordi Montes
|
* Jordi Montes
|
||||||
* Matt Morehouse
|
* Matt Morehouse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user