hub (unreleased): the end dates of the hub's own public names are read once a day; 14 days before, the operator is told (D85, R-1379)

The names are the setting HUB_OWN_NAMES; with no setting the hub makes no call. The setting is NOT in the manifest yet.

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 15:22:49 +01:00
1 parent c616727d84
commit c72ecf52b4
8 files changed
+616 -5

No files matched your search

@@ -0,0 +1,86 @@
== MUTATION: the warning comes at 7 days, not 14
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_WarnsOncePerNameFourteenDaysBefore (0.00s)
own_names_test.go:78: want one warning for each of the two near names, got 1: [hub_name_cert_ends_soon|warning||hub|The certificate of the hub's own name iso.example.test ends in 3 day(s), on 2026-11-18. It renews by itself about
--- FAIL: TestOwnNames_TheLineIsFourteenDays (0.00s)
own_names_test.go:109: not told at 14 days: []
== MUTATION: the same certificate is told at every run
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_WarnsOncePerNameFourteenDaysBefore (0.00s)
own_names_test.go:94: the same certificate was told again the next day: [hub_name_cert_ends_soon|warning||hub|The certificate of the hub's own name hub.example.test ends in 13 day(s), on 2026-11-28. It renews by itself about 30 da
== MUTATION: an ended certificate stays a warning
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_EndedIsAnErrorAndARenewalIsNewNews (0.00s)
own_names_test.go:123: want one warning then one error for the ended certificate: [hub_name_cert_ends_soon|warning||hub|The certificate of the hub's own name a.example.test ends in 5 day(s), on 2026-11-20. It renews by itself abou
== MUTATION: a renewed certificate near its own end is never told again
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_EndedIsAnErrorAndARenewalIsNewNews (0.00s)
own_names_test.go:133: the renewed certificate's own end was not told: [hub_name_cert_ends_soon|warning||hub|The certificate of the hub's own name a.example.test ends in 5 day(s), on 2026-11-20. It renews by itself about 30 days b
== MUTATION: a name that does not answer raises the end-date alarm
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_ANameThatDoesNotAnswerIsNotAnEndDateAlarm (0.00s)
own_names_test.go:146: want ONE unreachable line for two runs, got 0: [hub_name_cert_ends_soon|warning||hub|The hub could not read the certificate of its own name down.example.test today: the name did not answer a TLS connection f
== MUTATION: the unreachable line is told at every run
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_ANameThatDoesNotAnswerIsNotAnEndDateAlarm (0.00s)
own_names_test.go:146: want ONE unreachable line for two runs, got 2: [hub_name_unreachable|warning||hub|The hub could not read the certificate of its own name down.example.test today: the name did not answer a TLS connection from
== MUTATION: a dead name stops the names after it
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_ANameThatDoesNotAnswerIsNotAnEndDateAlarm (0.00s)
own_names_test.go:154: the name after the dead one was not read: [hub_name_unreachable|warning||hub|The hub could not read the certificate of its own name down.example.test today: the name did not answer a TLS connection from the
== MUTATION: the recovery keeps the unreachable mark
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_ANameThatDoesNotAnswerIsNotAnEndDateAlarm (0.00s)
own_names_test.go:162: the recovery was not told once, or its mark stayed: events [hub_name_unreachable|warning||hub|The hub could not read the certificate of its own name down.example.test today: the name did not answer a TLS con
== MUTATION: any text in the setting is dialled
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_OnlyPlainHostNamesFromTheSettingAreDialled (0.00s)
own_names_test.go:176: names = ["hub.example.test" "iso.example.test:8443" "https://evil.example/x" "a..b" "user@host" "10.0.0.1"]
== MUTATION: the list has no cap
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_OnlyPlainHostNamesFromTheSettingAreDialled (0.00s)
own_names_test.go:191: the list is not capped at 16: 17 names, 0 refused
== MUTATION: a name with a port is dialled on 443
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_OnlyPlainHostNamesFromTheSettingAreDialled (0.00s)
own_names_test.go:187: dialled ["hub.example.test:443|hub.example.test" "iso.example.test:443|iso.example.test" "10.0.0.1:443|10.0.0.1"]
== MUTATION: the read verifies the chain (an ended certificate gives no date)
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_DialCertEndReadsTheServedDate_AlsoOfAnEndedCertificate (0.02s)
own_names_test.go:226: served end 2026-11-24 13:34:53 +0000 UTC, read 0001-01-01 00:00:00 +0000 UTC (err tls: failed to verify certificate: x509: certificate signed by unknown authority)
== MUTATION: the read gives the time of the read, not the certificate's end
RED on the mutant, GREEN on the real file
--- FAIL: TestOwnNames_DialCertEndReadsTheServedDate_AlsoOfAnEndedCertificate (0.00s)
own_names_test.go:226: served end 2026-11-24 13:34:56 +0000 UTC, read 2026-08-26 13:34:56 +0000 UTC (err <nil>)
13 mutations, 0 not a red-proof
## the wiring
== MUTATION: the ledger does not watch the own-names job
RED on the mutant, GREEN on the real file
--- FAIL: TestD85_MainWiresTheOwnNamesCheck (0.00s)
d85_wiring_test.go:28: main.go: want exactly one "\"deadline-check\", \"offsite-key-audit\", ownNamesJob)", found 0
== MUTATION: the names are a list in code
RED on the mutant, GREEN on the real file
--- FAIL: TestD85_MainWiresTheOwnNamesCheck (0.00s)
d85_wiring_test.go:28: main.go: want exactly one "monitor.ParseOwnNames(os.Getenv(\"HUB_OWN_NAMES\"))", found 0
d85_wiring_test.go:34: main.go names hub.felhom.eu in code — the list of own names must come from the setting
== MUTATION: the job is never started
RED on the mutant, GREEN on the real file
--- FAIL: TestD85_MainWiresTheOwnNamesCheck (0.00s)
d85_wiring_test.go:28: main.go: want exactly one "go scheduleDaily(ctx, ownNamesJob, \"06:40\", ownNames.CheckOnce, logger)", found 0
d85_wiring_test.go:40: the own-names job is not started inside the branch that has names — an empty setting would start it
3 mutations, 0 not a red-proof
== MUTATION: the end-date event of a hub name can reach a household
RED on the mutant, GREEN on the real file
--- FAIL: TestD85_TheEventsAreOperatorOnlyAndPerName (0.00s)
d85_wiring_test.go:48: hub_name_cert_ends_soon is not operator-only: a household could get a mail about the hub's own names
== MUTATION: two names of one day share one cooldown
RED on the mutant, GREEN on the real file
--- FAIL: TestD85_TheEventsAreOperatorOnlyAndPerName (0.00s)
d85_wiring_test.go:51: hub_name_cert_ends_soon has no per-name cooldown: the second name of the same day would be suppressed and never told again
d85_wiring_test.go:51: hub_name_unreachable has no per-name cooldown: the second name of the same day would be suppressed and never told again
d85_wiring_test.go:51: hub_name_reachable has no per-name cooldown: the second name of the same day would be suppressed and never told again
2 mutations, 0 not a red-proof