Add OpsProof public portfolio demo
Homelab Main / validate (push) Failing after 2m40s Details
Homelab Main / running-update (push) Has been skipped Details
Homelab Main / debian-ops (push) Has been skipped Details

This commit is contained in:
juvenal.diaz 2026-12-04 16:29:58 -06:00
parent 778fb69038
commit 2927b05f3f
17 changed files with 232 additions and 7 deletions

View File

@ -120,6 +120,14 @@
<td><a href="https://feeds.lab2025.duckdns.org/">https://feeds.lab2025.duckdns.org/</a></td>
<td><code>infra/miniflux/README.md</code></td>
</tr>
<tr>
<td>OpsProof public demo</td>
<td>debian (control-plane, 192.168.100.73)</td>
<td>systemd / jeannie deploy-opsproof</td>
<td><a href="http://192.168.100.73:8891/">http://192.168.100.73:8891/</a></td>
<td><a href="https://opsproof.lab2025.duckdns.org/">https://opsproof.lab2025.duckdns.org/</a></td>
<td><code>apps/opsproof/README.md</code></td>
</tr>
<tr>
<td>GitOps mirror</td>
<td>debian (control-plane, 192.168.100.73)</td>

View File

@ -94,6 +94,12 @@ diagnostic, Five Whys, mitigation, validation, and recommendation sections.
Failed or incomplete validation is recorded explicitly instead of being shown
as a successful repair.
`/demo` is an unauthenticated portfolio surface backed only by a compiled,
sanitized fixture. It does not construct a Jeannie client and has no approval
or execution controls. The OCI edge exposes only `/demo` and immutable build
assets at `https://opsproof.lab2025.duckdns.org/`; all operator routes remain
unpublished there.
## Security boundary
OpsProof is not a shell console.
@ -123,7 +129,7 @@ Each slice should be a small, independently testable commit:
6. Dex login and operator authorization (implemented);
7. approval-gated execution and live progress (implemented);
8. post-change validation and incident report (implemented);
9. sanitized public demo mode and portfolio link.
9. sanitized public demo mode and portfolio link (implemented).
## Initial demonstration

View File

@ -0,0 +1,25 @@
package demo
import (
"go.laravel.com/inertia"
"go.laravel.com/web"
)
func Show(*web.Request) *web.Response {
return inertia.Render("Demo", inertia.Props{
"demo": inertia.Props{
"scope": "cluster", "target": "example-api", "outcome": "validated",
"finding": "A disposable application repeatedly restarted after a configuration rollout.",
"diagnostic": "Focused evidence linked the restarts to one invalid application setting; node and storage checks remained healthy.",
"proposal": "Run the constrained Jeannie Doctor repair for the affected application.",
"rollback": "Restore the previous application revision and confirm readiness before reopening traffic.",
"validation": "The execution completed and a fresh focused Doctor run returned no warning or failing evidence.",
"evidence": []inertia.Props{
{"id": "C01", "status": "fail", "check": "Application readiness", "summary": "Desired 1, ready 0"},
{"id": "C02", "status": "warn", "check": "Container restarts", "summary": "Restart backoff observed"},
{"id": "C03", "status": "ok", "check": "Post-change validation", "summary": "Desired state satisfied"},
},
"notice": "Sanitized fixture only. This public route has no Jeannie client, credentials, approval, or execution capability.",
},
})
}

View File

@ -0,0 +1,61 @@
interface Demo {
scope: string;
target: string;
outcome: string;
finding: string;
diagnostic: string;
proposal: string;
rollback: string;
validation: string;
notice: string;
evidence: Array<{ id: string; status: string; check: string; summary: string }>;
}
export default function DemoPage({ demo }: { demo: Demo }) {
return (
<main className="min-h-screen bg-[#071019] px-5 py-10 text-slate-100">
<div className="mx-auto max-w-6xl">
<header className="border-b border-white/10 pb-8">
<p className="text-xs uppercase tracking-[0.22em] text-cyan-300">OpsProof · public portfolio demo</p>
<h1 className="mt-4 max-w-4xl text-4xl font-semibold tracking-tight sm:text-6xl">
Evidence, approval, repair, and proof in one operational record.
</h1>
<p className="mt-5 max-w-3xl text-sm leading-6 text-slate-400">{demo.notice}</p>
</header>
<section className="grid gap-4 py-8 md:grid-cols-3">
{demo.evidence.map((item) => (
<article key={item.id} className="rounded-2xl border border-white/10 bg-[#0a141e] p-5">
<div className="flex items-center justify-between">
<span className="font-mono text-xs text-cyan-300">{item.id}</span>
<span className="text-[10px] uppercase text-slate-500">{item.status}</span>
</div>
<h2 className="mt-4 font-medium text-white">{item.check}</h2>
<p className="mt-2 text-sm leading-6 text-slate-400">{item.summary}</p>
</article>
))}
</section>
<section className="grid gap-px overflow-hidden rounded-3xl border border-white/10 bg-white/10 lg:grid-cols-2">
{[
['Finding', demo.finding],
['Diagnostic', demo.diagnostic],
['Approval-gated proposal', demo.proposal],
['Operator rollback', demo.rollback],
['Post-change validation', demo.validation],
['Outcome', demo.outcome],
].map(([heading, body]) => (
<article key={heading} className="bg-[#0b1621] p-6">
<p className="text-xs uppercase tracking-[0.18em] text-cyan-200">{heading}</p>
<p className="mt-3 text-sm leading-6 text-slate-400">{body}</p>
</article>
))}
</section>
<footer className="py-8 text-xs text-slate-600">
Built with Laravel Go, React/Inertia, PostgreSQL, Dex, Jeannie, Holmes, and an OCI edge boundary.
</footer>
</div>
</main>
);
}

View File

@ -9,6 +9,7 @@ import (
"go.laravel.com/web"
"app/handlers/authentication"
"app/handlers/demo"
"app/handlers/execution"
"app/handlers/incident"
"app/handlers/proposal"
@ -19,6 +20,7 @@ import (
func Web(route *routing.Router, cfg *config.Config) {
route.Get("/", welcome.Show)
route.Get("/demo", demo.Show)
route.Get("/login", authentication.Login).Name("login")
route.Get("/auth/dex/callback", authentication.Callback)
route.Post("/logout", authentication.Logout).Middleware(auth.Authenticate{}, appmiddleware.Operator{})

View File

@ -0,0 +1,17 @@
package feature_test
import (
"testing"
"go.laravel.com/laraveltest"
"app/tests"
)
func TestPublicDemoUsesSanitizedFixtureWithoutAuthentication(t *testing.T) {
client := tests.New(t, laraveltest.Env(map[string]string{
"OPSPROOF_JEANNIE_URL": "http://127.0.0.1:1",
"OPSPROOF_JEANNIE_TOKEN": "must-not-be-used",
}))
client.Get("/demo").AssertOK().AssertInertia("Demo").AssertProp("demo.outcome", "validated")
}

View File

@ -19,6 +19,7 @@ locals {
searxng_server_name = "search.${var.server_name}"
privatebin_server_name = "paste.${var.server_name}"
miniflux_server_name = "feeds.${var.server_name}"
opsproof_server_name = "opsproof.${var.server_name}"
heimdall_backend_host = var.heimdall_backend_host != "" ? var.heimdall_backend_host : var.gitea_backend_host
homepage_backend_host = var.homepage_backend_host != "" ? var.homepage_backend_host : var.gitea_backend_host
oidc_backend_host = (
@ -28,13 +29,14 @@ locals {
searxng_backend_host = var.searxng_backend_host != "" ? var.searxng_backend_host : var.gitea_backend_host
privatebin_backend_host = var.privatebin_backend_host != "" ? var.privatebin_backend_host : var.gitea_backend_host
miniflux_backend_host = var.miniflux_backend_host != "" ? var.miniflux_backend_host : var.gitea_backend_host
opsproof_backend_host = var.opsproof_backend_host != "" ? var.opsproof_backend_host : var.gitea_backend_host
jeannie_api_server_name = "api.${var.server_name}"
office_server_name = var.office_server_name
office_onlyoffice_server_name = var.office_onlyoffice_server_name
matrix_server_names = var.matrix_enabled ? [var.matrix_server_name, var.element_server_name] : []
monitoring_names = var.monitoring_backend_host != "" ? ["grafana.${var.server_name}", "prometheus.${var.server_name}", "alertmanager.${var.server_name}"] : []
server_names = distinct(concat([var.server_name, local.heimdall_server_name, local.homepage_server_name, local.oidc_server_name, local.jellyfin_server_name, local.searxng_server_name, local.privatebin_server_name, local.miniflux_server_name, local.jeannie_api_server_name, local.office_server_name, local.office_onlyoffice_server_name], local.matrix_server_names, var.additional_server_names))
main_server_names = [for name in local.server_names : name if !contains([local.heimdall_server_name, local.homepage_server_name, local.oidc_server_name, local.jellyfin_server_name, local.searxng_server_name, local.privatebin_server_name, local.miniflux_server_name, local.jeannie_api_server_name, local.office_server_name, local.office_onlyoffice_server_name], name) && !contains(local.matrix_server_names, name) && !contains(local.monitoring_names, name)]
server_names = distinct(concat([var.server_name, local.heimdall_server_name, local.homepage_server_name, local.oidc_server_name, local.jellyfin_server_name, local.searxng_server_name, local.privatebin_server_name, local.miniflux_server_name, local.opsproof_server_name, local.jeannie_api_server_name, local.office_server_name, local.office_onlyoffice_server_name], local.matrix_server_names, var.additional_server_names))
main_server_names = [for name in local.server_names : name if !contains([local.heimdall_server_name, local.homepage_server_name, local.oidc_server_name, local.jellyfin_server_name, local.searxng_server_name, local.privatebin_server_name, local.miniflux_server_name, local.opsproof_server_name, local.jeannie_api_server_name, local.office_server_name, local.office_onlyoffice_server_name], name) && !contains(local.matrix_server_names, name) && !contains(local.monitoring_names, name)]
default_conf = templatefile("${path.module}/templates/default.conf.tftpl", {
server_name = var.server_name
monitoring_backend_host = var.monitoring_backend_host
@ -66,6 +68,9 @@ locals {
miniflux_server_name = local.miniflux_server_name
miniflux_backend_host = local.miniflux_backend_host
miniflux_backend_port = tostring(var.miniflux_backend_port)
opsproof_server_name = local.opsproof_server_name
opsproof_backend_host = local.opsproof_backend_host
opsproof_backend_port = tostring(var.opsproof_backend_port)
jeannie_api_server_name = local.jeannie_api_server_name
jeannie_api_backend_host = var.jeannie_api_backend_host
jeannie_api_backend_port = tostring(var.jeannie_api_backend_port)

View File

@ -118,7 +118,7 @@ server {
server {
listen 80;
server_name ${heimdall_server_name} ${homepage_server_name} ${oidc_server_name} ${jellyfin_server_name} ${searxng_server_name} ${privatebin_server_name} ${miniflux_server_name} ${jeannie_api_server_name} ${office_server_name} ${office_onlyoffice_server_name};
server_name ${heimdall_server_name} ${homepage_server_name} ${oidc_server_name} ${jellyfin_server_name} ${searxng_server_name} ${privatebin_server_name} ${miniflux_server_name} ${opsproof_server_name} ${jeannie_api_server_name} ${office_server_name} ${office_onlyoffice_server_name};
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
@ -131,6 +131,48 @@ server_name ${heimdall_server_name} ${homepage_server_name} ${oidc_server_name}
}
}
server {
listen 443 ssl;
http2 on;
server_name ${opsproof_server_name};
ssl_certificate /etc/nginx/certs/current.crt;
ssl_certificate_key /etc/nginx/certs/current.key;
ssl_protocols TLSv1.2 TLSv1.3;
if ($blocked_uris) { return 403; }
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy no-referrer;
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()";
location = / {
return 302 /demo;
}
location = /demo {
proxy_pass http://${opsproof_backend_host}:${opsproof_backend_port};
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
add_header Cache-Control "no-store";
}
location ^~ /build/ {
proxy_pass http://${opsproof_backend_host}:${opsproof_backend_port};
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
expires 1h;
}
location / {
return 404;
}
}
server {
listen 443 ssl;
http2 on;

View File

@ -255,6 +255,16 @@ variable "miniflux_backend_port" {
default = 8890
}
variable "opsproof_backend_host" {
type = string
default = ""
}
variable "opsproof_backend_port" {
type = number
default = 8891
}
variable "jeannie_api_backend_host" {
type = string
default = ""

View File

@ -641,7 +641,9 @@ is missing. Default is to fail and ask for host bootstrap.
`LAB_OPSPROOF_INSTALL_DIR`, `LAB_OPSPROOF_HTTP_PORT`, `LAB_OPSPROOF_BIND_IP`
: Override the OpsProof data root, HTTP port, and listen address. Defaults are
`/data/homelab-opsproof`, `8891`, and `127.0.0.1`.
`/data/homelab-opsproof`, `8891`, and `127.0.0.1`. The canonical inventory uses
`0.0.0.0` so the OCI edge can reach only the separately restricted public demo
route over Tailscale.
`LAB_OPSPROOF_GO_VERSION`, `LAB_OPSPROOF_GO_SHA256`
: Pin the isolated Go toolchain used only to build OpsProof. The archive is

View File

@ -83,6 +83,9 @@ confirmed by deterministic validation.
- Run the focused Doctor target once after a terminal execution and write a
durable before/after report. Preserve a failed validation as an explicit
outcome rather than inferring success from the execution status alone.
- Keep the public portfolio route fixture-only. The OCI edge may proxy `/demo`
and `/build/`, but must return 404 for login, incident, proposal, execution,
report, and every other application route.
## Why not Laravel Rust now?

View File

@ -25,6 +25,7 @@ Update `homelab.yml`, then run `scripts/render-service-catalog`.
| SearXNG | debian (control-plane, 192.168.100.73) | Docker Compose / jeannie deploy-searxng | [local](http://192.168.100.73:8888/) | [public](https://search.lab2025.duckdns.org/) | `infra/searxng/README.md` |
| PrivateBin | debian (control-plane, 192.168.100.73) | Docker Compose / jeannie deploy-privatebin | [local](http://192.168.100.73:8889/) | [public](https://paste.lab2025.duckdns.org/) | `infra/privatebin/README.md` |
| Miniflux | debian (control-plane, 192.168.100.73) | Docker Compose / jeannie deploy-miniflux | [local](http://192.168.100.73:8890/) | [public](https://feeds.lab2025.duckdns.org/) | `infra/miniflux/README.md` |
| OpsProof public demo | debian (control-plane, 192.168.100.73) | systemd / jeannie deploy-opsproof | [local](http://192.168.100.73:8891/) | [public](https://opsproof.lab2025.duckdns.org/) | `apps/opsproof/README.md` |
| GitOps mirror | debian (control-plane, 192.168.100.73) | Bare Git repository | `/home/jv/git-server/my-homelab-configs.git` | [public](ssh://jv@192.168.100.73/home/jv/git-server/my-homelab-configs.git) | `README.md#gitops-and-gitea-actions` |
| Container Registry | debian (control-plane, 192.168.100.73) | Argo CD / apps/container-registry | [local](http://192.168.100.73:30500/v2/_catalog) | | `apps/container-registry/` |
| Traefik | Kubernetes | OpenTofu / bootstrap/platform | [local](http://192.168.100.240/) | [public](https://lab2025.duckdns.org) | `README.md#loadbalancer-services` |

View File

@ -33,6 +33,7 @@ domain:
- search.lab2025.duckdns.org
- paste.lab2025.duckdns.org
- feeds.lab2025.duckdns.org
- opsproof.lab2025.duckdns.org
network:
lan_cidr: 192.168.100.0/24
@ -208,6 +209,13 @@ services:
install_dir: /data/homelab-miniflux
http_port: 8890
public_url: https://feeds.lab2025.duckdns.org/
opsproof:
host: debian
install_dir: /data/homelab-opsproof
http_port: 8891
bind_ip: 0.0.0.0
public_url: http://192.168.100.73:8891/
demo_public_url: https://opsproof.lab2025.duckdns.org/
gitops_mirror:
host: debian
path: /home/jv/git-server/my-homelab-configs.git

View File

@ -76,6 +76,11 @@ mapping = {
"services.miniflux.install_dir": "LAB_MINIFLUX_INSTALL_DIR",
"services.miniflux.http_port": "LAB_MINIFLUX_HTTP_PORT",
"services.miniflux.public_url": "LAB_MINIFLUX_PUBLIC_URL",
"services.opsproof.install_dir": "LAB_OPSPROOF_INSTALL_DIR",
"services.opsproof.http_port": "LAB_OPSPROOF_HTTP_PORT",
"services.opsproof.bind_ip": "LAB_OPSPROOF_BIND_IP",
"services.opsproof.public_url": "LAB_OPSPROOF_PUBLIC_URL",
"services.opsproof.demo_public_url": "LAB_OPSPROOF_DEMO_PUBLIC_URL",
"services.local_registry.endpoint": "LAB_REGISTRY_ENDPOINT",
"services.ollama.url": "LAB_OLLAMA_URL",
"services.ollama.bind_address": "LAB_OLLAMA_BIND_ADDRESS",
@ -243,6 +248,7 @@ for service_name, env_name in [
("searxng", "LAB_SEARXNG_BACKEND_HOST"),
("privatebin", "LAB_PRIVATEBIN_BACKEND_HOST"),
("miniflux", "LAB_MINIFLUX_BACKEND_HOST"),
("opsproof", "LAB_OPSPROOF_BACKEND_HOST"),
]:
service_lan = service_host_value(service_name, "lan_ip") or services_host_lan
service_tailscale = service_host_value(service_name, "tailscale_ip") or services_host_tailscale
@ -358,6 +364,8 @@ export_homelab_inventory_tf_vars() {
export_if_unset TF_VAR_privatebin_backend_port "${LAB_PRIVATEBIN_HTTP_PORT:-8889}"
export_if_unset TF_VAR_miniflux_backend_host "${LAB_MINIFLUX_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-}}"
export_if_unset TF_VAR_miniflux_backend_port "${LAB_MINIFLUX_HTTP_PORT:-8890}"
export_if_unset TF_VAR_opsproof_backend_host "${LAB_OPSPROOF_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-}}"
export_if_unset TF_VAR_opsproof_backend_port "${LAB_OPSPROOF_HTTP_PORT:-8891}"
export_if_unset TF_VAR_office_server_name "${LAB_OFFICE_PUBLIC_HOST:-office.${LAB_DOMAIN:-lab2025.duckdns.org}}"
export_if_unset TF_VAR_office_backend_host "${LAB_OFFICE_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-${LAB_DEBIAN_LAN_IP:-}}}"
export_if_unset TF_VAR_office_backend_port "${LAB_OFFICE_HTTP_PORT:-8090}"

View File

@ -5694,6 +5694,7 @@ deploy_opsproof() {
local install_dir="${LAB_OPSPROOF_INSTALL_DIR:-/data/homelab-opsproof}"
local http_port="${LAB_OPSPROOF_HTTP_PORT:-8891}"
local bind_ip="${LAB_OPSPROOF_BIND_IP:-127.0.0.1}"
local health_ip="${LAB_OPSPROOF_BIND_IP:-127.0.0.1}"
local go_version="${LAB_OPSPROOF_GO_VERSION:-1.27.4}"
local go_sha256="${LAB_OPSPROOF_GO_SHA256:-7226736c2339719cda28fbf3a54d71aa63bcefe376e98cef00034268dab24840}"
local starter_commit="${LAB_OPSPROOF_STARTER_COMMIT:-6dd8bd22b9d335e55b190aa16f3271e73c97cd25}"
@ -5729,6 +5730,10 @@ deploy_opsproof() {
require_debian_server "deploy-opsproof"
if [[ "${health_ip}" == "0.0.0.0" || "${health_ip}" == "::" ]]; then
health_ip="127.0.0.1"
fi
if ! [[ "${http_port}" =~ ^[0-9]+$ ]] || ((http_port < 1 || http_port > 65535)); then
echo "LAB_OPSPROOF_HTTP_PORT must be a valid TCP port." >&2
return 1
@ -5990,9 +5995,9 @@ UNIT_EOF
sudo systemctl enable opsproof.service
sudo systemctl restart opsproof.service
until curl -fsS --connect-timeout 3 "http://${bind_ip}:${http_port}/up" >/dev/null; do
until curl -fsS --connect-timeout 3 "http://${health_ip}:${http_port}/up" >/dev/null; do
if ((elapsed >= 90)); then
echo "Timed out waiting for OpsProof on http://${bind_ip}:${http_port}/up" >&2
echo "Timed out waiting for OpsProof on http://${health_ip}:${http_port}/up" >&2
sudo systemctl status opsproof.service --no-pager >&2 || true
sudo journalctl -u opsproof.service -n 120 --no-pager >&2 || true
return 1

View File

@ -152,6 +152,14 @@ def service_rows(values: dict[str, object]) -> list[dict[str, str]]:
"public": value(values, "services.miniflux.public_url", f"https://feeds.{domain}/"),
"docs": "infra/miniflux/README.md",
},
{
"name": "OpsProof public demo",
"host": value(values, "services.opsproof.host", "debian"),
"managed_by": "systemd / jeannie deploy-opsproof",
"local": value(values, "services.opsproof.public_url", f"http://{debian_ip}:8891/"),
"public": value(values, "services.opsproof.demo_public_url", f"https://opsproof.{domain}/"),
"docs": "apps/opsproof/README.md",
},
{
"name": "GitOps mirror",
"host": value(values, "services.gitops_mirror.host", "debian"),

View File

@ -148,6 +148,7 @@ class OpsProofPipelineTests(unittest.TestCase):
encoding="utf-8"
)
self.assertIn('route.Get("/login"', routes)
self.assertIn('route.Get("/demo"', routes)
self.assertIn("auth.Authenticate{}", routes)
self.assertIn("appmiddleware.Operator{}", routes)
self.assertIn('operator.Post("/incidents/{scope}/{target}/proposals"', routes)
@ -183,6 +184,19 @@ class OpsProofPipelineTests(unittest.TestCase):
self.assertIn("Five Whys", report_page)
self.assertIn("Bounded execution output", report_page)
demo_handler = (
ROOT / "apps/opsproof/overlay/handlers/demo/show.go"
).read_text(encoding="utf-8")
self.assertIn("Sanitized fixture only", demo_handler)
self.assertNotIn("Jeannie.", demo_handler)
edge = (ROOT / "bootstrap/edge/templates/default.conf.tftpl").read_text(
encoding="utf-8"
)
self.assertIn("server_name ${opsproof_server_name}", edge)
self.assertIn("location = /demo", edge)
self.assertIn("location ^~ /build/", edge)
if __name__ == "__main__":
unittest.main()