Skip to content

Commit

Permalink
feat(directus): add oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
walkoss committed Apr 13, 2023
1 parent e075090 commit 6660554
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 59 deletions.
4 changes: 2 additions & 2 deletions directus/helm/directus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: directus
description: helm chart for directus
type: application
version: 0.1.0
appVersion: 9.25.0
appVersion: 9.25.1
dependencies:
- name: postgres
version: 0.1.16
repository: https://pluralsh.github.io/module-library
condition: postgres.enabled
condition: postgres.enabled
54 changes: 0 additions & 54 deletions directus/helm/directus/main.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions directus/helm/directus/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ spec:
secretKeyRef:
name: {{ include "directus-plural.secretName" . }}
key: secret
{{- if .Values.directus.oidc.enabled }}
- name: AUTH_PLURAL_ISSUER_URL
valueFrom:
secretKeyRef:
name: {{ include "directus-plural.secretName" . }}
key: oidc-issuer
- name: AUTH_PLURAL_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ include "directus-plural.secretName" . }}
key: oidc-client-id
- name: AUTH_PLURAL_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ include "directus-plural.secretName" . }}
key: oidc-client-secret
{{- end }}
ports:
- name: http
containerPort: 8055
Expand Down
5 changes: 5 additions & 0 deletions directus/helm/directus/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ metadata:
stringData:
key: {{ .Values.directus.key }}
secret: {{ .Values.directus.secret }}
{{- if .Values.directus.oidc.enabled }}}
oidc-issuer: {{ .Values.directus.oidc.issuer }}
oidc-client-id: {{ .Values.directus.oidc.clientId }}
oidc-client-secret: {{ .Values.directus.oidc.clientSecret }}
{{- end }}
2 changes: 1 addition & 1 deletion directus/helm/directus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ affinity: {}

env:
DB_CLIENT: pg
NODE_TLS_REJECT_UNAUTHORIZED: 0
NODE_TLS_REJECT_UNAUTHORIZED: 0
13 changes: 13 additions & 0 deletions directus/helm/directus/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,23 @@ postgres:

env:
PUBLIC_URL: https://{{ $hostname }}
{{ if .OIDC }}
AUTH_PROVIDERS: plural
AUTH_PLURAL_DRIVER: openid
AUTH_PLURAL_SCOPE: openid profile
AUTH_PLURAL_ALLOW_PUBLIC_REGISTRATION: true
{{ end }}

directus:
key: {{ $key }}
secret: {{ $secret }}
{{ if .OIDC }}
oidc:
enabled: true
clientId: {{ .OIDC.ClientId }}
clientSecret: {{ .OIDC.ClientSecret }}
issuer: {{ .OIDC.Configuration.Issuer }}
{{ end }}

ingress:
enabled: true
Expand Down
7 changes: 7 additions & 0 deletions directus/plural/notes.tpl
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
Your directus installation is available at https://{{ .Values.hostname }}

{{ if .OIDC }}
Your directus has been configured with OAuth against your plural account!
{{ else }}
You are using standard username/password authentication, so user management will be manual via the ADMIN_EMAIL and ADMIN_PASSWORD environment variables.
We strongly recommend that you consider installing with OIDC enabled.
{{ end }}
4 changes: 4 additions & 0 deletions directus/plural/recipes/directus-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ dependencies:
name: aws-k8s
- repo: ingress-nginx
name: ingress-nginx-aws
oidcSettings:
authMethod: POST
uriFormat: https://{domain}/auth/login/plural/callback
domainKey: hostname
sections:
- name: directus
configuration:
Expand Down
4 changes: 4 additions & 0 deletions directus/plural/recipes/directus-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ dependencies:
name: azure-k8s
- repo: ingress-nginx
name: ingress-nginx-azure
oidcSettings:
authMethod: POST
uriFormat: https://{domain}/auth/login/plural/callback
domainKey: hostname
sections:
- name: directus
configuration:
Expand Down
4 changes: 4 additions & 0 deletions directus/plural/recipes/directus-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ dependencies:
name: gcp-k8s
- repo: ingress-nginx
name: ingress-nginx-gcp
oidcSettings:
authMethod: POST
uriFormat: https://{domain}/auth/login/plural/callback
domainKey: hostname
sections:
- name: directus
configuration:
Expand Down
7 changes: 6 additions & 1 deletion directus/repository.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: directus
description: directus deployed on plural
description: The Modern Data Stack 🐰 — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database.
category: DATA
private: true
releaseStatus: ALPHA
icon: plural/icons/directus-logo-stacked.png
notes: plural/notes.tpl
homepage: https://directus.io/engine
gitUrl: https://github.com/directus/directus
oauthSettings:
uriFormat: https://{domain}/auth/login/plural/callback
authMethod: POST
contributors:
- [email protected]
2 changes: 1 addition & 1 deletion directus/vendor_images.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker.io:
images:
directus/directus:
- "9.25.0"
- "9.25.1"

0 comments on commit 6660554

Please sign in to comment.