Add COLLABORA_EXTRA_HOSTS option

Signed-off-by: Keith Wansbrough <keithw@lochan.org>
This commit is contained in:
Keith Wansbrough 2025-12-30 18:32:40 +00:00
parent 15fa3be655
commit f9198b4ab2
4 changed files with 17 additions and 0 deletions

View file

@ -763,6 +763,14 @@ class ConfigurationManager
return trim($this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue));
}
public function GetCollaboraExtraHosts() : string {
$envVariableName = 'COLLABORA_EXTRA_HOSTS';
$configName = 'collabora_extra_hosts';
$defaultValue = '';
$value = trim($this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue));
return preg_split('/ +/', $value, -1, PREG_SPLIT_NO_EMPTY);
}
public function GetCollaboraSeccompPolicy() : string {
$defaultString = '--o:security.seccomp=';
if (!$this->isSeccompDisabled()) {

View file

@ -425,6 +425,10 @@ readonly class DockerActionManager {
if ($this->configurationManager->GetAdditionalCollaboraOptions() !== '') {
$requestBody['Cmd'] = [$this->configurationManager->GetAdditionalCollaboraOptions()];
}
if (count($this->configurationManager->GetCollaboraExtraHosts()) > 0) {
$requestBody['HostConfig']['ExtraHosts'] = $this->configurationManager->GetCollaboraExtraHosts();
}
}
if (count($mounts) > 0) {