Publish NextPath through OCI edge
Homelab Main / validate (push) Failing after 1m47s 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-05 10:38:31 -06:00
parent 73de08e9d3
commit 5cbd62b421
10 changed files with 131 additions and 3 deletions

View File

@ -128,6 +128,14 @@
<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>NextPath Arizona WIP</td>
<td>debian (control-plane, 192.168.100.73)</td>
<td>systemd / jeannie deploy-nextpath</td>
<td><a href="http://192.168.100.73:8892/">http://192.168.100.73:8892/</a></td>
<td><a href="https://nextpath.lab2025.duckdns.org/">https://nextpath.lab2025.duckdns.org/</a></td>
<td><code>apps/nextpath/README.md</code></td>
</tr>
<tr>
<td>GitOps mirror</td>
<td>debian (control-plane, 192.168.100.73)</td>

View File

@ -20,6 +20,7 @@ locals {
privatebin_server_name = "paste.${var.server_name}"
miniflux_server_name = "feeds.${var.server_name}"
opsproof_server_name = "opsproof.${var.server_name}"
nextpath_server_name = "nextpath.${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 = (
@ -30,13 +31,14 @@ locals {
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
nextpath_backend_host = var.nextpath_backend_host != "" ? var.nextpath_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.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)]
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.nextpath_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.nextpath_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
@ -71,6 +73,9 @@ locals {
opsproof_server_name = local.opsproof_server_name
opsproof_backend_host = local.opsproof_backend_host
opsproof_backend_port = tostring(var.opsproof_backend_port)
nextpath_server_name = local.nextpath_server_name
nextpath_backend_host = local.nextpath_backend_host
nextpath_backend_port = tostring(var.nextpath_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)
@ -139,6 +144,8 @@ resource "null_resource" "edge_services" {
privatebin_port = tostring(var.privatebin_backend_port)
miniflux_host = local.miniflux_backend_host
miniflux_port = tostring(var.miniflux_backend_port)
nextpath_host = local.nextpath_backend_host
nextpath_port = tostring(var.nextpath_backend_port)
jeannie_api_host = var.jeannie_api_backend_host
jeannie_api_port = tostring(var.jeannie_api_backend_port)
office_host = var.office_backend_host
@ -272,6 +279,8 @@ privatebin_host="${self.triggers.privatebin_host}"
privatebin_port="${self.triggers.privatebin_port}"
miniflux_host="${self.triggers.miniflux_host}"
miniflux_port="${self.triggers.miniflux_port}"
nextpath_host="${self.triggers.nextpath_host}"
nextpath_port="${self.triggers.nextpath_port}"
jeannie_api_host="${self.triggers.jeannie_api_host}"
jeannie_api_port="${self.triggers.jeannie_api_port}"
enable_letsencrypt="${self.triggers.enable_letsencrypt}"
@ -390,6 +399,11 @@ if ! curl -fsS --connect-timeout 10 "http://$miniflux_host:$miniflux_port/health
echo "Run ./jeannie deploy-miniflux on Debian before testing the public hostname." >&2
fi
if ! curl -fsS --connect-timeout 10 "http://$nextpath_host:$nextpath_port/healthz" >/dev/null; then
echo "Warning: cannot reach NextPath backend http://$nextpath_host:$nextpath_port/healthz from the edge host." >&2
echo "Run ./jeannie deploy-nextpath on Debian before testing the public hostname." >&2
fi
if ! curl -sS --connect-timeout 10 -o /dev/null -w '%%{http_code}' "http://$jeannie_api_host:$jeannie_api_port/v1/health" | grep -Eq '^(200|401)$'; then
echo "Warning: cannot reach Jeannie API backend http://$jeannie_api_host:$jeannie_api_port/v1/health from the edge host." >&2
echo "Check the Debian Jeannie API service before testing the public hostname." >&2

View File

@ -47,6 +47,7 @@ limit_req_zone $binary_remote_addr zone=jeannie_api:10m rate=5r/s;
limit_req_zone $binary_remote_addr zone=searxng_search:10m rate=30r/m;
limit_req_zone $binary_remote_addr zone=privatebin_write:10m rate=10r/m;
limit_req_zone $binary_remote_addr zone=miniflux_login:10m rate=20r/m;
limit_req_zone $binary_remote_addr zone=nextpath_auth:10m rate=10r/m;
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_assets:10m max_size=100m inactive=24h;
proxy_cache_path /var/cache/nginx_dynamic levels=1:2 keys_zone=dynamic_content:5m max_size=50m inactive=1h;
@ -118,7 +119,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} ${opsproof_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} ${nextpath_server_name} ${jeannie_api_server_name} ${office_server_name} ${office_onlyoffice_server_name};
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
@ -188,6 +189,42 @@ server {
}
}
server {
listen 443 ssl;
http2 on;
server_name ${nextpath_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 always;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy no-referrer always;
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
add_header Cache-Control "no-store" always;
location ~ ^/(?:register|login)$ {
limit_req zone=nextpath_auth burst=10 nodelay;
proxy_pass http://${nextpath_backend_host}:${nextpath_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 / {
proxy_pass http://${nextpath_backend_host}:${nextpath_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;
}
}
server {
listen 443 ssl;
http2 on;

View File

@ -265,6 +265,16 @@ variable "opsproof_backend_port" {
default = 8891
}
variable "nextpath_backend_host" {
type = string
default = ""
}
variable "nextpath_backend_port" {
type = number
default = 8892
}
variable "jeannie_api_backend_host" {
type = string
default = ""

View File

@ -371,6 +371,22 @@ admin credentials in the root-owned `.env`. The edge publishes the native
Miniflux login at `https://feeds.lab2025.duckdns.org/` so API and feed-reader
clients remain compatible.
## NextPath Arizona WIP
NextPath is a Debian-hosted Go service for family testing of the Arizona career
exploration MVP. Deploy the service before applying its public OCI edge route:
```bash
./jeannie deploy-nextpath
./jeannie edge apply
```
Private account and assessment data stays under `/data/homelab-nextpath/data`.
The edge publishes `https://nextpath.lab2025.duckdns.org/`, rate-limits account
entry points, disables caching, and supplies TLS required by secure cookies.
This is a public work in progress; do not enter information beyond the minimal
profile fields requested by the application.
The Debian bare repo remains the GitOps mirror:
```text

View File

@ -26,6 +26,7 @@ Update `homelab.yml`, then run `scripts/render-service-catalog`.
| 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 | | [public](https://opsproof.lab2025.duckdns.org/) | `apps/opsproof/README.md` |
| NextPath Arizona WIP | debian (control-plane, 192.168.100.73) | systemd / jeannie deploy-nextpath | [local](http://192.168.100.73:8892/) | [public](https://nextpath.lab2025.duckdns.org/) | `apps/nextpath/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

@ -371,6 +371,22 @@ admin credentials in the root-owned `.env`. The edge publishes the native
Miniflux login at `https://feeds.lab2025.duckdns.org/` so API and feed-reader
clients remain compatible.
## NextPath Arizona WIP
NextPath is a Debian-hosted Go service for family testing of the Arizona career
exploration MVP. Deploy the service before applying its public OCI edge route:
```bash
./{{ main_script }} deploy-nextpath
./{{ main_script }} edge apply
```
Private account and assessment data stays under `/data/homelab-nextpath/data`.
The edge publishes `https://nextpath.lab2025.duckdns.org/`, rate-limits account
entry points, disables caching, and supplies TLS required by secure cookies.
This is a public work in progress; do not enter information beyond the minimal
profile fields requested by the application.
The Debian bare repo remains the GitOps mirror:
```text

View File

@ -371,6 +371,8 @@ export_homelab_inventory_tf_vars() {
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_nextpath_backend_host "${LAB_NEXTPATH_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-}}"
export_if_unset TF_VAR_nextpath_backend_port "${LAB_NEXTPATH_HTTP_PORT:-8892}"
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

@ -160,6 +160,14 @@ def service_rows(values: dict[str, object]) -> list[dict[str, str]]:
"public": value(values, "services.opsproof.demo_public_url", f"https://opsproof.{domain}/"),
"docs": "apps/opsproof/README.md",
},
{
"name": "NextPath Arizona WIP",
"host": value(values, "services.nextpath.host", "debian"),
"managed_by": "systemd / jeannie deploy-nextpath",
"local": f"http://{debian_ip}:{value(values, 'services.nextpath.http_port', '8892')}/",
"public": value(values, "services.nextpath.public_url", f"https://nextpath.{domain}/"),
"docs": "apps/nextpath/README.md",
},
{
"name": "GitOps mirror",
"host": value(values, "services.gitops_mirror.host", "debian"),

View File

@ -28,6 +28,22 @@ class NextPathPipelineTests(unittest.TestCase):
self.assertIn("install_dir: /data/homelab-nextpath", inventory)
self.assertIn("http_port: 8892", inventory)
def test_edge_routes_public_tls_to_the_private_backend(self):
main = (ROOT / "bootstrap/edge/main.tf").read_text(encoding="utf-8")
variables = (ROOT / "bootstrap/edge/variables.tf").read_text(encoding="utf-8")
nginx = (ROOT / "bootstrap/edge/templates/default.conf.tftpl").read_text(
encoding="utf-8"
)
environment = (ROOT / "lib/jeannie/env.sh").read_text(encoding="utf-8")
self.assertIn('nextpath_server_name = "nextpath.${var.server_name}"', main)
self.assertIn("nextpath_backend_host", variables)
self.assertIn("TF_VAR_nextpath_backend_host", environment)
self.assertIn("server_name ${nextpath_server_name};", nginx)
self.assertIn("proxy_pass http://${nextpath_backend_host}:${nextpath_backend_port}", nginx)
self.assertIn("zone=nextpath_auth", nginx)
self.assertIn("X-Forwarded-Proto https", nginx)
if __name__ == "__main__":
unittest.main()