mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-07-21 13:42:54 +00:00
Revert "Drop as much capabilities as possibile for the Collabora container (#8000)"
This reverts commit9dcb25b4ae, reversing changes made to261675f4d3.
This commit is contained in:
+1
-1
@@ -418,7 +418,7 @@
|
|||||||
"CHOWN"
|
"CHOWN"
|
||||||
],
|
],
|
||||||
"cap_drop": [
|
"cap_drop": [
|
||||||
"ALL"
|
"NET_RAW"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ readonly class Container {
|
|||||||
public bool $enableNvidiaGpu,
|
public bool $enableNvidiaGpu,
|
||||||
/** @var string[] */
|
/** @var string[] */
|
||||||
public array $capAdd,
|
public array $capAdd,
|
||||||
/** @var string[] */
|
|
||||||
public array $capDrop,
|
|
||||||
public int $shmSize,
|
public int $shmSize,
|
||||||
public bool $apparmorUnconfined,
|
public bool $apparmorUnconfined,
|
||||||
/** @var string[] */
|
/** @var string[] */
|
||||||
|
|||||||
@@ -308,11 +308,6 @@ readonly class ContainerDefinitionFetcher {
|
|||||||
$capAdd = $entry['cap_add'];
|
$capAdd = $entry['cap_add'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$capDrop = [];
|
|
||||||
if (isset($entry['cap_drop'])) {
|
|
||||||
$capDrop = $entry['cap_drop'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$shmSize = -1;
|
$shmSize = -1;
|
||||||
if (isset($entry['shm_size'])) {
|
if (isset($entry['shm_size'])) {
|
||||||
$shmSize = $entry['shm_size'];
|
$shmSize = $entry['shm_size'];
|
||||||
@@ -375,7 +370,6 @@ readonly class ContainerDefinitionFetcher {
|
|||||||
$devices,
|
$devices,
|
||||||
$enableNvidiaGpu,
|
$enableNvidiaGpu,
|
||||||
$capAdd,
|
$capAdd,
|
||||||
$capDrop,
|
|
||||||
$shmSize,
|
$shmSize,
|
||||||
$apparmorUnconfined,
|
$apparmorUnconfined,
|
||||||
$backupVolumes,
|
$backupVolumes,
|
||||||
|
|||||||
@@ -401,11 +401,8 @@ readonly class DockerActionManager {
|
|||||||
$requestBody['HostConfig']['CapAdd'] = $capAdds;
|
$requestBody['HostConfig']['CapAdd'] = $capAdds;
|
||||||
}
|
}
|
||||||
|
|
||||||
$capDrops = $container->capDrop;
|
// Disable arp spoofing
|
||||||
if (count($capDrops) > 0) {
|
if (!in_array('NET_RAW', $capAdds, true)) {
|
||||||
$requestBody['HostConfig']['CapDrop'] = $capDrops;
|
|
||||||
} else if (!in_array('NET_RAW', $capAdds, true)) {
|
|
||||||
// Prevent ARP spoofing by default
|
|
||||||
$requestBody['HostConfig']['CapDrop'] = ['NET_RAW'];
|
$requestBody['HostConfig']['CapDrop'] = ['NET_RAW'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,11 +463,9 @@ readonly class DockerActionManager {
|
|||||||
// Special things for the collabora container which should not be exposed in the containers.json
|
// Special things for the collabora container which should not be exposed in the containers.json
|
||||||
} elseif ($container->identifier === 'nextcloud-aio-collabora') {
|
} elseif ($container->identifier === 'nextcloud-aio-collabora') {
|
||||||
if (!$this->configurationManager->collaboraSeccompDisabled) {
|
if (!$this->configurationManager->collaboraSeccompDisabled) {
|
||||||
// Load reference seccomp profile for collabora...
|
// Load reference seccomp profile for collabora
|
||||||
$seccompProfile = (string)file_get_contents(DataConst::GetCollaboraSeccompProfilePath());
|
$seccompProfile = (string)file_get_contents(DataConst::GetCollaboraSeccompProfilePath());
|
||||||
$requestBody['HostConfig']['SecurityOpt'] = ["label:disable", "seccomp=$seccompProfile"];
|
$requestBody['HostConfig']['SecurityOpt'] = ["label:disable", "seccomp=$seccompProfile"];
|
||||||
// ...which allows the collabora container to run without any capabilities
|
|
||||||
$requestBody['HostConfig']['CapAdd'] = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional Collabora options
|
// Additional Collabora options
|
||||||
|
|||||||
Reference in New Issue
Block a user