Skip to content

Commit

Permalink
Added Push Notification Variables
Browse files Browse the repository at this point in the history
  • Loading branch information
iamEvanYT committed May 27, 2024
1 parent 908c74e commit 4244374
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions app/Models/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ public function extraFields()
$SMTP_SECURITY = $this->environment_variables()->where('key', 'SMTP_SECURITY')->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) {
$data = $data->merge([
'Database URL' => [
Expand Down Expand Up @@ -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);
break;
}
Expand Down
3 changes: 3 additions & 0 deletions templates/compose/vaultwarden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ services:
- SMTP_SECURITY=${SMTP_SECURITY:-starttls}
- SMTP_PORT=${SMTP_PORT}
- SMTP_TIMEOUT=15
- PUSH_ENABLED=${PUSH_ENABLED:-false}
- PUSH_INSTALLATION_ID=${PUSH_SERVICE_ID}
- PUSH_INSTALLATION_KEY=${PUSH_SERVICE_KEY}
volumes:
- vaultwarden-data:/data
healthcheck:
Expand Down

0 comments on commit 4244374

Please sign in to comment.