Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Notifications existing secret #107

Merged
merged 5 commits into from
Aug 27, 2024
Merged
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: 1 addition & 1 deletion charts/vaultwarden/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- name: guerzon
email: [email protected]
url: https://github.com/guerzon
version: 0.24.1
version: 0.24.2
kubeVersion: ">=1.12.0-0"
16 changes: 11 additions & 5 deletions charts/vaultwarden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,17 @@ helm -n $NAMESPACE uninstall $RELEASE_NAME
| `database.connectionRetries` | Number of times to retry the database connection during startup, with 1 second delay between each retry, set to 0 to retry indefinitely. | `15` |
| `database.maxConnections` | Define the size of the connection pool used for connecting to the database. | `10` |

### Push notifications

| Name | Description | Value |
| ------------------- | ---------------------------------------------------------------- | ----- |
| `pushNotifications` | Enable mobile push notifications, see values.yaml for parameters | `{}` |
### Push Notifications

| Name | Description | Value |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------- |
| `pushNotifications.existingSecret` | Name of an existing secret containing the Bitwarden installation id and key | `""` |
| `pushNotifications.installationId.value` | Bitwarden installation id string | `""` |
| `pushNotifications.installationId.existingSecretKey` | When using an existing secret, specify the key which contains the installation id. | `""` |
| `pushNotifications.installationKey.value` | Bitwarden installation key string | `""` |
| `pushNotifications.installationKey.existingSecretKey` | When using an existing secret, specify the key which contains the installation key. | `""` |
| `pushNotifications.relayUri` | Change Bitwarden relay uri. | `https://push.bitwarden.com` |
| `pushNotifications.identityUri` | Change Bitwarden identity uri. | `https://identity.bitwarden.com` |

### Scheduled jobs

Expand Down
14 changes: 14 additions & 0 deletions charts/vaultwarden/templates/_podSpec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ containers:
- name: DISABLE_ADMIN_TOKEN
value: "true"
{{- end }}
{{- if or (.Values.pushNotifications.installationId.value) (.Values.pushNotifications.installationId.existingSecretKey )}}
- name: PUSH_INSTALLATION_ID
valueFrom:
secretKeyRef:
name: {{ default (include "vaultwarden.fullname" .) .Values.pushNotifications.existingSecret }}
key: {{ default "PUSH_INSTALLATION_ID" .Values.pushNotifications.installationId.existingSecretKey }}
{{- end }}
{{- if or (.Values.pushNotifications.installationKey.value) (.Values.pushNotifications.installationKey.existingSecretKey )}}
- name: PUSH_INSTALLATION_KEY
valueFrom:
secretKeyRef:
name: {{ default (include "vaultwarden.fullname" .) .Values.pushNotifications.existingSecret }}
key: {{ default "PUSH_INSTALLATION_KEY" .Values.pushNotifications.installationKey.existingSecretKey }}
{{- end }}
{{- if ne "default" .Values.database.type }}
- name: DATABASE_URL
{{- if .Values.database.existingSecret }}
Expand Down
2 changes: 0 additions & 2 deletions charts/vaultwarden/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ data:
IP_HEADER: {{ .Values.ipHeader | quote }}
{{- if .Values.pushNotifications }}
PUSH_ENABLED: "true"
PUSH_INSTALLATION_ID: {{ .Values.pushNotifications.installationId | quote }}
PUSH_INSTALLATION_KEY: {{ .Values.pushNotifications.installationKey | quote }}
{{- with .Values.pushNotifications.relayUri }}
PUSH_RELAY_URI: {{ . | quote }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/vaultwarden/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ data:
SMTP_PASSWORD: {{ .Values.smtp.password.value | b64enc | quote }}
SMTP_USERNAME: {{ .Values.smtp.username.value | b64enc | quote }}
{{- end }}
{{- if not ( .Values.pushNotifications.existingSecret ) }}
PUSH_INSTALLATION_ID: {{ .Values.pushNotifications.installationId.value | b64enc | quote }}
PUSH_INSTALLATION_KEY: {{ .Values.pushNotifications.installationKey.value | b64enc | quote }}
{{- end }}
{{- if not ( .Values.adminToken.existingSecret ) }}
ADMIN_TOKEN: {{ .Values.adminToken.value | b64enc | quote }}
{{- end }}
Expand Down
41 changes: 32 additions & 9 deletions charts/vaultwarden/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,41 @@ database:
##
maxConnections: 10

## @section Push notifications
##

## @param pushNotifications Enable mobile push notifications, see values.yaml for parameters
## @section Push Notifications
## Supported since 1.29.0.
## Refer to https://github.com/dani-garcia/vaultwarden/wiki/Enabling-Mobile-Client-push-notification for details
##
pushNotifications: {}
# installationId: ""
# installationKey: ""
# relayUri: "https://push.bitwarden.com"
# identityUri: "https://identity.bitwarden.com"

pushNotifications:
## @param pushNotifications.existingSecret Name of an existing secret containing the Bitwarden installation id and key
##
existingSecret: ""
installationId:
## @param pushNotifications.installationId.value Bitwarden installation id string
## Example: installationIdGoesHere
##
value: ""
## @param pushNotifications.installationId.existingSecretKey When using an existing secret, specify the key which contains the installation id.
## Example: INSTALLATION_ID
##
existingSecretKey: ""
installationKey:
## @param pushNotifications.installationKey.value Bitwarden installation key string
## Example: superSecretInstallationKey
##
value: ""
## @param pushNotifications.installationKey.existingSecretKey When using an existing secret, specify the key which contains the installation key.
## Example: INSTALLATION_KEY
##
existingSecretKey: ""
## @param pushNotifications.relayUri Change Bitwarden relay uri.
## Refer to https://github.com/dani-garcia/vaultwarden/wiki/Enabling-Mobile-Client-push-notification for details
##
relayUri: "https://push.bitwarden.com"
## @param pushNotifications.identityUri Change Bitwarden identity uri.
## Refer to https://github.com/dani-garcia/vaultwarden/wiki/Enabling-Mobile-Client-push-notification for details
##
identityUri: "https://identity.bitwarden.com"

## @section Scheduled jobs
##
Expand Down
Loading