mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
allow nextcloud to access outside directories
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
a2f60ba765
commit
bc50b0cc4f
4 changed files with 55 additions and 0 deletions
|
|
@ -67,6 +67,18 @@ class ContainerDefinitionFetcher
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if($value['name'] === '%NEXTCLOUD_MOUNT%') {
|
||||
$value['name'] = $this->configurationManager->GetNextcloudMount();
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if($value['location'] === '%NEXTCLOUD_MOUNT%') {
|
||||
$value['location'] = $this->configurationManager->GetNextcloudMount();
|
||||
if($value['location'] === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$volumes->AddVolume(
|
||||
new ContainerVolume(
|
||||
$value['name'],
|
||||
|
|
|
|||
|
|
@ -254,4 +254,27 @@ class ConfigurationManager
|
|||
|
||||
return $config['backup-mode'];
|
||||
}
|
||||
|
||||
public function GetNextcloudMount() : string {
|
||||
$mount = getenv('NEXTCLOUD_MOUNT');
|
||||
if ($mount === false) {
|
||||
$config = $this->GetConfig();
|
||||
if (!isset($config['nextcloud_mount'])) {
|
||||
$config['nextcloud_mount'] = '';
|
||||
}
|
||||
return $config['nextcloud_mount'];
|
||||
} else {
|
||||
if(file_exists(DataConst::GetConfigFile())) {
|
||||
$config = $this->GetConfig();
|
||||
if (!isset($config['nextcloud_mount'])) {
|
||||
$config['nextcloud_mount'] = '';
|
||||
}
|
||||
if ($mount !== $config['nextcloud_mount']) {
|
||||
$config['nextcloud_mount'] = $mount;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
}
|
||||
return $mount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue