Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Let provider MSP installs obtain their TLS certificate
[email protected]1ee2c5410a62
diff --git a/deploy/provider-msp/docker-compose.yml b/deploy/provider-msp/docker-compose.ymlindex 6f2d9ba70f..33ae6dda3d 100644--- a/deploy/provider-msp/docker-compose.yml+++ b/deploy/provider-msp/docker-compose.yml@@ -1,12 +1,36 @@services:traefik:image: ${TRAEFIK_IMAGE:?TRAEFIK_IMAGE must be set to a digest-pinned image}+ # Traefik takes its static configuration from exactly one source, and a+ # mounted traefik.yml wins over flags and TRAEFIK_* variables. The bundle+ # used to mount one with [email protected], which Let's Encrypt refuses,+ # so no install could obtain a certificate and ACME_EMAIL and+ # ACME_DNS_PROVIDER were silently ignored. The flags carry the .env values.+ command:+ - --api.dashboard=false+ - --entrypoints.web.address=:80+ - --entrypoints.web.http.redirections.entrypoint.to=websecure+ - --entrypoints.web.http.redirections.entrypoint.scheme=https+ - --entrypoints.websecure.address=:443+ - --entrypoints.websecure.http.middlewares=security-headers@file+ - --providers.docker.endpoint=unix:///var/run/docker.sock+ - --providers.docker.exposedbydefault=false+ - --providers.docker.network=${PULSE_PROVIDER_MSP_DOCKER_NETWORK:-pulse-provider-msp}+ - --providers.file.filename=/etc/traefik/traefik-dynamic.yml+ - --providers.file.watch=true+ - --certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL:?ACME_EMAIL must be set}+ - --certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json+ - --certificatesresolvers.letsencrypt.acme.dnschallenge.provider=${ACME_DNS_PROVIDER:-cloudflare}+ - --certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53+ - --certificatesresolvers.le.acme.email=${ACME_EMAIL:?ACME_EMAIL must be set}+ - --certificatesresolvers.le.acme.storage=/etc/traefik/acme/acme.json+ - --certificatesresolvers.le.acme.dnschallenge.provider=${ACME_DNS_PROVIDER:-cloudflare}+ - --certificatesresolvers.le.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53ports:- "80:80"- "443:443"volumes:- ${PULSE_PROVIDER_MSP_DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock:ro- - ./traefik.yml:/etc/traefik/traefik.yml:ro- ./traefik-dynamic.yml:/etc/traefik/traefik-dynamic.yml:ro- acme-data:/etc/traefik/acme# The edge container gets only ACME/DNS material, never the operator .env:@@ -17,10 +41,6 @@ services:required: falseenvironment:- CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN:-}- - TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_DNSCHALLENGE_PROVIDER=${ACME_DNS_PROVIDER:-cloudflare}- - TRAEFIK_CERTIFICATESRESOLVERS_LE_ACME_DNSCHALLENGE_PROVIDER=${ACME_DNS_PROVIDER:-cloudflare}- - TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_EMAIL=${ACME_EMAIL}- - TRAEFIK_CERTIFICATESRESOLVERS_LE_ACME_EMAIL=${ACME_EMAIL}networks:- pulse-provider-msprestart: unless-stoppeddiff --git a/deploy/provider-msp/setup.sh b/deploy/provider-msp/setup.shindex 2c0eb25478..ffc6bbad28 100755--- a/deploy/provider-msp/setup.sh+++ b/deploy/provider-msp/setup.sh@@ -27,6 +27,7 @@ PULSE_PROVIDER_MSP_SIGNUP_SOURCE="${PULSE_PROVIDER_MSP_SIGNUP_SOURCE:-provider_mPULSE_PROVIDER_MSP_DOMAIN="${PULSE_PROVIDER_MSP_DOMAIN:-}"PULSE_PROVIDER_MSP_ACME_EMAIL="${PULSE_PROVIDER_MSP_ACME_EMAIL:-}"PULSE_PROVIDER_MSP_CF_DNS_API_TOKEN="${PULSE_PROVIDER_MSP_CF_DNS_API_TOKEN:-}"+PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS="${PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS:-180}"log() {echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] $*"@@ -153,7 +154,6 @@ install_deploy_bundle() {local required=("docker-compose.yml"- "traefik.yml""traefik-dynamic.yml"".env.example""run-install-proof.sh"@@ -199,7 +199,6 @@ error: missing deploy bundle files next to setup.sh.This script needs these files present on disk:- docker-compose.yml- - traefik.yml- traefik-dynamic.yml- .env.example- run-install-proof.sh@@ -212,7 +211,9 @@ EOFfiinstall -m 0644 "${src_dir}/docker-compose.yml" "${PULSE_PROVIDER_MSP_INSTALL_DIR}/docker-compose.yml"- install -m 0644 "${src_dir}/traefik.yml" "${PULSE_PROVIDER_MSP_INSTALL_DIR}/traefik.yml"+ # Traefik's static configuration lives in docker-compose.yml; an installed+ # traefik.yml would only mislead whoever edits it.+ rm -f "${PULSE_PROVIDER_MSP_INSTALL_DIR}/traefik.yml"install -m 0644 "${src_dir}/traefik-dynamic.yml" "${PULSE_PROVIDER_MSP_INSTALL_DIR}/traefik-dynamic.yml"install -m 0644 "${src_dir}/.env.example" "${PULSE_PROVIDER_MSP_INSTALL_DIR}/.env.example"install -m 0755 "${src_dir}/run-install-proof.sh" "${PULSE_PROVIDER_MSP_INSTALL_DIR}/run-install-proof.sh"@@ -822,6 +823,80 @@ start_provider_services() {die "control plane did not reach running state; inspect: cd ${PULSE_PROVIDER_MSP_INSTALL_DIR} && docker compose logs control-plane"}+# What a provider must fix when Traefik reports an ACME failure, in their terms.+explain_acme_failure() {+ case "$1" in+ *invalidContact*)+ echo "Let's Encrypt refused ACME_EMAIL. Use a real address; example.com and similar are refused." ;;+ *rateLimited*)+ echo "Let's Encrypt is rate limiting this domain. Wait for the time in the message, then retry." ;;+ *[Cc]loudflare*)+ echo "Cloudflare refused the DNS change. CF_DNS_API_TOKEN needs Zone / Zone / Read and Zone / DNS / Edit on the zone that holds DOMAIN." ;;+ *NXDOMAIN*|*"time limit exceeded"*|*propagat*)+ echo "The DNS challenge record was not visible in time. Check that DOMAIN is in the zone the token can edit." ;;+ *)+ echo "Read the Traefik message below." ;;+ esac+}++# A running stack is not a usable one: until the wildcard certificate exists,+# Traefik refuses TLS for the portal and every client address (sniStrict), so+# browsers and agents see only a handshake error. Wait for it, check the two+# DNS records, and say what to fix. Setup still finishes either way.+PORTAL_CERTIFICATE_READY=0+PORTAL_READINESS_REPORT=""+check_portal_readiness() {+ local env_path domain waited acme_error="" reason name missing=() missing_list+ env_path="${PULSE_PROVIDER_MSP_INSTALL_DIR}/.env"+ domain="$(env_value DOMAIN "${env_path}")"+ [[ "${PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS}" =~ ^[0-9]+$ ]] \+ || die "PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS must be a whole number of seconds"++ log "waiting up to ${PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS}s for the certificate for ${domain} and *.${domain}"+ for (( waited = 0; waited <= PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS; waited += 5 )); do+ if timeout 10 openssl s_client -connect 127.0.0.1:443 -servername "${domain}" </dev/null 2>/dev/null \+ | openssl x509 -noout -ext subjectAltName 2>/dev/null | grep -qF "DNS:*.${domain}"; then+ PORTAL_CERTIFICATE_READY=1+ break+ fi+ acme_error="$( (cd "${PULSE_PROVIDER_MSP_INSTALL_DIR}" && docker compose logs --no-color traefik 2>/dev/null) \+ | grep -F "Unable to obtain ACME certificate" | tail -n 1 \+ | sed -e 's/\x1b\[[0-9;]*m//g' -e 's/.*error=//' -e 's/ ACME CA=.*//' -e 's/^"//' -e 's/"$//' \+ | cut -c1-400 || true)"+ [[ -n "${acme_error}" ]] && break+ sleep 5+ done++ for name in "${domain}" "pulse-dns-check.${domain}"; do+ timeout 10 getent ahostsv4 "${name}" >/dev/null 2>&1 || missing+=("${name}")+ done++ if [[ "${PORTAL_CERTIFICATE_READY}" -eq 1 && "${#missing[@]}" -eq 0 ]]; then+ PORTAL_READINESS_REPORT="Certificate: issued for ${domain} and *.${domain}."+ else+ PORTAL_READINESS_REPORT="NOT READY YET:"+ if [[ "${PORTAL_CERTIFICATE_READY}" -ne 1 ]]; then+ if [[ -n "${acme_error}" ]]; then+ reason="$(explain_acme_failure "${acme_error}")"+ else+ reason="No certificate after ${PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS}s and no error from Traefik yet; it may still arrive."+ fi+ PORTAL_READINESS_REPORT+=$'\n'" - No TLS certificate yet, so browsers and agents cannot connect."+ PORTAL_READINESS_REPORT+=$'\n'" ${reason}"+ [[ -n "${acme_error}" ]] && PORTAL_READINESS_REPORT+=$'\n'" Traefik said: ${acme_error}"+ fi+ if [[ "${#missing[@]}" -ne 0 ]]; then+ # setup.sh sets IFS to newline and tab, so join the names by hand.+ missing_list="$(printf '%s, ' "${missing[@]}")"+ PORTAL_READINESS_REPORT+=$'\n'" - This host cannot resolve ${missing_list%, }. Browsers and agents need A records"+ PORTAL_READINESS_REPORT+=$'\n'" for ${domain} and *.${domain} pointing here (on Cloudflare, DNS only)."+ fi+ PORTAL_READINESS_REPORT+=$'\n'" Correct any wrong value with: sudo nano ${env_path}"+ PORTAL_READINESS_REPORT+=$'\n'" then retry with: cd ${PULSE_PROVIDER_MSP_INSTALL_DIR} && sudo docker compose up -d --force-recreate traefik control-plane"+ fi+ printf '\n%s\n\n' "${PORTAL_READINESS_REPORT}"+}+run_install_proof_if_requested() {local modemode="$(echo "${PULSE_PROVIDER_MSP_RUN_INSTALL_PROOF}" | tr '[:upper:]' '[:lower:]')"@@ -860,6 +935,8 @@ print_summary() {Pulse Provider MSP is running.+${PORTAL_READINESS_REPORT}+Paths:- Deploy dir: ${PULSE_PROVIDER_MSP_INSTALL_DIR}- Data dir: ${data_dir}@@ -927,6 +1004,7 @@ main() {ensure_eval_licensevalidate_compose_configstart_provider_services+ check_portal_readinessrun_install_proof_if_requestedprint_summary}diff --git a/deploy/provider-msp/traefik.yml b/deploy/provider-msp/traefik.ymldeleted file mode 100644index f430095007..0000000000--- a/deploy/provider-msp/traefik.yml+++ /dev/null@@ -1,45 +0,0 @@-api:- dashboard: false--entryPoints:- web:- address: ":80"- http:- redirections:- entryPoint:- to: websecure- scheme: https- websecure:- address: ":443"- http:- middlewares:- - security-headers@file--providers:- docker:- endpoint: "unix:///var/run/docker.sock"- exposedByDefault: false- network: pulse-provider-msp- file:- filename: /etc/traefik/traefik-dynamic.yml- watch: true--certificatesResolvers:- letsencrypt:- acme:- email: "[email protected]"- storage: /etc/traefik/acme/acme.json- dnsChallenge:- provider: cloudflare- resolvers:- - "1.1.1.1:53"- - "8.8.8.8:53"- le:- acme:- email: "[email protected]"- storage: /etc/traefik/acme/acme.json- dnsChallenge:- provider: cloudflare- resolvers:- - "1.1.1.1:53"- - "8.8.8.8:53"diff --git a/deploy/provider-msp/upgrade.sh b/deploy/provider-msp/upgrade.shindex 8ef8c0c272..2f40ca98eb 100755--- a/deploy/provider-msp/upgrade.sh+++ b/deploy/provider-msp/upgrade.sh@@ -112,7 +112,7 @@ resolve_image_digest() {# The files setup.sh installs from a bundle. A bundle upgrade installs the same# set, so an upgraded install matches a fresh one.-bundle_install_files=(docker-compose.yml traefik.yml traefik-dynamic.yml .env.example run-install-proof.sh upgrade.sh)+bundle_install_files=(docker-compose.yml traefik-dynamic.yml .env.example run-install-proof.sh upgrade.sh)# A bundle upgrade brings an existing install up to the release bundle this# script was extracted with. Setup resolves the image pins in .env to digests@@ -170,6 +170,10 @@ apply_bundle_upgrade() {*) install -m 0644 "${bundle_dir}/${file}" "${install_dir}/${file}" ;;esacdone+ # Bundles up to v6.7.0 mounted a traefik.yml whose example.com ACME email+ # Let's Encrypt refuses. Its settings now live in docker-compose.yml, so the+ # old file is removed rather than left looking editable.+ rm -f "${install_dir}/traefik.yml"for ((i = 0; i < ${#bundle_pin_keys[@]}; i++)); doset_env_value "${bundle_pin_keys[$i]}" "${bundle_pin_values[$i]}" "${env_path}"donediff --git a/docs/MSP.md b/docs/MSP.mdindex 3d7ce77d84..29c26aa5ce 100644--- a/docs/MSP.md+++ b/docs/MSP.md@@ -404,6 +404,19 @@ file is readable by root only, then press Enter. It ends withportal sign-in link; run that command with `sudo` as well. In the portal,**Add client** and then **Install agents** walk the first client to live data.+**v6.7.0 only:** the bundle's `traefik.yml` gives Let's Encrypt+`[email protected]`, which it refuses, so no certificate is issued and the+portal refuses TLS. Once setup finishes, copy your `ACME_EMAIL` into that file+and restart Traefik:++```bash+cd /opt/pulse-provider-msp && e=$(sudo sed -n 's/^ACME_EMAIL=//p' .env | tail -n 1 | tr -d "\"'" | sed 's/[&/\]/\\&/g') && sudo sed -i "s/[email protected]/$e/" traefik.yml && sudo docker compose restart traefik+```++With a DNS provider other than Cloudflare, also change both+`provider: cloudflare` lines in that file. Later bundles read both values from+`.env` and report after setup whether the certificate was issued.+Leave `CP_PROVIDER_MSP_LICENSE_FILE` blank and `setup.sh` self-issues a2-client evaluation licence. The bundle sends the public half of thesigning key generated on your host, a setup-stage marker, and a signup-sourcediff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.mdindex 112b482001..552c68f440 100644--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md@@ -4990,6 +4990,49 @@ stops before anything runs as root.macOS bash 3.2 and bash 5 against a scratch install directory; not yet run on afresh Ubuntu host.++### Provider MSP Traefik takes ACME settings from .env, and setup reports the certificate++From the first provider bundle (2 June 2026) through v6.7.0,+`deploy/provider-msp/docker-compose.yml` mounted `traefik.yml` as Traefik's+static configuration and set `TRAEFIK_CERTIFICATESRESOLVERS_*` variables for+the ACME email and DNS-01 provider. Traefik reads static configuration from+exactly one source and the file wins, so those variables were ignored: every+install registered with Let's Encrypt as `[email protected]`, which Let's+Encrypt refuses, no certificate was issued, and the portal and every client+address refused TLS under `sniStrict`. `ACME_DNS_PROVIDER` was ignored the same+way. Lab walkthroughs used a self-signed override and never saw it. Reproduced+on a fresh Ubuntu 24.04 VM with a clean ACME store on 3 November 2026: the+shipped files fail with `invalidContact` for `example.com`; copying+`ACME_EMAIL` into the installed `traefik.yml` moves issuance on to the DNS+challenge.++The static configuration now lives in compose `command:` flags, which Compose+fills from `.env` (`ACME_EMAIL`, `ACME_DNS_PROVIDER`,+`PULSE_PROVIDER_MSP_DOCKER_NETWORK`); `traefik.yml` is gone from the bundle,+from setup's and upgrade's install lists and from `scripts/validate-release.sh`,+and setup and upgrade delete an installed copy. On the same VM the fixed files+registered the real email and failed only at the placeholder Cloudflare token,+and `ACME_DNS_PROVIDER=route53` reached Traefik's route53 provider.++Setup no longer ends at "running" while the portal is unusable:+`check_portal_readiness` waits up to `PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS`+(180) for a certificate whose SANs include `*.DOMAIN`, probing+`127.0.0.1:443` with `openssl s_client`. It stops early on Traefik's+`Unable to obtain ACME certificate` log line and translates refused email,+Cloudflare permission, DNS propagation and rate-limit failures. It checks that+this host can resolve `DOMAIN` and a name under it, and prints the report+before the optional install proof and again in the summary, with the `.env`+edit and a `docker compose up -d --force-recreate traefik control-plane` retry+(the control plane carries the `DOMAIN` routing labels). Verified on+that VM for a refused email, a refused Cloudflare token, an unresolvable host+name and, with a self-signed wildcard certificate and hosts entries, the ready+report. A real Let's Encrypt issuance has not been run: the lab has no domain+with an API token. `docs/MSP.md` carries the one-line v6.7.0 workaround while+it pins that bundle. `TestProviderMSPTraefikStaticConfigComesFromComposeFlags`,+`TestProviderMSPSetupReportsPortalReadiness` and+`TestProviderMSPEvaluationDocsUsePublishedSignedBundle` pin the change.+### Provider MSP clients survive a support-container recreateRecreating the control plane or Traefik detaches it from each client'sdiff --git a/frontend-modern/public/docs/MSP.md b/frontend-modern/public/docs/MSP.mdindex 3d7ce77d84..29c26aa5ce 100644--- a/frontend-modern/public/docs/MSP.md+++ b/frontend-modern/public/docs/MSP.md@@ -404,6 +404,19 @@ file is readable by root only, then press Enter. It ends withportal sign-in link; run that command with `sudo` as well. In the portal,**Add client** and then **Install agents** walk the first client to live data.+**v6.7.0 only:** the bundle's `traefik.yml` gives Let's Encrypt+`[email protected]`, which it refuses, so no certificate is issued and the+portal refuses TLS. Once setup finishes, copy your `ACME_EMAIL` into that file+and restart Traefik:++```bash+cd /opt/pulse-provider-msp && e=$(sudo sed -n 's/^ACME_EMAIL=//p' .env | tail -n 1 | tr -d "\"'" | sed 's/[&/\]/\\&/g') && sudo sed -i "s/[email protected]/$e/" traefik.yml && sudo docker compose restart traefik+```++With a DNS provider other than Cloudflare, also change both+`provider: cloudflare` lines in that file. Later bundles read both values from+`.env` and report after setup whether the certificate was issued.+Leave `CP_PROVIDER_MSP_LICENSE_FILE` blank and `setup.sh` self-issues a2-client evaluation licence. The bundle sends the public half of thesigning key generated on your host, a setup-stage marker, and a signup-sourcediff --git a/scripts/installtests/provider_msp_deploy_test.go b/scripts/installtests/provider_msp_deploy_test.goindex bec01f90da..04533e0c9a 100644--- a/scripts/installtests/provider_msp_deploy_test.go+++ b/scripts/installtests/provider_msp_deploy_test.go@@ -201,7 +201,6 @@ func TestProviderMSPSetupScriptMatchesProviderContract(t *testing.T) {"PULSE_PROVIDER_MSP_BUNDLE_URL","docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin","docker-compose.yml",- "traefik.yml","traefik-dynamic.yml",".env.example","run-install-proof.sh",@@ -318,21 +317,55 @@ func TestProviderMSPInstallProofRunnerMatchesComposeContract(t *testing.T) {)}-func TestProviderMSPTraefikUsesProviderNetwork(t *testing.T) {- traefikBytes, err := os.ReadFile(repoFile("deploy", "provider-msp", "traefik.yml"))+// Traefik reads its static configuration from exactly one source, and a+// mounted traefik.yml beats flags and TRAEFIK_* variables. Through v6.7.0 the+// bundle mounted one carrying [email protected], which Let's Encrypt refuses,+// so no install obtained a certificate and ACME_EMAIL and ACME_DNS_PROVIDER+// never reached Traefik. The static configuration now lives in compose flags.+func TestProviderMSPTraefikStaticConfigComesFromComposeFlags(t *testing.T) {+ if _, err := os.Stat(repoFile("deploy", "provider-msp", "traefik.yml")); !os.IsNotExist(err) {+ t.Fatal("deploy/provider-msp/traefik.yml must not return: a mounted static file overrides every compose flag")+ }+ composeBytes, err := os.ReadFile(repoFile("deploy", "provider-msp", "docker-compose.yml"))if err != nil {- t.Fatalf("read provider MSP Traefik config: %v", err)+ t.Fatalf("read provider MSP compose: %v", err)}- var cfg map[string]any- if err := yaml.Unmarshal(traefikBytes, &cfg); err != nil {- t.Fatalf("provider MSP Traefik config must be valid YAML: %v", err)+ var compose struct {+ Services map[string]struct {+ Command []string `yaml:"command"`+ Volumes []string `yaml:"volumes"`+ Environment []string `yaml:"environment"`+ } `yaml:"services"`}- assertContainsAll(t, string(traefikBytes),- "network: pulse-provider-msp",- "certificatesResolvers:",- "letsencrypt:",- "le:",+ if err := yaml.Unmarshal(composeBytes, &compose); err != nil {+ t.Fatalf("provider MSP compose must be valid YAML: %v", err)+ }+ traefik := compose.Services["traefik"]+ for _, volume := range traefik.Volumes {+ if strings.Contains(volume, "traefik.yml") {+ t.Fatalf("traefik must not mount a static config file: %s", volume)+ }+ }+ for _, env := range traefik.Environment {+ if strings.HasPrefix(env, "TRAEFIK_") {+ t.Fatalf("TRAEFIK_* variables are ignored beside compose flags and must not suggest otherwise: %s", env)+ }+ }+ assertContainsAll(t, strings.Join(traefik.Command, "\n"),+ "--providers.docker.network=${PULSE_PROVIDER_MSP_DOCKER_NETWORK:-pulse-provider-msp}",+ "--providers.file.filename=/etc/traefik/traefik-dynamic.yml",+ "--entrypoints.websecure.http.middlewares=security-headers@file",+ "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL:?ACME_EMAIL must be set}",+ "--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=${ACME_DNS_PROVIDER:-cloudflare}",+ "--certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json",+ "--certificatesresolvers.le.acme.email=${ACME_EMAIL:?ACME_EMAIL must be set}",+ "--certificatesresolvers.le.acme.dnschallenge.provider=${ACME_DNS_PROVIDER:-cloudflare}",)+ for _, flag := range traefik.Command {+ if strings.Contains(flag, "acme.email=") && strings.Contains(flag, "example.com") {+ t.Fatalf("the ACME contact must come from ACME_EMAIL, not an example.com address: %s", flag)+ }+ }}func TestProviderMSPControlPlaneDockerfileBuildsReleaseLicenseBinary(t *testing.T) {@@ -554,6 +587,9 @@ func TestProviderMSPEvaluationDocsUsePublishedSignedBundle(t *testing.T) {// The portal and client workspaces need both records, and the default// DNS-01 token needs both permissions."`*.DOMAIN` (each client workspace",+ // The pinned v6.7.0 bundle still mounts traefik.yml with an example.com+ // ACME contact; drop this when the pin moves past it.+ `e=$(sudo sed -n 's/^ACME_EMAIL=//p' .env | tail -n 1 | tr -d "\"'" | sed 's/[&/\]/\\&/g') && sudo sed -i "s/[email protected]/$e/" traefik.yml && sudo docker compose restart traefik`,"Zone / Zone / Read and Zone / DNS / Edit","The licence request omits an email address unless you export","`PULSE_PROVIDER_MSP_EVAL_EMAIL` before running `setup.sh`",@@ -647,8 +683,8 @@ func TestProviderMSPTraefikEnvIsMinimalAndDNSProviderOverridable(t *testing.T) {text := string(composeBytes)assertContainsAll(t, text,- "TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_DNSCHALLENGE_PROVIDER=${ACME_DNS_PROVIDER:-cloudflare}",- "TRAEFIK_CERTIFICATESRESOLVERS_LE_ACME_DNSCHALLENGE_PROVIDER=${ACME_DNS_PROVIDER:-cloudflare}",+ "--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=${ACME_DNS_PROVIDER:-cloudflare}",+ "--certificatesresolvers.le.acme.dnschallenge.provider=${ACME_DNS_PROVIDER:-cloudflare}","CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN:-}","path: ./dns-credentials.env","required: false",@@ -700,7 +736,7 @@ func TestProviderMSPSetupLeavesPlatformRunning(t *testing.T) {assertContainsAll(t, summary, "Open Plan in the portal to see whether", "Keep within two clients until Plan confirms a", "Manage billing")assertNotContainsAny(t, summary, "must bind this key", "derive_lease_signing_public_key", "checkout is by Stripe", "applies within\nseconds")- sequence := " ensure_eval_license\n validate_compose_config\n start_provider_services\n run_install_proof_if_requested\n print_summary\n"+ sequence := " ensure_eval_license\n validate_compose_config\n start_provider_services\n check_portal_readiness\n run_install_proof_if_requested\n print_summary\n"if !strings.Contains(script, sequence) {t.Fatal("setup must start provider services after the licensed compose validation and before the install proof and summary")}@@ -759,6 +795,46 @@ func TestProviderMSPSetupAsksForFirstRunValuesUpFront(t *testing.T) {assertNotContainsAny(t, summary, "\n docker compose run", "\n ./run-install-proof.sh")}+// On a fresh host setup printed "Pulse Provider MSP is running." while the+// portal refused every TLS handshake: Let's Encrypt had rejected the ACME+// email, Traefik had no certificate, and sniStrict left the browser with only+// a handshake error. Setup now waits for the wildcard certificate, checks the+// two DNS records, and names the fix in the provider's terms.+func TestProviderMSPSetupReportsPortalReadiness(t *testing.T) {+ scriptBytes, err := os.ReadFile(repoFile("deploy", "provider-msp", "setup.sh"))+ if err != nil {+ t.Fatalf("read provider MSP setup: %v", err)+ }+ script := string(scriptBytes)++ assertContainsAll(t, script,+ `PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS="${PULSE_PROVIDER_MSP_CERT_WAIT_SECONDS:-180}"`,+ `openssl s_client -connect 127.0.0.1:443 -servername "${domain}"`,+ `grep -qF "DNS:*.${domain}"`,+ `grep -F "Unable to obtain ACME certificate"`,+ `for name in "${domain}" "pulse-dns-check.${domain}"; do`,+ `timeout 10 getent ahostsv4 "${name}"`,+ "sudo docker compose up -d --force-recreate traefik control-plane",+ )+ explain := script[strings.Index(script, "explain_acme_failure() {"):]+ explain = explain[:strings.Index(explain, "\n}\n")]+ assertContainsAll(t, explain,+ "*invalidContact*", "Let's Encrypt refused ACME_EMAIL",+ "*[Cc]loudflare*", "Zone / Zone / Read and Zone / DNS / Edit",+ "*rateLimited*",+ )+ // The report is printed when it is made, so a failing install proof+ // cannot hide it, and again in the closing summary.+ check := script[strings.Index(script, "check_portal_readiness() {"):]+ check = check[:strings.Index(check, "\n}\n")]+ if !strings.Contains(check, `printf '\n%s\n\n' "${PORTAL_READINESS_REPORT}"`) {+ t.Fatal("readiness report must be printed before the install proof runs")+ }+ summary := script[strings.Index(script, "Pulse Provider MSP is running."):]+ summary = summary[:strings.Index(summary, "EOF")]+ assertContainsAll(t, summary, "${PORTAL_READINESS_REPORT}")+}+// Setup pins the images in .env to digests once, so an upgrade used to re-pull// only the release a provider first installed. Run from a newly extracted// bundle, upgrade.sh must install that bundle into the existing install,@@ -780,7 +856,7 @@ func TestProviderMSPUpgradeFromBundleRepinsToTheBundleRelease(t *testing.T) {t.Fatal(err)}}- for _, name := range []string{"docker-compose.yml", "traefik.yml", "traefik-dynamic.yml", ".env.example", "run-install-proof.sh", "upgrade.sh", "setup.sh"} {+ for _, name := range []string{"docker-compose.yml", "traefik-dynamic.yml", ".env.example", "run-install-proof.sh", "upgrade.sh", "setup.sh"} {content, err := os.ReadFile(repoFile("deploy", "provider-msp", name))if err != nil {t.Fatal(err)diff --git a/scripts/validate-release.sh b/scripts/validate-release.shindex f95fb4f9ec..71f54f0f4e 100755--- a/scripts/validate-release.sh+++ b/scripts/validate-release.sh@@ -639,7 +639,7 @@ provider_msp_root="pulse-provider-msp-v${PULSE_VERSION}"provider_msp_extract="${tmp_root}/provider-msp"mkdir -p "${provider_msp_extract}"tar -xzf "${provider_msp_bundle}" -C "${provider_msp_extract}"-for required in setup.sh upgrade.sh run-install-proof.sh docker-compose.yml traefik.yml traefik-dynamic.yml .env.example VERSION; do+for required in setup.sh upgrade.sh run-install-proof.sh docker-compose.yml traefik-dynamic.yml .env.example VERSION; doif [ ! -s "${provider_msp_extract}/${provider_msp_root}/${required}" ]; thenerror "Provider MSP bundle is missing ${required}"exit 1