WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 3c9b741

Browse files
committed
Ory Hydra improvements
1 parent d85e938 commit 3c9b741

File tree

6 files changed

+114
-37
lines changed

6 files changed

+114
-37
lines changed

apps/ory-hydra2/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
prometheus.io/scrape: 'false'
2222
spec:
2323
containers:
24-
- image: oryd/hydra:v2.3.0
24+
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
2525
imagePullPolicy: Always
2626
name: ory-hydra2
2727
envFrom:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{- $wave := 1 }}
2+
{{- range .Values.clients }}
3+
apiVersion: batch/v1
4+
kind: Job
5+
metadata:
6+
name: ory-hydra-create-client-{{ .id | replace "-" "" }}
7+
namespace: faf-apps
8+
labels:
9+
app: ory-hydra-create-clients
10+
annotations:
11+
argocd.argoproj.io/hook: PostSync
12+
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
13+
#argocd.argoproj.io/hook-delete-policy: HookSucceeded
14+
argocd.argoproj.io/sync-wave: '{{ $wave }}'
15+
spec:
16+
backoffLimit: 1
17+
template:
18+
spec:
19+
containers:
20+
- name: ory-hydra-create-client
21+
image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
22+
imagePullPolicy: Always
23+
envFrom:
24+
- configMapRef:
25+
name: ory-hydra2
26+
- secretRef:
27+
name: ory-hydra2
28+
env:
29+
- name: ORY_SDK_URL
30+
value: http://ory-hydra2:4445
31+
command: ["/bin/sh", "-c"]
32+
args:
33+
- |
34+
if ! hydra get oauth2-client "{{ .id }}" >/dev/null 2>&1; then
35+
hydra create oauth2-client \
36+
--name "{{ .name }}" \
37+
--id "{{ .id }}" \
38+
--grant-type "{{ .grantType }}" \
39+
--scope "{{ .scope }}" \
40+
{{- if .redirectUri }}--redirect-uri "{{ .redirectUri }}" {{- end }} \
41+
{{- if .logoUri }}--logo-uri "{{ .logoUri }}" {{- end }} \
42+
{{- if .tosUri }}--tos-uri "{{ .tosUri }}" {{- end }} \
43+
{{- if .policyUri }}--policy-uri "{{ .policyUri }}" {{- end }} \
44+
{{- if .tokenEndpointAuthMethod }}--token-endpoint-auth-method "{{ .tokenEndpointAuthMethod }}" {{- end }}
45+
else
46+
echo "Client {{ .id }} already exists, skipping."
47+
fi
48+
restartPolicy: Never
49+
{{- $wave = add $wave 1 }}
50+
{{- end }}

apps/ory-hydra2/templates/janitor-cronjob.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
template:
2121
spec:
2222
containers:
23-
- image: oryd/hydra:v2.3.0
23+
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
2424
imagePullPolicy: Always
2525
name: ory-hydra
2626
envFrom:

apps/ory-hydra2/templates/migration-cronjob.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
kind: Job
2+
apiVersion: batch/v1
3+
metadata:
4+
name: ory-hydra2-migration
5+
namespace: faf-apps
6+
labels:
7+
app: ory-hydra-migration
8+
annotations:
9+
argocd.argoproj.io/hook: PreSync
10+
argocd.argoproj.io/hook-delete-policy: HookSucceeded
11+
argocd.argoproj.io/sync-wave: '-1'
12+
spec:
13+
backoffLimit: 1
14+
template:
15+
spec:
16+
containers:
17+
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
18+
imagePullPolicy: Always
19+
name: ory-hydra-migration
20+
envFrom:
21+
- configMapRef:
22+
name: ory-hydra2
23+
- secretRef:
24+
name: ory-hydra2
25+
ports:
26+
- containerPort: 4444
27+
- containerPort: 4445
28+
args: [ "migrate", "sql", "--read-from-env", "--yes"]
29+
restartPolicy: Never

apps/ory-hydra2/values.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
image:
2+
repository: "oryd/hydra"
3+
tag: "v25.4.0"
4+
clients:
5+
- name: "FAF Client"
6+
id: "2e8808cf-5889-469b-b2c3-01f0cc58c4af"
7+
grantType: "authorization_code,refresh_token"
8+
scope: "openid,email,offline,public_profile,lobby,upload_map,upload_mod"
9+
redirectUri: "http://127.0.0.1"
10+
logoUri: "https://faforever.com/images/faf-logo.png"
11+
tosUri: "https://faforever.com/tos"
12+
policyUri: "https://faforever.com/privacy"
13+
tokenEndpointAuthMethod: "none"
14+
15+
- name: "FAF Moderator Client"
16+
id: "8ff5c14f-60e2-41b9-b594-a641dc5013be"
17+
grantType: "authorization_code"
18+
scope: "openid,public_profile,upload_avatar,administrative_actions,read_sensible_userdata,manage_vault"
19+
redirectUri: "http://localhost,http://localhost:8080/,http://127.0.0.1"
20+
logoUri: "https://faforever.com/images/faf-logo.png"
21+
tosUri: "https://faforever.com/tos"
22+
policyUri: "https://faforever.com/privacy"
23+
clientUri: "https://github.com/FAForever/faf-moderator-client"
24+
tokenEndpointAuthMethod: "none"
25+
26+
- name: "Ethereal FAF client"
27+
id: "b05039ed-e2ab-4fb6-8a7f-e6ecdcc2edcd"
28+
grantType: "authorization_code,refresh_token"
29+
scope: "openid,offline,public_profile,lobby,upload_map,upload_mod"
30+
redirectUri: "http://localhost,http://localhost:57728,http://localhost:59573,http://localhost:58256,http://localhost:53037,http://localhost:51360"
31+
logoUri: "https://raw.githubusercontent.com/Eternal-ll/Ethereal-FAF-Client/master/Logo/OAuth.svg"
32+
clientUri: "https://github.com/Eternal-ll/Ethereal-FAF-Client"
33+
tokenEndpointAuthMethod: "none"

0 commit comments

Comments
 (0)