mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-12-29 10:10:55 +08:00
Merge pull request #1625 from nextcloud/revert-1603-enh/noid/refactor-volumes
Revert "substitute volume variables in dockeractionmanager"
This commit is contained in:
commit
9a9f16ec2f
2 changed files with 33 additions and 34 deletions
|
@ -94,6 +94,39 @@ class ContainerDefinitionFetcher
|
|||
|
||||
$volumes = new ContainerVolumes();
|
||||
foreach ($entry['volumes'] as $value) {
|
||||
if($value['name'] === '%BORGBACKUP_HOST_LOCATION%') {
|
||||
$value['name'] = $this->configurationManager->GetBorgBackupHostLocation();
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if($value['name'] === '%NEXTCLOUD_MOUNT%') {
|
||||
$value['name'] = $this->configurationManager->GetNextcloudMount();
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value['name'] === '%NEXTCLOUD_DATADIR%') {
|
||||
$value['name'] = $this->configurationManager->GetNextcloudDatadirMount();
|
||||
if ($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value['name'] === '%DOCKER_SOCKET_PATH%') {
|
||||
$value['name'] = $this->configurationManager->GetDockerSocketPath();
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value['name'] === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') {
|
||||
$value['name'] = $this->configurationManager->GetTrustedCacertsDir();
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($value['location'] === '%NEXTCLOUD_MOUNT%') {
|
||||
$value['location'] = $this->configurationManager->GetNextcloudMount();
|
||||
if($value['location'] === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$volumes->AddVolume(
|
||||
new ContainerVolume(
|
||||
$value['name'],
|
||||
|
|
|
@ -205,40 +205,6 @@ class DockerActionManager
|
|||
public function CreateContainer(Container $container) : void {
|
||||
$volumes = [];
|
||||
foreach($container->GetVolumes()->GetVolumes() as $volume) {
|
||||
if($volume->name === '%BORGBACKUP_HOST_LOCATION%') {
|
||||
$volume->name = $this->configurationManager->GetBorgBackupHostLocation();
|
||||
if($volume->name === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if($volume->name === '%NEXTCLOUD_MOUNT%') {
|
||||
$volume->name = $this->configurationManager->GetNextcloudMount();
|
||||
if($volume->name === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($volume->name === '%NEXTCLOUD_DATADIR%') {
|
||||
$volume->name = $this->configurationManager->GetNextcloudDatadirMount();
|
||||
if ($volume->name === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($volume->name === '%DOCKER_SOCKET_PATH%') {
|
||||
$volume->name = $this->configurationManager->GetDockerSocketPath();
|
||||
if($volume->name === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($volume->name === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') {
|
||||
$volume->name = $this->configurationManager->GetTrustedCacertsDir();
|
||||
if($volume->name === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($volume->mountPoint === '%NEXTCLOUD_MOUNT%') {
|
||||
$volume->mountPoint = $this->configurationManager->GetNextcloudMount();
|
||||
if($volume->mountPoint === '') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$volumeEntry = $volume->name . ':' . $volume->mountPoint;
|
||||
if($volume->isWritable) {
|
||||
$volumeEntry = $volumeEntry . ':' . 'rw';
|
||||
|
|
Loading…
Reference in a new issue