Use canonical OpsProof public origin
This commit is contained in:
parent
d59e6da7c1
commit
fa23118696
|
|
@ -124,7 +124,7 @@
|
|||
<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><span class="muted">not exposed</span></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>
|
||||
|
|
|
|||
|
|
@ -96,9 +96,11 @@ 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.
|
||||
or execution controls. The canonical application URL is
|
||||
`https://opsproof.lab2025.duckdns.org/`; unauthenticated root requests redirect
|
||||
to the fixture. The OCI edge publishes only the fixture, build assets, and the
|
||||
explicit Dex/operator route families. Incident data and mutations still require
|
||||
both a valid Dex session and current operator allowlist membership.
|
||||
|
||||
## Security boundary
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"go.laravel.com/inertia"
|
||||
"go.laravel.com/web"
|
||||
|
||||
"app/models"
|
||||
"app/services"
|
||||
)
|
||||
|
||||
|
|
@ -21,6 +22,9 @@ type overview struct {
|
|||
}
|
||||
|
||||
func Show(request *web.Request) *web.Response {
|
||||
if models.CurrentUser(request) == nil {
|
||||
return web.Redirect("/demo")
|
||||
}
|
||||
status := overview{
|
||||
Message: "Jeannie status is temporarily unavailable.",
|
||||
Rows: []services.StatusRow{},
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ func TestPublicDemoUsesSanitizedFixtureWithoutAuthentication(t *testing.T) {
|
|||
"OPSPROOF_JEANNIE_URL": "http://127.0.0.1:1",
|
||||
"OPSPROOF_JEANNIE_TOKEN": "must-not-be-used",
|
||||
}))
|
||||
client.WithoutRedirects().Get("/").AssertRedirect("/demo")
|
||||
client.Get("/demo").AssertOK().AssertInertia("Demo").AssertProp("demo.outcome", "validated")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,13 +147,18 @@ server {
|
|||
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()";
|
||||
|
||||
location = / {
|
||||
return 302 /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;
|
||||
}
|
||||
|
||||
location = /demo {
|
||||
proxy_pass http://${opsproof_backend_host}:${opsproof_backend_port};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host ${opsproof_backend_host}:${opsproof_backend_port};
|
||||
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;
|
||||
|
|
@ -163,11 +168,21 @@ server {
|
|||
location ^~ /build/ {
|
||||
proxy_pass http://${opsproof_backend_host}:${opsproof_backend_port};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host ${opsproof_backend_host}:${opsproof_backend_port};
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
expires 1h;
|
||||
}
|
||||
|
||||
location ~ ^/(?:login|logout|auth/dex/callback|incidents(?:/|$)|proposals(?:/|$)|executions(?:/|$)|reports(?:/|$)) {
|
||||
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 / {
|
||||
return 404;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,9 +83,11 @@ 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.
|
||||
- Keep the unauthenticated portfolio route fixture-only. The OCI edge proxies
|
||||
`/demo`, `/build/`, and explicit login/operator route families. Root redirects
|
||||
anonymous users to the fixture; live evidence and mutations remain behind
|
||||
Dex authentication and the server-side operator allowlist. Unknown routes
|
||||
return 404.
|
||||
|
||||
## Why not Laravel Rust now?
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +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` |
|
||||
| OpsProof public demo | debian (control-plane, 192.168.100.73) | systemd / jeannie deploy-opsproof | | [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` |
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ services:
|
|||
install_dir: /data/homelab-opsproof
|
||||
http_port: 8891
|
||||
bind_ip: 0.0.0.0
|
||||
public_url: http://192.168.100.73:8891/
|
||||
public_url: https://opsproof.lab2025.duckdns.org/
|
||||
demo_public_url: https://opsproof.lab2025.duckdns.org/
|
||||
gitops_mirror:
|
||||
host: debian
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ def service_rows(values: dict[str, object]) -> list[dict[str, str]]:
|
|||
"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/"),
|
||||
"local": "",
|
||||
"public": value(values, "services.opsproof.demo_public_url", f"https://opsproof.{domain}/"),
|
||||
"docs": "apps/opsproof/README.md",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -204,10 +204,14 @@ class OpsProofPipelineTests(unittest.TestCase):
|
|||
self.assertIn("server_name ${opsproof_server_name}", edge)
|
||||
self.assertIn("location = /demo", edge)
|
||||
self.assertIn("location ^~ /build/", edge)
|
||||
self.assertGreaterEqual(
|
||||
edge.count("proxy_set_header Host ${opsproof_backend_host}:${opsproof_backend_port};"),
|
||||
2,
|
||||
)
|
||||
self.assertIn("auth/dex/callback", edge)
|
||||
self.assertIn("incidents(?:/|$)", edge)
|
||||
|
||||
welcome = (
|
||||
ROOT / "apps/opsproof/overlay/handlers/welcome/welcome.go"
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn("models.CurrentUser(request) == nil", welcome)
|
||||
self.assertIn('web.Redirect("/demo")', welcome)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in New Issue