Add grafana

This commit is contained in:
Marko Korhonen 2023-04-08 13:06:56 +03:00
parent 4e6d402070
commit 17c1d739c2
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
2 changed files with 32 additions and 0 deletions

View file

@ -125,6 +125,11 @@ korhonen.cc, *.korhonen.cc {
reverse_proxy collabora:9980
}
@grafana host grafana.korhonen.cc
handle @grafana {
reverse_proxy grafana:3000
}
# Fallback for unhandled domains
handle {
redir https://korhonen.cc/404.html 301

View file

@ -0,0 +1,27 @@
[services.grafana]
image = "grafana/grafana"
container_name = "grafana"
volumes = ["/docker/stats/grafana:/var/lib/grafana"]
networks = ["stats", "proxy"]
user = "1000:984"
env_file = [".env"]
environment = [
"GF_AUTH_GENERIC_OAUTH_CLIENT_ID",
"GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET",
"GF_AUTH_GENERIC_OAUTH_ENABLED=true",
"GF_AUTH_GENERIC_OAUTH_NAME=authentik",
"GF_AUTH_GENERIC_OAUTH_SCOPES=openid profile email",
"GF_AUTH_GENERIC_OAUTH_AUTH_URL=https://sso.korhonen.cc/application/o/authorize/",
"GF_AUTH_GENERIC_OAUTH_TOKEN_URL=https://sso.korhonen.cc/application/o/token/",
"GF_AUTH_GENERIC_OAUTH_API_URL=https://sso.korhonen.cc/application/o/userinfo/",
"GF_AUTH_SIGNOUT_REDIRECT_URL=https://sso.korhonen.cc/application/o/grafana/end-session/",
"GF_AUTH_OAUTH_AUTO_LOGIN=true",
"GF_SERVER_ROOT_URL=https://grafana.korhonen.cc",
"GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH=contains(groups[*], 'Administrators') && 'Admin' || 'Viewer'",
]
[networks.stats]
external = false
[networks.proxy]
external = true