Skip to content

Commit dd38337

Browse files
Add a custom templates example in the documentation (#93)
* Add a custom templates example in the documentation Related to oauth2-proxy/oauth2-proxy#1507 * Update Chart.yaml Co-authored-by: Pierluigi Lenoci <[email protected]> Co-authored-by: Pierluigi Lenoci <[email protected]>
1 parent 3c67889 commit dd38337

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 6.2.5
2+
version: 6.2.6
33
apiVersion: v2
44
appVersion: 7.3.0
55
home: https://oauth2-proxy.github.io/oauth2-proxy/

helm/oauth2-proxy/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,44 @@ extraEnv:
247247
- name: TEST_ENV_VAR_2
248248
value: '{{ .Values.tplValue }}'
249249
```
250+
251+
## Custom templates configuration
252+
You can replace the default template files using a Kubernetes `configMap` volume. The default templates are the two files [sign_in.html](https://github.com/oauth2-proxy/oauth2-proxy/blob/master/pkg/app/pagewriter/sign_in.html) and [error.html](https://github.com/oauth2-proxy/oauth2-proxy/blob/master/pkg/app/pagewriter/error.html).
253+
254+
```yaml
255+
config:
256+
configFile: |
257+
...
258+
custom_templates_dir = "/data/custom-templates"
259+
260+
extraVolumes:
261+
- name: custom-templates
262+
configMap:
263+
name: oauth2-proxy-custom-templates
264+
265+
extraVolumeMounts:
266+
- name: custom-templates
267+
mountPath: "/data/custom-templates"
268+
readOnly: true
269+
270+
extraObjects:
271+
- apiVersion: v1
272+
kind: ConfigMap
273+
metadata:
274+
name: oauth2-proxy-custom-templates
275+
data:
276+
sign_in.html: |
277+
<!DOCTYPE html>
278+
<html>
279+
<body>sign_in</body>
280+
</html>
281+
error.html: |
282+
<!DOCTYPE html>
283+
<html>
284+
<body>
285+
<h1>error</h1>
286+
<p>{{.StatusCode}}</p>
287+
</body>
288+
</html>
289+
```
290+

0 commit comments

Comments
 (0)