Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ grafana:
grafanaEditor: grafana_editor # maps to grafana role editor
grafanaViewer: grafana_viewer # maps to grafana role viewer
scopes: openid profile email groups
useInternalDex: true
externalDexDomain: set-me
Comment on lines +150 to +151
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get a starting point for schema by:

yq4 -i '.properties.grafana.properties.ops.properties.oidc.properties.useInternalDex.type="boolean"' config/schemas/config.yaml
yq4 -i '.properties.grafana.properties.ops.properties.oidc.properties.externalDexDomain.type="string"' config/schemas/config.yaml

allowedDomains:
- set-me
viewersCanEdit: true
Expand Down
6 changes: 6 additions & 0 deletions helmfile.d/values/grafana/grafana-user.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,15 @@ grafana.ini:
client_secret: $__env{clientSecret}
use_pkce: true
scopes: {{ .Values.grafana.user.oidc.scopes }}
{{- if .Values.grafana.user.oidc.useInternalDex }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be simpler if this was conditional on externalDexDomain being set instead of having two settings?

auth_url: https://{{ .Values.dex.subdomain }}.{{ .Values.global.baseDomain }}{{ $trailingDot }}/auth
token_url: http://dex.dex.svc.cluster.local{{ $trailingDot }}:5556/token
api_url: http://dex.dex.svc.cluster.local{{ $trailingDot }}:5556/api
{{- else }}
auth_url: https://{{ .Values.grafana.user.oidc.externalDexDomain }}{{ $trailingDot }}/auth
token_url: https://{{ .Values.grafana.user.oidc.externalDexDomain }}{{ $trailingDot }}/token
api_url: https://{{ .Values.grafana.user.oidc.externalDexDomain }}{{ $trailingDot }}/api
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you add these settings to the grafana-ops.yaml.gotmpl aswell?
As otherwise i'm wondering why the keys aren't just added to the grafana.user section as they do nothing for the ops grafana version currently.

allowed_domains: {{ join " " .Values.grafana.user.oidc.allowedDomains }}
allow_sign_up: true
tls_skip_verify_insecure: {{ not .Values.global.verifyTls }}
Expand Down
Loading