mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Make 'nextcloudEnableDriDevice' an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
76b871fc86
commit
f5a035c450
3 changed files with 5 additions and 15 deletions
|
|
@ -132,7 +132,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
'nextcloud_upload_limit' => $configurationManager->nextcloudUploadLimit,
|
||||
'nextcloud_max_time' => $configurationManager->nextcloudMaxTime,
|
||||
'nextcloud_memory_limit' => $configurationManager->nextcloudMemoryLimit,
|
||||
'is_dri_device_enabled' => $configurationManager->isDriDeviceEnabled(),
|
||||
'is_dri_device_enabled' => $configurationManager->nextcloudEnableDriDevice,
|
||||
'is_nvidia_gpu_enabled' => $configurationManager->isNvidiaGpuEnabled(),
|
||||
'is_talk_recording_enabled' => $configurationManager->isTalkRecordingEnabled,
|
||||
'is_docker_socket_proxy_enabled' => $configurationManager->isDockerSocketProxyEnabled,
|
||||
|
|
|
|||
|
|
@ -919,19 +919,9 @@ class ConfigurationManager
|
|||
return $cc;
|
||||
}
|
||||
|
||||
private function GetEnabledDriDevice() : string {
|
||||
$envVariableName = 'NEXTCLOUD_ENABLE_DRI_DEVICE';
|
||||
$configName = 'nextcloud_enable_dri_device';
|
||||
$defaultValue = '';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
|
||||
public function isDriDeviceEnabled() : bool {
|
||||
if ($this->GetEnabledDriDevice() === 'true') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
public bool $nextcloudEnableDriDevice{
|
||||
get => booleanize($this->GetEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_DRI_DEVICE', 'nextcloud_enable_dri_device', ''));
|
||||
set { $this->set('nextcloud_enable_dri_device', $value); }
|
||||
}
|
||||
|
||||
private function GetEnabledNvidiaGpu() : string {
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ readonly class DockerActionManager {
|
|||
|
||||
$devices = [];
|
||||
foreach ($container->devices as $device) {
|
||||
if ($device === '/dev/dri' && !$this->configurationManager->isDriDeviceEnabled()) {
|
||||
if ($device === '/dev/dri' && !$this->configurationManager->nextcloudEnableDriDevice) {
|
||||
continue;
|
||||
}
|
||||
$devices[] = ["PathOnHost" => $device, "PathInContainer" => $device, "CgroupPermissions" => "rwm"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue