From ccfa33508367feb75eb7648093b6cc6f21b39f07 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Thu, 22 Oct 2026 10:25:35 -0600 Subject: [PATCH] fix: publish office endpoint publicly --- bootstrap/edge/main.tf | 2 -- bootstrap/edge/templates/default.conf.tftpl | 3 --- bootstrap/edge/variables.tf | 5 ----- infra/office/README.md | 4 ++-- lib/jeannie/env.sh | 1 - lib/jeannie/pipeline.sh | 2 +- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/bootstrap/edge/main.tf b/bootstrap/edge/main.tf index e43cfaa..7e063ab 100644 --- a/bootstrap/edge/main.tf +++ b/bootstrap/edge/main.tf @@ -54,7 +54,6 @@ locals { office_server_name = local.office_server_name office_backend_host = var.office_backend_host office_backend_port = tostring(var.office_backend_port) - office_tailscale_cidr = var.office_tailscale_cidr }) default_vcl = templatefile("${path.module}/templates/default.vcl.tftpl", { backend_host = var.backend_host @@ -112,7 +111,6 @@ resource "null_resource" "edge_services" { jeannie_api_port = tostring(var.jeannie_api_backend_port) office_host = var.office_backend_host office_port = tostring(var.office_backend_port) - office_tailscale_cidr = var.office_tailscale_cidr enable_letsencrypt = tostring(var.enable_letsencrypt) letsencrypt_email = var.letsencrypt_email letsencrypt_staging = tostring(var.letsencrypt_staging) diff --git a/bootstrap/edge/templates/default.conf.tftpl b/bootstrap/edge/templates/default.conf.tftpl index 31a548c..6b2720a 100644 --- a/bootstrap/edge/templates/default.conf.tftpl +++ b/bootstrap/edge/templates/default.conf.tftpl @@ -218,9 +218,6 @@ server { ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; - # The office data plane is reachable only from the Tailscale CGNAT range. - allow ${office_tailscale_cidr}; - deny all; client_max_body_size 2g; location / { diff --git a/bootstrap/edge/variables.tf b/bootstrap/edge/variables.tf index 87d245c..a10f519 100644 --- a/bootstrap/edge/variables.tf +++ b/bootstrap/edge/variables.tf @@ -163,11 +163,6 @@ variable "office_backend_port" { default = 8090 } -variable "office_tailscale_cidr" { - type = string - default = "100.64.0.0/10" -} - # Matrix (isolated vhost + its own cert; does NOT touch shared current.crt) variable "matrix_enabled" { type = bool diff --git a/infra/office/README.md b/infra/office/README.md index 2c654ba..a2ad4fa 100644 --- a/infra/office/README.md +++ b/infra/office/README.md @@ -11,8 +11,8 @@ The pipeline deploys the stack independently with: ./jeannie deploy-office ``` -The edge route is `https://office.lab2025.duckdns.org` and is restricted to the -Tailscale CGNAT range. Dex SSO is configured by the pipeline after the first +The edge route is `https://office.lab2025.duckdns.org` and is protected by +Dex SSO. Dex SSO is configured by the pipeline after the first Nextcloud boot when `DEX_OFFICE_CLIENT_SECRET` exists in the encrypted Dex secret. Existing older Dex secret files must be regenerated or supplied with `LAB_OFFICE_OIDC_CLIENT_SECRET`; credentials are never committed to the diff --git a/lib/jeannie/env.sh b/lib/jeannie/env.sh index 7bdb8bc..79c5ea5 100644 --- a/lib/jeannie/env.sh +++ b/lib/jeannie/env.sh @@ -290,7 +290,6 @@ export_homelab_inventory_tf_vars() { 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}" - export_if_unset TF_VAR_office_tailscale_cidr "${LAB_TAILSCALE_CGNAT_CIDR:-100.64.0.0/10}" export_if_unset TF_VAR_jeannie_api_backend_host "${LAB_JEANNIE_API_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-${LAB_DEBIAN_LAN_IP:-}}}" export_if_unset TF_VAR_jeannie_api_backend_port "${LAB_JEANNIE_API_BACKEND_PORT:-8787}" export_if_unset TF_VAR_gitops_repo_url "${LAB_GITOPS_REPO_URL:-}" diff --git a/lib/jeannie/pipeline.sh b/lib/jeannie/pipeline.sh index 457d8be..af7ab7d 100644 --- a/lib/jeannie/pipeline.sh +++ b/lib/jeannie/pipeline.sh @@ -1060,7 +1060,7 @@ ENV_EOF -e "OIDC_ISSUER=${LAB_DEX_PUBLIC_URL:-https://auth.${LAB_DOMAIN:-lab2025.duckdns.org}}" \ "${OFFICE_NEXTCLOUD_CONTAINER_NAME:-homelab-office-nextcloud}" \ sh -lc 'su -s /bin/sh www-data -c "php occ user_oidc:provider nextcloud --clientid=nextcloud --clientsecret=\"$OIDC_CLIENT_SECRET\" --discoveryuri=\"$OIDC_ISSUER/.well-known/openid-configuration\" --scope=openid,profile,email 2>/dev/null || true"' || true - echo "Office stack is running at https://${public_host}/ through the Tailscale-restricted edge route." + echo "Office stack is running at https://${public_host}/ with Dex SSO." echo "Nextcloud data: ${nextcloud_data_dir}; Collabora backend: http://127.0.0.1:${collabora_port}." }