Skip to content

Commit 53f49ba

Browse files
authored
Don't allow Let's Encrypt with Traefik router, fixes ddev#4632 (ddev#4671)
1 parent 84d4a07 commit 53f49ba

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

cmd/ddev/cmd/config-global_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/drud/ddev/pkg/exec"
55
"github.com/drud/ddev/pkg/fileutil"
66
"github.com/drud/ddev/pkg/globalconfig"
7+
"github.com/drud/ddev/pkg/nodeps"
78
asrt "github.com/stretchr/testify/assert"
89
"github.com/stretchr/testify/require"
910
"os"
@@ -16,7 +17,9 @@ import (
1617

1718
func TestCmdGlobalConfig(t *testing.T) {
1819
assert := asrt.New(t)
19-
20+
if nodeps.UseTraefikDefault {
21+
t.Skip("Skipping with traefik turned on because can't use hardened images")
22+
}
2023
backupConfig := globalconfig.DdevGlobalConfig
2124
// Start with no config file
2225
configFile := globalconfig.GetGlobalConfigPath()

docs/content/users/configuration/config.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ DDEV must detect whether the internet is working to determine whether to add hos
216216

217217
## `letsencrypt_email`
218218

219-
Email associated with Let’s Encrypt feature. (Works in conjunction with [`use_letsencrypt`](#use_letsencrypt).)
219+
Email associated with Let’s Encrypt feature. (Works in conjunction with [`use_letsencrypt`](#use_letsencrypt).) (Not currently compatible with Traefik router.)
220220

221221
| Type | Default | Usage
222222
| -- | -- | --
@@ -497,7 +497,7 @@ When `true`, more secure hardened images are used for an internet deployment. Th
497497

498498
## `use_letsencrypt`
499499

500-
Whether to enable Let’s Encrypt integration. (Works in conjunction with [`letsencrypt_email`](#letsencrypt_email).)
500+
Whether to enable Let’s Encrypt integration. (Works in conjunction with [`letsencrypt_email`](#letsencrypt_email).) (Not currently compatible with Traefik router.)
501501

502502
| Type | Default | Usage
503503
| -- | -- | --

docs/content/users/topics/hosting.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
!!!warning "Experimental Feature!"
44
This is not a replacement for scalable, managed hosting. It’s unknown how much traffic it can handle in a given environment.
5+
!!!warning "Let's Encrypt support not directly compatible with Traefik router"
6+
`ddev config global --use-letsencrypt` is not directly compatible with the Traefik router, but it [can be configured using Traefik docs](https://doc.traefik.io/traefik/https/acme/).
57

68
One of DDEV’s experimental features is lightweight hosting with Let’s Encrypt for HTTPS support. You can run DDEV on a public web server, point DNS to it, and use it as a limited hosting environment.
79

pkg/globalconfig/global_config.go

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ func ValidateGlobalConfig() error {
135135
if DdevGlobalConfig.DisableHTTP2 && DdevGlobalConfig.UseTraefik {
136136
return fmt.Errorf("disable_http2 and use_traefik are mutually incompatible")
137137
}
138+
if DdevGlobalConfig.UseTraefik && (DdevGlobalConfig.UseLetsEncrypt || DdevGlobalConfig.LetsEncryptEmail != "") {
139+
return fmt.Errorf("use-letsencrypt is not directly supported with traefik. but can be configured with custom config, see https://doc.traefik.io/traefik/https/acme/")
140+
}
138141
return nil
139142
}
140143

0 commit comments

Comments
 (0)