fix: set default values for missing env variables

This commit is contained in:
Moritz 2023-03-08 16:48:45 +01:00
parent 783392bc36
commit 12b28932b2
2 changed files with 16 additions and 15 deletions

View File

@ -1,5 +1,5 @@
export CUSTOM_CSS_VERSION=v2
export CUSTOM_FLOWS_VERSION=v4
export CUSTOM_FLOWS_VERSION=v5
customize() {
if [ -z "$1" ]

View File

@ -4,12 +4,13 @@ metadata:
blueprints.goauthentik.io/instantiate: "true"
name: Custom - Flows
context:
welcome_message: {{ if eq (env "WELCOME_MESSAGE") "" }} "Welcome to authentik!" {{ else }} {{ env "WELCOME_MESSAGE" }} {{ end }}
####### Translations ########
transl_recovery: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Passwort Zurücksetzen {{ else }} Reset your password {{ end }}
transl_password: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Passwort {{ else }} Password {{ end }}
transl_password_repeat: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Passwort (wiederholen) {{ else }} Password (repeat) {{ end }}
transl_username: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Benutzername {{ else }} Username {{ end }}
transl_name: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Vor- und Nachname {{ else }} Full name {{ end }}
transl_recovery: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort Zurücksetzen" {{ else }} "Reset your password" {{ end }}
transl_password: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort" {{ else }} "Password" {{ end }}
transl_password_repeat: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort (wiederholen)" {{ else }} "Password (repeat)" {{ end }}
transl_username: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Benutzername" {{ else }} "Username" {{ end }}
transl_name: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Vor- und Nachname" {{ else }} "Full name" {{ end }}
entries:
######## Email Recovery Flow ########
@ -25,10 +26,10 @@ entries:
### PROMPTS
- identifiers:
field_key: password
label: !Context transl_password
id: prompt-field-password
model: authentik_stages_prompt.prompt
attrs:
label: !Context transl_password
type: password
required: true
placeholder: !Context transl_password
@ -36,10 +37,10 @@ entries:
placeholder_expression: false
- identifiers:
field_key: password_repeat
label: !Context transl_password_repeat
id: prompt-field-password-repeat
model: authentik_stages_prompt.prompt
attrs:
label: !Context transl_password_repeat
type: password
required: true
placeholder: !Context transl_password_repeat
@ -54,8 +55,8 @@ entries:
model: authentik_stages_email.emailstage
attrs:
use_global_settings: true
token_expiry: {{ env "EMAIL_TOKEN_EXPIRY_MINUTES" }}
subject: "{{ env "EMAIL_SUBJECT" }}"
token_expiry: {{ if eq (env "EMAIL_TOKEN_EXPIRY_MINUTES") "" }} 30 {{ else }} {{ env "EMAIL_TOKEN_EXPIRY_MINUTES" }} {{ end }}
subject: {{ if eq (env "EMAIL_SUBJECT") "" }} "Account Recovery" {{ else }} "{{ env "EMAIL_SUBJECT" }}" {{ end }}
template: email/password_reset.html
activate_user_on_success: true
- identifiers:
@ -178,7 +179,7 @@ entries:
- attrs:
designation: authentication
name: custom-authentication-flow
title: {{ env "WELCOME_MESSAGE" }}
title: !Context welcome_message
identifiers:
slug: custom-authentication-flow
id: authentication_flow
@ -240,7 +241,7 @@ entries:
- attrs:
designation: enrollment
name: invitation-enrollment-flow
title: {{ env "WELCOME_MESSAGE" }}
title: !Context welcome_message
identifiers:
slug: invitation-enrollment-flow
id: invitation-enrollment-flow
@ -249,10 +250,10 @@ entries:
### PROMPTS
- identifiers:
field_key: username
label: !Context transl_username
id: prompt-field-username
model: authentik_stages_prompt.prompt
attrs:
label: !Context transl_username
type: username
required: true
placeholder: !Context transl_username
@ -260,10 +261,10 @@ entries:
placeholder_expression: false
- identifiers:
field_key: name
label: !Context transl_name
id: prompt-field-name
model: authentik_stages_prompt.prompt
attrs:
label: !Context transl_name
type: text
required: true
placeholder: !Context transl_name
@ -387,7 +388,7 @@ entries:
- attrs:
attributes:
settings:
locale: {{ env "DEFAULT_LANGUAGE" }}
locale: {{ if eq (env "DEFAULT_LANGUAGE") "" }} en {{ else }} {{ env "DEFAULT_LANGUAGE" }} {{ end }}
# branding_favicon: /static/dist/assets/icons/icon.png
# branding_logo: /static/dist/assets/icons/icon_left_brand.svg
# branding_title: Authentik