Add Last Update widget to Homepage via record-update script
record-update parses nvd diff after switch and writes latest.json; Homepage polls a local-only nginx listener and renders date/changes/ closure/kernel via a customapi widget. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
916c1d1c2d
commit
f57c6e99ec
5 changed files with 76 additions and 1 deletions
|
|
@ -65,6 +65,7 @@ in
|
|||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/homepage-custom-css 0755 fred users -"
|
||||
"f /var/lib/homepage-custom-css/custom.css 0644 fred users -"
|
||||
"d /var/lib/homepage-updates 0755 fred users -"
|
||||
];
|
||||
|
||||
systemd.services.homepage-dashboard.serviceConfig.BindPaths = [
|
||||
|
|
@ -257,6 +258,25 @@ in
|
|||
icon = "go2rtc.png";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Last Update" = {
|
||||
description = "Most recent nixos-rebuild switch";
|
||||
icon = "mdi-history";
|
||||
widget = {
|
||||
type = "customapi";
|
||||
url = "http://127.0.0.1:8083/latest.json";
|
||||
refreshInterval = 60000;
|
||||
method = "GET";
|
||||
display = "list";
|
||||
mappings = [
|
||||
{ field = "date"; label = "Date"; }
|
||||
{ field = "changes"; label = "Changes"; }
|
||||
{ field = "closure"; label = "Closure"; }
|
||||
{ field = "kernel"; label = "Kernel"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -107,6 +107,16 @@ in
|
|||
# --- Protected by Authelia ---
|
||||
"camera.nordhammer.it" = protectedProxy 1984;
|
||||
"homepage.nordhammer.it" = protectedProxy 8082;
|
||||
|
||||
# --- Local-only: serves update history JSON to Homepage's customapi widget ---
|
||||
"homepage-updates.local" = {
|
||||
listen = [ { addr = "127.0.0.1"; port = 8083; } ];
|
||||
locations."/".root = "/var/lib/homepage-updates";
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue