Added Push Notification Variables

This commit is contained in:
iamEvan 2024-05-27 23:40:35 +01:00
parent 908c74eb27
commit 424437446d
2 changed files with 34 additions and 0 deletions

View File

@ -486,6 +486,10 @@ public function extraFields()
$SMTP_SECURITY = $this->environment_variables()->where('key', 'SMTP_SECURITY')->first(); $SMTP_SECURITY = $this->environment_variables()->where('key', 'SMTP_SECURITY')->first();
$SMTP_PORT = $this->environment_variables()->where('key', 'SMTP_PORT')->first(); $SMTP_PORT = $this->environment_variables()->where('key', 'SMTP_PORT')->first();
$PUSH_ENABLED = $this->environment_variables()->where('key', 'PUSH_ENABLED')->first();
$PUSH_INSTALLATION_ID = $this->environment_variables()->where('key', 'PUSH_SERVICE_ID')->first();
$PUSH_INSTALLATION_KEY = $this->environment_variables()->where('key', 'PUSH_SERVICE_KEY')->first();
if ($DATABASE_URL) { if ($DATABASE_URL) {
$data = $data->merge([ $data = $data->merge([
'Database URL' => [ 'Database URL' => [
@ -566,6 +570,33 @@ public function extraFields()
]); ]);
} }
if ($PUSH_ENABLED) {
$data = $data->merge([
'Push Enabled' => [
'key' => data_get($PUSH_ENABLED, 'key'),
'value' => data_get($PUSH_ENABLED, 'value'),
'rules' => 'required|string|in:true,false',
],
]);
}
if ($PUSH_INSTALLATION_ID) {
$data = $data->merge([
'Push Installation ID' => [
'key' => data_get($PUSH_INSTALLATION_ID, 'key'),
'value' => data_get($PUSH_INSTALLATION_ID, 'value'),
],
]);
}
if ($PUSH_INSTALLATION_KEY) {
$data = $data->merge([
'Push Installation Key' => [
'key' => data_get($PUSH_INSTALLATION_KEY, 'key'),
'value' => data_get($PUSH_INSTALLATION_KEY, 'value'),
'isPassword' => true,
],
]);
}
$fields->put('Vaultwarden', $data); $fields->put('Vaultwarden', $data);
break; break;
} }

View File

@ -20,6 +20,9 @@ services:
- SMTP_SECURITY=${SMTP_SECURITY:-starttls} - SMTP_SECURITY=${SMTP_SECURITY:-starttls}
- SMTP_PORT=${SMTP_PORT} - SMTP_PORT=${SMTP_PORT}
- SMTP_TIMEOUT=15 - SMTP_TIMEOUT=15
- PUSH_ENABLED=${PUSH_ENABLED:-false}
- PUSH_INSTALLATION_ID=${PUSH_SERVICE_ID}
- PUSH_INSTALLATION_KEY=${PUSH_SERVICE_KEY}
volumes: volumes:
- vaultwarden-data:/data - vaultwarden-data:/data
healthcheck: healthcheck: