fix: publish office endpoint publicly
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-10-22 10:25:35 -06:00
parent 5c5055465b
commit ccfa335083
6 changed files with 3 additions and 14 deletions

View File

@ -54,7 +54,6 @@ locals {
office_server_name = local.office_server_name office_server_name = local.office_server_name
office_backend_host = var.office_backend_host office_backend_host = var.office_backend_host
office_backend_port = tostring(var.office_backend_port) office_backend_port = tostring(var.office_backend_port)
office_tailscale_cidr = var.office_tailscale_cidr
}) })
default_vcl = templatefile("${path.module}/templates/default.vcl.tftpl", { default_vcl = templatefile("${path.module}/templates/default.vcl.tftpl", {
backend_host = var.backend_host backend_host = var.backend_host
@ -112,7 +111,6 @@ resource "null_resource" "edge_services" {
jeannie_api_port = tostring(var.jeannie_api_backend_port) jeannie_api_port = tostring(var.jeannie_api_backend_port)
office_host = var.office_backend_host office_host = var.office_backend_host
office_port = tostring(var.office_backend_port) office_port = tostring(var.office_backend_port)
office_tailscale_cidr = var.office_tailscale_cidr
enable_letsencrypt = tostring(var.enable_letsencrypt) enable_letsencrypt = tostring(var.enable_letsencrypt)
letsencrypt_email = var.letsencrypt_email letsencrypt_email = var.letsencrypt_email
letsencrypt_staging = tostring(var.letsencrypt_staging) letsencrypt_staging = tostring(var.letsencrypt_staging)

View File

@ -218,9 +218,6 @@ server {
ssl_protocols TLSv1.2 TLSv1.3; ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5; 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; client_max_body_size 2g;
location / { location / {

View File

@ -163,11 +163,6 @@ variable "office_backend_port" {
default = 8090 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) # Matrix (isolated vhost + its own cert; does NOT touch shared current.crt)
variable "matrix_enabled" { variable "matrix_enabled" {
type = bool type = bool

View File

@ -11,8 +11,8 @@ The pipeline deploys the stack independently with:
./jeannie deploy-office ./jeannie deploy-office
``` ```
The edge route is `https://office.lab2025.duckdns.org` and is restricted to the The edge route is `https://office.lab2025.duckdns.org` and is protected by
Tailscale CGNAT range. Dex SSO is configured by the pipeline after the first Dex SSO. Dex SSO is configured by the pipeline after the first
Nextcloud boot when `DEX_OFFICE_CLIENT_SECRET` exists in the encrypted Dex Nextcloud boot when `DEX_OFFICE_CLIENT_SECRET` exists in the encrypted Dex
secret. Existing older Dex secret files must be regenerated or supplied with secret. Existing older Dex secret files must be regenerated or supplied with
`LAB_OFFICE_OIDC_CLIENT_SECRET`; credentials are never committed to the `LAB_OFFICE_OIDC_CLIENT_SECRET`; credentials are never committed to the

View File

@ -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_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_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_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_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_jeannie_api_backend_port "${LAB_JEANNIE_API_BACKEND_PORT:-8787}"
export_if_unset TF_VAR_gitops_repo_url "${LAB_GITOPS_REPO_URL:-}" export_if_unset TF_VAR_gitops_repo_url "${LAB_GITOPS_REPO_URL:-}"

View File

@ -1060,7 +1060,7 @@ ENV_EOF
-e "OIDC_ISSUER=${LAB_DEX_PUBLIC_URL:-https://auth.${LAB_DOMAIN:-lab2025.duckdns.org}}" \ -e "OIDC_ISSUER=${LAB_DEX_PUBLIC_URL:-https://auth.${LAB_DOMAIN:-lab2025.duckdns.org}}" \
"${OFFICE_NEXTCLOUD_CONTAINER_NAME:-homelab-office-nextcloud}" \ "${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 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}." echo "Nextcloud data: ${nextcloud_data_dir}; Collabora backend: http://127.0.0.1:${collabora_port}."
} }