diff --git a/apps/nightscout/kustomization.yaml b/apps/nightscout/kustomization.yaml index 323cc99..ab0581d 100644 --- a/apps/nightscout/kustomization.yaml +++ b/apps/nightscout/kustomization.yaml @@ -11,4 +11,5 @@ resources: - nightscout-deployment.yaml - nightscout-service.yaml - nightscout-ingress.yaml + - nightscout-lan-only.yaml - network-policy.yaml diff --git a/apps/nightscout/nightscout-configmap.yaml b/apps/nightscout/nightscout-configmap.yaml index 2f0e129..3d88f15 100644 --- a/apps/nightscout/nightscout-configmap.yaml +++ b/apps/nightscout/nightscout-configmap.yaml @@ -9,6 +9,5 @@ data: INSECURE_USE_HTTP: "true" HOSTNAME: "0.0.0.0" ENABLE: "careportal basal iob cob bwp cage sage iage bage boluscalc pump openaps loop profile timeago bgnow delta direction upbat errorcodes ar2 rawbg" - AUTH_DEFAULT_ROLES: "careportal" THEME: "colors" NODE_ENV: "production" diff --git a/apps/nightscout/nightscout-deployment.yaml b/apps/nightscout/nightscout-deployment.yaml index 0c4effd..97f54d3 100644 --- a/apps/nightscout/nightscout-deployment.yaml +++ b/apps/nightscout/nightscout-deployment.yaml @@ -27,6 +27,10 @@ spec: capabilities: drop: - ALL + # Set explicitly so changing anonymous access triggers a pod rollout. + env: + - name: AUTH_DEFAULT_ROLES + value: "readable" envFrom: - configMapRef: name: nightscout-config diff --git a/apps/nightscout/nightscout-ingress.yaml b/apps/nightscout/nightscout-ingress.yaml index e8422e0..c569f94 100644 --- a/apps/nightscout/nightscout-ingress.yaml +++ b/apps/nightscout/nightscout-ingress.yaml @@ -6,6 +6,8 @@ metadata: annotations: cert-manager.io/cluster-issuer: letsencrypt-prod traefik.ingress.kubernetes.io/router.entrypoints: websecure + # Nightscout grants anonymous read access; keep that access on the trusted LAN only. + traefik.ingress.kubernetes.io/router.middlewares: nightscout-lan-only@kubernetescrd spec: ingressClassName: traefik rules: diff --git a/apps/nightscout/nightscout-lan-only.yaml b/apps/nightscout/nightscout-lan-only.yaml new file mode 100644 index 0000000..60cb418 --- /dev/null +++ b/apps/nightscout/nightscout-lan-only.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: nightscout-lan-only + namespace: nightscout +spec: + ipAllowList: + sourceRange: + - 10.10.0.0/24