Settings down to eight tabs; Domains become a tab of DNS
Notifications gains Alert tickets, Display gains Badge colours, and a new Data tab holds Backup, Logs and Cache. Domains is the 'Domain names' tab of DNS. Old addresses redirect; the docs, the Privacy page and the links from alerts and the agenda name the new places. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1432b148e9
commit
ddd0aa622a
23 files changed
+153
-65
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Finishes a restore that was staged from Settings → Backup. It has to happen before the database is opened, which is why it is a module
|
||||
* Finishes a restore that was staged from Settings → Data → Backup. It has to happen before the database is opened, which is why it is a module
|
||||
* of its own that index.ts imports first: by the time anything else loads, the file is already the one that was chosen.
|
||||
*
|
||||
* Nothing is deleted. The database that was in use is moved into the backups folder (as "…-pre-restore.sqlite") before the chosen one is put
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import "./loadEnv.js";
|
||||
// Before anything opens the database: puts a restore that was staged from Settings → Backup in place.
|
||||
// Before anything opens the database: puts a restore that was staged from Settings → Data → Backup in place.
|
||||
import "./db/applyRestore.js";
|
||||
import { env, warnIfAuthNotConfigured, checkSessionSecret } from "./env.js";
|
||||
import { createApp } from "./app.js";
|
||||
|
||||
@@ -85,7 +85,7 @@ export const INTEGRATION_FIELDS: Partial<Record<IntegrationType, IntegrationFiel
|
||||
optional: true,
|
||||
placeholder: "ost_ (osTicket's default, unless changed at install)",
|
||||
},
|
||||
// Only for opening tickets from alerts (Settings → Alert tickets). The rest of this integration reads the database and never writes.
|
||||
// Only for opening tickets from alerts (Settings → Notifications → Alert tickets). The rest of this integration reads the database and never writes.
|
||||
{
|
||||
key: "apiUrl",
|
||||
label: "Ticket API address (optional)",
|
||||
|
||||
@@ -192,7 +192,7 @@ export function agendaFromData(data: AgendaData, now: Date, tz: string, days: nu
|
||||
const certificate = s.type === "ssl_certificate";
|
||||
day(`secret:${s.id}`, certificate ? "certificate" : "secret", s.expiryDate, (past) => ({ title: `${certificate ? "Certificate" : "Secret"} “${s.name}” ${past ? "expired" : "expires"}`, detail: certificate ? "kept as a secret" : null, link: "/secrets" }));
|
||||
}
|
||||
for (const d of data.domains) day(`domain:${d.id}`, "domain", d.expiresAt, (past) => ({ title: `Domain ${d.name} ${past ? "expired" : "expires"}`, link: "/domains" }));
|
||||
for (const d of data.domains) day(`domain:${d.id}`, "domain", d.expiresAt, (past) => ({ title: `Domain ${d.name} ${past ? "expired" : "expires"}`, link: "/dns?view=domains" }));
|
||||
for (const e of data.endpoints) {
|
||||
if (!e.enabled || !e.certExpiresAt) continue;
|
||||
day(`endpoint-cert:${e.id}`, "certificate", e.certExpiresAt.slice(0, 10), (past) => ({ title: `The certificate for ${e.name} ${past ? "expired" : "expires"}`, detail: "seen by an endpoint check", link: "/endpoints", serverId: e.serverId }));
|
||||
|
||||
@@ -359,7 +359,7 @@ export async function sendTestTicket(actor: CurrentUser): Promise<CreatedTicket>
|
||||
topicId: settings.topicId,
|
||||
priorityId: settings.priorityId,
|
||||
subject: "[Homelab] Test ticket from Homelab Manager",
|
||||
message: `This is a test. ${actor.name ?? actor.email ?? "An administrator"} asked Homelab Manager to open it from Settings → Alert tickets, to check that tickets can be created here.\n\nNothing is wrong. You can close this ticket.\n\n${absolute("/settings/alert-tickets")}`,
|
||||
message: `This is a test. ${actor.name ?? actor.email ?? "An administrator"} asked Homelab Manager to open it from Settings → Notifications → Alert tickets, to check that tickets can be created here.\n\nNothing is wrong. You can close this ticket.\n\n${absolute("/settings/alert-tickets")}`,
|
||||
});
|
||||
await recordAudit({ actor, category: "alert_ticket", action: "test", targetType: "integration", targetId: settings.integrationId ?? undefined, detail: { ticket: created.number } });
|
||||
return created;
|
||||
|
||||
@@ -59,12 +59,12 @@ const SOURCES: Record<string, { label: string; link: string }> = {
|
||||
gitea: { label: "Gitea", link: "/gitea" },
|
||||
dockhand: { label: "Docker", link: "/docker" },
|
||||
tailscale: { label: "Tailscale", link: "/tailscale" },
|
||||
homelab: { label: "Homelab Manager", link: "/settings/backup" },
|
||||
homelab: { label: "Homelab Manager", link: "/settings/data" },
|
||||
pbs: { label: "Proxmox Backup", link: "/pbs" },
|
||||
uptimekuma: { label: "Uptime Kuma", link: "/uptime-kuma" },
|
||||
osticket: { label: "osTicket", link: "/osticket" },
|
||||
secrets: { label: "Secrets", link: "/secrets" },
|
||||
domains: { label: "Domains", link: "/domains" },
|
||||
domains: { label: "Domains", link: "/dns?view=domains" },
|
||||
endpoint: { label: "Endpoint", link: "/endpoints" },
|
||||
heartbeat: { label: "Heartbeat", link: "/heartbeats" },
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Backups of Homelab Manager itself. Everything it knows is one SQLite file, so a backup is a consistent copy of that file (`VACUUM INTO`,
|
||||
* which is safe while the app is working) kept in the data folder's `backups/`: taken every day, the newest few kept, each one checked as
|
||||
* it is made, and downloadable, uploadable and restorable from Settings → Backup.
|
||||
* it is made, and downloadable, uploadable and restorable from Settings → Data → Backup.
|
||||
*
|
||||
* What a backup is not: it does not hold `CREDENTIALS_ENCRYPTION_KEY`, which decrypts the credentials stored in it, and it isn't off the
|
||||
* machine until someone copies it there. Both are said where backups are shown.
|
||||
|
||||
@@ -180,7 +180,7 @@ export interface NameGeneratorSettings {
|
||||
|
||||
export type AlertTicketSeverity = "critical" | "warning" | "info";
|
||||
|
||||
/** Opening an osTicket ticket for an alert. Off until an admin sets it up under Settings → Alert tickets. */
|
||||
/** Opening an osTicket ticket for an alert. Off until an admin sets it up under Settings → Notifications → Alert tickets. */
|
||||
export interface AlertTicketSettings {
|
||||
enabled: boolean;
|
||||
/** The osTicket integration whose API (address and key) is used. */
|
||||
|
||||
@@ -420,7 +420,7 @@ describe("how current the backups are, in the alerts and /metrics", () => {
|
||||
assert.equal(stale!.severity, "warning");
|
||||
assert.match(stale!.message, /60 h old/);
|
||||
assert.equal(stale!.source, "Homelab Manager");
|
||||
assert.equal(stale!.link, "/settings/backup");
|
||||
assert.equal(stale!.link, "/settings/data");
|
||||
await oneAged(24 * 8);
|
||||
assert.equal((await selfAlert())!.severity, "critical");
|
||||
assert.match((await selfAlert())!.message, /8 days old/);
|
||||
|
||||
Reference in new issue
Block a user