Set local only access for Prometheus and Traefik

This commit is contained in:
Kris Lamoureux 2020-09-11 23:16:02 -04:00
parent 8a9dea2ec8
commit 274d8736cb
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 6 additions and 1 deletions

View File

@ -2,3 +2,4 @@ prom_name: prometheus
grafana_name: grafana grafana_name: grafana
prom_root: "/opt/{{ prom_name }}" prom_root: "/opt/{{ prom_name }}"
grafana_root: "/opt/{{ prom_name }}/grafana" grafana_root: "/opt/{{ prom_name }}/grafana"
traefik_localonly: "192.168.1.0/24"

View File

@ -44,6 +44,9 @@
labels: labels:
traefik.http.routers.prometheus.rule: "Host(`{{ prom_domain }}`)" traefik.http.routers.prometheus.rule: "Host(`{{ prom_domain }}`)"
traefik.http.routers.prometheus.entrypoints: websecure traefik.http.routers.prometheus.entrypoints: websecure
traefik.http.routers.prometheus.middlewares: "securehttps@file,localonly"
traefik.http.routers.prometheus.tls.certresolver: letsencrypt
traefik.http.middlewares.localonly.ipwhitelist.sourcerange: "{{ traefik_localonly }}"
traefik.docker.network: traefik traefik.docker.network: traefik
traefik.enable: "true" traefik.enable: "true"

View File

@ -35,8 +35,9 @@
labels: labels:
traefik.http.routers.traefik.rule: "Host(`{{ traefik_domain }}`)" traefik.http.routers.traefik.rule: "Host(`{{ traefik_domain }}`)"
traefik.http.middlewares.auth.basicauth.users: "{{ traefik_auth }}" traefik.http.middlewares.auth.basicauth.users: "{{ traefik_auth }}"
traefik.http.middlewares.localonly.ipwhitelist.sourcerange: "{{ traefik_localonly }}"
traefik.http.routers.traefik.tls.certresolver: letsencrypt traefik.http.routers.traefik.tls.certresolver: letsencrypt
traefik.http.routers.traefik.middlewares: "securehttps@file,auth@docker" traefik.http.routers.traefik.middlewares: "securehttps@file,auth@docker,localonly"
traefik.http.routers.traefik.service: "api@internal" traefik.http.routers.traefik.service: "api@internal"
traefik.http.routers.traefik.entrypoints: websecure traefik.http.routers.traefik.entrypoints: websecure
traefik.http.routers.traefik.tls: "true" traefik.http.routers.traefik.tls: "true"