ci / test (pull_request) Successful in 51s
The proxy in front of the console and the webmail, which holds their
TLS keys (and runs on the host network beside a host server), was
docker.io/library/caddy:2-alpine: a floating tag on Docker Hub, so
every install and converge ran whatever that tag named that day, and
whoever could push it chose what ran as the proxy. Everything else
the installer downloads is checked against a checksum in its source.
Caddy is now pinned in internal/release by the digest of its image
index (2.11.9-alpine, the same digest as on main), and compose.yaml
names it by digest. The comment that called the suite's own tags
immutable is corrected: they can be pushed again.
Backport to the 2026 line, by hand where the code differs: this line
has no pin-check, so that part is left out and the pin is moved by
hand like the other pins here; the image test also accepts the
webmail's version-and-commit tags.
Test: TestCaddyIsPinnedByDigest failed before (DefaultCaddyImage was
"docker.io/library/caddy:2-alpine") and now passes;
TestSuiteImagesNameAnExactRelease is new.
(backported from commit 71ec74be74)
31 lines
1.1 KiB
Go
31 lines
1.1 KiB
Go
// SPDX-FileCopyrightText: 2026 Coffey Labs LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
package apply
|
|
|
|
import (
|
|
"regexp"
|
|
"testing"
|
|
)
|
|
|
|
// Everything this installer downloads as a file is checked against a
|
|
// checksum in its source. Caddy, the proxy that holds the TLS keys, was
|
|
// pulled by a floating tag from Docker Hub instead, so whoever could push
|
|
// that tag chose what ran (INSTALLER-5). It is pinned by its digest now.
|
|
func TestCaddyIsPinnedByDigest(t *testing.T) {
|
|
if !regexp.MustCompile(`@sha256:[0-9a-f]{64}$`).MatchString(DefaultCaddyImage) {
|
|
t.Errorf("DefaultCaddyImage = %q, not pinned by digest", DefaultCaddyImage)
|
|
}
|
|
}
|
|
|
|
// The suite's own images name one exact release, never a moving tag. The
|
|
// webmail's releases on this line are named by version and commit.
|
|
func TestSuiteImagesNameAnExactRelease(t *testing.T) {
|
|
exact := regexp.MustCompile(`:\d+\.\d+(\.\d+)*(-rc\.\d+|-g[0-9a-f]+)?$`)
|
|
for _, img := range []string{DefaultServerImage, DefaultConsoleImage, DefaultWebmailImage} {
|
|
if !exact.MatchString(img) {
|
|
t.Errorf("%s does not name an exact release", img)
|
|
}
|
|
}
|
|
}
|