allow to adjust the talk port

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-06-07 00:43:48 +02:00
parent 8b7aa71d15
commit 7ae718300f
13 changed files with 50 additions and 15 deletions

View file

@ -139,7 +139,8 @@
"TALK_ENABLED=%TALK_ENABLED%",
"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice",
"DAILY_BACKUP_RUNNING=%DAILY_BACKUP_RUNNING%",
"TZ=%TIMEZONE%"
"TZ=%TIMEZONE%",
"TALK_PORT=%TALK_PORT%"
],
"maxShutdownTime": 10,
"restartPolicy": "unless-stopped"
@ -190,18 +191,19 @@
"displayName": "Talk",
"containerName": "nextcloud/aio-talk",
"ports": [
"3478/tcp",
"3478/udp"
"%TALK_PORT%/tcp",
"%TALK_PORT%/udp"
],
"internalPorts": [
"3478"
"%TALK_PORT%"
],
"environmentVariables": [
"NC_DOMAIN=%NC_DOMAIN%",
"TURN_SECRET=%TURN_SECRET%",
"SIGNALING_SECRET=%SIGNALING_SECRET%",
"JANUS_API_KEY=%JANUS_API_KEY%",
"TZ=%TIMEZONE%"
"TZ=%TIMEZONE%",
"TALK_PORT=%TALK_PORT%"
],
"volumes": [],
"secrets": [

View file

@ -98,6 +98,7 @@ $app->get('/containers', function ($request, $response, $args) use ($container)
'is_daily_backup_running' => $configurationManager->isDailyBackupRunning(),
'timezone' => $configurationManager->GetTimezone(),
'skip_domain_validation' => $configurationManager->shouldDomainValidationBeSkipped(),
'talk_port' => $configurationManager->GetTalkPort(),
]);
})->setName('profile');
$app->get('/login', function ($request, $response, $args) use ($container) {

View file

@ -71,6 +71,10 @@ class ContainerDefinitionFetcher
foreach ($entry['ports'] as $port) {
if($port === '%APACHE_PORT%/tcp') {
$port = $this->configurationManager->GetApachePort() . '/tcp';
} elseif($port === '%TALK_PORT%/tcp') {
$port = $this->configurationManager->GetTalkPort() . '/tcp';
} elseif($port === '%TALK_PORT%/udp') {
$port = $this->configurationManager->GetTalkPort() . '/udp';
}
$ports->AddPort($port);
}
@ -79,6 +83,8 @@ class ContainerDefinitionFetcher
foreach ($entry['internalPorts'] as $internalPort) {
if($internalPort === '%APACHE_PORT%') {
$internalPort = $this->configurationManager->GetApachePort();
} elseif($internalPort === '%TALK_PORT%') {
$internalPort = $this->configurationManager->GetTalkPort();
}
$internalPorts->AddInternalPort($internalPort);
}

View file

@ -395,6 +395,13 @@ class ConfigurationManager
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
}
public function GetTalkPort() : string {
$envVariableName = 'TALK_PORT';
$configName = 'talk_port';
$defaultValue = '3478';
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
}
/**
* @throws InvalidSettingConfigurationException
*/

View file

@ -250,6 +250,8 @@ class DockerActionManager
$replacements[1] = $this->configurationManager->GetSelectedRestoreTime();
} elseif ($out[1] === 'APACHE_PORT') {
$replacements[1] = $this->configurationManager->GetApachePort();
} elseif ($out[1] === 'TALK_PORT') {
$replacements[1] = $this->configurationManager->GetTalkPort();
} elseif ($out[1] === 'NEXTCLOUD_MOUNT') {
$replacements[1] = $this->configurationManager->GetNextcloudMount();
} elseif ($out[1] === 'BACKUP_RESTORE_PASSWORD') {

View file

@ -438,9 +438,9 @@
<input type="checkbox" id="collabora" name="collabora"><label for="collabora">Collabora (Nextcloud Office)</label><br>
{% endif %}
{% if is_talk_enabled == true %}
<input type="checkbox" id="talk" name="talk" checked="checked"><label for="talk">Nextcloud Talk (needs ports 3478/TCP and 3478/UDP open in your firewall/router)</label><br><br>
<input type="checkbox" id="talk" name="talk" checked="checked"><label for="talk">Nextcloud Talk (needs ports {{ talk_port }}/TCP and {{ talk_port }}/UDP open in your firewall/router)</label><br><br>
{% else %}
<input type="checkbox" id="talk" name="talk"><label for="talk">Nextcloud Talk (needs ports 3478/TCP and 3478/UDP open in your firewall/router)</label><br><br>
<input type="checkbox" id="talk" name="talk"><label for="talk">Nextcloud Talk (needs ports {{ talk_port }}/TCP and {{ talk_port }}/UDP open in your firewall/router)</label><br><br>
{% endif %}
{% if is_onlyoffice_enabled == true %}
<input type="checkbox" id="onlyoffice" name="onlyoffice" checked="checked"><label for="onlyoffice">OnlyOffice (only supported on x64)</label><br>