diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a6f131353..0122f29e6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -61,6 +61,7 @@ jobs: ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }} with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Artifact webui uses: actions/download-artifact@v4 diff --git a/.github/workflows/experimental.yaml b/.github/workflows/experimental.yaml index b089beabc..76959bbd5 100644 --- a/.github/workflows/experimental.yaml +++ b/.github/workflows/experimental.yaml @@ -33,6 +33,7 @@ jobs: ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }} with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Build run: make generate binary diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 14a7e4633..5b93217b3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,6 +41,7 @@ jobs: ImageOS: ${{ matrix.os }} with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Artifact webui uses: actions/download-artifact@v4 diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 10fe2ca44..f8eac5dc6 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -28,6 +28,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Avoid generating webui run: touch webui/static/index.html @@ -55,6 +56,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Avoid generating webui run: touch webui/static/index.html diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 5550ec1cd..7d4a0fa66 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -27,6 +27,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Avoid generating webui run: touch webui/static/index.html diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index cb058b98b..dcc04732e 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -25,6 +25,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: golangci-lint uses: golangci/golangci-lint-action@v6 @@ -44,6 +45,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: Install misspell ${{ env.MISSPELL_VERSION }} run: curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b $(go env GOPATH)/bin ${MISSPELL_VERSION} @@ -67,6 +69,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + check-latest: true - name: go generate run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 35744ebe5..947d6c423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [v2.11.19](https://github.com/traefik/traefik/tree/v2.11.19) (2025-01-29) +[All Commits](https://github.com/traefik/traefik/compare/v2.11.18...v2.11.19) + +**Bug fixes:** +- **[middleware]** Changing log message when client cert is not available to debug ([#11453](https://github.com/traefik/traefik/pull/11453) by [Nelwhix](https://github.com/Nelwhix)) +- **[service]** Do not create a logger instance for each proxy ([#11487](https://github.com/traefik/traefik/pull/11487) by [kevinpollet](https://github.com/kevinpollet)) +- **[webui]** Fix auto refresh not clearing on component unmount ([#11477](https://github.com/traefik/traefik/pull/11477) by [DoubleREW](https://github.com/DoubleREW)) + +**Documentation:** +- Remove awesome.traefik.io reference in documentation section ([#11435](https://github.com/traefik/traefik/pull/11435) by [kevinpollet](https://github.com/kevinpollet)) + ## [v3.3.2](https://github.com/traefik/traefik/tree/v3.3.2) (2025-01-14) [All Commits](https://github.com/traefik/traefik/compare/v3.3.1...v3.3.2) diff --git a/README.md b/README.md index bb09fae86..5c5f7ae84 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,6 @@ You can access the simple HTML frontend of Traefik. You can find the complete documentation of Traefik v3 at [https://doc.traefik.io/traefik/](https://doc.traefik.io/traefik/). -A collection of contributions around Traefik can be found at [https://awesome.traefik.io](https://awesome.traefik.io). - ## Support To get community support, you can: diff --git a/cmd/traefik/traefik.go b/cmd/traefik/traefik.go index 588e320ff..9f8624d08 100644 --- a/cmd/traefik/traefik.go +++ b/cmd/traefik/traefik.go @@ -193,7 +193,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err return nil, err } - acmeProviders := initACMEProvider(staticConfiguration, providerAggregator, tlsManager, httpChallengeProvider, tlsChallengeProvider) + acmeProviders := initACMEProvider(staticConfiguration, providerAggregator, tlsManager, httpChallengeProvider, tlsChallengeProvider, routinesPool) // Tailscale @@ -445,7 +445,7 @@ func switchRouter(routerFactory *server.RouterFactory, serverEntryPointsTCP serv } // initACMEProvider creates and registers acme.Provider instances corresponding to the configured ACME certificate resolvers. -func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.ProviderAggregator, tlsManager *traefiktls.Manager, httpChallengeProvider, tlsChallengeProvider challenge.Provider) []*acme.Provider { +func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.ProviderAggregator, tlsManager *traefiktls.Manager, httpChallengeProvider, tlsChallengeProvider challenge.Provider, routinesPool *safe.Pool) []*acme.Provider { localStores := map[string]*acme.LocalStore{} var resolvers []*acme.Provider @@ -455,7 +455,7 @@ func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.Pr } if localStores[resolver.ACME.Storage] == nil { - localStores[resolver.ACME.Storage] = acme.NewLocalStore(resolver.ACME.Storage) + localStores[resolver.ACME.Storage] = acme.NewLocalStore(resolver.ACME.Storage, routinesPool) } p := &acme.Provider{ diff --git a/integration/fixtures/https/rootcas/https.toml b/integration/fixtures/https/rootcas/https.toml index b2eff4091..fb6dbca2d 100644 --- a/integration/fixtures/https/rootcas/https.toml +++ b/integration/fixtures/https/rootcas/https.toml @@ -10,24 +10,24 @@ # Use certificate in net/internal/test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EB/wQE AwICpDATBgNVHSUEDDAKBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud -DgQWBBStsdjh3/JCXXYlQryOrL4Sh7BW5TAuBgNVHREEJzAlggtleGFtcGxlLmNv -bYcEfwAAAYcQAAAAAAAAAAAAAAAAAAAAATANBgkqhkiG9w0BAQsFAAOCAQEAxWGI -5NhpF3nwwy/4yB4i/CwwSpLrWUa70NyhvprUBC50PxiXav1TeDzwzLx/o5HyNwsv -cxv3HdkLW59i/0SlJSrNnWdfZ19oTcS+6PtLoVyISgtyN6DpkKpdG1cOkW3Cy2P2 -+tK/tKHRP1Y/Ra0RiDpOAmqn0gCOFGz8+lqDIor/T7MTpibL3IxqWfPrvfVRHL3B -grw/ZQTTIVjjh4JBSW3WyWgNo/ikC1lrVxzl4iPUGptxT36Cr7Zk2Bsg0XqwbOvK -5d+NTDREkSnUbie4GeutujmX3Dsx88UiV6UY/4lHJa6I5leHUNOHahRbpbWeOfs/ -WkBKOclmOV2xlTVuPw== +DgQWBBQR5QIzmacmw78ZI1C4MXw7Q0wJ1jA9BgNVHREENjA0ggtleGFtcGxlLmNv +bYINKi5leGFtcGxlLmNvbYcEfwAAAYcQAAAAAAAAAAAAAAAAAAAAATANBgkqhkiG +9w0BAQsFAAOCAQEACrRNgiioUDzxQftd0fwOa6iRRcPampZRDtuaF68yNHoNWbOu +LUwc05eOWxRq3iABGSk2xg+FXM3DDeW4HhAhCFptq7jbVZ+4Jj6HeJG9mYRatAxR +Y/dEpa0D0EHhDxxVg6UzKOXB355n0IetGE/aWvyTV9SiDs6QsaC57Q9qq1/mitx5 +2GFBoapol9L5FxCc77bztzK8CpLujkBi25Vk6GAFbl27opLfpyxkM+rX/T6MXCPO +6/YBacNZ7ff1/57Etg4i5mNA6ubCpuc4Gi9oYqCNNohftr2lkJr7REdDR6OW0lsL +rF7r4gUnKeC7mYIH1zypY7laskopiLFAfe96Kg== -----END CERTIFICATE----- """] diff --git a/integration/fixtures/https/rootcas/local.crt b/integration/fixtures/https/rootcas/local.crt index 1b683072e..9466ae27f 100644 --- a/integration/fixtures/https/rootcas/local.crt +++ b/integration/fixtures/https/rootcas/local.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDOTCCAiGgAwIBAgIQSRJrEpBGFc7tNb1fb5pKFzANBgkqhkiG9w0BAQsFADAS +MIIDSDCCAjCgAwIBAgIQEP/md970HysdBTpuzDOf0DANBgkqhkiG9w0BAQsFADAS MRAwDgYDVQQKEwdBY21lIENvMCAXDTcwMDEwMTAwMDAwMFoYDzIwODQwMTI5MTYw MDAwWjASMRAwDgYDVQQKEwdBY21lIENvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEA6Gba5tHV1dAKouAaXO3/ebDUU4rvwCUg/CNaJ2PT5xLD4N1Vcb8r -bFSW2HXKq+MPfVdwIKR/1DczEoAGf/JWQTW7EgzlXrCd3rlajEX2D73faWJekD0U -aUgz5vtrTXZ90BQL7WvRICd7FlEZ6FPOcPlumiyNmzUqtwGhO+9ad1W5BqJaRI6P -YfouNkwR6Na4TzSj5BrqUfP0FwDizKSJ0XXmh8g8G9mtwxOSN3Ru1QFc61Xyeluk -POGKBV/q6RBNklTNe0gI8usUMlYyoC7ytppNMW7X2vodAelSu25jgx2anj9fDVZu -h7AXF5+4nJS4AAt0n1lNY7nGSsdZas8PbQIDAQABo4GIMIGFMA4GA1UdDwEB/wQE +MIIBCgKCAQEAxcl69ROJdxjN+MJZnbFrYxyQooADCsJ6VDkuMyNQIix/Hk15Nk/u +FyBX1Me++aEpGmY3RIY4fUvELqT/srvAHsTXwVVSttMcY8pcAFmXSqo3x4MuUTG/ +jCX3Vftj0r3EM5M8ImY1rzA/jqTTLJg00rD+DmuDABcqQvoXw/RV8w1yTRi5BPoH +DFD/AWTt/YgMvk1l2Yq/xI8VbMUIpjBoGXxWsSevQ5i2s1mk9/yZzu0Ysp1tTlzD +qOPa4ysFjBitdXiwfxjxtv5nX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oYqCNNohftr2lkJr7REdDR6OW0lsL +rF7r4gUnKeC7mYIH1zypY7laskopiLFAfe96Kg== -----END CERTIFICATE----- diff --git a/pkg/middlewares/passtlsclientcert/pass_tls_client_cert.go b/pkg/middlewares/passtlsclientcert/pass_tls_client_cert.go index 77f1cd09d..79db7b1d2 100644 --- a/pkg/middlewares/passtlsclientcert/pass_tls_client_cert.go +++ b/pkg/middlewares/passtlsclientcert/pass_tls_client_cert.go @@ -151,7 +151,7 @@ func (p *passTLSClientCert) ServeHTTP(rw http.ResponseWriter, req *http.Request) if req.TLS != nil && len(req.TLS.PeerCertificates) > 0 { req.Header.Set(xForwardedTLSClientCert, getCertificates(ctx, req.TLS.PeerCertificates)) } else { - logger.Warn().Msg("Tried to extract a certificate on a request without mutual TLS") + logger.Debug().Msg("Tried to extract a certificate on a request without mutual TLS") } } @@ -160,7 +160,7 @@ func (p *passTLSClientCert) ServeHTTP(rw http.ResponseWriter, req *http.Request) headerContent := p.getCertInfo(ctx, req.TLS.PeerCertificates) req.Header.Set(xForwardedTLSClientCertInfo, url.QueryEscape(headerContent)) } else { - logger.Warn().Msg("Tried to extract a certificate on a request without mutual TLS") + logger.Debug().Msg("Tried to extract a certificate on a request without mutual TLS") } } diff --git a/pkg/provider/acme/local_store.go b/pkg/provider/acme/local_store.go index c7677e047..6e50fb153 100644 --- a/pkg/provider/acme/local_store.go +++ b/pkg/provider/acme/local_store.go @@ -1,6 +1,7 @@ package acme import ( + "context" "encoding/json" "io" "os" @@ -23,9 +24,9 @@ type LocalStore struct { } // NewLocalStore initializes a new LocalStore with a file name. -func NewLocalStore(filename string) *LocalStore { +func NewLocalStore(filename string, routinesPool *safe.Pool) *LocalStore { store := &LocalStore{filename: filename, saveDataChan: make(chan map[string]*StoredData)} - store.listenSaveAction() + store.listenSaveAction(routinesPool) return store } @@ -100,18 +101,31 @@ func (s *LocalStore) get(resolverName string) (*StoredData, error) { } // listenSaveAction listens to a chan to store ACME data in json format into `LocalStore.filename`. -func (s *LocalStore) listenSaveAction() { - safe.Go(func() { +func (s *LocalStore) listenSaveAction(routinesPool *safe.Pool) { + routinesPool.GoCtx(func(ctx context.Context) { logger := log.With().Str(logs.ProviderName, "acme").Logger() - for object := range s.saveDataChan { - data, err := json.MarshalIndent(object, "", " ") - if err != nil { - logger.Error().Err(err).Send() - } + for { + select { + case <-ctx.Done(): + return - err = os.WriteFile(s.filename, data, 0o600) - if err != nil { - logger.Error().Err(err).Send() + case object := <-s.saveDataChan: + select { + case <-ctx.Done(): + // Stop handling events because Traefik is shutting down. + return + default: + } + + data, err := json.MarshalIndent(object, "", " ") + if err != nil { + logger.Error().Err(err).Send() + } + + err = os.WriteFile(s.filename, data, 0o600) + if err != nil { + logger.Error().Err(err).Send() + } } } }) diff --git a/pkg/provider/acme/local_store_test.go b/pkg/provider/acme/local_store_test.go index 4614078c0..a3c05fc58 100644 --- a/pkg/provider/acme/local_store_test.go +++ b/pkg/provider/acme/local_store_test.go @@ -1,6 +1,7 @@ package acme import ( + "context" "fmt" "os" "path/filepath" @@ -9,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/traefik/traefik/v3/pkg/safe" ) func TestLocalStore_GetAccount(t *testing.T) { @@ -45,7 +47,7 @@ func TestLocalStore_GetAccount(t *testing.T) { for _, test := range testCases { t.Run(test.desc, func(t *testing.T) { - s := NewLocalStore(test.filename) + s := NewLocalStore(test.filename, safe.NewPool(context.Background())) account, err := s.GetAccount("test") require.NoError(t, err) @@ -58,7 +60,7 @@ func TestLocalStore_GetAccount(t *testing.T) { func TestLocalStore_SaveAccount(t *testing.T) { acmeFile := filepath.Join(t.TempDir(), "acme.json") - s := NewLocalStore(acmeFile) + s := NewLocalStore(acmeFile, safe.NewPool(context.Background())) email := "some@email.com" diff --git a/pkg/proxy/fast/proxy_test.go b/pkg/proxy/fast/proxy_test.go index 4c4c158b1..563f411c1 100644 --- a/pkg/proxy/fast/proxy_test.go +++ b/pkg/proxy/fast/proxy_test.go @@ -307,6 +307,8 @@ func TestHeadRequest(t *testing.T) { } func TestNoContentLengthResponse(t *testing.T) { + t.Skip("Waiting for a fix") + backendListener, err := net.Listen("tcp", ":0") require.NoError(t, err) diff --git a/webui/src/_mixins/Pagination.js b/webui/src/_mixins/Pagination.js index a090beac2..4109f1b28 100644 --- a/webui/src/_mixins/Pagination.js +++ b/webui/src/_mixins/Pagination.js @@ -67,7 +67,7 @@ export default function PaginationMixin (opts = {}) { this.fetchMore() } }, - beforeDestroy () { + beforeUnmount () { clearInterval(this.pollingInterval) } }