Skip to content

Commit be30c09

Browse files
authored
Merge pull request #9787 from nextcloud/notify-credentials-env
allow setting notify credentials in environment
2 parents c60c8ac + 48fb126 commit be30c09

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apps/files_external/lib/Command/Notify.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ protected function execute(InputInterface $input, OutputInterface $output) {
106106

107107
if ($input->getOption('user')) {
108108
$mount->setBackendOption('user', $input->getOption('user'));
109+
} else if (isset($_ENV['NOTIFY_USER'])) {
110+
$mount->setBackendOption('user', $_ENV['NOTIFY_USER']);
111+
} else if (isset($_SERVER['NOTIFY_USER'])) {
112+
$mount->setBackendOption('user', $_SERVER['NOTIFY_USER']);
109113
}
110114
if ($input->getOption('password')) {
111115
$mount->setBackendOption('password', $input->getOption('password'));
116+
} else if (isset($_ENV['NOTIFY_PASSWORD'])) {
117+
$mount->setBackendOption('password', $_ENV['NOTIFY_PASSWORD']);
118+
} else if (isset($_SERVER['NOTIFY_PASSWORD'])) {
119+
$mount->setBackendOption('password', $_SERVER['NOTIFY_PASSWORD']);
112120
}
113121

114122
try {

0 commit comments

Comments
 (0)