Skip to content

Commit 6c5d8da

Browse files
Merge pull request #173 from basecamp/acme-cache-path
Expose flag to set ACME cache path
2 parents 89bdeb0 + bfede4f commit 6c5d8da

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

internal/cmd/deploy.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func newDeployCommand() *deployCommand {
3737
deployCommand.cmd.Flags().BoolVar(&deployCommand.tlsStaging, "tls-staging", false, "Use Let's Encrypt staging environment for certificate provisioning")
3838
deployCommand.cmd.Flags().StringVar(&deployCommand.args.ServiceOptions.TLSCertificatePath, "tls-certificate-path", "", "Configure custom TLS certificate path (PEM format)")
3939
deployCommand.cmd.Flags().StringVar(&deployCommand.args.ServiceOptions.TLSPrivateKeyPath, "tls-private-key-path", "", "Configure custom TLS private key path (PEM format)")
40+
deployCommand.cmd.Flags().StringVar(&deployCommand.args.ServiceOptions.ACMECachePath, "tls-acme-cache-path", globalConfig.CertificatePath(), "Location to store ACME assets")
4041
deployCommand.cmd.Flags().BoolVar(&deployCommand.args.ServiceOptions.TLSRedirect, "tls-redirect", true, "Redirect HTTP traffic to HTTPS")
4142

4243
deployCommand.cmd.Flags().DurationVar(&deployCommand.args.DeployTimeout, "deploy-timeout", server.DefaultDeployTimeout, "Maximum time to wait for the new target to become healthy")
@@ -71,12 +72,8 @@ func newDeployCommand() *deployCommand {
7172
func (c *deployCommand) run(cmd *cobra.Command, args []string) error {
7273
c.args.Service = args[0]
7374

74-
if c.args.ServiceOptions.TLSEnabled {
75-
c.args.ServiceOptions.ACMECachePath = globalConfig.CertificatePath()
76-
77-
if c.tlsStaging {
78-
c.args.ServiceOptions.ACMEDirectory = server.ACMEStagingDirectoryURL
79-
}
75+
if c.tlsStaging {
76+
c.args.ServiceOptions.ACMEDirectory = server.ACMEStagingDirectoryURL
8077
}
8178

8279
return withRPCClient(globalConfig.SocketPath(), func(client *rpc.Client) error {

0 commit comments

Comments
 (0)