From adfa3f795c1bd1934c7d64e4ca24a680bf0ef032 Mon Sep 17 00:00:00 2001 From: Martijn Heemels Date: Wed, 17 Jan 2018 12:20:04 +0100 Subject: [PATCH 01/17] Fix typo in anonymous usage log message. --- cmd/traefik/traefik.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/traefik/traefik.go b/cmd/traefik/traefik.go index cc8179bcb..1f8c0077f 100644 --- a/cmd/traefik/traefik.go +++ b/cmd/traefik/traefik.go @@ -261,14 +261,14 @@ func stats(globalConfiguration *configuration.GlobalConfiguration) { Stats collection is enabled. Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration. Help us improve Traefik by leaving this feature on :) -More details on: https://docs.traefik.io/basic/#collected-data +More details on: https://docs.traefik.io/basics/#collected-data `) collect(globalConfiguration) } else { log.Info(` Stats collection is disabled. Help us improve Traefik by turning this feature on :) -More details on: https://docs.traefik.io/basic/#collected-data +More details on: https://docs.traefik.io/basics/#collected-data `) } } From ced5aa5dc693aa4ec3da92fad8f2cc4a25675ceb Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Wed, 17 Jan 2018 18:46:03 +0100 Subject: [PATCH 02/17] Challenge HTTP must ignore deprecated web.path option --- integration/acme_test.go | 10 +++++ .../fixtures/acme/acme_http01_web.toml | 38 +++++++++++++++++++ server/server.go | 5 +++ 3 files changed, 53 insertions(+) create mode 100644 integration/fixtures/acme/acme_http01_web.toml diff --git a/integration/acme_test.go b/integration/acme_test.go index 01da7ca94..5a9f1dd32 100644 --- a/integration/acme_test.go +++ b/integration/acme_test.go @@ -92,6 +92,16 @@ func (s *AcmeSuite) TestOnHostRuleRetrieveAcmeCertificateHTTP01(c *check.C) { s.retrieveAcmeCertificate(c, testCase) } +// Test OnHostRule option with none provided certificate and challenge HTTP-01 and web path +func (s *AcmeSuite) TestOnHostRuleRetrieveAcmeCertificateHTTP01WithPath(c *check.C) { + testCase := AcmeTestCase{ + traefikConfFilePath: "fixtures/acme/acme_http01_web.toml", + onDemand: false, + domainToCheck: acmeDomain} + + s.retrieveAcmeCertificate(c, testCase) +} + // Test OnDemand option with a wildcard provided certificate func (s *AcmeSuite) TestOnDemandRetrieveAcmeCertificateWithWildcard(c *check.C) { testCase := AcmeTestCase{ diff --git a/integration/fixtures/acme/acme_http01_web.toml b/integration/fixtures/acme/acme_http01_web.toml new file mode 100644 index 000000000..346af1e63 --- /dev/null +++ b/integration/fixtures/acme/acme_http01_web.toml @@ -0,0 +1,38 @@ +logLevel = "DEBUG" + +defaultEntryPoints = ["http", "https"] + +[entryPoints] + [entryPoints.http] + address = ":5002" + [entryPoints.https] + address = ":5001" + [entryPoints.https.tls] + + +[web] +path="/traefik" + +[acme] +email = "test@traefik.io" +storage = "/dev/null" +entryPoint = "https" +onDemand = {{.OnDemand}} +OnHostRule = {{.OnHostRule}} +caServer = "http://{{.BoulderHost}}:4000/directory" +[acme.httpchallenge] +entrypoint="http" + +[file] + +[backends] + [backends.backend] + [backends.backend.servers.server1] + url = "http://127.0.0.1:9010" + + +[frontends] + [frontends.frontend] + backend = "backend" + [frontends.frontend.routes.test] + rule = "Host:traefik.acme.wtf" diff --git a/server/server.go b/server/server.go index 79d067865..4caa983c4 100644 --- a/server/server.go +++ b/server/server.go @@ -758,7 +758,9 @@ func (s *Server) addInternalPublicRoutes(entryPointName string, router *mux.Rout if s.globalConfiguration.Ping != nil && s.globalConfiguration.Ping.EntryPoint != "" && s.globalConfiguration.Ping.EntryPoint == entryPointName { s.globalConfiguration.Ping.AddRoutes(router) } +} +func (s *Server) addACMERoutes(entryPointName string, router *mux.Router) { if s.globalConfiguration.ACME != nil && s.globalConfiguration.ACME.HTTPChallenge != nil && s.globalConfiguration.ACME.HTTPChallenge.EntryPoint == entryPointName { s.globalConfiguration.ACME.AddRoutes(router) } @@ -839,6 +841,9 @@ func (s *Server) buildInternalRouter(entryPointName, path string, internalMiddle internalMuxRouter.Walk(wrapRoute(internalMiddlewares)) s.addInternalPublicRoutes(entryPointName, internalMuxSubrouter) + + s.addACMERoutes(entryPointName, internalMuxRouter) + return internalMuxRouter } From d8297a055a5d0e6ad2c91c90f49143b68fff3ac1 Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Fri, 19 Jan 2018 14:30:04 +0100 Subject: [PATCH 03/17] Fix breaking change in web metrics --- cmd/traefik/configuration.go | 5 +++-- integration/basic_test.go | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cmd/traefik/configuration.go b/cmd/traefik/configuration.go index dec67e328..b76c84eaf 100644 --- a/cmd/traefik/configuration.go +++ b/cmd/traefik/configuration.go @@ -61,7 +61,8 @@ func NewTraefikDefaultPointersConfiguration() *TraefikConfiguration { // TODO: Deprecated - default Metrics defaultWeb.Metrics = &types.Metrics{ Prometheus: &types.Prometheus{ - Buckets: types.Buckets{0.1, 0.3, 1.2, 5}, + Buckets: types.Buckets{0.1, 0.3, 1.2, 5}, + EntryPoint: configuration.DefaultInternalEntryPointName, }, Datadog: &types.Datadog{ Address: "localhost:8125", @@ -220,7 +221,7 @@ func NewTraefikDefaultPointersConfiguration() *TraefikConfiguration { defaultMetrics := types.Metrics{ Prometheus: &types.Prometheus{ Buckets: types.Buckets{0.1, 0.3, 1.2, 5}, - EntryPoint: "traefik", + EntryPoint: configuration.DefaultInternalEntryPointName, }, Datadog: &types.Datadog{ Address: "localhost:8125", diff --git a/integration/basic_test.go b/integration/basic_test.go index cc3eacd57..7684d5507 100644 --- a/integration/basic_test.go +++ b/integration/basic_test.go @@ -336,3 +336,25 @@ func (s *SimpleSuite) TestWithUnexistingEntrypoint(c *check.C) { err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) c.Assert(err, checker.IsNil) } + +func (s *SimpleSuite) TestMetricsPrometheusDefaultEntrypoint(c *check.C) { + + s.createComposeProject(c, "base") + s.composeProject.Start(c) + + cmd, output := s.traefikCmd("--defaultEntryPoints=http", "--entryPoints=Name:http Address::8000", "--web", "--web.metrics.prometheus.buckets=0.1,0.3,1.2,5.0", "--docker", "--debug") + defer output(c) + + err := cmd.Start() + c.Assert(err, checker.IsNil) + defer cmd.Process.Kill() + + err = try.GetRequest("http://127.0.0.1:8080/api/providers", 1*time.Second, try.BodyContains("PathPrefix")) + c.Assert(err, checker.IsNil) + + err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) + c.Assert(err, checker.IsNil) + + err = try.GetRequest("http://127.0.0.1:8080/metrics", 1*time.Second, try.StatusCodeIs(http.StatusOK)) + c.Assert(err, checker.IsNil) +} From d7b513e9aa617e7b1128b3f5f8d0985486dcc750 Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Fri, 19 Jan 2018 17:34:03 +0100 Subject: [PATCH 04/17] Disable websocket compression --- Gopkg.lock | 2 +- vendor/github.com/vulcand/oxy/forward/fwd.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 619b529cb..9025bc23a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1027,7 +1027,7 @@ "roundrobin", "utils" ] - revision = "fd0f370c961f6aa304379f4106e76ffe5ed7e97a" + revision = "fd6f71c694e2ab8b584c50b98ab4825027feb315" source = "https://github.com/containous/oxy.git" [[projects]] diff --git a/vendor/github.com/vulcand/oxy/forward/fwd.go b/vendor/github.com/vulcand/oxy/forward/fwd.go index 485f98cac..68888b8b5 100644 --- a/vendor/github.com/vulcand/oxy/forward/fwd.go +++ b/vendor/github.com/vulcand/oxy/forward/fwd.go @@ -283,8 +283,6 @@ func (f *httpForwarder) serveWebSocket(w http.ResponseWriter, req *http.Request, dialer := websocket.DefaultDialer - dialer.EnableCompression = strings.Contains(req.Header.Get("Sec-Websocket-Extensions"), "permessage-deflate") - if outReq.URL.Scheme == "wss" && f.tlsClientConfig != nil { dialer.TLSClientConfig = f.tlsClientConfig.Clone() // WebSocket is only in http/1.1 @@ -326,8 +324,6 @@ func (f *httpForwarder) serveWebSocket(w http.ResponseWriter, req *http.Request, return true }} - upgrader.EnableCompression = strings.Contains(resp.Header.Get("Sec-Websocket-Extensions"), "permessage-deflate") - utils.RemoveHeaders(resp.Header, WebsocketUpgradeHeaders...) underlyingConn, err := upgrader.Upgrade(w, req, resp.Header) From ae34486b57a3a1e29bb628eb126cf2239dc591fe Mon Sep 17 00:00:00 2001 From: Eldon Date: Mon, 22 Jan 2018 09:26:03 +0000 Subject: [PATCH 05/17] Fix some doc links --- docs/user-guide/kv-config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/kv-config.md b/docs/user-guide/kv-config.md index d4aae8c97..41a6e7ef1 100644 --- a/docs/user-guide/kv-config.md +++ b/docs/user-guide/kv-config.md @@ -408,7 +408,7 @@ Here, we have a 50% balance between the `http://172.17.0.3:80` and the `http://1 ## Store configuration in Key-value store !!! note - Don't forget to [setup the connection between Træfik and Key-value store](/user-guide/kv-config/#launch-trfk). + Don't forget to [setup the connection between Træfik and Key-value store](/user-guide/kv-config/#launch-trfik). The static Træfik configuration in a key-value store can be automatically created and updated, using the [`storeconfig` subcommand](/basics/#commands). @@ -416,7 +416,7 @@ The static Træfik configuration in a key-value store can be automatically creat traefik storeconfig [flags] ... ``` This command is here only to automate the [process which upload the configuration into the Key-value store](/user-guide/kv-config/#upload-the-configuration-in-the-key-value-store). -Træfik will not start but the [static configuration](/basics/#static-trfk-configuration) will be uploaded into the Key-value store. +Træfik will not start but the [static configuration](/basics/#static-trfik-configuration) will be uploaded into the Key-value store. If you configured ACME (Let's Encrypt), your registration account and your certificates will also be uploaded. From fc00e1c2281e862b8e9d528dde826d8806649e26 Mon Sep 17 00:00:00 2001 From: Roman Pridybailo Date: Mon, 22 Jan 2018 12:00:07 +0200 Subject: [PATCH 06/17] Don't reload configuration when rancher server is down --- provider/rancher/api.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/provider/rancher/api.go b/provider/rancher/api.go index dff55a361..0b8c05e68 100644 --- a/provider/rancher/api.go +++ b/provider/rancher/api.go @@ -91,19 +91,24 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool for { select { case <-ticker.C: + checkAPI, errAPI := rancherClient.ApiKey.List(withoutPagination) - log.Debugf("Refreshing new Data from Provider API") - var stacks = listRancherStacks(rancherClient) - var services = listRancherServices(rancherClient) - var container = listRancherContainer(rancherClient) + if errAPI != nil { + log.Errorf("Cannot establish connection: %+v, Rancher API return: %+v; Skipping refresh Data from Rancher API.", errAPI, checkAPI) + } else { + log.Debugf("Refreshing new Data from Rancher API") + stacks := listRancherStacks(rancherClient) + services := listRancherServices(rancherClient) + container := listRancherContainer(rancherClient) - rancherData := parseAPISourcedRancherData(stacks, services, container) + rancherData := parseAPISourcedRancherData(stacks, services, container) - configuration := p.loadRancherConfig(rancherData) - if configuration != nil { - configurationChan <- types.ConfigMessage{ - ProviderName: "rancher", - Configuration: configuration, + configuration := p.loadRancherConfig(rancherData) + if configuration != nil { + configurationChan <- types.ConfigMessage{ + ProviderName: "rancher", + Configuration: configuration, + } } } case <-stop: From 4e07d921909569975c40252d0c9a75c8bc589d46 Mon Sep 17 00:00:00 2001 From: Emile Vauge Date: Tue, 23 Jan 2018 09:12:03 +0100 Subject: [PATCH 07/17] Fix doc dynamic certificates --- docs/configuration/backends/file.md | 25 +++++++++++++++---------- docs/configuration/entrypoints.md | 8 ++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/docs/configuration/backends/file.md b/docs/configuration/backends/file.md index 2621a5695..2fd1809df 100644 --- a/docs/configuration/backends/file.md +++ b/docs/configuration/backends/file.md @@ -85,10 +85,16 @@ defaultEntryPoints = ["http", "https"] # HTTPS certificate [[tlsConfiguration]] -entryPoints = ["https"] + entryPoints = ["https"] [tlsConfiguration.certificate] - certFile = "integration/fixtures/https/snitest.com.cert" - keyFile = "integration/fixtures/https/snitest.com.key" + certFile = "path/to/my.cert" + keyFile = "path/to/my.key" + +[[tlsConfiguration]] + entryPoints = ["https"] + [tlsConfiguration.certificate] + certFile = "path/to/my/other.cert" + keyFile = "path/to/my/other.key" ``` !!! note @@ -160,15 +166,14 @@ filename = "rules.toml" [[tlsConfiguration]] entryPoints = ["https"] [tlsConfiguration.certificate] - certFile = "integration/fixtures/https/snitest.com.cert" - keyFile = "integration/fixtures/https/snitest.com.key" - + certFile = "path/to/my.cert" + keyFile = "path/to/my.key" + [[tlsConfiguration]] entryPoints = ["https"] - [[tlsConfiguration.certificates]] - certFile = "integration/fixtures/https/snitest.org.cert" - keyFile = "integration/fixtures/https/snitest.org.key" -``` + [tlsConfiguration.certificate] + certFile = "path/to/my/other.cert" + keyFile = "path/to/my/other.key" ## Multiple `.toml` Files diff --git a/docs/configuration/entrypoints.md b/docs/configuration/entrypoints.md index a9b949f9b..878e34ee4 100644 --- a/docs/configuration/entrypoints.md +++ b/docs/configuration/entrypoints.md @@ -55,6 +55,8 @@ To redirect an entrypoint rewriting the URL. ## TLS +### Static Certificates + Define an entrypoint with SNI support. ```toml @@ -69,6 +71,12 @@ Define an entrypoint with SNI support. !!! note If an empty TLS configuration is done, default self-signed certificates are generated. + + +### Dynamic Certificates + +If you need to add or remove TLS certificates while Traefik is started, Dynamic TLS certificates are supported using the [file provider](/configuration/backends/file). + ## TLS Mutual Authentication From b6af61fa6e1544c8578cd93161c51d2d213d774c Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 23 Jan 2018 09:52:03 +0100 Subject: [PATCH 08/17] ACME and corporate proxy. --- acme/acme.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/acme/acme.go b/acme/acme.go index 31b25d1ef..c3da88c4a 100644 --- a/acme/acme.go +++ b/acme/acme.go @@ -114,6 +114,20 @@ type Domain struct { } func (a *ACME) init() error { + // FIXME temporary fix, waiting for https://github.com/xenolf/lego/pull/478 + acme.HTTPClient = http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 15 * time.Second, + ResponseHeaderTimeout: 15 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + }, + } + if a.ACMELogging { acme.Logger = fmtlog.New(os.Stderr, "legolog: ", fmtlog.LstdFlags) } else { From 4cc17e112f231bf9de02582d2d753758db8a48ae Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Tue, 23 Jan 2018 12:44:03 +0100 Subject: [PATCH 09/17] Fix goroutine leak in throttler logic. --- server/server.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/server/server.go b/server/server.go index 4caa983c4..971bb49a8 100644 --- a/server/server.go +++ b/server/server.go @@ -66,6 +66,7 @@ type Server struct { stopChan chan bool providers []provider.Provider currentConfigurations safe.Safe + providerConfigUpdateMap map[string]chan types.ConfigMessage globalConfiguration configuration.GlobalConfiguration accessLoggerMiddleware *accesslog.LogHandler routinesPool *safe.Pool @@ -105,6 +106,7 @@ func NewServer(globalConfiguration configuration.GlobalConfiguration) *Server { server.configureSignals() currentConfigurations := make(types.Configurations) server.currentConfigurations.Set(currentConfigurations) + server.providerConfigUpdateMap = make(map[string]chan types.ConfigMessage) server.globalConfiguration = globalConfiguration if server.globalConfiguration.API != nil { server.globalConfiguration.API.CurrentConfigurations = &server.currentConfigurations @@ -350,7 +352,6 @@ func (s *Server) listenProviders(stop chan bool) { } func (s *Server) preLoadConfiguration(configMsg types.ConfigMessage) { - providerConfigUpdateMap := map[string]chan types.ConfigMessage{} providersThrottleDuration := time.Duration(s.globalConfiguration.ProvidersThrottleDuration) s.defaultConfigurationValues(configMsg.Configuration) currentConfigurations := s.currentConfigurations.Get().(types.Configurations) @@ -361,14 +362,15 @@ func (s *Server) preLoadConfiguration(configMsg types.ConfigMessage) { } else if reflect.DeepEqual(currentConfigurations[configMsg.ProviderName], configMsg.Configuration) { log.Infof("Skipping same configuration for provider %s", configMsg.ProviderName) } else { - if _, ok := providerConfigUpdateMap[configMsg.ProviderName]; !ok { - providerConfigUpdate := make(chan types.ConfigMessage) - providerConfigUpdateMap[configMsg.ProviderName] = providerConfigUpdate + providerConfigUpdateCh, ok := s.providerConfigUpdateMap[configMsg.ProviderName] + if !ok { + providerConfigUpdateCh = make(chan types.ConfigMessage) + s.providerConfigUpdateMap[configMsg.ProviderName] = providerConfigUpdateCh s.routinesPool.Go(func(stop chan bool) { - throttleProviderConfigReload(providersThrottleDuration, s.configurationValidatedChan, providerConfigUpdate, stop) + throttleProviderConfigReload(providersThrottleDuration, s.configurationValidatedChan, providerConfigUpdateCh, stop) }) } - providerConfigUpdateMap[configMsg.ProviderName] <- configMsg + providerConfigUpdateCh <- configMsg } } From 171cda61866b2134f61e18b430e3b87d4e2fd7e5 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 23 Jan 2018 14:18:03 +0100 Subject: [PATCH 10/17] New multi version documentation mechanism --- .travis.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index af7a23397..b821bff9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,22 +21,14 @@ before_deploy: sudo -E apt-get -yq update; sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install docker-ce=${DOCKER_VERSION}*; docker version; - pip install --user -r requirements.txt; make -j${N_MAKE_JOBS} crossbinary-parallel; make image-dirty; - mkdocs build --clean; + curl -sI https://github.com/containous/structor/releases/latest | grep -Fi Location | tr -d '\r' | sed "s/tag/download/g" | awk -F " " '{ print $2 "/structor_linux-amd64"}' | wget --output-document=$GOPATH/bin/structor -i -; + chmod +x $GOPATH/bin/structor; + structor -o containous -r traefik --dockerfile-url="https://raw.githubusercontent.com/containous/traefik/master/docs.Dockerfile" --menu.js-url="https://raw.githubusercontent.com/containous/structor/master/traefik-menu.js.gotmpl" --exp-branch=master --debug; tar cfz dist/traefik-${VERSION}.src.tar.gz --exclude-vcs --exclude dist .; fi deploy: - - provider: pages - edge: true - github_token: ${GITHUB_TOKEN} - local_dir: site - skip_cleanup: true - on: - repo: containous/traefik - tags: true - condition: ${TRAVIS_TAG} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ - provider: releases api_key: ${GITHUB_TOKEN} file: dist/traefik* @@ -56,3 +48,10 @@ deploy: skip_cleanup: true on: repo: containous/traefik + - provider: pages + edge: true + github_token: ${GITHUB_TOKEN} + local_dir: site + skip_cleanup: true + on: + repo: containous/traefik From bfb07746fe7d632b041dac9d975dca948cd9f635 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 23 Jan 2018 14:48:04 +0100 Subject: [PATCH 11/17] Deploy pages on all branches. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b821bff9b..503bd029d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,3 +55,5 @@ deploy: skip_cleanup: true on: repo: containous/traefik + all_branches: true + From 00e05718118905a37a390a1f7e78938f84d4a64b Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 23 Jan 2018 16:30:07 +0100 Subject: [PATCH 12/17] Rename TLSConfigurations to TLS. --- autogen/gentemplates/gen.go | 8 +++--- docs/configuration/backends/file.md | 16 +++++------ docs/user-guide/kv-config.md | 28 +++++++++---------- examples/consul-config.sh | 12 ++++---- examples/etcd-config.sh | 24 ++++++++-------- integration/consul_test.go | 16 +++++------ integration/etcd3_test.go | 24 ++++++++-------- integration/etcd_test.go | 16 +++++------ integration/fixtures/acme/certificates.toml | 4 +-- integration/fixtures/https/dynamic_https.toml | 4 +-- integration/https_test.go | 2 +- provider/file/file.go | 4 +-- provider/file/file_test.go | 24 ++++++++-------- server/server.go | 6 ++-- server/server_test.go | 4 +-- templates/kv.tmpl | 8 +++--- tls/tls.go | 4 +-- types/types.go | 6 ++-- 18 files changed, 105 insertions(+), 105 deletions(-) diff --git a/autogen/gentemplates/gen.go b/autogen/gentemplates/gen.go index e6c160953..313db391b 100644 --- a/autogen/gentemplates/gen.go +++ b/autogen/gentemplates/gen.go @@ -522,7 +522,7 @@ func templatesKubernetesTmpl() (*asset, error) { var _templatesKvTmpl = []byte(`{{$frontends := List .Prefix "/frontends/" }} {{$backends := List .Prefix "/backends/"}} -{{$tlsconfiguration := List .Prefix "/tlsconfiguration/"}} +{{$tls := List .Prefix "/tls/"}} [backends]{{range $backends}} {{$backend := .}} @@ -587,13 +587,13 @@ var _templatesKvTmpl = []byte(`{{$frontends := List .Prefix "/frontends/" }} {{end}} {{end}} -{{range $tlsconfiguration}} +{{range $tls}} {{$entryPoints := SplitGet . "/entrypoints"}} -[[tlsConfiguration]] +[[tls]] entryPoints = [{{range $entryPoints}} "{{.}}", {{end}}] - [tlsConfiguration.certificate] + [tls.certificate] certFile = """{{Get "" . "/certificate" "/certfile"}}""" keyFile = """{{Get "" . "/certificate" "/keyfile"}}""" {{end}} diff --git a/docs/configuration/backends/file.md b/docs/configuration/backends/file.md index 2fd1809df..2df402e0c 100644 --- a/docs/configuration/backends/file.md +++ b/docs/configuration/backends/file.md @@ -84,15 +84,15 @@ defaultEntryPoints = ["http", "https"] rule = "Path:/test" # HTTPS certificate -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = "path/to/my.cert" keyFile = "path/to/my.key" -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = "path/to/my/other.cert" keyFile = "path/to/my/other.key" ``` @@ -163,15 +163,15 @@ filename = "rules.toml" rule = "Path:/test" # HTTPS certificate -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = "path/to/my.cert" keyFile = "path/to/my.key" -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = "path/to/my/other.cert" keyFile = "path/to/my/other.key" diff --git a/docs/user-guide/kv-config.md b/docs/user-guide/kv-config.md index 41a6e7ef1..21fea7d20 100644 --- a/docs/user-guide/kv-config.md +++ b/docs/user-guide/kv-config.md @@ -274,14 +274,14 @@ Here is the toml configuration we would like to store in the store : backend = "backend2" rule = "Path:/test" -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = "path/to/your.cert" keyFile = "path/to/your.key" -[[tlsConfiguration]] +[[tls]] entryPoints = ["https","other-https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = """-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----""" @@ -335,19 +335,19 @@ And there, the same dynamic configuration in a KV Store (using `prefix = "traefi - certificate 1 -| Key | Value | -|----------------------------------------------------|--------------------| -| `/traefik/tlsconfiguration/1/entrypoints` | `https` | -| `/traefik/tlsconfiguration/1/certificate/certfile` | `path/to/your.cert`| -| `/traefik/tlsconfiguration/1/certificate/keyfile` | `path/to/your.key` | +| Key | Value | +|---------------------------------------|--------------------| +| `/traefik/tls/1/entrypoints` | `https` | +| `/traefik/tls/1/certificate/certfile` | `path/to/your.cert`| +| `/traefik/tls/1/certificate/keyfile` | `path/to/your.key` | - certificate 2 -| Key | Value | -|----------------------------------------------------|-----------------------| -| `/traefik/tlsconfiguration/2/entrypoints` | `https,other-https` | -| `/traefik/tlsconfiguration/2/certificate/certfile` | `` | -| `/traefik/tlsconfiguration/2/certificate/certfile` | `` | +| Key | Value | +|---------------------------------------|-----------------------| +| `/traefik/tls/2/entrypoints` | `https,other-https` | +| `/traefik/tls/2/certificate/certfile` | `` | +| `/traefik/tls/2/certificate/certfile` | `` | ### Atomic configuration changes diff --git a/examples/consul-config.sh b/examples/consul-config.sh index 94509e710..ee9066eeb 100755 --- a/examples/consul-config.sh +++ b/examples/consul-config.sh @@ -26,11 +26,11 @@ curl -i -H "Accept: application/json" -X PUT -d "Path:/test" ht # certificate 1 -curl -i -H "Accept: application/json" -X PUT -d "https" http://localhost:8500/v1/kv/traefik/tlsconfiguration/pair1/entrypoints -curl -i -H "Accept: application/json" -X PUT -d "/tmp/test1.crt" http://localhost:8500/v1/kv/traefik/tlsconfiguration/pair1/certificate/certfile -curl -i -H "Accept: application/json" -X PUT -d "/tmp/test1.key" http://localhost:8500/v1/kv/traefik/tlsconfiguration/pair1/certificate/keyfile +curl -i -H "Accept: application/json" -X PUT -d "https" http://localhost:8500/v1/kv/traefik/tls/pair1/entrypoints +curl -i -H "Accept: application/json" -X PUT -d "/tmp/test1.crt" http://localhost:8500/v1/kv/traefik/tls/pair1/certificate/certfile +curl -i -H "Accept: application/json" -X PUT -d "/tmp/test1.key" http://localhost:8500/v1/kv/traefik/tls/pair1/certificate/keyfile # certificate 2 -curl -i -H "Accept: application/json" -X PUT -d "http,https" http://localhost:8500/v1/kv/traefik/tlsconfiguration/pair2/entrypoints -curl -i -H "Accept: application/json" -X PUT -d "/tmp/test2.crt" http://localhost:8500/v1/kv/traefik/tlsconfiguration/pair2/certificate/certfile -curl -i -H "Accept: application/json" -X PUT -d "/tmp/test2.key" http://localhost:8500/v1/kv/traefik/tlsconfiguration/pair2/certificate/keyfile +curl -i -H "Accept: application/json" -X PUT -d "http,https" http://localhost:8500/v1/kv/traefik/tls/pair2/entrypoints +curl -i -H "Accept: application/json" -X PUT -d "/tmp/test2.crt" http://localhost:8500/v1/kv/traefik/tls/pair2/certificate/certfile +curl -i -H "Accept: application/json" -X PUT -d "/tmp/test2.key" http://localhost:8500/v1/kv/traefik/tls/pair2/certificate/keyfile diff --git a/examples/etcd-config.sh b/examples/etcd-config.sh index 6a5279957..0bb0b69c7 100755 --- a/examples/etcd-config.sh +++ b/examples/etcd-config.sh @@ -28,14 +28,14 @@ function insert_etcd2_data() { curl -i -H "Accept: application/json" -X PUT -d value="Path:/test" http://localhost:2379/v2/keys/traefik/frontends/frontend2/routes/test_2/rule # certificate 1 - curl -i -H "Accept: application/json" -X PUT -d value="https" http://localhost:2379/v2/keys/traefik/tlsconfiguration/pair1/entrypoints - curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test1.crt" http://localhost:2379/v2/keys/traefik/tlsconfiguration/pair1/certificate/certfile - curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test1.key" http://localhost:2379/v2/keys/traefik/tlsconfiguration/pair1/certificate/keyfile + curl -i -H "Accept: application/json" -X PUT -d value="https" http://localhost:2379/v2/keys/traefik/tls/pair1/entrypoints + curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test1.crt" http://localhost:2379/v2/keys/traefik/tls/pair1/certificate/certfile + curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test1.key" http://localhost:2379/v2/keys/traefik/tls/pair1/certificate/keyfile # certificate 2 - curl -i -H "Accept: application/json" -X PUT -d value="http,https" http://localhost:2379/v2/keys/traefik/tlsconfiguration/pair2/entrypoints - curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test2.crt" http://localhost:2379/v2/keys/traefik/tlsconfiguration/pair2/certificate/certfile - curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test2.key" http://localhost:2379/v2/keys/traefik/tlsconfiguration/pair2/certificate/keyfile + curl -i -H "Accept: application/json" -X PUT -d value="http,https" http://localhost:2379/v2/keys/traefik/tls/pair2/entrypoints + curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test2.crt" http://localhost:2379/v2/keys/traefik/tls/pair2/certificate/certfile + curl -i -H "Accept: application/json" -X PUT -d value="/tmp/test2.key" http://localhost:2379/v2/keys/traefik/tls/pair2/certificate/keyfile } # @@ -71,14 +71,14 @@ function insert_etcd3_data() { docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/frontends/frontend2/routes/test_2/rule" "Path:/test" # certificate 1 - docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tlsconfiguration/pair1/entrypoints" "https" - docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tlsconfiguration/pair1/certificate/certfile" "/tmp/test1.crt" - docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tlsconfiguration/pair1/certificate/keyfile" "/tmp/test1.key" + docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tls/pair1/entrypoints" "https" + docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tls/pair1/certificate/certfile" "/tmp/test1.crt" + docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tls/pair1/certificate/keyfile" "/tmp/test1.key" # certificate 2 - docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tlsconfiguration/pair2/entrypoints" "https" - docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tlsconfiguration/pair2/certificate/certfile" "/tmp/test2.crt" - docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tlsconfiguration/pair2/certificate/keyfile" "/tmp/test2.key" + docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tls/pair2/entrypoints" "https" + docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tls/pair2/certificate/certfile" "/tmp/test2.crt" + docker container run --rm -ti -e ETCDCTL_DIAL_="TIMEOUT 10s" -e ETCDCTL_API="3" tenstartups/etcdctl --endpoints=[$etcd_ip:2379] put "/traefik/tls/pair2/certificate/keyfile" "/tmp/test2.key" } function show_usage() { diff --git a/integration/consul_test.go b/integration/consul_test.go index 112944dfb..049102ef3 100644 --- a/integration/consul_test.go +++ b/integration/consul_test.go @@ -564,15 +564,15 @@ func (s *ConsulSuite) TestSNIDynamicTlsConfig(c *check.C) { } tlsconfigure1 := map[string]string{ - "traefik/tlsconfiguration/snitestcom/entrypoints": "https", - "traefik/tlsconfiguration/snitestcom/certificate/keyfile": string(snitestComKey), - "traefik/tlsconfiguration/snitestcom/certificate/certfile": string(snitestComCert), + "traefik/tls/snitestcom/entrypoints": "https", + "traefik/tls/snitestcom/certificate/keyfile": string(snitestComKey), + "traefik/tls/snitestcom/certificate/certfile": string(snitestComCert), } tlsconfigure2 := map[string]string{ - "traefik/tlsconfiguration/snitestorg/entrypoints": "https", - "traefik/tlsconfiguration/snitestorg/certificate/keyfile": string(snitestOrgKey), - "traefik/tlsconfiguration/snitestorg/certificate/certfile": string(snitestOrgCert), + "traefik/tls/snitestorg/entrypoints": "https", + "traefik/tls/snitestorg/certificate/keyfile": string(snitestOrgKey), + "traefik/tls/snitestorg/certificate/certfile": string(snitestOrgCert), } // config backends,frontends and first tls keypair @@ -613,7 +613,7 @@ func (s *ConsulSuite) TestSNIDynamicTlsConfig(c *check.C) { // wait for consul err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("traefik/tlsconfiguration/snitestcom/certificate/keyfile", nil) + _, err := s.kv.Get("traefik/tls/snitestcom/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) @@ -642,7 +642,7 @@ func (s *ConsulSuite) TestSNIDynamicTlsConfig(c *check.C) { // wait for consul err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("traefik/tlsconfiguration/snitestorg/certificate/keyfile", nil) + _, err := s.kv.Get("traefik/tls/snitestorg/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) diff --git a/integration/etcd3_test.go b/integration/etcd3_test.go index 1fce96a91..ebd9ecf80 100644 --- a/integration/etcd3_test.go +++ b/integration/etcd3_test.go @@ -474,15 +474,15 @@ func (s *Etcd3Suite) TestSNIDynamicTlsConfig(c *check.C) { } tlsconfigure1 := map[string]string{ - "/traefik/tlsconfiguration/snitestcom/entrypoints": "https", - "/traefik/tlsconfiguration/snitestcom/certificate/keyfile": string(snitestComKey), - "/traefik/tlsconfiguration/snitestcom/certificate/certfile": string(snitestComCert), + "/traefik/tls/snitestcom/entrypoints": "https", + "/traefik/tls/snitestcom/certificate/keyfile": string(snitestComKey), + "/traefik/tls/snitestcom/certificate/certfile": string(snitestComCert), } tlsconfigure2 := map[string]string{ - "/traefik/tlsconfiguration/snitestorg/entrypoints": "https", - "/traefik/tlsconfiguration/snitestorg/certificate/keyfile": string(snitestOrgKey), - "/traefik/tlsconfiguration/snitestorg/certificate/certfile": string(snitestOrgCert), + "/traefik/tls/snitestorg/entrypoints": "https", + "/traefik/tls/snitestorg/certificate/keyfile": string(snitestOrgKey), + "/traefik/tls/snitestorg/certificate/certfile": string(snitestOrgCert), } // config backends,frontends and first tls keypair @@ -523,7 +523,7 @@ func (s *Etcd3Suite) TestSNIDynamicTlsConfig(c *check.C) { // wait for etcd err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("/traefik/tlsconfiguration/snitestcom/certificate/keyfile", nil) + _, err := s.kv.Get("/traefik/tls/snitestcom/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) @@ -557,7 +557,7 @@ func (s *Etcd3Suite) TestSNIDynamicTlsConfig(c *check.C) { // wait for etcd err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("/traefik/tlsconfiguration/snitestorg/certificate/keyfile", nil) + _, err := s.kv.Get("/traefik/tls/snitestorg/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) @@ -609,9 +609,9 @@ func (s *Etcd3Suite) TestDeleteSNIDynamicTlsConfig(c *check.C) { } tlsconfigure1 := map[string]string{ - "/traefik/tlsconfiguration/snitestcom/entrypoints": "https", - "/traefik/tlsconfiguration/snitestcom/certificate/keyfile": string(snitestComKey), - "/traefik/tlsconfiguration/snitestcom/certificate/certfile": string(snitestComCert), + "/traefik/tls/snitestcom/entrypoints": "https", + "/traefik/tls/snitestcom/certificate/keyfile": string(snitestComKey), + "/traefik/tls/snitestcom/certificate/certfile": string(snitestComCert), } // config backends,frontends and first tls keypair @@ -637,7 +637,7 @@ func (s *Etcd3Suite) TestDeleteSNIDynamicTlsConfig(c *check.C) { // wait for etcd err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("/traefik/tlsconfiguration/snitestcom/certificate/keyfile", nil) + _, err := s.kv.Get("/traefik/tls/snitestcom/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) diff --git a/integration/etcd_test.go b/integration/etcd_test.go index d0470729a..986a7065d 100644 --- a/integration/etcd_test.go +++ b/integration/etcd_test.go @@ -490,15 +490,15 @@ func (s *EtcdSuite) TestSNIDynamicTlsConfig(c *check.C) { } tlsconfigure1 := map[string]string{ - "/traefik/tlsconfiguration/snitestcom/entrypoints": "https", - "/traefik/tlsconfiguration/snitestcom/certificate/keyfile": string(snitestComKey), - "/traefik/tlsconfiguration/snitestcom/certificate/certfile": string(snitestComCert), + "/traefik/tls/snitestcom/entrypoints": "https", + "/traefik/tls/snitestcom/certificate/keyfile": string(snitestComKey), + "/traefik/tls/snitestcom/certificate/certfile": string(snitestComCert), } tlsconfigure2 := map[string]string{ - "/traefik/tlsconfiguration/snitestorg/entrypoints": "https", - "/traefik/tlsconfiguration/snitestorg/certificate/keyfile": string(snitestOrgKey), - "/traefik/tlsconfiguration/snitestorg/certificate/certfile": string(snitestOrgCert), + "/traefik/tls/snitestorg/entrypoints": "https", + "/traefik/tls/snitestorg/certificate/keyfile": string(snitestOrgKey), + "/traefik/tls/snitestorg/certificate/certfile": string(snitestOrgCert), } // config backends,frontends and first tls keypair @@ -539,7 +539,7 @@ func (s *EtcdSuite) TestSNIDynamicTlsConfig(c *check.C) { // wait for etcd err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("/traefik/tlsconfiguration/snitestcom/certificate/keyfile", nil) + _, err := s.kv.Get("/traefik/tls/snitestcom/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) @@ -573,7 +573,7 @@ func (s *EtcdSuite) TestSNIDynamicTlsConfig(c *check.C) { // wait for etcd err = try.Do(60*time.Second, func() error { - _, err := s.kv.Get("/traefik/tlsconfiguration/snitestorg/certificate/keyfile", nil) + _, err := s.kv.Get("/traefik/tls/snitestorg/certificate/keyfile", nil) return err }) c.Assert(err, checker.IsNil) diff --git a/integration/fixtures/acme/certificates.toml b/integration/fixtures/acme/certificates.toml index 5e0693f96..c0bdc831b 100644 --- a/integration/fixtures/acme/certificates.toml +++ b/integration/fixtures/acme/certificates.toml @@ -9,8 +9,8 @@ [frontends.frontend.routes.test] rule = "Host:traefik.acme.wtf" -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = "fixtures/acme/ssl/wildcard.crt" keyFile = "fixtures/acme/ssl/wildcard.key" \ No newline at end of file diff --git a/integration/fixtures/https/dynamic_https.toml b/integration/fixtures/https/dynamic_https.toml index aa513ba6d..ad530081a 100644 --- a/integration/fixtures/https/dynamic_https.toml +++ b/integration/fixtures/https/dynamic_https.toml @@ -16,9 +16,9 @@ [frontends.frontend2.routes.test_2] rule = "Host:snitest.org" -[[tlsConfiguration]] +[[tls]] entryPoints = ["https"] - [tlsConfiguration.certificate] + [tls.certificate] certFile = """-----BEGIN CERTIFICATE----- MIIC/zCCAeegAwIBAgIJALAYHG/vGqWEMA0GCSqGSIb3DQEBBQUAMBYxFDASBgNV BAMMC3NuaXRlc3Qub3JnMB4XDTE1MTEyMzIyMDU0NFoXDTI1MTEyMDIyMDU0NFow diff --git a/integration/https_test.go b/integration/https_test.go index 2582dfcda..dad461fff 100644 --- a/integration/https_test.go +++ b/integration/https_test.go @@ -624,7 +624,7 @@ func modifyCertificateConfFileContent(c *check.C, certFileName, confFileName, en // If certificate file is not provided, just truncate the configuration file if len(certFileName) > 0 { tlsConf := types.Configuration{ - TLSConfiguration: []*traefikTls.Configuration{ + TLS: []*traefikTls.Configuration{ { Certificate: &traefikTls.Certificate{ CertFile: traefikTls.FileOrContent("fixtures/https/" + certFileName + ".cert"), diff --git a/provider/file/file.go b/provider/file/file.go index 06e25bb2c..d32c022dc 100644 --- a/provider/file/file.go +++ b/provider/file/file.go @@ -186,7 +186,7 @@ func loadFileConfigFromDirectory(directory string, configuration *types.Configur } } - for _, conf := range c.TLSConfiguration { + for _, conf := range c.TLS { if _, exists := configTLSMaps[conf]; exists { log.Warnf("TLS Configuration %v already configured, skipping", conf) } else { @@ -196,7 +196,7 @@ func loadFileConfigFromDirectory(directory string, configuration *types.Configur } for conf := range configTLSMaps { - configuration.TLSConfiguration = append(configuration.TLSConfiguration, conf) + configuration.TLS = append(configuration.TLS, conf) } return configuration, nil } diff --git a/provider/file/file_test.go b/provider/file/file_test.go index af622d741..649fc32ae 100644 --- a/provider/file/file_test.go +++ b/provider/file/file_test.go @@ -26,7 +26,7 @@ func TestProvideSingleFileAndWatch(t *testing.T) { tempDir, "simple.toml", createFrontendConfiguration(expectedNumFrontends), createBackendConfiguration(expectedNumBackends), - createTLSConfiguration(expectedNumTLSConf)) + createTLS(expectedNumTLSConf)) configurationChan, signal := createConfigurationRoutine(t, &expectedNumFrontends, &expectedNumBackends, &expectedNumTLSConf) @@ -45,7 +45,7 @@ func TestProvideSingleFileAndWatch(t *testing.T) { tempDir, "simple.toml", createFrontendConfiguration(expectedNumFrontends), createBackendConfiguration(expectedNumBackends), - createTLSConfiguration(expectedNumTLSConf)) + createTLS(expectedNumTLSConf)) err = waitForSignal(signal, 2*time.Second, "single frontend, backend, TLS configuration") assert.NoError(t, err) @@ -63,7 +63,7 @@ func TestProvideSingleFileAndNotWatch(t *testing.T) { tempDir, "simple.toml", createFrontendConfiguration(expectedNumFrontends), createBackendConfiguration(expectedNumBackends), - createTLSConfiguration(expectedNumTLSConf)) + createTLS(expectedNumTLSConf)) configurationChan, signal := createConfigurationRoutine(t, &expectedNumFrontends, &expectedNumBackends, &expectedNumTLSConf) @@ -82,7 +82,7 @@ func TestProvideSingleFileAndNotWatch(t *testing.T) { tempDir, "simple.toml", createFrontendConfiguration(expectedNumFrontends), createBackendConfiguration(expectedNumBackends), - createTLSConfiguration(expectedNumTLSConf)) + createTLS(expectedNumTLSConf)) // Must fail because we don't watch the changes err = waitForSignal(signal, 2*time.Second, "single frontend, backend and TLS configuration") @@ -99,7 +99,7 @@ func TestProvideDirectoryAndWatch(t *testing.T) { tempFile1 := createRandomFile(t, tempDir, createFrontendConfiguration(expectedNumFrontends)) tempFile2 := createRandomFile(t, tempDir, createBackendConfiguration(expectedNumBackends)) - tempFile3 := createRandomFile(t, tempDir, createTLSConfiguration(expectedNumTLSConf)) + tempFile3 := createRandomFile(t, tempDir, createTLS(expectedNumTLSConf)) configurationChan, signal := createConfigurationRoutine(t, &expectedNumFrontends, &expectedNumBackends, &expectedNumTLSConf) @@ -145,7 +145,7 @@ func TestProvideDirectoryAndNotWatch(t *testing.T) { createRandomFile(t, tempDir, createFrontendConfiguration(expectedNumFrontends)) tempFile2 := createRandomFile(t, tempDir, createBackendConfiguration(expectedNumBackends)) - createRandomFile(t, tempTLSDir, createTLSConfiguration(expectedNumTLSConf)) + createRandomFile(t, tempTLSDir, createTLS(expectedNumTLSConf)) configurationChan, signal := createConfigurationRoutine(t, &expectedNumFrontends, &expectedNumBackends, &expectedNumTLSConf) @@ -167,7 +167,7 @@ func TestProvideDirectoryAndNotWatch(t *testing.T) { } -func createConfigurationRoutine(t *testing.T, expectedNumFrontends *int, expectedNumBackends *int, expectedNumTLSConfigurations *int) (chan types.ConfigMessage, chan interface{}) { +func createConfigurationRoutine(t *testing.T, expectedNumFrontends *int, expectedNumBackends *int, expectedNumTLSes *int) (chan types.ConfigMessage, chan interface{}) { configurationChan := make(chan types.ConfigMessage) signal := make(chan interface{}) @@ -177,7 +177,7 @@ func createConfigurationRoutine(t *testing.T, expectedNumFrontends *int, expecte assert.Equal(t, "file", data.ProviderName) assert.Len(t, data.Configuration.Frontends, *expectedNumFrontends) assert.Len(t, data.Configuration.Backends, *expectedNumBackends) - assert.Len(t, data.Configuration.TLSConfiguration, *expectedNumTLSConfigurations) + assert.Len(t, data.Configuration.TLS, *expectedNumTLSes) signal <- nil } }) @@ -297,13 +297,13 @@ func createBackendConfiguration(n int) string { return conf } -// createTLSConfiguration Helper -func createTLSConfiguration(n int) string { +// createTLS Helper +func createTLS(n int) string { var conf string for i := 1; i <= n; i++ { - conf += fmt.Sprintf(`[[TLSConfiguration]] + conf += fmt.Sprintf(`[[TLS]] EntryPoints = ["https"] - [TLSConfiguration.Certificate] + [TLS.Certificate] CertFile = "integration/fixtures/https/snitest%[1]d.com.cert" KeyFile = "integration/fixtures/https/snitest%[1]d.com.key" `, i) diff --git a/server/server.go b/server/server.go index 971bb49a8..76729409e 100644 --- a/server/server.go +++ b/server/server.go @@ -357,7 +357,7 @@ func (s *Server) preLoadConfiguration(configMsg types.ConfigMessage) { currentConfigurations := s.currentConfigurations.Get().(types.Configurations) jsonConf, _ := json.Marshal(configMsg.Configuration) log.Debugf("Configuration received from provider %s: %s", configMsg.ProviderName, string(jsonConf)) - if configMsg.Configuration == nil || configMsg.Configuration.Backends == nil && configMsg.Configuration.Frontends == nil && configMsg.Configuration.TLSConfiguration == nil { + if configMsg.Configuration == nil || configMsg.Configuration.Backends == nil && configMsg.Configuration.Frontends == nil && configMsg.Configuration.TLS == nil { log.Infof("Skipping empty Configuration for provider %s", configMsg.ProviderName) } else if reflect.DeepEqual(currentConfigurations[configMsg.ProviderName], configMsg.Configuration) { log.Infof("Skipping same configuration for provider %s", configMsg.ProviderName) @@ -462,8 +462,8 @@ func (s *Server) loadHTTPSConfiguration(configurations types.Configurations) (ma newEPCertificates := make(map[string]*traefikTls.DomainsCertificates) // Get all certificates for _, configuration := range configurations { - if configuration.TLSConfiguration != nil && len(configuration.TLSConfiguration) > 0 { - if err := traefikTls.SortTLSConfigurationPerEntryPoints(configuration.TLSConfiguration, newEPCertificates); err != nil { + if configuration.TLS != nil && len(configuration.TLS) > 0 { + if err := traefikTls.SortTLSPerEntryPoints(configuration.TLS, newEPCertificates); err != nil { return nil, err } } diff --git a/server/server_test.go b/server/server_test.go index 919b910ca..72a0e5f42 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -463,7 +463,7 @@ func TestServerLoadConfigHealthCheckOptions(t *testing.T) { HealthCheck: healthCheck, }, }, - TLSConfiguration: []*tls.Configuration{ + TLS: []*tls.Configuration{ { Certificate: &tls.Certificate{ CertFile: localhostCert, @@ -644,7 +644,7 @@ func TestServerLoadConfigEmptyBasicAuth(t *testing.T) { }, }, }, - TLSConfiguration: []*tls.Configuration{ + TLS: []*tls.Configuration{ { Certificate: &tls.Certificate{ CertFile: localhostCert, diff --git a/templates/kv.tmpl b/templates/kv.tmpl index fc4ab782f..21de5604e 100644 --- a/templates/kv.tmpl +++ b/templates/kv.tmpl @@ -1,6 +1,6 @@ {{$frontends := List .Prefix "/frontends/" }} {{$backends := List .Prefix "/backends/"}} -{{$tlsconfiguration := List .Prefix "/tlsconfiguration/"}} +{{$tls := List .Prefix "/tls/"}} [backends]{{range $backends}} {{$backend := .}} @@ -65,13 +65,13 @@ {{end}} {{end}} -{{range $tlsconfiguration}} +{{range $tls}} {{$entryPoints := SplitGet . "/entrypoints"}} -[[tlsConfiguration]] +[[tls]] entryPoints = [{{range $entryPoints}} "{{.}}", {{end}}] - [tlsConfiguration.certificate] + [tls.certificate] certFile = """{{Get "" . "/certificate" "/certfile"}}""" keyFile = """{{Get "" . "/certificate" "/keyfile"}}""" {{end}} diff --git a/tls/tls.go b/tls/tls.go index 1798da12d..d25d99eef 100644 --- a/tls/tls.go +++ b/tls/tls.go @@ -86,8 +86,8 @@ func (r *RootCAs) Type() string { return "rootcas" } -// SortTLSConfigurationPerEntryPoints converts TLS configuration sorted by Certificates into TLS configuration sorted by EntryPoints -func SortTLSConfigurationPerEntryPoints(configurations []*Configuration, epConfiguration map[string]*DomainsCertificates) error { +// SortTLSPerEntryPoints converts TLS configuration sorted by Certificates into TLS configuration sorted by EntryPoints +func SortTLSPerEntryPoints(configurations []*Configuration, epConfiguration map[string]*DomainsCertificates) error { if epConfiguration == nil { epConfiguration = make(map[string]*DomainsCertificates) } diff --git a/types/types.go b/types/types.go index 2f337e65d..7439ceae6 100644 --- a/types/types.go +++ b/types/types.go @@ -197,9 +197,9 @@ type Configurations map[string]*Configuration // Configuration of a provider. type Configuration struct { - Backends map[string]*Backend `json:"backends,omitempty"` - Frontends map[string]*Frontend `json:"frontends,omitempty"` - TLSConfiguration []*traefikTls.Configuration `json:"tlsConfiguration,omitempty"` + Backends map[string]*Backend `json:"backends,omitempty"` + Frontends map[string]*Frontend `json:"frontends,omitempty"` + TLS []*traefikTls.Configuration `json:"tls,omitempty"` } // ConfigMessage hold configuration information exchanged between parts of traefik. From 3040d9df0d6b84bdf524e27eb2d0fe451c1a7b75 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 23 Jan 2018 17:00:06 +0100 Subject: [PATCH 13/17] Build cross binary only on tags in travis --- .travis.yml | 11 +++++++---- docs/archive.md | 23 ----------------------- mkdocs.yml | 1 - 3 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 docs/archive.md diff --git a/.travis.yml b/.travis.yml index 503bd029d..9a921963c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ sudo: required dist: trusty +git: + depth: false + services: - docker @@ -21,12 +24,13 @@ before_deploy: sudo -E apt-get -yq update; sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install docker-ce=${DOCKER_VERSION}*; docker version; - make -j${N_MAKE_JOBS} crossbinary-parallel; - make image-dirty; + if [ "$TRAVIS_TAG" ]; then + make -j${N_MAKE_JOBS} crossbinary-parallel; + make image-dirty; + fi; curl -sI https://github.com/containous/structor/releases/latest | grep -Fi Location | tr -d '\r' | sed "s/tag/download/g" | awk -F " " '{ print $2 "/structor_linux-amd64"}' | wget --output-document=$GOPATH/bin/structor -i -; chmod +x $GOPATH/bin/structor; structor -o containous -r traefik --dockerfile-url="https://raw.githubusercontent.com/containous/traefik/master/docs.Dockerfile" --menu.js-url="https://raw.githubusercontent.com/containous/structor/master/traefik-menu.js.gotmpl" --exp-branch=master --debug; - tar cfz dist/traefik-${VERSION}.src.tar.gz --exclude-vcs --exclude dist .; fi deploy: - provider: releases @@ -56,4 +60,3 @@ deploy: on: repo: containous/traefik all_branches: true - diff --git a/docs/archive.md b/docs/archive.md deleted file mode 100644 index 6f6c323ae..000000000 --- a/docs/archive.md +++ /dev/null @@ -1,23 +0,0 @@ -## Current versions documentation - -- [Latest stable](https://docs.traefik.io) - -## Future version documentation - -- [Experimental](https://master--traefik-docs.netlify.com/) - -## Previous versions documentation - -- [v1.5 aka Cancoillotte](http://v1-5.archive.docs.traefik.io/) - -- [v1.4 aka Roquefort](http://v1-4.archive.docs.traefik.io/) - -- [v1.3 aka Raclette](http://v1-3.archive.docs.traefik.io/) - -- [v1.2 aka Morbier](http://v1-2.archive.docs.traefik.io/) - -- [v1.1 aka Camembert](http://v1-1.archive.docs.traefik.io/) - -## More - -[Change log](https://github.com/containous/traefik/blob/master/CHANGELOG.md) diff --git a/mkdocs.yml b/mkdocs.yml index 9befff6fa..e7a10747f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -100,4 +100,3 @@ pages: - 'gRPC Example': 'user-guide/grpc.md' - 'Traefik cluster example with Swarm': 'user-guide/cluster-docker-consul.md' - Benchmarks: benchmarks.md - - 'Archive': 'archive.md' From ae9342208ea8935a46d9d70ec44537aca84eb7b7 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 23 Jan 2018 17:34:04 +0100 Subject: [PATCH 14/17] Prepare release v1.5.0 --- CHANGELOG.md | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89b2844eb..7e571c270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,169 @@ # Change Log +## [v1.5.0](https://github.com/containous/traefik/tree/v1.5.0) (2018-01-23) +[All Commits](https://github.com/containous/traefik/compare/v1.4.0-rc1...v1.5.0) + +**Enhancements:** +- **[acme,tls]** Rename TLSConfigurations to TLS. ([#2744](https://github.com/containous/traefik/pull/2744) by [ldez](https://github.com/ldez)) +- **[acme,provider,docker,tls]** Make the TLS certificates management dynamic. ([#2233](https://github.com/containous/traefik/pull/2233) by [nmengin](https://github.com/nmengin)) +- **[acme]** Add Let's Encrypt HTTP Challenge ([#2701](https://github.com/containous/traefik/pull/2701) by [Juliens](https://github.com/Juliens)) +- **[acme]** Update github.com/xenolf/lego to 0.4.1 ([#2304](https://github.com/containous/traefik/pull/2304) by [oldmantaiter](https://github.com/oldmantaiter)) +- **[api,healthcheck,metrics,provider,webui]** Split Web into API/Dashboard, ping, metric and Rest Provider ([#2335](https://github.com/containous/traefik/pull/2335) by [Juliens](https://github.com/Juliens)) +- **[authentication]** Pass through certain forward auth negative response headers ([#2127](https://github.com/containous/traefik/pull/2127) by [wheresmysocks](https://github.com/wheresmysocks)) +- **[cluster,consul,file]** Add file to storeconfig ([#2419](https://github.com/containous/traefik/pull/2419) by [emilevauge](https://github.com/emilevauge)) +- **[cluster,provider]** Support Etcd v3, enhance KV support ([#2407](https://github.com/containous/traefik/pull/2407) by [nmengin](https://github.com/nmengin)) +- **[docker,k8s,rancher,webui]** Redirect to another entryPoint per frontend ([#2133](https://github.com/containous/traefik/pull/2133) by [SantoDE](https://github.com/SantoDE)) +- **[docker,k8s,rancher]** Support regex redirect by frontend ([#2570](https://github.com/containous/traefik/pull/2570) by [ldez](https://github.com/ldez)) +- **[docker]** Add Custom header parsing to Docker Provider ([#2030](https://github.com/containous/traefik/pull/2030) by [dtomcej](https://github.com/dtomcej)) +- **[docker]** Docker labels ([#2473](https://github.com/containous/traefik/pull/2473) by [ldez](https://github.com/ldez)) +- **[docker]** Add docker security headers via labels ([#2334](https://github.com/containous/traefik/pull/2334) by [dtomcej](https://github.com/dtomcej)) +- **[docker]** Use Node IP in Swarm Standalone with "host" NetworkMode ([#2274](https://github.com/containous/traefik/pull/2274) by [BlakeMesdag](https://github.com/BlakeMesdag)) +- **[ecs]** ECS provider refactoring ([#2050](https://github.com/containous/traefik/pull/2050) by [mmatur](https://github.com/mmatur)) +- **[ecs]** Add health check label to ECS ([#2421](https://github.com/containous/traefik/pull/2421) by [oldmantaiter](https://github.com/oldmantaiter)) +- **[ecs]** Support Host NetworkMode for ECS provider ([#2320](https://github.com/containous/traefik/pull/2320) by [FriggaHel](https://github.com/FriggaHel)) +- **[etcd]** Manage certificates dynamically in kv store ([#2411](https://github.com/containous/traefik/pull/2411) by [dahefanteng](https://github.com/dahefanteng)) +- **[healthcheck]** Use health check for systemd watchdog ([#2283](https://github.com/containous/traefik/pull/2283) by [guilhem](https://github.com/guilhem)) +- **[k8s]** Kubernetes security header annotations ([#2460](https://github.com/containous/traefik/pull/2460) by [dtomcej](https://github.com/dtomcej)) +- **[k8s]** Add labels for `traefik.frontend.entryPoints` & `PassTLSCert` to Kubernetes ([#2324](https://github.com/containous/traefik/pull/2324) by [ryarnyah](https://github.com/ryarnyah)) +- **[k8s]** Only listen to configured k8s namespaces. ([#1895](https://github.com/containous/traefik/pull/1895) by [timoreimann](https://github.com/timoreimann)) +- **[logs,middleware,consul,docker]** Use constants from http package. ([#2425](https://github.com/containous/traefik/pull/2425) by [ldez](https://github.com/ldez)) +- **[logs]** Add json format support for Traefik logs ([#2056](https://github.com/containous/traefik/pull/2056) by [marco-jantke](https://github.com/marco-jantke)) +- **[marathon]** Marathon constraints filtering ([#2388](https://github.com/containous/traefik/pull/2388) by [aantono](https://github.com/aantono)) +- **[marathon]** Remove unused lightMarathonClient. ([#2383](https://github.com/containous/traefik/pull/2383) by [timoreimann](https://github.com/timoreimann)) +- **[metrics]** Add InfluxDB support for traefik metrics ([#2289](https://github.com/containous/traefik/pull/2289) by [adityacs](https://github.com/adityacs)) +- **[middleware]** Added ReplacePathRegex middleware ([#2033](https://github.com/containous/traefik/pull/2033) by [Tiscs](https://github.com/Tiscs)) +- **[middleware]** Fix custom headers replacement ([#2455](https://github.com/containous/traefik/pull/2455) by [mmatur](https://github.com/mmatur)) +- **[oxy]** Resync oxy with original repository ([#2451](https://github.com/containous/traefik/pull/2451) by [Juliens](https://github.com/Juliens)) +- **[provider]** Support template as raw string. ([#2413](https://github.com/containous/traefik/pull/2413) by [ldez](https://github.com/ldez)) +- **[rancher]** Run Rancher tests cases in parallel. ([#2424](https://github.com/containous/traefik/pull/2424) by [ldez](https://github.com/ldez)) +- **[rancher]** Update Rancher API integration to go-rancher client v2. ([#2291](https://github.com/containous/traefik/pull/2291) by [rawmind0](https://github.com/rawmind0)) +- **[servicefabric]** Add Service Fabric Provider ([#2117](https://github.com/containous/traefik/pull/2117) by [lawrencegripper](https://github.com/lawrencegripper)) +- **[tls]** Allow adding optional Client CA files ([#2306](https://github.com/containous/traefik/pull/2306) by [nmengin](https://github.com/nmengin)) +- **[websocket]** Add tests for websocket headers ([#2379](https://github.com/containous/traefik/pull/2379) by [Juliens](https://github.com/Juliens)) +- Upgrade libkermit/compose version ([#2071](https://github.com/containous/traefik/pull/2071) by [nmengin](https://github.com/nmengin)) +- Add proxy protocol tests ([#2325](https://github.com/containous/traefik/pull/2325) by [emilevauge](https://github.com/emilevauge)) +- Register pprof handlers. ([#2428](https://github.com/containous/traefik/pull/2428) by [timoreimann](https://github.com/timoreimann)) +- Rate limiting for frontends ([#2034](https://github.com/containous/traefik/pull/2034) by [bparli](https://github.com/bparli)) +- Stats collection. ([#2447](https://github.com/containous/traefik/pull/2447) by [ldez](https://github.com/ldez)) +- Add request accepting grace period delaying graceful shutdown. ([#1971](https://github.com/containous/traefik/pull/1971) by [timoreimann](https://github.com/timoreimann)) +- Put subcommand in dedicated files. ([#2265](https://github.com/containous/traefik/pull/2265) by [ldez](https://github.com/ldez)) + +**Bug fixes:** +- **[acme,docker]** Modify ACME configuration migration into KV store ([#2598](https://github.com/containous/traefik/pull/2598) by [nmengin](https://github.com/nmengin)) +- **[acme,logs]** Modify DEBUG messages to get ACME certificates ([#2685](https://github.com/containous/traefik/pull/2685) by [nmengin](https://github.com/nmengin)) +- **[acme]** Modify the ACME renewing logs level ([#2520](https://github.com/containous/traefik/pull/2520) by [nmengin](https://github.com/nmengin)) +- **[acme]** ACME and corporate proxy. ([#2738](https://github.com/containous/traefik/pull/2738) by [ldez](https://github.com/ldez)) +- **[acme]** Challenge HTTP must ignore deprecated web.path option ([#2719](https://github.com/containous/traefik/pull/2719) by [Juliens](https://github.com/Juliens)) +- **[api]** Fix pprof route order. ([#2523](https://github.com/containous/traefik/pull/2523) by [timoreimann](https://github.com/timoreimann)) +- **[authentication,middleware]** Fix concurrent map writes on digest auth ([#2695](https://github.com/containous/traefik/pull/2695) by [mmatur](https://github.com/mmatur)) +- **[consulcatalog]** Use prefix for sticky and stickiness tags. ([#2624](https://github.com/containous/traefik/pull/2624) by [ldez](https://github.com/ldez)) +- **[consulcatalog]** Fix bad Træfik update on Consul Catalog ([#2573](https://github.com/containous/traefik/pull/2573) by [mmatur](https://github.com/mmatur)) +- **[consulcatalog]** Reload configuration when port change for one service ([#2574](https://github.com/containous/traefik/pull/2574) by [mmatur](https://github.com/mmatur)) +- **[docker,k8s]** Fix Labels/annotation logs and values. ([#2488](https://github.com/containous/traefik/pull/2488) by [ldez](https://github.com/ldez)) +- **[docker,k8s]** Change custom headers separator ([#2509](https://github.com/containous/traefik/pull/2509) by [ldez](https://github.com/ldez)) +- **[docker]** Fix empty IP for backend when dnsrr in Docker swarm mode ([#2490](https://github.com/containous/traefik/pull/2490) by [mmatur](https://github.com/mmatur)) +- **[docker]** Quote template strings ([#2496](https://github.com/containous/traefik/pull/2496) by [dtomcej](https://github.com/dtomcej)) +- **[docker]** Return errors from Docker client.Events ([#2689](https://github.com/containous/traefik/pull/2689) by [BlakeMesdag](https://github.com/BlakeMesdag)) +- **[docker]** Typo in Docker template. ([#2692](https://github.com/containous/traefik/pull/2692) by [ldez](https://github.com/ldez)) +- **[ecs]** Add missing functions for ECS template ([#2312](https://github.com/containous/traefik/pull/2312) by [oldmantaiter](https://github.com/oldmantaiter)) +- **[file,tls]** Send empty configuration from file provider ([#2609](https://github.com/containous/traefik/pull/2609) by [nmengin](https://github.com/nmengin)) +- **[healthcheck]** Fix health check when web is not specified ([#2529](https://github.com/containous/traefik/pull/2529) by [Juliens](https://github.com/Juliens)) +- **[k8s]** Reduce logs with new Kubernetes security annotations ([#2506](https://github.com/containous/traefik/pull/2506) by [ldez](https://github.com/ldez)) +- **[k8s]** Add missing entry points template. ([#2594](https://github.com/containous/traefik/pull/2594) by [ldez](https://github.com/ldez)) +- **[kv]** Fix stickiness bug due to template syntax error ([#2591](https://github.com/containous/traefik/pull/2591) by [dahefanteng](https://github.com/dahefanteng)) +- **[kv]** List entries parsing. ([#2669](https://github.com/containous/traefik/pull/2669) by [ldez](https://github.com/ldez)) +- **[logs]** Fix traefik logs to behave like configured ([#2176](https://github.com/containous/traefik/pull/2176) by [marco-jantke](https://github.com/marco-jantke)) +- **[marathon]** Update go-marathon ([#2585](https://github.com/containous/traefik/pull/2585) by [timoreimann](https://github.com/timoreimann)) +- **[mesos]** Mesos: Use slave.PID.Host as task SlaveIP. ([#2590](https://github.com/containous/traefik/pull/2590) by [nemosupremo](https://github.com/nemosupremo)) +- **[metrics]** Fix breaking change in web metrics ([#2725](https://github.com/containous/traefik/pull/2725) by [Juliens](https://github.com/Juliens)) +- **[metrics]** Do not ignore web params when web.metrics.prometheus is set ([#2499](https://github.com/containous/traefik/pull/2499) by [Juliens](https://github.com/Juliens)) +- **[metrics]** Fix metrics problem on multiple entrypoints ([#2492](https://github.com/containous/traefik/pull/2492) by [Juliens](https://github.com/Juliens)) +- **[metrics]** Fix data races. ([#2287](https://github.com/containous/traefik/pull/2287) by [tcolgate](https://github.com/tcolgate)) +- **[metrics]** Flaky test Influxdb. ([#2386](https://github.com/containous/traefik/pull/2386) by [ldez](https://github.com/ldez)) +- **[middleware,docker,k8s]** Fix custom headers template ([#2621](https://github.com/containous/traefik/pull/2621) by [ldez](https://github.com/ldez)) +- **[middleware]** Don't panic if ResponseWriter does not implement CloseNotify ([#2651](https://github.com/containous/traefik/pull/2651) by [Juliens](https://github.com/Juliens)) +- **[middleware]** GzipResponse must implement CloseNotifier if ResponseWriter implement it ([#2657](https://github.com/containous/traefik/pull/2657) by [Juliens](https://github.com/Juliens)) +- **[middleware]** Fix RawPath handling in addPrefix ([#2560](https://github.com/containous/traefik/pull/2560) by [risdenk](https://github.com/risdenk)) +- **[middleware]** We need to flush the end of the body when retry is streamed ([#2644](https://github.com/containous/traefik/pull/2644) by [Juliens](https://github.com/Juliens)) +- **[provider]** Fix typo in frontend.headers.customresponseheaders label ([#2356](https://github.com/containous/traefik/pull/2356) by [nmandery](https://github.com/nmandery)) +- **[provider]** Fix concurrent provider config reloads ([#2276](https://github.com/containous/traefik/pull/2276) by [marco-jantke](https://github.com/marco-jantke)) +- **[rancher]** Don't reload configuration when rancher server is down ([#2706](https://github.com/containous/traefik/pull/2706) by [wacken89](https://github.com/wacken89)) +- **[rules]** Add non regex pathPrefix ([#2592](https://github.com/containous/traefik/pull/2592) by [emilevauge](https://github.com/emilevauge)) +- **[servicefabric]** Fix backend name for Stateful services. (Service Fabric) ([#2559](https://github.com/containous/traefik/pull/2559) by [ldez](https://github.com/ldez)) +- **[servicefabric]** Fix isHealthy logic. ([#2577](https://github.com/containous/traefik/pull/2577) by [ldez](https://github.com/ldez)) +- **[servicefabric]** Service Fabric 'expose' as boolean. ([#2476](https://github.com/containous/traefik/pull/2476) by [ldez](https://github.com/ldez)) +- **[tls]** Allow deleting dynamically all TLS certificates from an entryPoint ([#2603](https://github.com/containous/traefik/pull/2603) by [nmengin](https://github.com/nmengin)) +- **[websocket]** Disable websocket compression ([#2727](https://github.com/containous/traefik/pull/2727) by [Juliens](https://github.com/Juliens)) +- **[websocket]** Add compression and better error handling ([#2702](https://github.com/containous/traefik/pull/2702) by [Juliens](https://github.com/Juliens)) +- **[websocket]** Use gorilla readMessage and writeMessage instead of just an io.Copy ([#2650](https://github.com/containous/traefik/pull/2650) by [Juliens](https://github.com/Juliens)) +- **[websocket]** RawPath and Transfer TLSConfig in websocket ([#2077](https://github.com/containous/traefik/pull/2077) by [Juliens](https://github.com/Juliens)) +- **[zk]** Change Zookeeper default prefix. ([#2580](https://github.com/containous/traefik/pull/2580) by [ldez](https://github.com/ldez)) +- Fix wrong default entry point and non-existing entry point issue ([#2501](https://github.com/containous/traefik/pull/2501) by [Juliens](https://github.com/Juliens)) +- Fix goroutine leak in throttler logic. ([#2739](https://github.com/containous/traefik/pull/2739) by [timoreimann](https://github.com/timoreimann)) +- Fix timeout integration test ([#2679](https://github.com/containous/traefik/pull/2679) by [ldez](https://github.com/ldez)) +- Fix frontend redirect ([#2544](https://github.com/containous/traefik/pull/2544) by [ldez](https://github.com/ldez)) +- Close ring buffer used in throttling function. ([#2532](https://github.com/containous/traefik/pull/2532) by [timoreimann](https://github.com/timoreimann)) + +**Documentation:** +- **[acme]** Improve documentation for Cloudflare API key ([#2558](https://github.com/containous/traefik/pull/2558) by [mmatur](https://github.com/mmatur)) +- **[acme]** Update Let's Encrypt provider list ([#2347](https://github.com/containous/traefik/pull/2347) by [mmatur](https://github.com/mmatur)) +- **[cluster]** Add a clustering example with Docker Swarm ([#2589](https://github.com/containous/traefik/pull/2589) by [jmaitrehenry](https://github.com/jmaitrehenry)) +- **[consul,consulcatalog]** Split Consul and Consul Catalog documentation ([#2654](https://github.com/containous/traefik/pull/2654) by [ldez](https://github.com/ldez)) +- **[consul]** Improve Consul documentation ([#2485](https://github.com/containous/traefik/pull/2485) by [mmatur](https://github.com/mmatur)) +- **[docker/swarm]** Typo in docker.endpoint TCP port. ([#2626](https://github.com/containous/traefik/pull/2626) by [redhandpl](https://github.com/redhandpl)) +- **[docker]** Fix Docker labels documentation render. ([#2505](https://github.com/containous/traefik/pull/2505) by [ldez](https://github.com/ldez)) +- **[docker]** Add a note on how to add label to a docker compose file ([#2611](https://github.com/containous/traefik/pull/2611) by [jmaitrehenry](https://github.com/jmaitrehenry)) +- **[etcd]** Fix typo in examples ([#2446](https://github.com/containous/traefik/pull/2446) by [dahefanteng](https://github.com/dahefanteng)) +- **[k8s]** Add note to Kubernetes RBAC docs about RoleBindings and namespaces ([#2498](https://github.com/containous/traefik/pull/2498) by [jmara](https://github.com/jmara)) +- **[k8s]** k8s guide: Leave note about assumed DaemonSet usage. ([#2634](https://github.com/containous/traefik/pull/2634) by [timoreimann](https://github.com/timoreimann)) +- **[k8s]** Apply various contentual and stylish improvements to the k8s docs. ([#2677](https://github.com/containous/traefik/pull/2677) by [timoreimann](https://github.com/timoreimann)) +- **[k8s]** Document rewrite-target annotation. ([#2676](https://github.com/containous/traefik/pull/2676) by [timoreimann](https://github.com/timoreimann)) +- **[k8s]** Remove obsolete links in k8s docs ([#2465](https://github.com/containous/traefik/pull/2465) by [marco-jantke](https://github.com/marco-jantke)) +- **[k8s]** Document filename parameter for Kubernetes. ([#2464](https://github.com/containous/traefik/pull/2464) by [timoreimann](https://github.com/timoreimann)) +- **[marathon]** Improve Marathon service label documentation. ([#2635](https://github.com/containous/traefik/pull/2635) by [timoreimann](https://github.com/timoreimann)) +- **[metrics]** Add entrypoint in Prometheus doc and remove web on Influxdb doc ([#2452](https://github.com/containous/traefik/pull/2452) by [Juliens](https://github.com/Juliens)) +- **[provider,webui]** Fix redirect problem on dashboard + docs/tests on [web] ([#2686](https://github.com/containous/traefik/pull/2686) by [Juliens](https://github.com/Juliens)) +- **[servicefabric]** Describe 'refreshSecond' configuration. ([#2471](https://github.com/containous/traefik/pull/2471) by [ldez](https://github.com/ldez)) +- **[tls]** Fix doc dynamic certificates ([#2737](https://github.com/containous/traefik/pull/2737) by [emilevauge](https://github.com/emilevauge)) +- **[tls]** Add link to crypto/tls godoc. ([#2470](https://github.com/containous/traefik/pull/2470) by [ldez](https://github.com/ldez)) +- Move rate limit documentation. ([#2588](https://github.com/containous/traefik/pull/2588) by [ldez](https://github.com/ldez)) +- Grammar ([#2562](https://github.com/containous/traefik/pull/2562) by [geraldcroes](https://github.com/geraldcroes)) +- Fix some doc links ([#2731](https://github.com/containous/traefik/pull/2731) by [eldondev](https://github.com/eldondev)) +- Fix broken links and improve ResponseCodeRatio() description ([#2538](https://github.com/containous/traefik/pull/2538) by [mvasin](https://github.com/mvasin)) +- Fix typo in anonymous usage log message. ([#2711](https://github.com/containous/traefik/pull/2711) by [Yggdrasil](https://github.com/Yggdrasil)) +- Fix typos in changelog ([#2387](https://github.com/containous/traefik/pull/2387) by [ferhatelmas](https://github.com/ferhatelmas)) +- Add mmatur to maintainers ([#2303](https://github.com/containous/traefik/pull/2303) by [emilevauge](https://github.com/emilevauge)) +- Add a note about redirection rule to precise how regex/replacement work. ([#2243](https://github.com/containous/traefik/pull/2243) by [nmengin](https://github.com/nmengin)) +- Add docker things for documentation ([#2020](https://github.com/containous/traefik/pull/2020) by [tcoupin](https://github.com/tcoupin)) +- Prepare release v1.5.0-rc5 ([#2707](https://github.com/containous/traefik/pull/2707) by [mmatur](https://github.com/mmatur)) +- Prepare release v1.5.0-rc4 ([#2656](https://github.com/containous/traefik/pull/2656) by [Juliens](https://github.com/Juliens)) +- Prepare release v1.5.0-rc3 ([#2599](https://github.com/containous/traefik/pull/2599) by [ldez](https://github.com/ldez)) +- Prepare release v1.5.0-rc2 ([#2533](https://github.com/containous/traefik/pull/2533) by [ldez](https://github.com/ldez)) +- Prepare release v1.5.0-rc1 ([#2480](https://github.com/containous/traefik/pull/2480) by [ldez](https://github.com/ldez)) + +**Misc:** +- **[acme]** dumpcerts.sh: Fix call to "base64" for Alpine ([#2344](https://github.com/containous/traefik/pull/2344) by [nknapp](https://github.com/nknapp)) +- **[acme]** dumpcerts.sh: fixed sed, extracted domain keys ([#2161](https://github.com/containous/traefik/pull/2161) by [sjawhar](https://github.com/sjawhar)) +- **[etcd,kv,tls]** Add tests for TLS dynamic configuration in ETCD3 ([#2606](https://github.com/containous/traefik/pull/2606) by [dahefanteng](https://github.com/dahefanteng)) +- Upgrade libkermit/compose version ([#2074](https://github.com/containous/traefik/pull/2074) by [nmengin](https://github.com/nmengin)) +- Merge v1.4.6 into v1.5 ([#2642](https://github.com/containous/traefik/pull/2642) by [ldez](https://github.com/ldez)) +- Merge v1.4.5 into v1.5 ([#2530](https://github.com/containous/traefik/pull/2530) by [mmatur](https://github.com/mmatur)) +- Merge current v1.4 into master ([#2479](https://github.com/containous/traefik/pull/2479) by [ldez](https://github.com/ldez)) +- Merge v1.4.3 into master ([#2415](https://github.com/containous/traefik/pull/2415) by [ldez](https://github.com/ldez)) +- Merge v1.4.4 into master ([#2457](https://github.com/containous/traefik/pull/2457) by [ldez](https://github.com/ldez)) +- Merge v1.4.3 into master ([#2406](https://github.com/containous/traefik/pull/2406) by [ldez](https://github.com/ldez)) +- Revert "Merge v1.4.2 into master" ([#2414](https://github.com/containous/traefik/pull/2414) by [ldez](https://github.com/ldez)) +- Merge v1.4.2 into master ([#2358](https://github.com/containous/traefik/pull/2358) by [ldez](https://github.com/ldez)) +- Merge v1.4.1 into master ([#2318](https://github.com/containous/traefik/pull/2318) by [ldez](https://github.com/ldez)) +- Merge v1.4.0 ([#2271](https://github.com/containous/traefik/pull/2271) by [ldez](https://github.com/ldez)) +- Merge v1.4.0-rc5 into master ([#2242](https://github.com/containous/traefik/pull/2242) by [ldez](https://github.com/ldez)) +- Merge v1.4.0-rc4 into master ([#2202](https://github.com/containous/traefik/pull/2202) by [ldez](https://github.com/ldez)) +- Merge current v1.4 into master ([#2469](https://github.com/containous/traefik/pull/2469) by [ldez](https://github.com/ldez)) +- Merge current v1.4 ([#2154](https://github.com/containous/traefik/pull/2154) by [ldez](https://github.com/ldez)) +- Merge v1.4.0-rc3 into master ([#2140](https://github.com/containous/traefik/pull/2140) by [ldez](https://github.com/ldez)) +- Merge v1.4.0-rc2 into master ([#2092](https://github.com/containous/traefik/pull/2092) by [ldez](https://github.com/ldez)) +- Merge current 1.4 ([#2064](https://github.com/containous/traefik/pull/2064) by [ldez](https://github.com/ldez)) + ## [v1.5.0-rc5](https://github.com/containous/traefik/tree/v1.5.0-rc5) (2018-01-15) [All Commits](https://github.com/containous/traefik/compare/v1.5.0-rc4...v1.5.0-rc5) From f5d150c3b40ed9ad5ebf7a19cde69755285c678b Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 24 Jan 2018 08:12:03 +0100 Subject: [PATCH 15/17] Fix the k8s redirection template. --- autogen/gentemplates/gen.go | 6 +++--- templates/kubernetes.tmpl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autogen/gentemplates/gen.go b/autogen/gentemplates/gen.go index 313db391b..455c05ed6 100644 --- a/autogen/gentemplates/gen.go +++ b/autogen/gentemplates/gen.go @@ -441,9 +441,9 @@ var _templatesKubernetesTmpl = []byte(`[backends]{{range $backendName, $backend {{if $frontend.Redirect}} [frontends."{{$frontendName}}".redirect] - entryPoint = "{{$frontend.RedirectEntryPoint}}" - regex = "{{$frontend.RedirectRegex}}" - replacement = "{{$frontend.RedirectReplacement}}" + entryPoint = "{{$frontend.Redirect.EntryPoint}}" + regex = "{{$frontend.Redirect.Regex}}" + replacement = "{{$frontend.Redirect.Replacement}}" {{end}} {{ if $frontend.Headers }} diff --git a/templates/kubernetes.tmpl b/templates/kubernetes.tmpl index 2509a8fbc..580aac838 100644 --- a/templates/kubernetes.tmpl +++ b/templates/kubernetes.tmpl @@ -37,9 +37,9 @@ {{if $frontend.Redirect}} [frontends."{{$frontendName}}".redirect] - entryPoint = "{{$frontend.RedirectEntryPoint}}" - regex = "{{$frontend.RedirectRegex}}" - replacement = "{{$frontend.RedirectReplacement}}" + entryPoint = "{{$frontend.Redirect.EntryPoint}}" + regex = "{{$frontend.Redirect.Regex}}" + replacement = "{{$frontend.Redirect.Replacement}}" {{end}} {{ if $frontend.Headers }} From 751781a3b779e592ffddda9eb22289f3455dae60 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 24 Jan 2018 09:14:02 +0100 Subject: [PATCH 16/17] Increase integration tests timeout. --- script/test-integration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/test-integration b/script/test-integration index 95d32af32..0cf7ccf8b 100755 --- a/script/test-integration +++ b/script/test-integration @@ -4,7 +4,7 @@ set -e export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export DEST=. -TESTFLAGS="${TESTFLAGS} -test.timeout=9m -check.v" +TESTFLAGS="${TESTFLAGS} -test.timeout=20m -check.v" if [ -n "$VERBOSE" ]; then TESTFLAGS="${TESTFLAGS} -v" From 4afb39778aba5e86616957a27adbede0b35214d1 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 24 Jan 2018 10:40:04 +0100 Subject: [PATCH 17/17] =?UTF-8?q?Fix=20add=20src.tar.gz=20in=20Tr=C3=A6fik?= =?UTF-8?q?=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9a921963c..74b01fb55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ before_deploy: curl -sI https://github.com/containous/structor/releases/latest | grep -Fi Location | tr -d '\r' | sed "s/tag/download/g" | awk -F " " '{ print $2 "/structor_linux-amd64"}' | wget --output-document=$GOPATH/bin/structor -i -; chmod +x $GOPATH/bin/structor; structor -o containous -r traefik --dockerfile-url="https://raw.githubusercontent.com/containous/traefik/master/docs.Dockerfile" --menu.js-url="https://raw.githubusercontent.com/containous/structor/master/traefik-menu.js.gotmpl" --exp-branch=master --debug; + tar cfz dist/traefik-${VERSION}.src.tar.gz --exclude-vcs --exclude dist .; fi deploy: - provider: releases