Skip to content

Commit 82f7e5f

Browse files
committed
Merge branch 'feat/oauth' into 'main'
feat: Add OAuth support for Grafana authentication See merge request postgres-ai/postgres_ai!79
2 parents cd4e56c + 98b5bc3 commit 82f7e5f

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
[users]
22
home_page = /d/f90500a0-a12e-4081-a2f0-07ed96f27915/1-postgres-node-performance-overview-high-level/
3+
4+
[auth]
5+
# When OAuth is enabled, optionally disable the basic login form
6+
disable_login_form = false
7+
8+
[auth.generic_oauth]
9+
# OAuth is disabled by default; enable via GF_AUTH_GENERIC_OAUTH_ENABLED env var
10+
enabled = false
11+
name = PostgresAI
12+
allow_sign_up = true

docker-compose.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ services:
119119
GF_SECURITY_ADMIN_USER: monitor
120120
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:-demo}
121121
GF_INSTALL_PLUGINS: yesoreyeram-infinity-datasource
122+
# OAuth configuration (disabled by default, enabled via Ansible)
123+
GF_AUTH_GENERIC_OAUTH_ENABLED: ${GRAFANA_OAUTH_ENABLED:-false}
124+
GF_AUTH_GENERIC_OAUTH_NAME: ${GRAFANA_OAUTH_NAME:-PostgresAI}
125+
GF_AUTH_GENERIC_OAUTH_ALLOW_SIGN_UP: ${GRAFANA_OAUTH_ALLOW_SIGN_UP:-true}
126+
GF_AUTH_GENERIC_OAUTH_CLIENT_ID: ${GRAFANA_OAUTH_CLIENT_ID:-}
127+
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET: ${GRAFANA_OAUTH_CLIENT_SECRET:-}
128+
GF_AUTH_GENERIC_OAUTH_SCOPES: ${GRAFANA_OAUTH_SCOPES:-openid email profile}
129+
GF_AUTH_GENERIC_OAUTH_AUTH_URL: ${GRAFANA_OAUTH_AUTH_URL:-}
130+
GF_AUTH_GENERIC_OAUTH_TOKEN_URL: ${GRAFANA_OAUTH_TOKEN_URL:-}
131+
GF_AUTH_GENERIC_OAUTH_API_URL: ${GRAFANA_OAUTH_API_URL:-}
132+
# Optional: disable login form when OAuth is primary auth
133+
GF_AUTH_DISABLE_LOGIN_FORM: ${GRAFANA_DISABLE_LOGIN_FORM:-false}
134+
GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL:-}
122135
ports:
123136
- "${GRAFANA_BIND_HOST:-}3000:3000"
124137
volumes:
@@ -191,18 +204,18 @@ services:
191204
- /var/lib/docker/:/var/lib/docker:ro
192205
- /dev/disk/:/dev/disk:ro
193206
command:
194-
- '--housekeeping_interval=30s'
195-
- '--docker_only=true'
196-
- '--disable_metrics=percpu,sched,tcp,udp,hugetlb,referenced_memory,cpu_topology,resctrl'
197-
- '--store_container_labels=false'
207+
- "--housekeeping_interval=30s"
208+
- "--docker_only=true"
209+
- "--disable_metrics=percpu,sched,tcp,udp,hugetlb,referenced_memory,cpu_topology,resctrl"
210+
- "--store_container_labels=false"
198211

199212
# Node Exporter - System metrics
200213
node-exporter:
201214
image: prom/node-exporter:v1.8.2
202215
container_name: node-exporter
203216
command:
204-
- '--path.rootfs=/host'
205-
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
217+
- "--path.rootfs=/host"
218+
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
206219
volumes:
207220
- /:/host:ro,rslave
208221
restart: unless-stopped

0 commit comments

Comments
 (0)