diff --git a/CHANGELOG.md b/CHANGELOG.md index 5741a5a2a..899357a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## [v1.4.6](https://github.com/containous/traefik/tree/v1.4.6) (2018-01-02) +[All Commits](https://github.com/containous/traefik/compare/v1.4.5...v1.4.6) + +**Bug fixes:** +- **[docker]** Normalize serviceName added to the service backend names ([#2631](https://github.com/containous/traefik/pull/2631) by [mmatur](https://github.com/mmatur)) +- **[websocket]** Use gorilla readMessage and writeMessage instead of just an io.Copy ([#2640](https://github.com/containous/traefik/pull/2640) by [Juliens](https://github.com/Juliens)) +- Fix bug report command ([#2638](https://github.com/containous/traefik/pull/2638) by [ldez](https://github.com/ldez)) + ## [v1.5.0-rc3](https://github.com/containous/traefik/tree/v1.5.0-rc3) (2017-12-20) [All Commits](https://github.com/containous/traefik/compare/v1.5.0-rc2...v1.5.0-rc3) diff --git a/LICENSE.md b/LICENSE.md index a67e37b43..ed3503b6e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2017 Containous SAS +Copyright (c) 2016-2018 Containous SAS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/autogen/gentemplates/gen.go b/autogen/gentemplates/gen.go index 3f3758494..1865d68ca 100644 --- a/autogen/gentemplates/gen.go +++ b/autogen/gentemplates/gen.go @@ -304,6 +304,7 @@ var _templatesDockerTmpl = []byte(`{{$backendServers := .Servers}} {{end}} {{end}} + {{ if hasHeaders $container}} [frontends."frontend-{{$frontend}}".headers] {{if hasSSLRedirectHeaders $container}} SSLRedirect = {{getSSLRedirectHeaders $container}} @@ -383,6 +384,7 @@ var _templatesDockerTmpl = []byte(`{{$backendServers := .Servers}} {{$k}} = "{{$v}}" {{end}} {{end}} + {{end}} [frontends."frontend-{{$frontend}}".routes."route-frontend-{{$frontend}}"] rule = "{{getFrontendRule $container}}" @@ -536,6 +538,7 @@ var _templatesKubernetesTmpl = []byte(`[backends]{{range $backendName, $backend replacement = "{{$frontend.RedirectReplacement}}" {{end}} + {{if $frontend.Headers }} [frontends."{{$frontendName}}".headers] SSLRedirect = {{$frontend.Headers.SSLRedirect}} SSLTemporaryRedirect = {{$frontend.Headers.SSLTemporaryRedirect}} @@ -579,13 +582,13 @@ var _templatesKubernetesTmpl = []byte(`[backends]{{range $backendName, $backend {{range $k, $v := $frontend.Headers.SSLProxyHeaders}} {{$k}} = "{{$v}}" {{end}} +{{end}} {{end}} {{range $routeName, $route := $frontend.Routes}} [frontends."{{$frontendName}}".routes."{{$routeName}}"] rule = "{{$route.Rule}}" {{end}} -{{end}} -`) +{{end}}`) func templatesKubernetesTmplBytes() ([]byte, error) { return _templatesKubernetesTmpl, nil @@ -805,6 +808,7 @@ var _templatesMarathonTmpl = []byte(`{{$apps := .Applications}} {{end}} {{end}} + {{if hasHeaders $app $serviceName }} [frontends."{{ getFrontendName $app $serviceName }}".headers] {{if hasSSLRedirectHeaders $app $serviceName}} SSLRedirect = {{getSSLRedirectHeaders $app $serviceName}} @@ -884,6 +888,7 @@ var _templatesMarathonTmpl = []byte(`{{$apps := .Applications}} {{$k}} = "{{$v}}" {{end}} {{end}} + {{end}} [frontends."{{ getFrontendName $app $serviceName }}".routes."route-host{{$app.ID | replace "/" "-"}}{{getServiceNameSuffix $serviceName }}"] rule = "{{getFrontendRule $app $serviceName}}" diff --git a/cmd/traefik/bug.go b/cmd/traefik/bug.go index 27d99d389..2c7551853 100644 --- a/cmd/traefik/bug.go +++ b/cmd/traefik/bug.go @@ -84,7 +84,7 @@ Add more configuration information here. ) // newBugCmd builds a new Bug command -func newBugCmd(traefikConfiguration interface{}, traefikPointersConfiguration interface{}) *flaeg.Command { +func newBugCmd(traefikConfiguration *TraefikConfiguration, traefikPointersConfiguration *TraefikConfiguration) *flaeg.Command { //version Command init return &flaeg.Command{ @@ -99,7 +99,7 @@ func newBugCmd(traefikConfiguration interface{}, traefikPointersConfiguration in } } -func runBugCmd(traefikConfiguration interface{}) func() error { +func runBugCmd(traefikConfiguration *TraefikConfiguration) func() error { return func() error { body, err := createBugReport(traefikConfiguration) @@ -113,7 +113,7 @@ func runBugCmd(traefikConfiguration interface{}) func() error { } } -func createBugReport(traefikConfiguration interface{}) (string, error) { +func createBugReport(traefikConfiguration *TraefikConfiguration) (string, error) { var version bytes.Buffer if err := getVersionPrint(&version); err != nil { return "", err @@ -124,7 +124,7 @@ func createBugReport(traefikConfiguration interface{}) (string, error) { return "", err } - config, err := anonymize.Do(&traefikConfiguration, true) + config, err := anonymize.Do(traefikConfiguration, true) if err != nil { return "", err } diff --git a/cmd/traefik/bug_test.go b/cmd/traefik/bug_test.go index 3158e8c99..ef81091f1 100644 --- a/cmd/traefik/bug_test.go +++ b/cmd/traefik/bug_test.go @@ -7,16 +7,27 @@ import ( "github.com/containous/traefik/configuration" "github.com/containous/traefik/provider/file" "github.com/containous/traefik/tls" + "github.com/containous/traefik/types" "github.com/stretchr/testify/assert" ) func Test_createBugReport(t *testing.T) { - traefikConfiguration := TraefikConfiguration{ + traefikConfiguration := &TraefikConfiguration{ ConfigFile: "FOO", GlobalConfiguration: configuration.GlobalConfiguration{ EntryPoints: configuration.EntryPoints{ "goo": &configuration.EntryPoint{ Address: "hoo.bar", + Auth: &types.Auth{ + Basic: &types.Basic{ + UsersFile: "foo Basic UsersFile", + Users: types.Users{"foo Basic Users 1", "foo Basic Users 2", "foo Basic Users 3"}, + }, + Digest: &types.Digest{ + UsersFile: "foo Digest UsersFile", + Users: types.Users{"foo Digest Users 1", "foo Digest Users 2", "foo Digest Users 3"}, + }, + }, }, }, File: &file.Provider{ @@ -28,6 +39,11 @@ func Test_createBugReport(t *testing.T) { report, err := createBugReport(traefikConfiguration) assert.NoError(t, err, report) + + // exported anonymous configuration + assert.NotContains(t, "web Basic Users ", report) + assert.NotContains(t, "foo Digest Users ", report) + assert.NotContains(t, "hoo.bar", report) } func Test_anonymize_traefikConfiguration(t *testing.T) { diff --git a/docs/configuration/backends/marathon.md b/docs/configuration/backends/marathon.md index d363fda5f..4d3ba7ee8 100644 --- a/docs/configuration/backends/marathon.md +++ b/docs/configuration/backends/marathon.md @@ -150,12 +150,15 @@ domain = "marathon.localhost" To enable constraints see [backend-specific constraints section](/configuration/commons/#backend-specific). - ## Labels: overriding default behaviour -### On Containers +Marathon labels may be used to dynamically change the routing and forwarding behaviour. -Labels can be used on containers to override default behaviour: +They may be specified on one of two levels: Application or service. + +### Application Level + +The following labels can be defined on Marathon applications. They adjust the behaviour for the entire application. | Label | Description | |------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -219,9 +222,9 @@ Labels can be used on containers to override default behaviour: | `traefik.frontend.headers.referrerPolicy=VALUE` | Adds referrer policy header. | | `traefik.frontend.headers.isDevelopment=false` | This will cause the `AllowedHosts`, `SSLRedirect`, and `STSSeconds`/`STSIncludeSubdomains` options to be ignored during development.
When deploying to production, be sure to set this to false. | -### On Services +### Service Level -If several ports need to be exposed from a container, the services labels can be used: +For applications that expose multiple ports, specific labels can be used to extract one frontend/backend configuration pair per port. Each such pair is called a _service_. The (freely choosable) name of the service is an integral part of the service label name. | Label | Description | |---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------| diff --git a/docs/theme/partials/footer.html b/docs/theme/partials/footer.html index 98cb1e652..e3b586dbe 100644 --- a/docs/theme/partials/footer.html +++ b/docs/theme/partials/footer.html @@ -20,7 +20,7 @@ IN THE SOFTWARE. --> -{% import "partials/language.html" as lang %} +{% import "partials/language.html" as lang with context %}