hub v0.118.0: the household's e-mails follow the household's language (R-558 Part A)
gates / gates (push) Successful in 23s
gates / gates (push) Successful in 23s
The hub has written every customer e-mail in Hungarian whatever the box was set to. The box has published its language since controller v0.247.0; nothing read it. Now it does. Nothing an operator reads changes. The Hungarian mails are byte-identical, and that is a diff rather than a reading: 56 goldens per language captured from v0.117.0 BEFORE any string moved, and all 56 Hungarian ones pass unchanged after every sentence was routed through the new bundle. - internal/i18n: flat bundle, 79 keys, hu authoritative + hu fallback, ceiling 0. - customerMessages/severityLabels are DERIVED from the bundle, so a sentence is written in one place and all 40+ tests that read those maps still work. - Language order: last reported -> created-with -> hu. reports.language defaults to EMPTY, never hu: "never told us" is not "chose Hungarian". - message_customer on POST /api/v1/event, additive and optional forever, for the sentences the box composes and the hub cannot translate. - The bind page is per-language, and its `expired` state stays Hungarian: it is the state an unknown token lands in, so rendering a real English customer's token in English would make the LANGUAGE answer what the TEXT refuses to. Two defects found inside the release: - R-581: the newest report was picked by received_at, which has SECOND granularity, so same-second reports tied and the winner was arbitrary. Ordered by the autoincrement id now. GetCustomers() still has the shape - row open. - R-582: the English copy-guard stems, ported word for word from Hungarian, convicted 141 honest sentences. The English claim is a phrase with a modal. R-555 closed: the language allowlist entry is out of wire_contract_gate.py. hub_copy_gate.py follows the sentences into the bundle - without that it would have scanned four files that no longer hold any customer text and reported success. Three new decoys incl. an innocent control. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
20aafc3dec
commit
9167cf53af
150 files changed
+4063
-410
No files matched your search
@@ -35,7 +35,7 @@ func TestRestoreInterruptedReachesTheHouseholdInHungarian(t *testing.T) {
|
||||
const raw = "RAW-ENGLISH-SENTINEL restore interrupted"
|
||||
// The SUBJECT is built from the Hungarian message alone; the body legitimately repeats the raw
|
||||
// message as a detail line ("Üzenet: …"), so the body cannot be the witness — the subject is.
|
||||
subject, body := notify.FormatCustomerEmail("c1", et, "warning", raw, "{}")
|
||||
subject, body := notify.FormatCustomerEmail("hu", "c1", et, "warning", raw, "", "{}")
|
||||
if strings.Contains(subject, "RAW-ENGLISH-SENTINEL") {
|
||||
t.Fatalf("customer mail subject for %s is the raw message — customerMessages entry missing: %q", et, subject)
|
||||
}
|
||||
|
||||
+26
-13
@@ -2065,11 +2065,11 @@ var allowedEventTypes = map[string]bool{
|
||||
// sends a dynamic Hungarian message (disk label + the triggering attribute names), so — like
|
||||
// offbox_enlarge_blocked — there is deliberately NO customerMessages entry (which would discard the
|
||||
// specifics via the templates.go fallback priority).
|
||||
"disk_health_degraded": true,
|
||||
"health_degraded": true,
|
||||
"health_critical": true,
|
||||
"health_recovered": true,
|
||||
"app_deployed": true,
|
||||
"disk_health_degraded": true,
|
||||
"health_degraded": true,
|
||||
"health_critical": true,
|
||||
"health_recovered": true,
|
||||
"app_deployed": true,
|
||||
// R-536 (controller v0.244.0). `app_deployed` used to fire beside the 202 that merely ACCEPTED a
|
||||
// deploy, so an install interrupted five seconds later stood on the timeline as a completed one
|
||||
// — measured 2026-09-16 on the drill box with mealie, which ended `not_deployed`. The accept-time
|
||||
@@ -2079,8 +2079,8 @@ var allowedEventTypes = map[string]bool{
|
||||
//
|
||||
// Both are customer-tier like `app_deployed` itself (NOT in operatorOnlyEvents): a household that
|
||||
// pressed „Telepítés" is the party who wants to know it did not finish.
|
||||
"app_deploy_started": true,
|
||||
"app_deploy_failed": true,
|
||||
"app_deploy_started": true,
|
||||
"app_deploy_failed": true,
|
||||
"app_removed": true,
|
||||
"app_start_failed": true, // controller fix-3 (CAMPAIGN-3): a deployed app is not running
|
||||
"disaster_recovery_started": true,
|
||||
@@ -2152,11 +2152,18 @@ func (h *Handler) handleEvent(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
var payload struct {
|
||||
CustomerID string `json:"customer_id"`
|
||||
EventType string `json:"event_type"`
|
||||
Severity string `json:"severity"`
|
||||
Message string `json:"message"`
|
||||
Details json.RawMessage `json:"details"`
|
||||
CustomerID string `json:"customer_id"`
|
||||
EventType string `json:"event_type"`
|
||||
Severity string `json:"severity"`
|
||||
Message string `json:"message"`
|
||||
// MessageCustomer (controller v0.256.0, R-558) — the SAME sentence as Message, written in
|
||||
// the household's language. Optional forever: an older controller sends none, and a box
|
||||
// that never will (a parked one) must keep working exactly as it does today.
|
||||
//
|
||||
// It is used ONLY to render the household's e-mail. Message stays the Hungarian one that is
|
||||
// stored, logged and mailed to the operator, so nothing an operator reads moves.
|
||||
MessageCustomer string `json:"message_customer"`
|
||||
Details json.RawMessage `json:"details"`
|
||||
}
|
||||
if err := json.Unmarshal(body, &payload); err != nil {
|
||||
http.Error(w, "Invalid JSON", http.StatusBadRequest)
|
||||
@@ -2208,6 +2215,11 @@ func (h *Handler) handleEvent(w http.ResponseWriter, r *http.Request) {
|
||||
payload.Severity = "info"
|
||||
}
|
||||
|
||||
// NO SEPARATE LENGTH CAP, and that is deliberate rather than an omission. `message` has never
|
||||
// had one either: both are bounded by the 1 MB LimitReader on this request body, which is the
|
||||
// only cap that has ever existed here. Adding one to the new field alone would make the two
|
||||
// sentences behave differently for no measured reason — and a byte-count truncation would cut a
|
||||
// UTF-8 sequence in half, turning a long Hungarian sentence into mojibake in a customer's inbox.
|
||||
// Store details as JSON string
|
||||
detailsStr := "{}"
|
||||
if len(payload.Details) > 0 && string(payload.Details) != "null" {
|
||||
@@ -2225,7 +2237,8 @@ func (h *Handler) handleEvent(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Dispatch notifications (non-blocking)
|
||||
if h.dispatcher != nil {
|
||||
go h.dispatcher.ProcessEvent(payload.CustomerID, payload.EventType, payload.Severity, payload.Message, detailsStr, "controller")
|
||||
go h.dispatcher.ProcessBoxEvent(payload.CustomerID, payload.EventType, payload.Severity,
|
||||
payload.Message, payload.MessageCustomer, detailsStr, "controller")
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
@@ -34,7 +34,7 @@ const retiredName = "Visszaállító kód"
|
||||
// secrets in one message is how a customer comes to believe they are the same thing.
|
||||
func TestFormatClaimEmail_OneNamePerSecret(t *testing.T) {
|
||||
for _, kind := range []EmailKind{EmailClaim, EmailReset, EmailReenroll} {
|
||||
subject, body := notify.FormatClaimEmail(string(kind), "c1", "example.hu", "alma-korte-szilva")
|
||||
subject, body := notify.FormatClaimEmail("hu", string(kind), "c1", "example.hu", "alma-korte-szilva")
|
||||
whole := subject + "\n" + body
|
||||
|
||||
if !strings.Contains(body, "Beállító kód: alma-korte-szilva") {
|
||||
@@ -57,12 +57,12 @@ func TestFormatClaimEmail_OneNamePerSecret(t *testing.T) {
|
||||
// Sending a re-enrolled customer to „Elfelejtett jelszó" names a route that is not on their screen.
|
||||
// That was the live defect, and this is the test that would have caught it.
|
||||
func TestFormatClaimEmail_NamesThePageTheMachineShows(t *testing.T) {
|
||||
_, resetBody := notify.FormatClaimEmail(string(EmailReset), "c1", "example.hu", "a-b-c")
|
||||
_, resetBody := notify.FormatClaimEmail("hu", string(EmailReset), "c1", "example.hu", "a-b-c")
|
||||
if !strings.Contains(resetBody, `"Elfelejtett jelszó"`) {
|
||||
t.Errorf("the forgot-password mail should name the page that IS on that customer's screen:\n%s", resetBody)
|
||||
}
|
||||
|
||||
_, reBody := notify.FormatClaimEmail(string(EmailReenroll), "c1", "example.hu", "a-b-c")
|
||||
_, reBody := notify.FormatClaimEmail("hu", string(EmailReenroll), "c1", "example.hu", "a-b-c")
|
||||
if strings.Contains(reBody, "Elfelejtett jelszó") {
|
||||
t.Errorf("a REBUILT box serves no login page, so it has no „Elfelejtett jelszó” link:\n%s", reBody)
|
||||
}
|
||||
@@ -77,7 +77,7 @@ func TestFormatClaimEmail_NamesThePageTheMachineShows(t *testing.T) {
|
||||
// true. Guarding the CLAIM rather than one phrasing of it: any sentence that says the backups are
|
||||
// unaffected would have to say so with one of these stems.
|
||||
func TestFormatClaimEmail_ReenrollPromisesNothingAboutTheData(t *testing.T) {
|
||||
_, body := notify.FormatClaimEmail(string(EmailReenroll), "c1", "example.hu", "a-b-c")
|
||||
_, body := notify.FormatClaimEmail("hu", string(EmailReenroll), "c1", "example.hu", "a-b-c")
|
||||
for _, claimWord := range []string{"mentés", "biztonsági", "alkalmazás", "adataid", "visszaállíthat", "visszaszerezhet"} {
|
||||
if strings.Contains(body, claimWord) {
|
||||
t.Errorf("the re-enrol mail must not talk about data or backups (found %q):\n%s", claimWord, body)
|
||||
@@ -90,7 +90,7 @@ func TestFormatClaimEmail_ReenrollPromisesNothingAboutTheData(t *testing.T) {
|
||||
// adding a kind on the engine side and forgetting the template: nothing panics, nothing errors, and
|
||||
// the wrong-but-harmless mail goes out. Pinning it means a future reader knows it was chosen.
|
||||
func TestFormatClaimEmail_UnknownKindFallsBackToSetup(t *testing.T) {
|
||||
subject, body := notify.FormatClaimEmail("no-such-kind", "c1", "example.hu", "a-b-c")
|
||||
subject, body := notify.FormatClaimEmail("hu", "no-such-kind", "c1", "example.hu", "a-b-c")
|
||||
if !strings.Contains(subject, "Elindult a Felhom szervered") {
|
||||
t.Errorf("unknown kind should fall back to the first-setup mail, got subject %q", subject)
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ func Generate(templateYAML string, cfg *store.CustomerConfig, claimState *store.
|
||||
setNested(base, []string{"customer", "name"}, cfg.CustomerName)
|
||||
setNested(base, []string{"customer", "domain"}, cfg.Domain)
|
||||
setNested(base, []string{"customer", "email"}, cfg.Email)
|
||||
// v0.118.0 (R-558): the language the box STARTS in. The controller uses it only when the
|
||||
// household has not chosen one on the dashboard — an explicit choice on the box always wins, and
|
||||
// is never overwritten by a config pull.
|
||||
setNested(base, []string{"customer", "language"}, cfg.Language)
|
||||
|
||||
setNested(base, []string{"hub", "enabled"}, true)
|
||||
setNested(base, []string{"hub", "url"}, "https://hub.felhom.eu")
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package configgen
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-hub/internal/store"
|
||||
)
|
||||
|
||||
// S4/S6 (R-558) — `customer.language` reaches controller.yaml, and it is the ONLY thing that moved.
|
||||
//
|
||||
// The controller reads it to decide what language a box STARTS in, before anyone has touched the
|
||||
// dashboard switch. It has to arrive, and nothing else may arrive with it: a config pull restarts
|
||||
// the box, so an unintended second change would ride out to the whole fleet on the same wire.
|
||||
func TestGenerate_CustomerLanguage(t *testing.T) {
|
||||
const tmpl = "customer:\n id: \"\"\n name: \"\"\nlogging:\n level: info\n"
|
||||
|
||||
base := &store.CustomerConfig{CustomerID: "c1", CustomerName: "Acme", ConfigJSON: "{}"}
|
||||
withEN := &store.CustomerConfig{CustomerID: "c1", CustomerName: "Acme", ConfigJSON: "{}", Language: "en"}
|
||||
|
||||
huYAML, err := Generate(tmpl, base, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
enYAML, err := Generate(tmpl, withEN, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !strings.Contains(enYAML, "language: en") {
|
||||
t.Fatalf("customer.language did not reach controller.yaml:\n%s", enYAML)
|
||||
}
|
||||
|
||||
// THE DIFF IS EXACTLY ONE LINE. Compared line by line after dropping the fields that are
|
||||
// regenerated on every call — a session secret and a timestamp differ between any two renders,
|
||||
// so counting them would make this test pass no matter what else changed.
|
||||
huLines := stableLines(huYAML)
|
||||
enLines := stableLines(enYAML)
|
||||
var onlyInEN, onlyInHU []string
|
||||
for _, l := range enLines {
|
||||
if !contains(huLines, l) {
|
||||
onlyInEN = append(onlyInEN, l)
|
||||
}
|
||||
}
|
||||
for _, l := range huLines {
|
||||
if !contains(enLines, l) {
|
||||
onlyInHU = append(onlyInHU, l)
|
||||
}
|
||||
}
|
||||
if len(onlyInEN) != 1 || !strings.Contains(onlyInEN[0], "language: en") {
|
||||
t.Errorf("the English config differs from the Hungarian one by %d line(s), want exactly the "+
|
||||
"language line: %v", len(onlyInEN), onlyInEN)
|
||||
}
|
||||
if len(onlyInHU) != 1 || !strings.Contains(onlyInHU[0], "language:") {
|
||||
t.Errorf("the Hungarian config has %d line(s) the English one lacks, want exactly the "+
|
||||
"language line: %v", len(onlyInHU), onlyInHU)
|
||||
}
|
||||
}
|
||||
|
||||
// An empty creation language still writes a line — the box is told "Hungarian" explicitly rather
|
||||
// than being left to guess from an absent key.
|
||||
func TestGenerate_EmptyLanguageStillWritesTheKey(t *testing.T) {
|
||||
const tmpl = "customer:\n id: \"\"\n"
|
||||
y, err := Generate(tmpl, &store.CustomerConfig{CustomerID: "c1", ConfigJSON: "{}"}, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(y, "language:") {
|
||||
t.Errorf("no language key at all — the box cannot tell a default from a missing field:\n%s", y)
|
||||
}
|
||||
}
|
||||
|
||||
// stableLines drops the lines that are regenerated on every call, so two renders are comparable.
|
||||
func stableLines(y string) []string {
|
||||
var out []string
|
||||
for _, l := range strings.Split(y, "\n") {
|
||||
t := strings.TrimSpace(l)
|
||||
if t == "" || strings.HasPrefix(t, "session_secret:") || strings.HasPrefix(t, "generated_at:") {
|
||||
continue
|
||||
}
|
||||
out = append(out, l)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func contains(ls []string, want string) bool {
|
||||
for _, l := range ls {
|
||||
if l == want {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
// Package i18n is the hub's customer-facing message bundle: one flat key → text map per language,
|
||||
// embedded in the binary, Hungarian first and authoritative.
|
||||
//
|
||||
// Design: felhom.eu/documentation/architecture/10-localisation.md, slice 3 (R-558).
|
||||
//
|
||||
// THIS BUNDLE IS FOR THE HOUSEHOLD, NOT THE OPERATOR. Everything the operator reads — the hub's own
|
||||
// pages, its logs, and FormatOperatorEmail — stays exactly as it is, in the language it is already
|
||||
// in. A key that would change an operator surface does not belong here.
|
||||
//
|
||||
// Three rules, the same three the controller's bundle follows:
|
||||
//
|
||||
// 1. HUNGARIAN IS THE SOURCE. hu.json holds every key. A key missing from hu is a programming
|
||||
// error and Msg says so loudly rather than rendering a blank line into a customer's mail.
|
||||
// 2. FALLBACK IS HUNGARIAN, AND IT IS COUNTED. A key absent from en.json renders the Hungarian and
|
||||
// is reported by MissingKeys, which the gate holds at zero. A household never sees a key name
|
||||
// or an empty space where a sentence should be.
|
||||
// 3. THE BOX'S OWN SENTENCES ARE NOT IN HERE. Roughly a third of the customer mails carry a
|
||||
// sentence composed on the box ("the remote target is not set"). The hub cannot translate those
|
||||
// and does not try: the box sends the household's version beside the Hungarian one
|
||||
// (`message_customer`), and the hub picks. See FormatCustomerEmail.
|
||||
//
|
||||
// Unlike the controller's bundle there is no template expansion here: a mail is plain text, so the
|
||||
// contextual-escaping problem that shaped the controller's design does not exist. Msg is a plain
|
||||
// lookup and Msgf formats with the Go verbs the Hungarian already uses.
|
||||
package i18n
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
//go:embed locales/*.json
|
||||
var localeFS embed.FS
|
||||
|
||||
// Default is the language of a household that never chose one — and the only language every key has.
|
||||
const Default = "hu"
|
||||
|
||||
// Supported lists the languages a household may be written to in, Default first.
|
||||
var Supported = []string{"hu", "en"}
|
||||
|
||||
// Bundle holds every language's messages.
|
||||
type Bundle struct {
|
||||
msgs map[string]map[string]string
|
||||
}
|
||||
|
||||
// Normalize maps any input to a supported language; everything unknown is Default.
|
||||
//
|
||||
// This is the ONLY gate between a reported language and a rendered mail. A box that reports
|
||||
// garbage, an old box that reports nothing, and a box that reports "EN " all land on a real
|
||||
// language rather than on an empty lookup.
|
||||
func Normalize(lang string) string {
|
||||
l := strings.ToLower(strings.TrimSpace(lang))
|
||||
for _, s := range Supported {
|
||||
if l == s {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return Default
|
||||
}
|
||||
|
||||
// IsSupported reports whether lang is exactly one of Supported. Used where an input must be
|
||||
// REFUSED rather than coerced — the customer-creation form, which should not silently store `hu`
|
||||
// for an operator who typed something else.
|
||||
func IsSupported(lang string) bool {
|
||||
for _, s := range Supported {
|
||||
if lang == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Load reads the embedded bundles.
|
||||
func Load() (*Bundle, error) { return loadFrom(localeFS) }
|
||||
|
||||
func loadFrom(fsys fs.FS) (*Bundle, error) {
|
||||
entries, err := fs.Glob(fsys, "locales/*.json")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b := &Bundle{msgs: make(map[string]map[string]string, len(entries))}
|
||||
for _, e := range entries {
|
||||
raw, err := fs.ReadFile(fsys, e)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("reading %s: %w", e, err)
|
||||
}
|
||||
var m map[string]string
|
||||
if err := json.Unmarshal(raw, &m); err != nil {
|
||||
return nil, fmt.Errorf("parsing %s: %w", e, err)
|
||||
}
|
||||
lang := strings.TrimSuffix(strings.TrimPrefix(e, "locales/"), ".json")
|
||||
b.msgs[lang] = m
|
||||
}
|
||||
if _, ok := b.msgs[Default]; !ok {
|
||||
return nil, fmt.Errorf("i18n: no %s.json — Hungarian is the source and must exist", Default)
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
|
||||
var (
|
||||
sharedOnce sync.Once
|
||||
shared *Bundle
|
||||
sharedErr error
|
||||
)
|
||||
|
||||
// Shared returns the process-wide bundle, loaded once.
|
||||
//
|
||||
// It panics if the embedded bundle cannot be parsed. That is deliberate and it is a BUILD-TIME
|
||||
// class of fault, not a runtime one: the JSON is compiled into the binary, so a parse failure means
|
||||
// every mail this binary will ever send is broken. Failing at the first send, loudly, beats sending
|
||||
// a thousand mails with blank bodies.
|
||||
func Shared() *Bundle {
|
||||
sharedOnce.Do(func() { shared, sharedErr = Load() })
|
||||
if sharedErr != nil {
|
||||
panic("i18n: embedded bundle is unloadable: " + sharedErr.Error())
|
||||
}
|
||||
return shared
|
||||
}
|
||||
|
||||
// Msg returns the message for key in lang, falling back to Hungarian.
|
||||
//
|
||||
// A key that exists in NO language returns a visible marker rather than an empty string. An empty
|
||||
// string in a mail body is invisible — the customer gets a mail with a hole in it and nobody ever
|
||||
// learns. The marker is ugly on purpose.
|
||||
func (b *Bundle) Msg(lang, key string) string {
|
||||
if b == nil {
|
||||
return "!" + key + "!"
|
||||
}
|
||||
if m, ok := b.msgs[Normalize(lang)]; ok {
|
||||
if v, ok := m[key]; ok && v != "" {
|
||||
return v
|
||||
}
|
||||
}
|
||||
if m, ok := b.msgs[Default]; ok {
|
||||
if v, ok := m[key]; ok && v != "" {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return "!" + key + "!"
|
||||
}
|
||||
|
||||
// Msgf formats the message for key in lang with args.
|
||||
//
|
||||
// Word order is the reason this exists rather than string concatenation at the call site: English
|
||||
// reorders what Hungarian does not, and a translation reorders with Go's explicit argument indexes
|
||||
// (`%[2]s`) inside its own value. The Hungarian value is then free to stay exactly the format
|
||||
// string it always was, which is what makes the goldens hold.
|
||||
func (b *Bundle) Msgf(lang, key string, args ...any) string {
|
||||
return fmt.Sprintf(b.Msg(lang, key), args...)
|
||||
}
|
||||
|
||||
// Has reports whether lang carries key in its own file (no fallback).
|
||||
func (b *Bundle) Has(lang, key string) bool {
|
||||
if b == nil {
|
||||
return false
|
||||
}
|
||||
m, ok := b.msgs[lang]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
v, ok := m[key]
|
||||
return ok && v != ""
|
||||
}
|
||||
|
||||
// Keys lists lang's own keys, sorted.
|
||||
func (b *Bundle) Keys(lang string) []string {
|
||||
if b == nil {
|
||||
return nil
|
||||
}
|
||||
m := b.msgs[lang]
|
||||
out := make([]string, 0, len(m))
|
||||
for k := range m {
|
||||
out = append(out, k)
|
||||
}
|
||||
sort.Strings(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// MissingKeys lists the Hungarian keys that lang does not carry, sorted.
|
||||
//
|
||||
// The gate holds this at zero for every supported language. It is the difference between "we
|
||||
// translated it" and "we believe we translated it".
|
||||
func (b *Bundle) MissingKeys(lang string) []string {
|
||||
if b == nil {
|
||||
return nil
|
||||
}
|
||||
var out []string
|
||||
for _, k := range b.Keys(Default) {
|
||||
if !b.Has(lang, k) {
|
||||
out = append(out, k)
|
||||
}
|
||||
}
|
||||
sort.Strings(out)
|
||||
return out
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package i18n
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// EnMissingCeiling is the number of Hungarian keys allowed to be missing from English. It is zero
|
||||
// and it stays zero: a fallback that renders Hungarian into an English household's mail is the
|
||||
// failure this bundle exists to prevent, so it must never be reachable in a shipped build.
|
||||
const EnMissingCeiling = 0
|
||||
|
||||
func TestEveryLanguageCarriesEveryKey(t *testing.T) {
|
||||
b := Shared()
|
||||
for _, lang := range Supported {
|
||||
missing := b.MissingKeys(lang)
|
||||
if lang == Default && len(missing) != 0 {
|
||||
t.Fatalf("%s is the source and cannot be missing keys: %v", lang, missing)
|
||||
}
|
||||
if len(missing) > EnMissingCeiling {
|
||||
t.Errorf("%s is missing %d key(s) (ceiling %d): %v",
|
||||
lang, len(missing), EnMissingCeiling, missing)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// verbRe matches a Go format verb, including an explicit argument index (%[2]s).
|
||||
var verbRe = regexp.MustCompile(`%(\[\d+\])?[-+# 0]*\d*(\.\d+)?[a-zA-Z%]`)
|
||||
|
||||
// TestFormatVerbsMatchAcrossLanguages is the test that stops a translation corrupting a mail.
|
||||
//
|
||||
// Msgf formats the TRANSLATED value with the arguments the Hungarian call site passes. A translation
|
||||
// that drops a `%s` silently loses a customer's server name; one that adds a `%s` renders
|
||||
// `%!s(MISSING)` into a real e-mail. Neither is visible to a reviewer reading the JSON, and neither
|
||||
// would fail any other test here — the mail still sends.
|
||||
//
|
||||
// Explicit argument indexes (`%[2]s`) are how English reorders what Hungarian does not, so the check
|
||||
// is on the MULTISET of verbs, not on their order.
|
||||
func TestFormatVerbsMatchAcrossLanguages(t *testing.T) {
|
||||
b := Shared()
|
||||
for _, key := range b.Keys(Default) {
|
||||
huVerbs := verbCounts(b.Msg(Default, key))
|
||||
for _, lang := range Supported {
|
||||
if lang == Default || !b.Has(lang, key) {
|
||||
continue
|
||||
}
|
||||
got := verbCounts(b.Msg(lang, key))
|
||||
if len(got) != len(huVerbs) {
|
||||
t.Errorf("%s/%s has %d format verb(s), hu has %d — the mail would render wrong",
|
||||
lang, key, len(got), len(huVerbs))
|
||||
continue
|
||||
}
|
||||
for verb, n := range huVerbs {
|
||||
if got[verb] != n {
|
||||
t.Errorf("%s/%s uses %q %d time(s), hu uses it %d time(s)",
|
||||
lang, key, verb, got[verb], n)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// verbCounts counts each format verb, ignoring the escaped %% which formats nothing.
|
||||
func verbCounts(s string) map[string]int {
|
||||
out := map[string]int{}
|
||||
for _, m := range verbRe.FindAllString(s, -1) {
|
||||
if m == "%%" {
|
||||
continue
|
||||
}
|
||||
// An indexed verb counts as its bare form: %[2]s and %s consume the same argument type.
|
||||
if i := strings.Index(m, "]"); i >= 0 {
|
||||
m = "%" + m[i+1:]
|
||||
}
|
||||
out[m]++
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func TestNormalizeAndIsSupported(t *testing.T) {
|
||||
for in, want := range map[string]string{
|
||||
"hu": "hu", "en": "en", "EN": "en", " en ": "en",
|
||||
"": "hu", "de": "hu", "en-GB": "hu", "garbage": "hu",
|
||||
} {
|
||||
if got := Normalize(in); got != want {
|
||||
t.Errorf("Normalize(%q) = %q, want %q", in, got, want)
|
||||
}
|
||||
}
|
||||
// IsSupported REFUSES where Normalize coerces — that difference is the whole reason both exist.
|
||||
for _, bad := range []string{"", "EN", " en ", "de", "en-GB"} {
|
||||
if IsSupported(bad) {
|
||||
t.Errorf("IsSupported(%q) is true — a bad input would be stored as a real language", bad)
|
||||
}
|
||||
}
|
||||
for _, good := range []string{"hu", "en"} {
|
||||
if !IsSupported(good) {
|
||||
t.Errorf("IsSupported(%q) is false", good)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A key that exists nowhere must be LOUD, never blank: an empty string in a mail body is a hole
|
||||
// nobody notices.
|
||||
func TestUnknownKeyIsVisible(t *testing.T) {
|
||||
got := Shared().Msg("en", "mail.event.no_such_thing_exists")
|
||||
if got == "" {
|
||||
t.Fatal("an unknown key rendered as an empty string — the mail would have a silent hole")
|
||||
}
|
||||
if !strings.Contains(got, "no_such_thing_exists") {
|
||||
t.Errorf("an unknown key rendered as %q — it does not name the key", got)
|
||||
}
|
||||
}
|
||||
|
||||
// An English key falls back to Hungarian rather than to nothing. Proven with a key deliberately
|
||||
// absent from en.json would be circular (there are none), so it is proven on the mechanism: a
|
||||
// language that carries no file at all.
|
||||
func TestFallbackIsHungarianNotBlank(t *testing.T) {
|
||||
b := Shared()
|
||||
if got := b.Msg("de", "mail.event.backup_completed"); got != b.Msg(Default, "mail.event.backup_completed") {
|
||||
t.Errorf("an unsupported language did not fall back to Hungarian: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
// The English bundle must not be a copy of the Hungarian one. A translation pass that silently
|
||||
// copied the source would pass every other test in this file.
|
||||
func TestEnglishIsActuallyTranslated(t *testing.T) {
|
||||
// The keys that are IDENTICAL IN BOTH LANGUAGES ON PURPOSE, each with the reason. An allowlist
|
||||
// rather than a count: a count lets the next untranslated key hide inside the budget, and the
|
||||
// question "why is this one the same?" then has no answer written down anywhere.
|
||||
sameOnPurpose := map[string]string{
|
||||
"mail.customer.subject": `"[Felhom] %s: %s" — a format with no words in it; both halves are themselves translated`,
|
||||
"bind.placeholder.pairing": `"ABC-234" — a sample of a code the box prints, not prose`,
|
||||
}
|
||||
|
||||
b := Shared()
|
||||
for _, key := range b.Keys(Default) {
|
||||
hu, en := b.Msg(Default, key), b.Msg("en", key)
|
||||
if hu != en {
|
||||
if _, listed := sameOnPurpose[key]; listed {
|
||||
t.Errorf("%s is allowlisted as identical but the two languages now differ — "+
|
||||
"remove it from sameOnPurpose", key)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if _, ok := sameOnPurpose[key]; !ok {
|
||||
t.Errorf("%s is identical in hu and en — untranslated text would ship: %q", key, hu)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"mail.event.claim_lockout": "Too many wrong setup codes were entered — the setup page is locked for 15 minutes. If that was not you, tell your operator.",
|
||||
"mail.event.backup_completed": "The backup finished successfully.",
|
||||
"mail.event.backup_failed": "The backup failed. Check your system.",
|
||||
"mail.event.db_dump_completed": "The database backup finished successfully.",
|
||||
"mail.event.db_dump_failed": "The database backup failed.",
|
||||
"mail.event.backup_integrity_ok": "The backup integrity check passed.",
|
||||
"mail.event.backup_integrity_failed": "The backup integrity check found a problem.",
|
||||
"mail.event.crossdrive_completed": "The second copy of your backup finished successfully.",
|
||||
"mail.event.crossdrive_failed": "The second copy of your backup failed.",
|
||||
"mail.event.offbox_repo_orphaned": "The remote backup store is orphaned: the backups inside it were made with an earlier key that is no longer available (usually after a reinstall). No new backup is made until the store is reset — open the Remote backup page.",
|
||||
"mail.event.offbox_repo_reset": "The remote backup store has been reset: the old history was set aside (not deleted), and an empty new store was created with the current key.",
|
||||
"mail.event.host_disk_warning": "The main disk of your home server's base system (the Proxmox host) is over 90% full — free up some space (old backups, for example).",
|
||||
"mail.event.host_disk_critical": "The main disk of your home server's base system is critically full (95%+). Act now, or the system may start to fail.",
|
||||
"mail.event.storage_fill_warning": "A drive on your home server is over 90% full — free up some space before it fills.",
|
||||
"mail.event.storage_fill_critical": "A drive on your home server is critically full (95%+). Backups and writes to it may fail. Act now.",
|
||||
"mail.event.storage_disconnected": "A drive was disconnected — backups may pause.",
|
||||
"mail.event.storage_reconnected": "The drive is connected again.",
|
||||
"mail.event.backup_target_absent": "The drive your whole-system backup is written to is not available. Until you reconnect it, no whole-system backup is made.",
|
||||
"mail.event.backup_target_restored": "The drive your whole-system backup is written to is available again — backups continue.",
|
||||
"mail.event.node_stale": "Your server has not sent a report recently.",
|
||||
"mail.event.node_down": "Your server cannot be reached.",
|
||||
"mail.event.node_recovered": "Your server can be reached again.",
|
||||
"mail.event.host_recovered": "Your home server's base system (the Proxmox host) can be reached again.",
|
||||
"mail.event.health_degraded": "Your system's health has got worse.",
|
||||
"mail.event.health_critical": "Your system's health is critical.",
|
||||
"mail.event.health_recovered": "Your system's health is back to normal.",
|
||||
"mail.event.controller_started": "The controller has started.",
|
||||
"mail.event.controller_updated": "The controller has been updated.",
|
||||
"mail.event.expected_backup_missed": "Today's backup did not finish by its deadline.",
|
||||
"mail.event.expected_dbdump_missed": "Today's database backup did not finish by its deadline.",
|
||||
"mail.event.app_deployed": "An app was installed.",
|
||||
"mail.event.app_removed": "An app was removed.",
|
||||
"mail.event.app_start_failed": "An installed app is not running — check the system monitor.",
|
||||
"mail.event.restore_interrupted": "A restore was interrupted because the box restarted. Start it again on the Restore page of your dashboard.",
|
||||
"mail.event.app_deploy_started": "An app has started installing.",
|
||||
"mail.event.app_deploy_failed": "An app did not finish installing.",
|
||||
"mail.event.disaster_recovery_started": "Disaster recovery has started.",
|
||||
"mail.event.disaster_recovery_completed": "Disaster recovery has finished.",
|
||||
"mail.event.test": "This is a test notification.",
|
||||
"mail.severity.info": "Information",
|
||||
"mail.severity.warning": "Warning",
|
||||
"mail.severity.error": "Error",
|
||||
"mail.severity.critical": "Critical error",
|
||||
"mail.customer.subject": "[Felhom] %s: %s",
|
||||
"mail.customer.body": "Dear Customer,\n\nYour Felhom system sent the following notification:\n\n%s\n\nDetails:\n- Server: %s\n- Time: %s\n- Level: %s\n- Type: %s",
|
||||
"mail.customer.line.message": "\n- Message: %s",
|
||||
"mail.customer.line.note": "\n- Note: %s",
|
||||
"mail.customer.signoff": "\n\nIf you have any questions, contact your operator.\n\nBest regards,\nFelhom.eu monitoring",
|
||||
"mail.claim.reset.subject": "[Felhom] Setup code to reset your password",
|
||||
"mail.claim.reset.body": "Dear Customer,\n\nYou asked to reset the password for your Felhom dashboard.\n\nSetup code: %s\n\nThe code is valid for 72 hours and can be used once. Enter it on the\n\"Forgotten password\" page of your dashboard, then choose a new password:\n\n%s\n\nIf you did not ask for this, ignore it — your current password is unchanged.\n\nBest regards,\nFelhom.eu",
|
||||
"mail.claim.reenroll.subject": "[Felhom] New setup code — your server was reinstalled",
|
||||
"mail.claim.reenroll.body": "Dear Customer,\n\nYour Felhom server was reinstalled, so the sign-in to your dashboard has to be\nset up again. Your earlier password is no longer valid.\n\nSetup code: %s\n\nThe code is valid for 72 hours and can be used once. Open your dashboard — the\n\"Set up the server\" page will greet you — enter the code, then choose a new\npassword:\n\n%s\n\nIf you did not reinstall your server, contact your operator.\n\nBest regards,\nFelhom.eu",
|
||||
"mail.claim.claimed.subject": "[Felhom] Your dashboard is now password protected",
|
||||
"mail.claim.claimed.body": "Dear Customer,\n\nThe setup of your Felhom dashboard is complete — your dashboard is now\npassword protected. You can sign in with the password you chose:\n\n%s\n\nIf you did not do this setup, contact your operator immediately.\n\nBest regards,\nFelhom.eu",
|
||||
"mail.claim.claim.subject": "[Felhom] Your Felhom server is up — setup code",
|
||||
"mail.claim.claim.body": "Dear Customer,\n\nYour Felhom server is up. To use the dashboard for the first time, enter the\nsetup code below, then choose your own password:\n\nSetup code: %s\n\nThe code is valid for 72 hours and can be used once. You can reach the\ndashboard here:\n\n%s\n\nIf it did not reach you in time, the dashboard's \"Request a new code\" button\ngets you a fresh one — it always arrives at this e-mail address.\n\nBest regards,\nFelhom.eu",
|
||||
"mail.selfbind.subject": "[Felhom] Link your Felhom box to your account",
|
||||
"mail.selfbind.body": "Dear Customer,\n\nYour Felhom box is ready and waiting to be linked. You can link it to your\naccount yourself using the link below — no sign-in needed:\n\n%s\n\nAfter you open the link you will need to enter two things:\n\n 1. The pairing code, shown on the box's own screen (the monitor).\n 2. Your owner passphrase (the 5-word phrase) that you received from your\n Felhom operator — in person or by telephone, never by e-mail. It proves\n the account is yours.\n\nThe link is valid for 7 days. For safety it locks after 5 failed attempts —\nif that happens, contact support.\n\nIf you did not ask for this, ignore this e-mail.\n\nBest regards,\nFelhom.eu",
|
||||
"bind.title": "Felhom — Link your box",
|
||||
"bind.heading": "Link your Felhom <span>box</span>",
|
||||
"bind.lead": "Link the Felhom box you have just installed to your account. Enter the pairing code shown on the box's screen, and your owner passphrase.",
|
||||
"bind.failed": "Those details are not right. Check the pairing code and the owner passphrase, then try again.",
|
||||
"bind.label.pairing": "Pairing code",
|
||||
"bind.placeholder.pairing": "ABC-234",
|
||||
"bind.hint.pairing": "It appears on the box's monitor, after the install.",
|
||||
"bind.label.passphrase": "Owner passphrase",
|
||||
"bind.placeholder.passphrase": "five words, with hyphens or spaces",
|
||||
"bind.hint.passphrase": "The five-word phrase you received during setup. It proves the account is yours.",
|
||||
"bind.submit": "Link the box",
|
||||
"bind.note": "For safety the link locks after 5 failed attempts. If that happens, contact support.",
|
||||
"bind.success.lead": "Linked successfully.",
|
||||
"bind.success.body": "The box carries on installing within about a minute. You can close this page — the setup finishes in the background, and your dashboard will be available soon.",
|
||||
"bind.consumed.lead": "This link has already been used.",
|
||||
"bind.consumed.body": "The box has been linked. If you think that is a mistake, contact support.",
|
||||
"bind.locked.lead": "This link is locked.",
|
||||
"bind.locked.body": "There were too many failed attempts. For safety the link has locked — contact support to link the box.",
|
||||
"bind.invalid.lead": "This link is invalid or has expired.",
|
||||
"bind.invalid.body": "The link is valid for 7 days. If it has expired, ask support for a new one, or your operator can do the linking.",
|
||||
"bind.htmllang": "en"
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"mail.event.claim_lockout": "Túl sok hibás beállító kód próbálkozás történt — a beállító oldal 15 percre zárolva lett. Ha nem te próbálkoztál, jelezd az üzemeltetőnek.",
|
||||
"mail.event.backup_completed": "A biztonsági mentés sikeresen elkészült.",
|
||||
"mail.event.backup_failed": "A biztonsági mentés sikertelen! Kérjük, ellenőrizd a rendszert.",
|
||||
"mail.event.db_dump_completed": "Az adatbázis mentés sikeresen elkészült.",
|
||||
"mail.event.db_dump_failed": "Az adatbázis mentés sikertelen!",
|
||||
"mail.event.backup_integrity_ok": "A mentés integritás ellenőrzés sikeres.",
|
||||
"mail.event.backup_integrity_failed": "A mentés integritás ellenőrzés hibát talált!",
|
||||
"mail.event.crossdrive_completed": "A másodlagos mentés sikeresen elkészült.",
|
||||
"mail.event.crossdrive_failed": "A másodlagos mentés sikertelen!",
|
||||
"mail.event.offbox_repo_orphaned": "A távoli mentési tároló elárvult: a benne lévő mentések egy korábbi, már nem elérhető kulccsal készültek (jellemzően újratelepítés után). Új mentés a tároló visszaállításáig nem készül — nyisd meg a Távoli mentés oldalt.",
|
||||
"mail.event.offbox_repo_reset": "A távoli mentési tároló visszaállítva: a régi előzmény félretéve (nem törölve), és egy üres, új tároló jött létre a mostani kulccsal.",
|
||||
"mail.event.host_disk_warning": "A házszerver alaprendszerének (Proxmox-gazda) gyökérlemeze 90% felett van — kérjük, szabadíts fel helyet (pl. régi biztonsági mentések).",
|
||||
"mail.event.host_disk_critical": "A házszerver alaprendszerének gyökérlemeze kritikusan tele van (95%+) — azonnali beavatkozás szükséges, különben a rendszer hibázhat!",
|
||||
"mail.event.storage_fill_warning": "Egy tároló a házszerveren 90% felett telt — kérjük, szabadíts fel helyet, mielőtt megtelik.",
|
||||
"mail.event.storage_fill_critical": "Egy tároló a házszerveren kritikusan tele van (95%+) — a rá készülő mentések/írások meghiúsulhatnak; azonnali beavatkozás szükséges!",
|
||||
"mail.event.storage_disconnected": "Egy meghajtó leválasztva — a mentések szünetelhetnek.",
|
||||
"mail.event.storage_reconnected": "A meghajtó újra csatlakoztatva.",
|
||||
"mail.event.backup_target_absent": "A rendszermentés meghajtója nem érhető el — amíg vissza nem csatlakoztatod, a teljes rendszermentés nem készül el.",
|
||||
"mail.event.backup_target_restored": "A rendszermentés meghajtója újra elérhető — a mentés folytatódik.",
|
||||
"mail.event.node_stale": "A szerver nem küldött jelentést az elmúlt időszakban.",
|
||||
"mail.event.node_down": "A szerver nem elérhető!",
|
||||
"mail.event.node_recovered": "A szerver újra elérhető.",
|
||||
"mail.event.host_recovered": "A házszerver alaprendszere (Proxmox-gazda) újra elérhető.",
|
||||
"mail.event.health_degraded": "A rendszer állapota romlott.",
|
||||
"mail.event.health_critical": "A rendszer állapota kritikus!",
|
||||
"mail.event.health_recovered": "A rendszer állapota helyreállt.",
|
||||
"mail.event.controller_started": "A vezérlő elindult.",
|
||||
"mail.event.controller_updated": "A vezérlő frissítve lett.",
|
||||
"mail.event.expected_backup_missed": "A mai biztonsági mentés nem készült el a határidőig!",
|
||||
"mail.event.expected_dbdump_missed": "A mai adatbázis mentés nem készült el a határidőig!",
|
||||
"mail.event.app_deployed": "Alkalmazás telepítve.",
|
||||
"mail.event.app_removed": "Alkalmazás eltávolítva.",
|
||||
"mail.event.app_start_failed": "Egy telepített alkalmazás nem fut — ellenőrizze a rendszermonitort.",
|
||||
"mail.event.restore_interrupted": "Egy visszaállítás megszakadt, mert a doboz újraindult. Indítsd el újra a vezérlőpult Visszaállítás oldalán.",
|
||||
"mail.event.app_deploy_started": "Alkalmazás telepítése elindult.",
|
||||
"mail.event.app_deploy_failed": "Egy alkalmazás telepítése nem fejeződött be.",
|
||||
"mail.event.disaster_recovery_started": "Katasztrófa helyreállítás elindítva.",
|
||||
"mail.event.disaster_recovery_completed": "Katasztrófa helyreállítás befejezve.",
|
||||
"mail.event.test": "Ez egy teszt értesítés.",
|
||||
"mail.severity.info": "Információ",
|
||||
"mail.severity.warning": "Figyelmeztetés",
|
||||
"mail.severity.error": "Hiba",
|
||||
"mail.severity.critical": "Kritikus hiba",
|
||||
"mail.customer.subject": "[Felhom] %s: %s",
|
||||
"mail.customer.body": "Kedves Ügyfél!\n\nA Felhom rendszered a következő értesítést küldte:\n\n%s\n\nRészletek:\n- Szerver: %s\n- Időpont: %s\n- Szint: %s\n- Típus: %s",
|
||||
"mail.customer.line.message": "\n- Üzenet: %s",
|
||||
"mail.customer.line.note": "\n- Megjegyzés: %s",
|
||||
"mail.customer.signoff": "\n\nHa kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.\n\nÜdvözlettel,\nFelhom.eu monitoring",
|
||||
"mail.claim.reset.subject": "[Felhom] Beállító kód a jelszavad visszaállításához",
|
||||
"mail.claim.reset.body": "Kedves Ügyfél!\n\nJelszó-visszaállítást kértél a Felhom vezérlőpultodhoz.\n\nBeállító kód: %s\n\nA kód 72 óráig érvényes, és egyszer használható fel. Add meg a vezérlőpult\n\"Elfelejtett jelszó\" oldalán, majd válassz új jelszót:\n\n%s\n\nHa nem te kérted, hagyd figyelmen kívül — a jelenlegi jelszavad változatlan.\n\nÜdvözlettel,\nFelhom.eu",
|
||||
"mail.claim.reenroll.subject": "[Felhom] Új beállító kód — újratelepült a szervered",
|
||||
"mail.claim.reenroll.body": "Kedves Ügyfél!\n\nA Felhom szervered újratelepült, ezért a vezérlőpultod belépését újra be kell\nállítani. A korábbi jelszavad már nem érvényes.\n\nBeállító kód: %s\n\nA kód 72 óráig érvényes, és egyszer használható fel. Nyisd meg a vezérlőpultot —\n\"A szerver beállítása\" oldal fogad —, add meg a kódot, majd válassz új jelszót:\n\n%s\n\nHa nem te telepítetted újra a szervered, vedd fel a kapcsolatot az üzemeltetővel.\n\nÜdvözlettel,\nFelhom.eu",
|
||||
"mail.claim.claimed.subject": "[Felhom] A vezérlőpultod mostantól jelszóval védett",
|
||||
"mail.claim.claimed.body": "Kedves Ügyfél!\n\nA Felhom vezérlőpultod beállítása elkészült — a vezérlőpultod mostantól\njelszóval védett. A megadott jelszóval tudsz bejelentkezni:\n\n%s\n\nHa nem te végezted a beállítást, azonnal vedd fel a kapcsolatot az üzemeltetővel.\n\nÜdvözlettel,\nFelhom.eu",
|
||||
"mail.claim.claim.subject": "[Felhom] Elindult a Felhom szervered — beállító kód",
|
||||
"mail.claim.claim.body": "Kedves Ügyfél!\n\nElindult a Felhom szervered. A vezérlőpult első használatához add meg az\nalábbi beállító kódot, majd válassz saját jelszót:\n\nBeállító kód: %s\n\nA kód 72 óráig érvényes, és egyszer használható fel. A vezérlőpultot itt éred el:\n\n%s\n\nHa nem kaptad volna meg időben, a vezérlőpult \"Új kód kérése\" gombjával\nkérhetsz frisset — az mindig erre az e-mail címre érkezik.\n\nÜdvözlettel,\nFelhom.eu",
|
||||
"mail.selfbind.subject": "[Felhom] Kösd össze a Felhom dobozodat",
|
||||
"mail.selfbind.body": "Kedves Ügyfél!\n\nElkészült a Felhom dobozod, és készen áll az összekötésre. Az alábbi hivatkozáson\ntudod te magad összekötni a fiókoddal — nincs szükség bejelentkezésre:\n\n%s\n\nA hivatkozás megnyitása után két adatot kell megadnod:\n\n 1. A párosító kódot, amely a doboz képernyőjén (a monitoron) látható.\n 2. A tulajdonosi jelmondatodat (az 5 szóból álló kifejezést), amelyet a\n Felhom üzemeltetőjétől kaptál — személyesen vagy telefonon, e-mailben\n soha. Ez igazolja, hogy a fiók a tiéd.\n\nA hivatkozás 7 napig érvényes. Biztonsági okból 5 sikertelen próbálkozás után\nzárolódik — ilyenkor vedd fel a kapcsolatot az ügyfélszolgálattal.\n\nHa nem te kérted ezt, hagyd figyelmen kívül ezt az e-mailt.\n\nÜdvözlettel,\nFelhom.eu",
|
||||
"bind.title": "Felhom — Doboz összekötése",
|
||||
"bind.heading": "Felhom <span>doboz</span> összekötése",
|
||||
"bind.lead": "Kösd össze a most telepített Felhom dobozodat a fiókoddal. Add meg a doboz képernyőjén látható párosító kódot és a tulajdonosi jelmondatodat.",
|
||||
"bind.failed": "A megadott adatok nem megfelelőek. Ellenőrizd a párosító kódot és a tulajdonosi jelmondatot, majd próbáld újra.",
|
||||
"bind.label.pairing": "Párosító kód",
|
||||
"bind.placeholder.pairing": "ABC-234",
|
||||
"bind.hint.pairing": "A doboz monitorán jelenik meg, a telepítés után.",
|
||||
"bind.label.passphrase": "Tulajdonosi jelmondat",
|
||||
"bind.placeholder.passphrase": "öt szó, kötőjellel vagy szóközzel",
|
||||
"bind.hint.passphrase": "Az öt szóból álló kifejezés, amelyet a beállításkor kaptál. Ez igazolja, hogy a fiók a tiéd.",
|
||||
"bind.submit": "Összekötés",
|
||||
"bind.note": "Biztonsági okból 5 sikertelen próbálkozás után a hivatkozás zárolódik. Ilyenkor vedd fel a kapcsolatot az ügyfélszolgálattal.",
|
||||
"bind.success.lead": "Sikeres összekötés.",
|
||||
"bind.success.body": "A doboz kb. egy percen belül folytatja a telepítést. Ezt az oldalt bezárhatod — a beállítás a háttérben befejeződik, és a vezérlőpultod hamarosan elérhető lesz.",
|
||||
"bind.consumed.lead": "Ez a hivatkozás már fel lett használva.",
|
||||
"bind.consumed.body": "A doboz összekötése megtörtént. Ha úgy gondolod, hogy ez tévedés, vedd fel a kapcsolatot az ügyfélszolgálattal.",
|
||||
"bind.locked.lead": "Ez a hivatkozás zárolva van.",
|
||||
"bind.locked.body": "Túl sok sikertelen próbálkozás történt. Biztonsági okból a hivatkozás zárolódott — kérjük, vedd fel a kapcsolatot az ügyfélszolgálattal a doboz összekötéséhez.",
|
||||
"bind.invalid.lead": "Ez a hivatkozás érvénytelen vagy lejárt.",
|
||||
"bind.invalid.body": "A hivatkozás 7 napig érvényes. Ha lejárt, kérj újat az ügyfélszolgálattól, vagy az összekötést az üzemeltető is elvégezheti.",
|
||||
"bind.htmllang": "hu"
|
||||
}
|
||||
@@ -107,7 +107,28 @@ func severityNotifies(severity string) bool {
|
||||
|
||||
// ProcessEvent evaluates an event and sends notifications as appropriate.
|
||||
// Safe to call from goroutines.
|
||||
//
|
||||
// This is the HUB-GENERATED entry point: the hub composed `message` itself (a checker, a staleness
|
||||
// sweep, an escrow decision), so there is no second sentence to carry and the customer mail is
|
||||
// rendered from the bundle alone.
|
||||
func (d *Dispatcher) ProcessEvent(customerID, eventType, severity, message, detailsJSON, source string) {
|
||||
d.processEvent(customerID, eventType, severity, message, "", detailsJSON, source)
|
||||
}
|
||||
|
||||
// ProcessBoxEvent is the entry point for an event a BOX sent (POST /api/v1/event).
|
||||
//
|
||||
// `messageCustomer` is the box's own sentence in the household's language, sent beside the Hungarian
|
||||
// `message` by controller v0.256.0 and later (R-558). It is optional forever — an older box sends
|
||||
// none and the mail is then exactly what it was.
|
||||
//
|
||||
// Kept SEPARATE from ProcessEvent rather than added as a parameter to it: 44 of the 45 call sites
|
||||
// are hub-generated and have no such sentence, and widening all of them would have meant 44 edits
|
||||
// whose only content is an empty string — churn that hides the one call site that matters.
|
||||
func (d *Dispatcher) ProcessBoxEvent(customerID, eventType, severity, message, messageCustomer, detailsJSON, source string) {
|
||||
d.processEvent(customerID, eventType, severity, message, messageCustomer, detailsJSON, source)
|
||||
}
|
||||
|
||||
func (d *Dispatcher) processEvent(customerID, eventType, severity, message, messageCustomer, detailsJSON, source string) {
|
||||
if d.resendAPIKey == "" {
|
||||
return
|
||||
}
|
||||
@@ -122,7 +143,7 @@ func (d *Dispatcher) ProcessEvent(customerID, eventType, severity, message, deta
|
||||
// branch: *_recovered stays severity "info" (semantics frozen), but is no longer silent.
|
||||
// Operator always hears both edges; the customer hears recovery iff they heard the down.
|
||||
if _, isRecovery := recoveredPairedDownTypes[eventType]; isRecovery {
|
||||
d.processRecovery(customerID, eventType, severity, message, detailsJSON, source)
|
||||
d.processRecovery(customerID, eventType, severity, message, messageCustomer, detailsJSON, source)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -167,7 +188,7 @@ func (d *Dispatcher) ProcessEvent(customerID, eventType, severity, message, deta
|
||||
d.processOperator(customerID, eventType, severity, message, detailsJSON, source)
|
||||
|
||||
// Customer channel
|
||||
d.processCustomer(customerID, eventType, severity, message, detailsJSON, source)
|
||||
d.processCustomer(customerID, eventType, severity, message, messageCustomer, detailsJSON, source)
|
||||
}
|
||||
|
||||
func (d *Dispatcher) sendTestEmail(customerID string) {
|
||||
@@ -219,7 +240,7 @@ Dashboard: https://hub.felhom.eu/customers/%s`, customerID, customerID)
|
||||
// - Customer leg: gated by the PAIRING rule, not enabled_events — "recovery notifies exactly
|
||||
// whoever the down notified." Evidence = a customer-channel status=sent row for the paired
|
||||
// stale/down set newer than the last customer-channel sent recovery of this type.
|
||||
func (d *Dispatcher) processRecovery(customerID, eventType, severity, message, detailsJSON, source string) {
|
||||
func (d *Dispatcher) processRecovery(customerID, eventType, severity, message, messageCustomer, detailsJSON, source string) {
|
||||
d.processOperator(customerID, eventType, severity, message, detailsJSON, source)
|
||||
|
||||
if d.store.IsCustomerBlocked(customerID) {
|
||||
@@ -263,7 +284,8 @@ func (d *Dispatcher) processRecovery(customerID, eventType, severity, message, d
|
||||
d.custCooldowns[cooldownKey] = time.Now()
|
||||
d.mu.Unlock()
|
||||
|
||||
subject, body := FormatCustomerEmail(customerID, eventType, severity, message, detailsJSON)
|
||||
subject, body := FormatCustomerEmail(d.store.CustomerLanguage(customerID),
|
||||
customerID, eventType, severity, message, messageCustomer, detailsJSON)
|
||||
if err := d.sendEmailFn(prefs.Email, subject, body, priorityHeaders(severity)); err != nil {
|
||||
d.logger.Printf("[ERROR] Customer recovery email failed for %s/%s: %v", customerID, eventType, err)
|
||||
d.store.LogNotification(customerID, eventType, severity, message, "failed", err.Error(), "customer")
|
||||
@@ -609,7 +631,7 @@ var operatorOnlyEvents = map[string]bool{
|
||||
// Read-only: the register itself stays unexported so nothing can widen it at runtime.
|
||||
func IsOperatorOnly(eventType string) bool { return operatorOnlyEvents[eventType] }
|
||||
|
||||
func (d *Dispatcher) processCustomer(customerID, eventType, severity, message, detailsJSON, source string) {
|
||||
func (d *Dispatcher) processCustomer(customerID, eventType, severity, message, messageCustomer, detailsJSON, source string) {
|
||||
// R-97c: operator-tier events stop here, BEFORE prefs are consulted — the point is that no
|
||||
// customer configuration can opt in. Logged rather than dropped, so the skip is visible in
|
||||
// notification_log instead of looking like a delivery that never happened.
|
||||
@@ -652,7 +674,8 @@ func (d *Dispatcher) processCustomer(customerID, eventType, severity, message, d
|
||||
d.custCooldowns[cooldownKey] = time.Now()
|
||||
d.mu.Unlock()
|
||||
|
||||
subject, body := FormatCustomerEmail(customerID, eventType, severity, message, detailsJSON)
|
||||
subject, body := FormatCustomerEmail(d.store.CustomerLanguage(customerID),
|
||||
customerID, eventType, severity, message, messageCustomer, detailsJSON)
|
||||
|
||||
if err := d.sendEmailFn(prefs.Email, subject, body, priorityHeaders(severity)); err != nil {
|
||||
d.logger.Printf("[ERROR] Customer email failed for %s/%s: %v", customerID, eventType, err)
|
||||
@@ -718,7 +741,7 @@ func (d *Dispatcher) SendClaimEmail(kind, customerID, email, domain, code string
|
||||
d.logger.Printf("[ERROR] claim %s email for %s NOT sent: no Resend API key configured", kind, customerID)
|
||||
return fmt.Errorf("notify: no resend api key")
|
||||
}
|
||||
subject, body := FormatClaimEmail(kind, customerID, domain, code)
|
||||
subject, body := FormatClaimEmail(d.store.CustomerLanguage(customerID), kind, customerID, domain, code)
|
||||
eventType := "claim_" + kind
|
||||
if err := d.sendEmailFn(email, subject, body, nil); err != nil {
|
||||
d.logger.Printf("[ERROR] claim %s email to customer %s failed: %v", kind, customerID, err)
|
||||
@@ -740,7 +763,7 @@ func (d *Dispatcher) SendSelfBindEmail(customerID, email, link string) error {
|
||||
d.logger.Printf("[ERROR] self-bind link email for %s NOT sent: no Resend API key configured", customerID)
|
||||
return fmt.Errorf("notify: no resend api key")
|
||||
}
|
||||
subject, body := FormatSelfBindEmail(customerID, link)
|
||||
subject, body := FormatSelfBindEmail(d.store.CustomerLanguage(customerID), customerID, link)
|
||||
if err := d.sendEmailFn(email, subject, body, nil); err != nil {
|
||||
d.logger.Printf("[ERROR] self-bind link email to customer %s failed: %v", customerID, err)
|
||||
d.store.LogNotification(customerID, "selfbind_link", "info", subject, "failed", err.Error(), "customer")
|
||||
|
||||
@@ -127,9 +127,9 @@ func TestRecovery_FlapDamping(t *testing.T) {
|
||||
d := NewDispatcher(st, "test-key", "from@felhom.eu", "op@felhom.eu", true, log.New(io.Discard, "", 0))
|
||||
sent := captureSeam(d)
|
||||
|
||||
d.ProcessEvent("c1", "node_down", "error", "down", "{}", "hub") // down #1: cust+op mailed
|
||||
d.ProcessEvent("c1", "node_recovered", "info", "up", "{}", "hub") // recovery #1: cust+op mailed
|
||||
d.ProcessEvent("c1", "node_down", "error", "down", "{}", "hub") // down #2 10min later: customer
|
||||
d.ProcessEvent("c1", "node_down", "error", "down", "{}", "hub") // down #1: cust+op mailed
|
||||
d.ProcessEvent("c1", "node_recovered", "info", "up", "{}", "hub") // recovery #1: cust+op mailed
|
||||
d.ProcessEvent("c1", "node_down", "error", "down", "{}", "hub") // down #2 10min later: customer
|
||||
// cooldown suppresses (op too, 1h)
|
||||
// Clear the recovery CUSTOMER cooldown so the pairing gate — not the cooldown — decides #2:
|
||||
d.mu.Lock()
|
||||
|
||||
@@ -56,7 +56,12 @@ func TestProcessEvent_PoolBoxScopeOperatorOnly(t *testing.T) {
|
||||
d := NewDispatcher(st, "test-key", "from@felhom.eu", "op@felhom.eu", true, log.New(io.Discard, "", 0))
|
||||
var mu sync.Mutex
|
||||
var sent []string
|
||||
d.sendEmailFn = func(to, _, _ string, _ map[string]string) error { mu.Lock(); defer mu.Unlock(); sent = append(sent, to); return nil }
|
||||
d.sendEmailFn = func(to, _, _ string, _ map[string]string) error {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
sent = append(sent, to)
|
||||
return nil
|
||||
}
|
||||
|
||||
d.ProcessEvent("pool-box", "offsite_box_fill", "warning", "Offsite pool box 82% full", `{"scope":"pool-box"}`, "hub")
|
||||
if len(sent) != 1 || sent[0] != "op@felhom.eu" {
|
||||
@@ -71,7 +76,12 @@ func TestProcessEvent_PBSDRBoxScopeOperatorOnly(t *testing.T) {
|
||||
d := NewDispatcher(st, "test-key", "from@felhom.eu", "op@felhom.eu", true, log.New(io.Discard, "", 0))
|
||||
var mu sync.Mutex
|
||||
var sent []string
|
||||
d.sendEmailFn = func(to, _, _ string, _ map[string]string) error { mu.Lock(); defer mu.Unlock(); sent = append(sent, to); return nil }
|
||||
d.sendEmailFn = func(to, _, _ string, _ map[string]string) error {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
sent = append(sent, to)
|
||||
return nil
|
||||
}
|
||||
|
||||
d.ProcessEvent("pbsdr-box", "pbsdr_box_fill", "warning", "PBS DR datastore 82% full", `{"scope":"pbsdr-box"}`, "hub")
|
||||
if len(sent) != 1 || sent[0] != "op@felhom.eu" {
|
||||
@@ -85,7 +95,12 @@ func TestProcessEvent_CriticalRoutes(t *testing.T) {
|
||||
d := NewDispatcher(st, "test-key", "from@felhom.eu", "op@felhom.eu", true, log.New(io.Discard, "", 0))
|
||||
var mu sync.Mutex
|
||||
var sent []string
|
||||
d.sendEmailFn = func(to, _, _ string, _ map[string]string) error { mu.Lock(); defer mu.Unlock(); sent = append(sent, to); return nil }
|
||||
d.sendEmailFn = func(to, _, _ string, _ map[string]string) error {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
sent = append(sent, to)
|
||||
return nil
|
||||
}
|
||||
|
||||
d.ProcessEvent("c1", "host_disk_critical", "critical", "root full", "{}", "hub")
|
||||
if len(sent) != 1 || sent[0] != "op@felhom.eu" {
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package notify
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-hub/internal/i18n"
|
||||
)
|
||||
|
||||
// Localisation slice 3 (R-558) — the behaviour the bundle exists to produce.
|
||||
//
|
||||
// The goldens next door prove WHAT each mail says. These prove WHICH ONE a household gets, and that
|
||||
// the operator's copy never moves.
|
||||
|
||||
// S3 — the box's own sentence.
|
||||
//
|
||||
// Roughly a third of the customer mails carry a sentence the BOX composed, naming a drive or an app
|
||||
// or a number. The hub cannot translate one, so the box sends a second copy in the household's
|
||||
// language. This is the test that the second copy is actually preferred — and that its absence
|
||||
// leaves the mail exactly as it was, which is the state of every box in the fleet until the
|
||||
// controller half ships.
|
||||
func TestMessageCustomerPreferredForTheHousehold(t *testing.T) {
|
||||
const hunSentence = "A /mnt/adat lemez 91%-ig megtelt (12,4 GB szabad)."
|
||||
const engSentence = "The /mnt/adat disk is 91% full (12.4 GB free)."
|
||||
|
||||
// disk_warning has NO bundle entry on purpose, so the box's sentence IS the mail.
|
||||
subject, body := FormatCustomerEmail("en", "c1", "disk_warning", "warning", hunSentence, engSentence, "")
|
||||
|
||||
if !strings.Contains(body, engSentence) {
|
||||
t.Errorf("the English household's mail does not carry the English sentence:\n%s", body)
|
||||
}
|
||||
if strings.Contains(body, hunSentence) {
|
||||
t.Errorf("the English household's mail still carries the Hungarian sentence:\n%s", body)
|
||||
}
|
||||
if !strings.Contains(subject, engSentence) {
|
||||
t.Errorf("the subject is not the English sentence: %q", subject)
|
||||
}
|
||||
|
||||
// The OPERATOR's mail is built from `message` and is untouched by any of this.
|
||||
opSubject, opBody := FormatOperatorEmail("c1", "disk_warning", "warning", hunSentence, "")
|
||||
if !strings.Contains(opBody, hunSentence) {
|
||||
t.Errorf("the operator's mail lost the Hungarian sentence:\n%s", opBody)
|
||||
}
|
||||
if strings.Contains(opBody, engSentence) || strings.Contains(opSubject, engSentence) {
|
||||
t.Error("the English sentence leaked into the operator's mail")
|
||||
}
|
||||
}
|
||||
|
||||
// S3, the other half: an old controller sends no second sentence, and the mail must be byte-for-byte
|
||||
// what it is today. Compared against the RENDER WITH NO NEW FIELD AT ALL, not against a retyped
|
||||
// expectation — a retyped one would pass even if both sides changed together.
|
||||
func TestMessageCustomerAbsentIsExactlyToday(t *testing.T) {
|
||||
const hunSentence = "A /mnt/adat lemez 91%-ig megtelt (12,4 GB szabad)."
|
||||
|
||||
subject, body := FormatCustomerEmail(i18n.Default, "c1", "disk_warning", "warning", hunSentence, "", "")
|
||||
if !strings.Contains(body, hunSentence) || !strings.Contains(subject, hunSentence) {
|
||||
t.Fatalf("an absent message_customer lost the box's sentence:\n%s\n%s", subject, body)
|
||||
}
|
||||
|
||||
// And a Hungarian household that DOES get a second sentence gets the Hungarian one, because the
|
||||
// box sends the same text twice. The point is that nothing about the hu path depends on it.
|
||||
s2, b2 := FormatCustomerEmail(i18n.Default, "c1", "disk_warning", "warning", hunSentence, hunSentence, "")
|
||||
if s2 != subject || b2 != body {
|
||||
t.Error("a Hungarian household's mail changed when the box sent the sentence twice")
|
||||
}
|
||||
}
|
||||
|
||||
// The entry still WINS over the box's sentence, in both languages — the property that keeps the
|
||||
// dynamic-message types (disk_warning and friends) working, stated from the other direction.
|
||||
func TestEntryWinsAndTheBoxSentenceBecomesItsOwnLine(t *testing.T) {
|
||||
const hun = "A cel nincs beallitva."
|
||||
const eng = "The target is not set."
|
||||
|
||||
_, body := FormatCustomerEmail("en", "c1", "backup_failed", "error", hun, eng, "")
|
||||
headline := i18n.Shared().Msg("en", "mail.event.backup_failed")
|
||||
if !strings.Contains(body, headline) {
|
||||
t.Errorf("the English entry is not the headline:\n%s", body)
|
||||
}
|
||||
if !strings.Contains(body, eng) {
|
||||
t.Errorf("the box's English sentence is not on its own line:\n%s", body)
|
||||
}
|
||||
if strings.Contains(body, hun) {
|
||||
t.Errorf("the Hungarian sentence reached an English household:\n%s", body)
|
||||
}
|
||||
// The line label is translated too — an English mail must not say "Üzenet".
|
||||
if strings.Contains(body, "Üzenet") {
|
||||
t.Errorf("the English mail carries the Hungarian field label:\n%s", body)
|
||||
}
|
||||
}
|
||||
|
||||
// Every mail kind actually differs between the two languages. Without this, a key that silently fell
|
||||
// back to Hungarian would pass every other test here: the mail sends, it just sends in the wrong
|
||||
// language, which is the exact defect this slice exists to remove.
|
||||
func TestEveryCustomerMailDiffersBetweenLanguages(t *testing.T) {
|
||||
for _, c := range customerMailCases("hu") {
|
||||
if strings.HasPrefix(c.name, "operator_") {
|
||||
continue // the operator's mails are English already and are not localised
|
||||
}
|
||||
name := c.name
|
||||
huSubject, huBody := c.render()
|
||||
var enSubject, enBody string
|
||||
for _, e := range customerMailCases("en") {
|
||||
if e.name == name {
|
||||
enSubject, enBody = e.render()
|
||||
}
|
||||
}
|
||||
if huBody == enBody {
|
||||
t.Errorf("%s renders identically in both languages — it is not localised", name)
|
||||
}
|
||||
if huSubject == enSubject && !strings.Contains(huSubject, "[Felhom] Információ") {
|
||||
t.Errorf("%s has the same subject in both languages: %q", name, huSubject)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// An unsupported or absent language renders Hungarian rather than a blank or a key.
|
||||
func TestUnknownLanguageRendersHungarian(t *testing.T) {
|
||||
want, wantBody := FormatCustomerEmail("hu", "c1", "backup_completed", "info", "", "", "")
|
||||
for _, lang := range []string{"", "de", "en-GB", " "} {
|
||||
got, gotBody := FormatCustomerEmail(lang, "c1", "backup_completed", "info", "", "", "")
|
||||
if got != want || gotBody != wantBody {
|
||||
t.Errorf("language %q did not fall back to Hungarian", lang)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package notify
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-hub/internal/i18n"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Mail goldens — the measurement localisation slice 3 rests on (R-558).
|
||||
//
|
||||
// Every customer-facing mail the hub can send is rendered here and compared against bytes captured
|
||||
// from the code as it stood BEFORE any string moved (felhom.eu 20aafc3dec20, hub v0.117.0). The
|
||||
// claim "the Hungarian mails are unchanged" is then a diff, not a reading.
|
||||
//
|
||||
// THE RULE THAT MAKES THEM WORTH HAVING: a golden is never regenerated to make a change pass. It is
|
||||
// regenerated only for a block that has been declared and measured, and the declaration says which
|
||||
// mail and why. Slice 2 on the controller earned that sentence twice.
|
||||
//
|
||||
// Regenerate deliberately: go test ./internal/notify/ -run TestCustomerMailGoldens -update-mail-goldens
|
||||
|
||||
var updateMailGoldens = flag.Bool("update-mail-goldens", false,
|
||||
"rewrite the captured mail goldens (deliberate, declared blocks only)")
|
||||
|
||||
// goldenClock is the instant every golden is stamped with. A fixed winter date, so the Budapest
|
||||
// offset in the operator mail's `MST` field is stable too (CET, not CEST).
|
||||
var goldenClock = time.Date(2026, 1, 15, 9, 30, 0, 0, time.UTC)
|
||||
|
||||
// mailCase is one rendered mail: a name for its golden file, and the call that produces it.
|
||||
type mailCase struct {
|
||||
name string
|
||||
render func() (string, string) // subject, body
|
||||
comment string
|
||||
}
|
||||
|
||||
// customerMailCases enumerates every customer mail the hub can produce.
|
||||
//
|
||||
// The event-type cases are generated FROM `customerMessages` itself rather than from a list retyped
|
||||
// here, so a new entry cannot be added without a golden appearing beside it — the list cannot drift
|
||||
// out of date the way a hand-maintained one does (R-423's lesson, other side).
|
||||
func customerMailCases(lang string) []mailCase {
|
||||
var cases []mailCase
|
||||
|
||||
keys := make([]string, 0, len(customerMessages))
|
||||
for k := range customerMessages {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
// 1. Every known event type, rendered with no box message and no details — the plain shape.
|
||||
for _, k := range keys {
|
||||
k := k
|
||||
cases = append(cases, mailCase{
|
||||
name: "customer_event_" + k,
|
||||
render: func() (string, string) { return FormatCustomerEmail(lang, "demo-fixture", k, "warning", "", "", "") },
|
||||
})
|
||||
}
|
||||
|
||||
// 2. The shapes that are NOT one per event type: the fallbacks and the optional lines.
|
||||
cases = append(cases,
|
||||
mailCase{
|
||||
name: "customer_shape_unknown_type_uses_box_message",
|
||||
comment: "an event type with no entry: the box's own Hungarian sentence IS the mail",
|
||||
render: func() (string, string) {
|
||||
return FormatCustomerEmail(lang, "demo-fixture", "disk_warning", "warning",
|
||||
"A /mnt/adat lemez 91%-ig megtelt (12,4 GB szabad).", "", "")
|
||||
},
|
||||
},
|
||||
mailCase{
|
||||
name: "customer_shape_box_message_beside_entry",
|
||||
comment: "a known type AND a box message: the entry is the headline, the message is a line",
|
||||
render: func() (string, string) {
|
||||
return FormatCustomerEmail(lang, "demo-fixture", "backup_failed", "error",
|
||||
"A cel nincs beallitva.", "", "")
|
||||
},
|
||||
},
|
||||
mailCase{
|
||||
name: "customer_shape_with_details",
|
||||
comment: "details render as the Megjegyzes line",
|
||||
render: func() (string, string) {
|
||||
return FormatCustomerEmail(lang, "demo-fixture", "app_deployed", "info", "", "", `{"app":"bentopdf"}`)
|
||||
},
|
||||
},
|
||||
mailCase{
|
||||
name: "customer_shape_empty_details_object_is_omitted",
|
||||
comment: "{} is not details",
|
||||
render: func() (string, string) {
|
||||
return FormatCustomerEmail(lang, "demo-fixture", "app_deployed", "info", "", "", "{}")
|
||||
},
|
||||
},
|
||||
mailCase{
|
||||
name: "customer_shape_unknown_severity_prints_raw",
|
||||
comment: "an unlabelled severity falls through to its own name",
|
||||
render: func() (string, string) {
|
||||
return FormatCustomerEmail(lang, "demo-fixture", "test", "verbose", "", "", "")
|
||||
},
|
||||
},
|
||||
)
|
||||
for _, sev := range []string{"info", "warning", "error", "critical"} {
|
||||
sev := sev
|
||||
cases = append(cases, mailCase{
|
||||
name: "customer_severity_" + sev,
|
||||
render: func() (string, string) { return FormatCustomerEmail(lang, "demo-fixture", "test", sev, "", "", "") },
|
||||
})
|
||||
}
|
||||
|
||||
// 3. The claim arc and the self-bind link — the mails sent before any box reports.
|
||||
for _, kind := range []string{"claim", "reset", "reenroll", "claimed"} {
|
||||
kind := kind
|
||||
cases = append(cases, mailCase{
|
||||
name: "claim_" + kind,
|
||||
render: func() (string, string) {
|
||||
return FormatClaimEmail(lang, kind, "demo-fixture", "fixture.example", "alma-korte-szilva")
|
||||
},
|
||||
})
|
||||
}
|
||||
cases = append(cases, mailCase{
|
||||
name: "selfbind",
|
||||
render: func() (string, string) {
|
||||
return FormatSelfBindEmail(lang, "demo-fixture", "https://hub.felhom.eu/bind/FIXTURETOKEN")
|
||||
},
|
||||
})
|
||||
|
||||
// 4. The OPERATOR mails. They are English and this slice does not touch them — which is exactly
|
||||
// why they are goldened: the claim "the operator's mail did not move" needs the same diff.
|
||||
cases = append(cases,
|
||||
mailCase{
|
||||
name: "operator_event_backup_failed",
|
||||
render: func() (string, string) {
|
||||
return FormatOperatorEmail("demo-fixture", "backup_failed", "error", "A mentes sikertelen.", "")
|
||||
},
|
||||
},
|
||||
mailCase{
|
||||
name: "operator_event_recovered",
|
||||
render: func() (string, string) { return FormatOperatorEmail("demo-fixture", "node_recovered", "info", "", "") },
|
||||
},
|
||||
mailCase{
|
||||
name: "operator_backup_run_failures_digest",
|
||||
comment: "the R-182 digest — operator-only, already English, never localised",
|
||||
render: func() (string, string) {
|
||||
return FormatOperatorEmail("demo-fixture", "backup_run_failures", "error", "3 app failed", `{
|
||||
"run_id":"r1","run_kind":"nightly","failed":2,"attempted":4,
|
||||
"target_path":"/mnt/backup","used_gb":81.5,"avail_gb":12.5,"total_gb":94.0,
|
||||
"used_percent":86.7,"space_known":true,
|
||||
"apps":[{"app":"bookstack","leg":"db","reason":"mysqldump exit 1 — /mnt/backup: 81.5/94.0 GB used (87%), 12.5 GB free"},
|
||||
{"app":"vaultwarden","leg":"volumes","reason":"no space left on device"}]}`)
|
||||
},
|
||||
},
|
||||
)
|
||||
return cases
|
||||
}
|
||||
|
||||
func goldenDir(lang string) string { return filepath.Join("testdata", "mail_goldens", lang) }
|
||||
|
||||
// renderGolden is the on-disk form: subject and body in one file, so a diff shows both.
|
||||
func renderGolden(c mailCase) string {
|
||||
subject, body := c.render()
|
||||
out := ""
|
||||
if c.comment != "" {
|
||||
out += "# " + c.comment + "\n"
|
||||
}
|
||||
return out + "SUBJECT: " + subject + "\n---\n" + body + "\n"
|
||||
}
|
||||
|
||||
func TestCustomerMailGoldens(t *testing.T) {
|
||||
old := nowFn
|
||||
nowFn = func() time.Time { return goldenClock }
|
||||
t.Cleanup(func() { nowFn = old })
|
||||
|
||||
for _, lang := range i18n.Supported {
|
||||
t.Run(lang, func(t *testing.T) { runMailGoldens(t, lang) })
|
||||
}
|
||||
}
|
||||
|
||||
// runMailGoldens renders every mail in one language and diffs it against that language's captured
|
||||
// bytes. Hungarian proves nothing moved; English proves what shipped is what was reviewed.
|
||||
func runMailGoldens(t *testing.T, lang string) {
|
||||
cases := customerMailCases(lang)
|
||||
if len(cases) < 50 {
|
||||
t.Fatalf("only %d mail cases enumerated — the table stopped covering the mails", len(cases))
|
||||
}
|
||||
|
||||
if *updateMailGoldens {
|
||||
if err := os.MkdirAll(goldenDir(lang), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, c := range cases {
|
||||
p := filepath.Join(goldenDir(lang), c.name+".txt")
|
||||
if err := os.WriteFile(p, []byte(renderGolden(c)), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
t.Logf("wrote %d %s mail goldens to %s", len(cases), lang, goldenDir(lang))
|
||||
return
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
t.Run(c.name, func(t *testing.T) {
|
||||
p := filepath.Join(goldenDir(lang), c.name+".txt")
|
||||
want, err := os.ReadFile(p)
|
||||
if err != nil {
|
||||
t.Fatalf("no golden for %s — capture it deliberately: %v", c.name, err)
|
||||
}
|
||||
got := renderGolden(c)
|
||||
if got != string(want) {
|
||||
t.Errorf("mail %s changed.\n--- golden ---\n%s\n--- now ---\n%s", c.name, want, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Every golden on disk belongs to a case: a file left behind after a mail is deleted would
|
||||
// otherwise sit there proving nothing about a mail that no longer exists.
|
||||
entries, err := os.ReadDir(goldenDir(lang))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
known := map[string]bool{}
|
||||
for _, c := range cases {
|
||||
known[c.name+".txt"] = true
|
||||
}
|
||||
for _, e := range entries {
|
||||
if !known[e.Name()] {
|
||||
t.Errorf("orphan golden %s — no case renders it", e.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,12 @@ func TestOperatorCooldown_NodeLivenessBypassesQuietHour(t *testing.T) {
|
||||
d := NewDispatcher(st, "test-key", "from@felhom.eu", "op@felhom.eu", true, log.New(io.Discard, "", 0))
|
||||
var mu sync.Mutex
|
||||
sent := 0
|
||||
d.sendEmailFn = func(string, string, string, map[string]string) error { mu.Lock(); defer mu.Unlock(); sent++; return nil }
|
||||
d.sendEmailFn = func(string, string, string, map[string]string) error {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
sent++
|
||||
return nil
|
||||
}
|
||||
count := func() int { mu.Lock(); defer mu.Unlock(); return sent }
|
||||
|
||||
// The previous node_stale mail went 39 minutes ago.
|
||||
|
||||
+111
-226
@@ -5,11 +5,21 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-hub/internal/i18n"
|
||||
)
|
||||
|
||||
// budapest timezone for formatting.
|
||||
var budapest *time.Location
|
||||
|
||||
// nowFn is the clock the mail bodies stamp themselves with. It exists so the golden tests can
|
||||
// render a mail that is byte-stable; production never replaces it.
|
||||
//
|
||||
// A mail body carries `time.Now()`, so without this seam every golden would differ from itself one
|
||||
// minute later and the parity measurement slice 3 rests on would be impossible to take. Replaced
|
||||
// only from tests, and restored by them.
|
||||
var nowFn = time.Now
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
budapest, err = time.LoadLocation("Europe/Budapest")
|
||||
@@ -35,7 +45,7 @@ func FormatOperatorEmail(customerID, eventType, severity, message, detailsJSON s
|
||||
|
||||
subject := fmt.Sprintf("[Felhom] %s %s: %s", icon, customerID, eventType)
|
||||
|
||||
now := time.Now().In(budapest).Format("2006-01-02 15:04 MST")
|
||||
now := nowFn().In(budapest).Format("2006-01-02 15:04 MST")
|
||||
body := fmt.Sprintf(`Customer: %s
|
||||
Event: %s
|
||||
Severity: %s
|
||||
@@ -67,144 +77,104 @@ Message: %s`, customerID, eventType, severity, now, message)
|
||||
// ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
// customerMessages maps event_type → Hungarian customer message.
|
||||
var customerMessages = map[string]string{
|
||||
// Customer-claim arc (v0.50.0)
|
||||
"claim_lockout": "Túl sok hibás beállító kód próbálkozás történt — a beállító oldal 15 percre zárolva lett. Ha nem te próbálkoztál, jelezd az üzemeltetőnek.",
|
||||
// Backup events
|
||||
"backup_completed": "A biztonsági mentés sikeresen elkészült.",
|
||||
"backup_failed": "A biztonsági mentés sikertelen! Kérjük, ellenőrizd a rendszert.",
|
||||
"db_dump_completed": "Az adatbázis mentés sikeresen elkészült.",
|
||||
"db_dump_failed": "Az adatbázis mentés sikertelen!",
|
||||
"backup_integrity_ok": "A mentés integritás ellenőrzés sikeres.",
|
||||
"backup_integrity_failed": "A mentés integritás ellenőrzés hibát talált!",
|
||||
"crossdrive_completed": "A másodlagos mentés sikeresen elkészült.",
|
||||
"crossdrive_failed": "A másodlagos mentés sikertelen!",
|
||||
// Offsite-repo continuity (controller v0.142.0)
|
||||
"offbox_repo_orphaned": "A távoli mentési tároló elárvult: a benne lévő mentések egy korábbi, már nem elérhető kulccsal készültek (jellemzően újratelepítés után). Új mentés a tároló visszaállításáig nem készül — nyisd meg a Távoli mentés oldalt.",
|
||||
"offbox_repo_reset": "A távoli mentési tároló visszaállítva: a régi előzmény félretéve (nem törölve), és egy üres, új tároló jött létre a mostani kulccsal.",
|
||||
// customerMessages maps event_type → the Hungarian customer message, DERIVED FROM THE BUNDLE.
|
||||
//
|
||||
// It was a hand-written literal until v0.118.0. The sentences now live in
|
||||
// internal/i18n/locales/hu.json under `mail.event.<event_type>`, because they need an English twin;
|
||||
// this map is rebuilt from them so a sentence is written in exactly ONE place. Everything that read
|
||||
// this map still reads it, and "a new event type must enter allowedEventTypes AND customerMessages
|
||||
// together" is unchanged in meaning — the entry is now a line in hu.json (and its English twin, or
|
||||
// the missing-key gate fails).
|
||||
//
|
||||
// WHAT AN ABSENT ENTRY MEANS, because it is deliberate for several types and has been misread once
|
||||
// already (asserted in a v0.78.0 comment, corrected in v0.79.0 / R-97c):
|
||||
//
|
||||
// - An absent entry does NOT block delivery. FormatCustomerEmail falls back to the sentence the
|
||||
// box sent, and the customer is mailed that.
|
||||
// - `disk_warning` / `disk_critical`, `offbox_enlarge_blocked` and `disk_health_degraded` have no
|
||||
// entry ON PURPOSE. Their producers send a DYNAMIC sentence naming the filesystem and its free
|
||||
// space, and the entry WINS over the message — so adding one would throw away the drive name and
|
||||
// the byte figures, leaving the customer a warning with nothing to act on. Pinned by
|
||||
// TestDiskFillTypesHaveNoGenericCustomerMessage and templates_offbox_test.go.
|
||||
// - Operator-tier types (`whole_guest_backup_failed`, `offsite_delivery_stuck`, the restore-test
|
||||
// pair) have no entry because they are listed in operatorOnlyEvents, which is what actually keeps
|
||||
// them off the customer channel. The absent entry is a consequence, not the mechanism.
|
||||
var customerMessages = bundleMessages("mail.event.")
|
||||
|
||||
// Disk events (GUEST — the controller's own view) — `disk_warning` / `disk_critical`.
|
||||
//
|
||||
// DELIBERATELY NO ENTRY, from hub v0.89.0 / controller v0.191.0 (R-167, decision D-c). These two
|
||||
// types were allowlisted here, carried generic Hungarian copy, sat in the controller's
|
||||
// DefaultEnabledEvents and had a UI checkbox — and NOTHING IN ANY REPO EMITTED THEM. A complete
|
||||
// customer pipeline with no producer; the sixth "built but never wired" instance in this project.
|
||||
// The controller became their producer in v0.191.0.
|
||||
//
|
||||
// The producer sends a DYNAMIC Hungarian message naming the filesystem and its free space, so a
|
||||
// static entry here would be actively harmful: FormatCustomerEmail PREFERS the entry over the
|
||||
// message, so re-adding one would discard the drive name and the byte figures and leave the
|
||||
// customer with "A lemezterület 90% felett van" — a warning with nothing to act on. Same reason
|
||||
// `offbox_enlarge_blocked` and `disk_health_degraded` have no entry. Pinned by
|
||||
// TestDiskFillTypesHaveNoGenericCustomerMessage.
|
||||
// severityLabels maps severity → the Hungarian label. Derived from the bundle, same reasoning.
|
||||
var severityLabels = bundleMessages("mail.severity.")
|
||||
|
||||
// Host disk events (the Proxmox HOST root filesystem — distinct from the guest disk above)
|
||||
"host_disk_warning": "A házszerver alaprendszerének (Proxmox-gazda) gyökérlemeze 90% felett van — kérjük, szabadíts fel helyet (pl. régi biztonsági mentések).",
|
||||
"host_disk_critical": "A házszerver alaprendszerének gyökérlemeze kritikusan tele van (95%+) — azonnali beavatkozás szükséges, különben a rendszer hibázhat!",
|
||||
|
||||
// Per-storage fill events (a SPECIFIC tároló — mentési kötet, adatmeghajtó, tároló-készlet — telik be)
|
||||
"storage_fill_warning": "Egy tároló a házszerveren 90% felett telt — kérjük, szabadíts fel helyet, mielőtt megtelik.",
|
||||
"storage_fill_critical": "Egy tároló a házszerveren kritikusan tele van (95%+) — a rá készülő mentések/írások meghiúsulhatnak; azonnali beavatkozás szükséges!",
|
||||
|
||||
// Storage events
|
||||
"storage_disconnected": "Egy meghajtó leválasztva — a mentések szünetelhetnek.",
|
||||
"storage_reconnected": "A meghajtó újra csatlakoztatva.",
|
||||
|
||||
// E-2 — the drive the whole-system backup is written to is gone. Deliberately NOT folded into
|
||||
// storage_disconnected: the customer action differs (reconnect THIS drive, or the system backup
|
||||
// stops surviving a disk failure), and the fallback is honest about what still protects them.
|
||||
"backup_target_absent": "A rendszermentés meghajtója nem érhető el — amíg vissza nem csatlakoztatod, a teljes rendszermentés nem készül el.",
|
||||
"backup_target_restored": "A rendszermentés meghajtója újra elérhető — a mentés folytatódik.",
|
||||
|
||||
// Staleness events (Hub-generated)
|
||||
"node_stale": "A szerver nem küldött jelentést az elmúlt időszakban.",
|
||||
"node_down": "A szerver nem elérhető!",
|
||||
"node_recovered": "A szerver újra elérhető.",
|
||||
"host_recovered": "A házszerver alaprendszere (Proxmox-gazda) újra elérhető.",
|
||||
|
||||
// Health events
|
||||
"health_degraded": "A rendszer állapota romlott.",
|
||||
"health_critical": "A rendszer állapota kritikus!",
|
||||
"health_recovered": "A rendszer állapota helyreállt.",
|
||||
|
||||
// Controller events
|
||||
"controller_started": "A vezérlő elindult.",
|
||||
"controller_updated": "A vezérlő frissítve lett.",
|
||||
|
||||
// Deadline events (Hub-generated)
|
||||
"expected_backup_missed": "A mai biztonsági mentés nem készült el a határidőig!",
|
||||
"expected_dbdump_missed": "A mai adatbázis mentés nem készült el a határidőig!",
|
||||
|
||||
// App lifecycle events
|
||||
"app_deployed": "Alkalmazás telepítve.",
|
||||
"app_removed": "Alkalmazás eltávolítva.",
|
||||
"app_start_failed": "Egy telepített alkalmazás nem fut — ellenőrizze a rendszermonitort.",
|
||||
// R-550 (v0.117.0): the box stopped while a restore was running.
|
||||
"restore_interrupted": "Egy visszaállítás megszakadt, mert a doboz újraindult. Indítsd el újra a vezérlőpult Visszaállítás oldalán.",
|
||||
// R-536 (controller v0.244.0): the pair that makes „telepítve" mean it. The started event is the
|
||||
// acceptance `app_deployed` used to assert beside the 202; the failed one is what an interrupted
|
||||
// install used to be — silence. A new type must enter allowedEventTypes AND this map together.
|
||||
"app_deploy_started": "Alkalmazás telepítése elindult.",
|
||||
"app_deploy_failed": "Egy alkalmazás telepítése nem fejeződött be.",
|
||||
|
||||
// Disaster recovery events
|
||||
"disaster_recovery_started": "Katasztrófa helyreállítás elindítva.",
|
||||
"disaster_recovery_completed": "Katasztrófa helyreállítás befejezve.",
|
||||
|
||||
// Test
|
||||
"test": "Ez egy teszt értesítés.",
|
||||
// bundleMessages rebuilds a legacy map from the Hungarian bundle: every key under prefix, with the
|
||||
// prefix stripped. Hungarian only — a caller that wants the household's language asks the bundle.
|
||||
func bundleMessages(prefix string) map[string]string {
|
||||
b := i18n.Shared()
|
||||
out := map[string]string{}
|
||||
for _, k := range b.Keys(i18n.Default) {
|
||||
if strings.HasPrefix(k, prefix) {
|
||||
out[strings.TrimPrefix(k, prefix)] = b.Msg(i18n.Default, k)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// severityLabels maps severity to Hungarian labels.
|
||||
var severityLabels = map[string]string{
|
||||
"info": "Információ",
|
||||
"warning": "Figyelmeztetés",
|
||||
"error": "Hiba",
|
||||
"critical": "Kritikus hiba",
|
||||
}
|
||||
// FormatCustomerEmail returns (subject, textBody) for the customer channel, written in lang.
|
||||
//
|
||||
// SLICE 3 (R-558). Two things arrive from the box and they are NOT interchangeable:
|
||||
//
|
||||
// - `message` is the box's own Hungarian sentence. It is what the operator reads, it is what is
|
||||
// written to notification_log, and it is what every hub before v0.118.0 put in this mail.
|
||||
// - `messageCustomer` is the SAME sentence in the household's language, sent beside it by
|
||||
// controller v0.256.0 and later. It is optional, forever: Peti's parked box will never send it,
|
||||
// and an absent one must leave this mail exactly as it was.
|
||||
//
|
||||
// The hub cannot translate a sentence the box composed, so this is the only way a dynamic line
|
||||
// (`the /mnt/adat disk is 91% full`) can reach an English household in English.
|
||||
//
|
||||
// `lang` governs only what the HOUSEHOLD reads. FormatOperatorEmail is untouched and still receives
|
||||
// `message`.
|
||||
func FormatCustomerEmail(lang, customerID, eventType, severity, message, messageCustomer, detailsJSON string) (string, string) {
|
||||
b := i18n.Shared()
|
||||
lang = i18n.Normalize(lang)
|
||||
|
||||
// FormatCustomerEmail returns (subject, textBody) for the customer channel.
|
||||
func FormatCustomerEmail(customerID, eventType, severity, message, detailsJSON string) (string, string) {
|
||||
label := severityLabels[severity]
|
||||
if label == "" {
|
||||
label = severity
|
||||
label := b.Msg(lang, "mail.severity."+severity)
|
||||
if !b.Has(i18n.Default, "mail.severity."+severity) {
|
||||
label = severity // an unlabelled severity prints its own name, as it always has
|
||||
}
|
||||
|
||||
// Use the per-event-type Hungarian message if available, otherwise fall back to message
|
||||
hunMessage := customerMessages[eventType]
|
||||
if hunMessage == "" {
|
||||
hunMessage = message
|
||||
// The box's sentence, in the household's language when the box sent one.
|
||||
boxMessage := message
|
||||
if messageCustomer != "" {
|
||||
boxMessage = messageCustomer
|
||||
}
|
||||
|
||||
subject := fmt.Sprintf("[Felhom] %s: %s", label, hunMessage)
|
||||
// The per-event-type message if this type has one, otherwise the box's own sentence.
|
||||
//
|
||||
// The ENTRY WINS over the message, and that is load-bearing rather than incidental: the types
|
||||
// that deliberately have no entry (disk_warning, disk_health_degraded, offbox_enlarge_blocked)
|
||||
// send a dynamic sentence naming the drive and the free space, and a generic entry would throw
|
||||
// exactly that away. Pinned by TestDiskFillTypesHaveNoGenericCustomerMessage.
|
||||
headline := ""
|
||||
if b.Has(i18n.Default, "mail.event."+eventType) {
|
||||
headline = b.Msg(lang, "mail.event."+eventType)
|
||||
}
|
||||
if headline == "" {
|
||||
headline = boxMessage
|
||||
}
|
||||
|
||||
now := time.Now().In(budapest).Format("2006-01-02 15:04")
|
||||
body := fmt.Sprintf(`Kedves Ügyfél!
|
||||
subject := b.Msgf(lang, "mail.customer.subject", label, headline)
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
now := nowFn().In(budapest).Format("2006-01-02 15:04")
|
||||
body := b.Msgf(lang, "mail.customer.body", headline, customerID, now, label, eventType)
|
||||
|
||||
%s
|
||||
|
||||
Részletek:
|
||||
- Szerver: %s
|
||||
- Időpont: %s
|
||||
- Szint: %s
|
||||
- Típus: %s`, hunMessage, customerID, now, label, eventType)
|
||||
|
||||
if message != "" && message != hunMessage {
|
||||
body += fmt.Sprintf("\n- Üzenet: %s", message)
|
||||
if boxMessage != "" && boxMessage != headline {
|
||||
body += b.Msgf(lang, "mail.customer.line.message", boxMessage)
|
||||
}
|
||||
|
||||
if detailsJSON != "" && detailsJSON != "{}" {
|
||||
body += fmt.Sprintf("\n- Megjegyzés: %s", detailsJSON)
|
||||
body += b.Msgf(lang, "mail.customer.line.note", detailsJSON)
|
||||
}
|
||||
|
||||
body += `
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring`
|
||||
body += b.Msg(lang, "mail.customer.signoff")
|
||||
|
||||
return subject, body
|
||||
}
|
||||
@@ -234,89 +204,25 @@ Felhom.eu monitoring`
|
||||
// capped and consumed exactly as before, and a reset code is still accepted on the setup page.
|
||||
// Pinned by TestFormatClaimEmail_OneNamePerSecret and, on the box side, by the controller's
|
||||
// claim_code_naming_test.go.
|
||||
func FormatClaimEmail(kind, customerID, domain, code string) (string, string) {
|
||||
func FormatClaimEmail(lang, kind, customerID, domain, code string) (string, string) {
|
||||
b := i18n.Shared()
|
||||
dashboardURL := "https://felhom." + domain
|
||||
|
||||
// An unknown kind is the "claim" mail, exactly as the switch's default always was.
|
||||
switch kind {
|
||||
case "reset":
|
||||
// The box HAS a password: the customer asked for a reset from the login screen, so the
|
||||
// „Elfelejtett jelszó" link IS on their screen and naming it is correct here.
|
||||
subject := "[Felhom] Beállító kód a jelszavad visszaállításához"
|
||||
body := fmt.Sprintf(`Kedves Ügyfél!
|
||||
|
||||
Jelszó-visszaállítást kértél a Felhom vezérlőpultodhoz.
|
||||
|
||||
Beállító kód: %s
|
||||
|
||||
A kód 72 óráig érvényes, és egyszer használható fel. Add meg a vezérlőpult
|
||||
"Elfelejtett jelszó" oldalán, majd válassz új jelszót:
|
||||
|
||||
%s
|
||||
|
||||
Ha nem te kérted, hagyd figyelmen kívül — a jelenlegi jelszavad változatlan.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu`, code, dashboardURL)
|
||||
return subject, body
|
||||
case "reenroll":
|
||||
// The box was rebuilt and has NO password, so it shows „A szerver beállítása" and serves no
|
||||
// login page — there is no „Elfelejtett jelszó" link to send anyone to. Same secret, same
|
||||
// name, the page the machine is actually showing.
|
||||
//
|
||||
// It deliberately says NOTHING about the apps or the backups. A clean-slate reinstall is
|
||||
// exactly the situation in which such a reassurance could be false, and this project has
|
||||
// spent four register rows removing promises it could not see were still true.
|
||||
subject := "[Felhom] Új beállító kód — újratelepült a szervered"
|
||||
body := fmt.Sprintf(`Kedves Ügyfél!
|
||||
|
||||
A Felhom szervered újratelepült, ezért a vezérlőpultod belépését újra be kell
|
||||
állítani. A korábbi jelszavad már nem érvényes.
|
||||
|
||||
Beállító kód: %s
|
||||
|
||||
A kód 72 óráig érvényes, és egyszer használható fel. Nyisd meg a vezérlőpultot —
|
||||
"A szerver beállítása" oldal fogad —, add meg a kódot, majd válassz új jelszót:
|
||||
|
||||
%s
|
||||
|
||||
Ha nem te telepítetted újra a szervered, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu`, code, dashboardURL)
|
||||
return subject, body
|
||||
case "claimed":
|
||||
subject := "[Felhom] A vezérlőpultod mostantól jelszóval védett"
|
||||
body := fmt.Sprintf(`Kedves Ügyfél!
|
||||
|
||||
A Felhom vezérlőpultod beállítása elkészült — a vezérlőpultod mostantól
|
||||
jelszóval védett. A megadott jelszóval tudsz bejelentkezni:
|
||||
|
||||
%s
|
||||
|
||||
Ha nem te végezted a beállítást, azonnal vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu`, dashboardURL)
|
||||
return subject, body
|
||||
default: // "claim"
|
||||
subject := "[Felhom] Elindult a Felhom szervered — beállító kód"
|
||||
body := fmt.Sprintf(`Kedves Ügyfél!
|
||||
|
||||
Elindult a Felhom szervered. A vezérlőpult első használatához add meg az
|
||||
alábbi beállító kódot, majd válassz saját jelszót:
|
||||
|
||||
Beállító kód: %s
|
||||
|
||||
A kód 72 óráig érvényes, és egyszer használható fel. A vezérlőpultot itt éred el:
|
||||
|
||||
%s
|
||||
|
||||
Ha nem kaptad volna meg időben, a vezérlőpult "Új kód kérése" gombjával
|
||||
kérhetsz frisset — az mindig erre az e-mail címre érkezik.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu`, code, dashboardURL)
|
||||
return subject, body
|
||||
case "reset", "reenroll", "claimed":
|
||||
default:
|
||||
kind = "claim"
|
||||
}
|
||||
|
||||
subject := b.Msg(lang, "mail.claim."+kind+".subject")
|
||||
|
||||
// "claimed" is the one branch that carries no code — it confirms a claim that already happened,
|
||||
// and putting a live secret in a mail that needs none would be a step backwards.
|
||||
if kind == "claimed" {
|
||||
return subject, b.Msgf(lang, "mail.claim.claimed.body", dashboardURL)
|
||||
}
|
||||
return subject, b.Msgf(lang, "mail.claim."+kind+".body", code, dashboardURL)
|
||||
}
|
||||
|
||||
// FormatSelfBindEmail builds the customer-facing Hungarian email carrying the self-bind capability
|
||||
@@ -341,30 +247,9 @@ Felhom.eu`, code, dashboardURL)
|
||||
//
|
||||
// Naming only: no acceptance logic moved, and the same phrase is still accepted. Pinned by
|
||||
// TestSelfBind_ThirdSecretNaming and TestSelfBindPassphrase_StillAcceptedAfterTheRename.
|
||||
func FormatSelfBindEmail(customerID, link string) (string, string) {
|
||||
subject := "[Felhom] Kösd össze a Felhom dobozodat"
|
||||
body := fmt.Sprintf(`Kedves Ügyfél!
|
||||
|
||||
Elkészült a Felhom dobozod, és készen áll az összekötésre. Az alábbi hivatkozáson
|
||||
tudod te magad összekötni a fiókoddal — nincs szükség bejelentkezésre:
|
||||
|
||||
%s
|
||||
|
||||
A hivatkozás megnyitása után két adatot kell megadnod:
|
||||
|
||||
1. A párosító kódot, amely a doboz képernyőjén (a monitoron) látható.
|
||||
2. A tulajdonosi jelmondatodat (az 5 szóból álló kifejezést), amelyet a
|
||||
Felhom üzemeltetőjétől kaptál — személyesen vagy telefonon, e-mailben
|
||||
soha. Ez igazolja, hogy a fiók a tiéd.
|
||||
|
||||
A hivatkozás 7 napig érvényes. Biztonsági okból 5 sikertelen próbálkozás után
|
||||
zárolódik — ilyenkor vedd fel a kapcsolatot az ügyfélszolgálattal.
|
||||
|
||||
Ha nem te kérted ezt, hagyd figyelmen kívül ezt az e-mailt.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu`, link)
|
||||
return subject, body
|
||||
func FormatSelfBindEmail(lang, customerID, link string) (string, string) {
|
||||
b := i18n.Shared()
|
||||
return b.Msg(lang, "mail.selfbind.subject"), b.Msgf(lang, "mail.selfbind.body", link)
|
||||
}
|
||||
|
||||
// ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -3,6 +3,8 @@ package notify
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-hub/internal/i18n"
|
||||
)
|
||||
|
||||
// TestFormatCustomerEmail_OffboxEnlargeBlockedRawMessageSurvives locks in the deliberate non-change
|
||||
@@ -19,7 +21,7 @@ func TestFormatCustomerEmail_OffboxEnlargeBlockedRawMessageSurvives(t *testing.T
|
||||
t.Fatal("offbox_enlarge_blocked must have NO customerMessages entry (it would discard the dynamic numbers)")
|
||||
}
|
||||
|
||||
subject, body := FormatCustomerEmail("c1", "offbox_enlarge_blocked", "warning", raw, "")
|
||||
subject, body := FormatCustomerEmail(i18n.Default, "c1", "offbox_enlarge_blocked", "warning", raw, "", "")
|
||||
for _, want := range []string{"~42.0 GB", "20/50 GB"} {
|
||||
if !strings.Contains(body, want) {
|
||||
t.Errorf("email body must carry the dynamic figure %q (raw message survived): %s", want, body)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
SUBJECT: [Felhom] Your Felhom server is up — setup code
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom server is up. To use the dashboard for the first time, enter the
|
||||
setup code below, then choose your own password:
|
||||
|
||||
Setup code: alma-korte-szilva
|
||||
|
||||
The code is valid for 72 hours and can be used once. You can reach the
|
||||
dashboard here:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
If it did not reach you in time, the dashboard's "Request a new code" button
|
||||
gets you a fresh one — it always arrives at this e-mail address.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,13 @@
|
||||
SUBJECT: [Felhom] Your dashboard is now password protected
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
The setup of your Felhom dashboard is complete — your dashboard is now
|
||||
password protected. You can sign in with the password you chose:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
If you did not do this setup, contact your operator immediately.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,19 @@
|
||||
SUBJECT: [Felhom] New setup code — your server was reinstalled
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom server was reinstalled, so the sign-in to your dashboard has to be
|
||||
set up again. Your earlier password is no longer valid.
|
||||
|
||||
Setup code: alma-korte-szilva
|
||||
|
||||
The code is valid for 72 hours and can be used once. Open your dashboard — the
|
||||
"Set up the server" page will greet you — enter the code, then choose a new
|
||||
password:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
If you did not reinstall your server, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,17 @@
|
||||
SUBJECT: [Felhom] Setup code to reset your password
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
You asked to reset the password for your Felhom dashboard.
|
||||
|
||||
Setup code: alma-korte-szilva
|
||||
|
||||
The code is valid for 72 hours and can be used once. Enter it on the
|
||||
"Forgotten password" page of your dashboard, then choose a new password:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
If you did not ask for this, ignore it — your current password is unchanged.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: An app did not finish installing.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An app did not finish installing.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: app_deploy_failed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: An app has started installing.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An app has started installing.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: app_deploy_started
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: An app was installed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An app was installed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: app_deployed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: An app was removed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An app was removed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: app_removed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: An installed app is not running — check the system monitor.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An installed app is not running — check the system monitor.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: app_start_failed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The backup finished successfully.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The backup finished successfully.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: backup_completed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The backup failed. Check your system.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The backup failed. Check your system.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: backup_failed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The backup integrity check found a problem.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The backup integrity check found a problem.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: backup_integrity_failed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The backup integrity check passed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The backup integrity check passed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: backup_integrity_ok
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The drive your whole-system backup is written to is not available. Until you reconnect it, no whole-system backup is made.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The drive your whole-system backup is written to is not available. Until you reconnect it, no whole-system backup is made.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: backup_target_absent
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The drive your whole-system backup is written to is available again — backups continue.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The drive your whole-system backup is written to is available again — backups continue.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: backup_target_restored
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Too many wrong setup codes were entered — the setup page is locked for 15 minutes. If that was not you, tell your operator.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Too many wrong setup codes were entered — the setup page is locked for 15 minutes. If that was not you, tell your operator.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: claim_lockout
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The controller has started.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The controller has started.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: controller_started
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The controller has been updated.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The controller has been updated.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: controller_updated
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The second copy of your backup finished successfully.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The second copy of your backup finished successfully.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: crossdrive_completed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The second copy of your backup failed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The second copy of your backup failed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: crossdrive_failed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The database backup finished successfully.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The database backup finished successfully.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: db_dump_completed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The database backup failed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The database backup failed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: db_dump_failed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Disaster recovery has finished.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Disaster recovery has finished.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: disaster_recovery_completed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Disaster recovery has started.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Disaster recovery has started.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: disaster_recovery_started
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Today's backup did not finish by its deadline.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Today's backup did not finish by its deadline.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: expected_backup_missed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Today's database backup did not finish by its deadline.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Today's database backup did not finish by its deadline.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: expected_dbdump_missed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your system's health is critical.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your system's health is critical.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: health_critical
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your system's health has got worse.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your system's health has got worse.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: health_degraded
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your system's health is back to normal.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your system's health is back to normal.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: health_recovered
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The main disk of your home server's base system is critically full (95%+). Act now, or the system may start to fail.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The main disk of your home server's base system is critically full (95%+). Act now, or the system may start to fail.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: host_disk_critical
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The main disk of your home server's base system (the Proxmox host) is over 90% full — free up some space (old backups, for example).
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The main disk of your home server's base system (the Proxmox host) is over 90% full — free up some space (old backups, for example).
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: host_disk_warning
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your home server's base system (the Proxmox host) can be reached again.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your home server's base system (the Proxmox host) can be reached again.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: host_recovered
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your server cannot be reached.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your server cannot be reached.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: node_down
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your server can be reached again.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your server can be reached again.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: node_recovered
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: Your server has not sent a report recently.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
Your server has not sent a report recently.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: node_stale
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The remote backup store is orphaned: the backups inside it were made with an earlier key that is no longer available (usually after a reinstall). No new backup is made until the store is reset — open the Remote backup page.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The remote backup store is orphaned: the backups inside it were made with an earlier key that is no longer available (usually after a reinstall). No new backup is made until the store is reset — open the Remote backup page.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: offbox_repo_orphaned
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The remote backup store has been reset: the old history was set aside (not deleted), and an empty new store was created with the current key.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The remote backup store has been reset: the old history was set aside (not deleted), and an empty new store was created with the current key.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: offbox_repo_reset
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: A restore was interrupted because the box restarted. Start it again on the Restore page of your dashboard.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
A restore was interrupted because the box restarted. Start it again on the Restore page of your dashboard.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: restore_interrupted
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: A drive was disconnected — backups may pause.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
A drive was disconnected — backups may pause.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: storage_disconnected
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: A drive on your home server is critically full (95%+). Backups and writes to it may fail. Act now.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
A drive on your home server is critically full (95%+). Backups and writes to it may fail. Act now.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: storage_fill_critical
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: A drive on your home server is over 90% full — free up some space before it fills.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
A drive on your home server is over 90% full — free up some space before it fills.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: storage_fill_warning
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: The drive is connected again.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The drive is connected again.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: storage_reconnected
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: This is a test notification.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
This is a test notification.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: test
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Critical error: This is a test notification.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
This is a test notification.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Critical error
|
||||
- Type: test
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Error: This is a test notification.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
This is a test notification.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Error
|
||||
- Type: test
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Information: This is a test notification.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
This is a test notification.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Information
|
||||
- Type: test
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Warning: This is a test notification.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
This is a test notification.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: test
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
# a known type AND a box message: the entry is the headline, the message is a line
|
||||
SUBJECT: [Felhom] Error: The backup failed. Check your system.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
The backup failed. Check your system.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Error
|
||||
- Type: backup_failed
|
||||
- Message: A cel nincs beallitva.
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
# {} is not details
|
||||
SUBJECT: [Felhom] Information: An app was installed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An app was installed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Information
|
||||
- Type: app_deployed
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
# an unlabelled severity falls through to its own name
|
||||
SUBJECT: [Felhom] verbose: This is a test notification.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
This is a test notification.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: verbose
|
||||
- Type: test
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
# an event type with no entry: the box's own Hungarian sentence IS the mail
|
||||
SUBJECT: [Felhom] Warning: A /mnt/adat lemez 91%-ig megtelt (12,4 GB szabad).
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
A /mnt/adat lemez 91%-ig megtelt (12,4 GB szabad).
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Warning
|
||||
- Type: disk_warning
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,20 @@
|
||||
# details render as the Megjegyzes line
|
||||
SUBJECT: [Felhom] Information: An app was installed.
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom system sent the following notification:
|
||||
|
||||
An app was installed.
|
||||
|
||||
Details:
|
||||
- Server: demo-fixture
|
||||
- Time: 2026-01-15 10:30
|
||||
- Level: Information
|
||||
- Type: app_deployed
|
||||
- Note: {"app":"bentopdf"}
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu monitoring
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
# the R-182 digest — operator-only, already English, never localised
|
||||
SUBJECT: [Felhom] 🔴 demo-fixture: 2 of 4 apps failed to back up (nightly run)
|
||||
---
|
||||
Customer: demo-fixture
|
||||
Event: backup_run_failures
|
||||
Severity: error
|
||||
Time: 2026-01-15 10:30 CET
|
||||
Message: 3 app failed
|
||||
|
||||
FAILED: 2 of 4 apps attempted in this nightly run.
|
||||
|
||||
bookstack db mysqldump exit 1
|
||||
vaultwarden volumes no space left on device
|
||||
|
||||
Filesystem: /mnt/backup — 81.5/94.0 GB used (87%), 12.5 GB free
|
||||
|
||||
Every failure above is also recorded individually in the notification log,
|
||||
whether or not this mail was sent.
|
||||
|
||||
Dashboard: https://hub.felhom.eu/customers/demo-fixture
|
||||
@@ -0,0 +1,9 @@
|
||||
SUBJECT: [Felhom] 🔴 demo-fixture: backup_failed
|
||||
---
|
||||
Customer: demo-fixture
|
||||
Event: backup_failed
|
||||
Severity: error
|
||||
Time: 2026-01-15 10:30 CET
|
||||
Message: A mentes sikertelen.
|
||||
|
||||
Dashboard: https://hub.felhom.eu/customers/demo-fixture
|
||||
@@ -0,0 +1,9 @@
|
||||
SUBJECT: [Felhom] ✅ demo-fixture: node_recovered
|
||||
---
|
||||
Customer: demo-fixture
|
||||
Event: node_recovered
|
||||
Severity: info
|
||||
Time: 2026-01-15 10:30 CET
|
||||
Message:
|
||||
|
||||
Dashboard: https://hub.felhom.eu/customers/demo-fixture
|
||||
@@ -0,0 +1,23 @@
|
||||
SUBJECT: [Felhom] Link your Felhom box to your account
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
Your Felhom box is ready and waiting to be linked. You can link it to your
|
||||
account yourself using the link below — no sign-in needed:
|
||||
|
||||
https://hub.felhom.eu/bind/FIXTURETOKEN
|
||||
|
||||
After you open the link you will need to enter two things:
|
||||
|
||||
1. The pairing code, shown on the box's own screen (the monitor).
|
||||
2. Your owner passphrase (the 5-word phrase) that you received from your
|
||||
Felhom operator — in person or by telephone, never by e-mail. It proves
|
||||
the account is yours.
|
||||
|
||||
The link is valid for 7 days. For safety it locks after 5 failed attempts —
|
||||
if that happens, contact support.
|
||||
|
||||
If you did not ask for this, ignore this e-mail.
|
||||
|
||||
Best regards,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Elindult a Felhom szervered — beállító kód
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
Elindult a Felhom szervered. A vezérlőpult első használatához add meg az
|
||||
alábbi beállító kódot, majd válassz saját jelszót:
|
||||
|
||||
Beállító kód: alma-korte-szilva
|
||||
|
||||
A kód 72 óráig érvényes, és egyszer használható fel. A vezérlőpultot itt éred el:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
Ha nem kaptad volna meg időben, a vezérlőpult "Új kód kérése" gombjával
|
||||
kérhetsz frisset — az mindig erre az e-mail címre érkezik.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,13 @@
|
||||
SUBJECT: [Felhom] A vezérlőpultod mostantól jelszóval védett
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom vezérlőpultod beállítása elkészült — a vezérlőpultod mostantól
|
||||
jelszóval védett. A megadott jelszóval tudsz bejelentkezni:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
Ha nem te végezted a beállítást, azonnal vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Új beállító kód — újratelepült a szervered
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom szervered újratelepült, ezért a vezérlőpultod belépését újra be kell
|
||||
állítani. A korábbi jelszavad már nem érvényes.
|
||||
|
||||
Beállító kód: alma-korte-szilva
|
||||
|
||||
A kód 72 óráig érvényes, és egyszer használható fel. Nyisd meg a vezérlőpultot —
|
||||
"A szerver beállítása" oldal fogad —, add meg a kódot, majd válassz új jelszót:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
Ha nem te telepítetted újra a szervered, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu
|
||||
@@ -0,0 +1,17 @@
|
||||
SUBJECT: [Felhom] Beállító kód a jelszavad visszaállításához
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
Jelszó-visszaállítást kértél a Felhom vezérlőpultodhoz.
|
||||
|
||||
Beállító kód: alma-korte-szilva
|
||||
|
||||
A kód 72 óráig érvényes, és egyszer használható fel. Add meg a vezérlőpult
|
||||
"Elfelejtett jelszó" oldalán, majd válassz új jelszót:
|
||||
|
||||
https://felhom.fixture.example
|
||||
|
||||
Ha nem te kérted, hagyd figyelmen kívül — a jelenlegi jelszavad változatlan.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Egy alkalmazás telepítése nem fejeződött be.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Egy alkalmazás telepítése nem fejeződött be.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: app_deploy_failed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Alkalmazás telepítése elindult.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Alkalmazás telepítése elindult.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: app_deploy_started
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Alkalmazás telepítve.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Alkalmazás telepítve.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: app_deployed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Alkalmazás eltávolítva.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Alkalmazás eltávolítva.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: app_removed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Egy telepített alkalmazás nem fut — ellenőrizze a rendszermonitort.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Egy telepített alkalmazás nem fut — ellenőrizze a rendszermonitort.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: app_start_failed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A biztonsági mentés sikeresen elkészült.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A biztonsági mentés sikeresen elkészült.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: backup_completed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A biztonsági mentés sikertelen! Kérjük, ellenőrizd a rendszert.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A biztonsági mentés sikertelen! Kérjük, ellenőrizd a rendszert.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: backup_failed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A mentés integritás ellenőrzés hibát talált!
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A mentés integritás ellenőrzés hibát talált!
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: backup_integrity_failed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A mentés integritás ellenőrzés sikeres.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A mentés integritás ellenőrzés sikeres.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: backup_integrity_ok
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A rendszermentés meghajtója nem érhető el — amíg vissza nem csatlakoztatod, a teljes rendszermentés nem készül el.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A rendszermentés meghajtója nem érhető el — amíg vissza nem csatlakoztatod, a teljes rendszermentés nem készül el.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: backup_target_absent
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A rendszermentés meghajtója újra elérhető — a mentés folytatódik.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A rendszermentés meghajtója újra elérhető — a mentés folytatódik.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: backup_target_restored
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Túl sok hibás beállító kód próbálkozás történt — a beállító oldal 15 percre zárolva lett. Ha nem te próbálkoztál, jelezd az üzemeltetőnek.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Túl sok hibás beállító kód próbálkozás történt — a beállító oldal 15 percre zárolva lett. Ha nem te próbálkoztál, jelezd az üzemeltetőnek.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: claim_lockout
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A vezérlő elindult.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A vezérlő elindult.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: controller_started
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A vezérlő frissítve lett.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A vezérlő frissítve lett.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: controller_updated
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A másodlagos mentés sikeresen elkészült.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A másodlagos mentés sikeresen elkészült.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: crossdrive_completed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A másodlagos mentés sikertelen!
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A másodlagos mentés sikertelen!
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: crossdrive_failed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Az adatbázis mentés sikeresen elkészült.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Az adatbázis mentés sikeresen elkészült.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: db_dump_completed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Az adatbázis mentés sikertelen!
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Az adatbázis mentés sikertelen!
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: db_dump_failed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Katasztrófa helyreállítás befejezve.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Katasztrófa helyreállítás befejezve.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: disaster_recovery_completed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: Katasztrófa helyreállítás elindítva.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
Katasztrófa helyreállítás elindítva.
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: disaster_recovery_started
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A mai biztonsági mentés nem készült el a határidőig!
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A mai biztonsági mentés nem készült el a határidőig!
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: expected_backup_missed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A mai adatbázis mentés nem készült el a határidőig!
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A mai adatbázis mentés nem készült el a határidőig!
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: expected_dbdump_missed
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
SUBJECT: [Felhom] Figyelmeztetés: A rendszer állapota kritikus!
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
A Felhom rendszered a következő értesítést küldte:
|
||||
|
||||
A rendszer állapota kritikus!
|
||||
|
||||
Részletek:
|
||||
- Szerver: demo-fixture
|
||||
- Időpont: 2026-01-15 10:30
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: health_critical
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
Felhom.eu monitoring
|
||||
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user