1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-27 03:32:05 +02:00

Add interface:port override to CLI

This commit is contained in:
xenolf 2016-01-08 08:05:07 +01:00
parent 0c10083ef0
commit 772f3d05ab
2 changed files with 8 additions and 8 deletions

8
cli.go
View File

@ -88,12 +88,12 @@ func main() {
Usage: "Explicitly disallow solvers by name from being used. Solvers: \"http-01\", \"tls-sni-01\".", Usage: "Explicitly disallow solvers by name from being used. Solvers: \"http-01\", \"tls-sni-01\".",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "httpPort", Name: "http",
Usage: "Set the port to use for HTTP based challenges to listen on.", Usage: "Set the port and interface to use for HTTP based challenges to listen on. Supported: interface:port or :port",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "tlsPort", Name: "tls",
Usage: "Set the port to use for TLS based challenges to listen on.", Usage: "Set the port and interface to use for TLS based challenges to listen on. Supported: interface:port or :port",
}, },
} }

View File

@ -43,12 +43,12 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
client.ExcludeChallenges(conf.ExcludedSolvers()) client.ExcludeChallenges(conf.ExcludedSolvers())
} }
if c.GlobalIsSet("httpPort") { if c.GlobalIsSet("http") {
client.SetHTTPPort(c.GlobalString("httpPort")) client.SetHTTPAddress(c.GlobalString("http"))
} }
if c.GlobalIsSet("tlsPort") { if c.GlobalIsSet("tls") {
client.SetTLSPort(c.GlobalString("tlsPort")) client.SetTLSAddress(c.GlobalString("tls"))
} }
return conf, acc, client return conf, acc, client