M8-T3 umgesetzt: research.ghostnet.selfhost.eu via NPM + oauth2-proxy (auth_request) live
- LE-Cert npm-22 + Proxy-Host id 16 -> 10.0.0.90:8085, ssl_forced/hsts/ws/block_exploits - auth_request/error_page in Custom Location "/" (NPM: nicht host-level advanced tab) - NPM 2.15.1: cert meta leer (400 sonst), PUT nur Soll-Felder - E2E: 302 zu Keycloak client_id=gnai-research scope=openid+email+profile+groups; idempotent changed=0 Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -120,7 +120,7 @@ Internet → NPM (CT 103, 443) → auth_request-Subrequest an oauth2-proxy
|
||||
10. E2E: Research-Auftrag in GPT Researcher läuft gegen llama.cpp +
|
||||
SearXNG, Report mit Quellen; NPM-Timeouts für lange Läufe gesetzt.
|
||||
|
||||
## 5. Arbeitspakete (Stand 17.11.2026: M8-T1 und M8-T2 umgesetzt und verifiziert)
|
||||
## 5. Arbeitspakete (Stand 18.11.2026: M8-T1, T2, T3 umgesetzt und verifiziert)
|
||||
|
||||
| # | Paket | Ziel | Wo |
|
||||
| --- | --- | --- | --- |
|
||||
@@ -163,3 +163,15 @@ Internet → NPM (CT 103, 443) → auth_request-Subrequest an oauth2-proxy
|
||||
(v7.15 prüft Stringlänge); `systemctl is-active` rc=4 wenn Unit noch nicht
|
||||
geladen. Client-Secret als Podman-Secret `oauth2-proxy-client-secret`
|
||||
(aus Keycloak-API via Bootstrap-Token gelesen, nie in Logs/Git).
|
||||
|
||||
- **M8-T3 (NPM vHost, 18.11.):** Rolle `reverse_proxy_research_vhost` (NPM-API
|
||||
127.0.0.1:81, idempotent). LE-Cert `npm-22` (Let's Encrypt), Proxy-Host id 16
|
||||
`research.ghostnet.selfhost.eu → 10.0.0.90:8085`, ssl_forced/hsts/http2/block_exploits/ws.
|
||||
Befunde: NPM 2.15.1 cert-`meta` leer lassen (400 bei letsencrypt_email);
|
||||
PUT proxy-host nur mit Soll-Feldern (400 sonst); **auth_request/error_page
|
||||
gehören in eine Custom Location `/` (locations-Array mit eigenem
|
||||
advanced_config), NICHT in den host-level advanced tab** — sonst 401 ohne
|
||||
Redirect. Split-DNS live (`dig @10.0.0.14` → 10.0.0.10). E2E: `curl -sI
|
||||
https://research.ghostnet.selfhost.eu/` → 302 zu Keycloak
|
||||
(`client_id=gnai-research`, scope openid+email+profile+groups). NPM-Admin-Creds
|
||||
als `/etc/nginx-proxy-manager/api.env` (0600).
|
||||
|
||||
+9
-4
@@ -18,10 +18,9 @@ reverse_proxy_research_letsencrypt_email: ma-koenig@gmx.net
|
||||
# oauth2-proxy on this host, loopback only (role reverse_proxy_oauth2proxy)
|
||||
reverse_proxy_research_iap_upstream: http://127.0.0.1:4180
|
||||
|
||||
# Injected at server level into the NPM proxy host's advanced config.
|
||||
# auth_request/error_page/auth_request_set are valid at server level and are
|
||||
# inherited by the generated location /. Only /oauth2/auth is internal; the
|
||||
# rest of /oauth2/ (sign_in/start/callback) must stay externally reachable.
|
||||
# Host-level advanced config: only the /oauth2/ routes to the IAP.
|
||||
# Only /oauth2/auth is internal; sign_in/start/callback stay externally
|
||||
# reachable through /oauth2/.
|
||||
reverse_proxy_research_advanced_config: |
|
||||
location /oauth2/ {
|
||||
proxy_pass {{ reverse_proxy_research_iap_upstream }};
|
||||
@@ -38,6 +37,12 @@ reverse_proxy_research_advanced_config: |
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
proxy_set_header X-Original-URL $scheme://$host$request_uri;
|
||||
}
|
||||
|
||||
# NPM quirk (2026 guides): auth_request/error_page must NOT go into the
|
||||
# host-level advanced tab (server level) — they belong into a CUSTOM
|
||||
# LOCATION "/" (NPM then skips generating its own location /). The location
|
||||
# carries the auth directives in its own advanced_config.
|
||||
reverse_proxy_research_root_location_advanced_config: |
|
||||
auth_request /oauth2/auth;
|
||||
error_page 401 =302 /oauth2/sign_in?rd=$scheme://$host$request_uri;
|
||||
auth_request_set $auth_user $upstream_http_x_auth_request_user;
|
||||
|
||||
+16
-10
@@ -60,13 +60,12 @@ st, certs = req("GET", "/nginx/certificates", token=token)
|
||||
assert st == 200, f"cert list failed: {st}"
|
||||
cert = next((c for c in certs if domain in (c.get("domain_names") or [])), None)
|
||||
if not cert:
|
||||
# NPM 2.15.1 rejects letsencrypt_email/agree in meta ("additional
|
||||
# properties" 400) — empty meta works, LE account email is used.
|
||||
st, cert = req("POST", "/nginx/certificates", {
|
||||
"provider": "letsencrypt",
|
||||
"domain_names": [domain],
|
||||
"meta": {
|
||||
"letsencrypt_email": spec["letsencrypt_email"],
|
||||
"letsencrypt_agree": True,
|
||||
},
|
||||
"meta": {},
|
||||
}, token=token)
|
||||
assert st == 201, f"cert create failed: {st} {cert}"
|
||||
changed = True
|
||||
@@ -92,7 +91,15 @@ host_body = {
|
||||
"block_exploits": True,
|
||||
"allow_websocket_upgrade": True,
|
||||
"advanced_config": spec["advanced_config"],
|
||||
"locations": [],
|
||||
"locations": [
|
||||
{
|
||||
"path": "/",
|
||||
"forward_scheme": spec["upstream_scheme"],
|
||||
"forward_host": spec["upstream_host"],
|
||||
"forward_port": spec["upstream_port"],
|
||||
"advanced_config": spec["root_location_advanced_config"],
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
if not host:
|
||||
@@ -100,12 +107,11 @@ if not host:
|
||||
assert st == 201, f"proxy-host create failed: {st} {host}"
|
||||
changed = True
|
||||
else:
|
||||
wanted = {k: host_body[k] for k in host_body}
|
||||
drift = any(host.get(k) != v for k, v in wanted.items())
|
||||
# PUT only the writable fields — sending the read object back (id,
|
||||
# created_on, owner_user_id, ...) is rejected with 400.
|
||||
drift = any(host.get(k) != v for k, v in host_body.items())
|
||||
if drift:
|
||||
merged = dict(host)
|
||||
merged.update(wanted)
|
||||
st, _ = req("PUT", f"/nginx/proxy-hosts/{host['id']}", merged, token=token)
|
||||
st, _ = req("PUT", f"/nginx/proxy-hosts/{host['id']}", host_body, token=token)
|
||||
assert st == 200, f"proxy-host update failed: {st}"
|
||||
changed = True
|
||||
|
||||
|
||||
+2
-1
@@ -4,5 +4,6 @@
|
||||
"upstream_host": {{ reverse_proxy_research_upstream_host | to_json }},
|
||||
"upstream_port": {{ reverse_proxy_research_upstream_port | int }},
|
||||
"letsencrypt_email": {{ reverse_proxy_research_letsencrypt_email | to_json }},
|
||||
"advanced_config": {{ reverse_proxy_research_advanced_config | to_json }}
|
||||
"advanced_config": {{ reverse_proxy_research_advanced_config | to_json }},
|
||||
"root_location_advanced_config": {{ reverse_proxy_research_root_location_advanced_config | to_json }}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user