mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 13:06:53 +00:00
Make apache_port an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
4e373cb2f8
commit
dc28eb6737
3 changed files with 9 additions and 11 deletions
|
|
@ -92,7 +92,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
|
||||
return $view->render($response, 'containers.twig', [
|
||||
'domain' => $configurationManager->domain,
|
||||
'apache_port' => $configurationManager->GetApachePort(),
|
||||
'apache_port' => $configurationManager->apache_port,
|
||||
'borg_backup_host_location' => $configurationManager->borg_backup_host_location,
|
||||
'borg_remote_repo' => $configurationManager->borg_remote_repo,
|
||||
'borg_public_key' => $configurationManager->GetBorgPublicKey(),
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ class ConfigurationManager
|
|||
}
|
||||
|
||||
// Get the apache port
|
||||
$port = $this->GetApachePort();
|
||||
$port = $this->apache_port;
|
||||
|
||||
if (!filter_var($dnsRecordIP, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
|
||||
if ($port === '443') {
|
||||
|
|
@ -558,11 +558,9 @@ class ConfigurationManager
|
|||
$this->set('password', $newPassword);
|
||||
}
|
||||
|
||||
public function GetApachePort() : string {
|
||||
$envVariableName = 'APACHE_PORT';
|
||||
$configName = 'apache_port';
|
||||
$defaultValue = '443';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
public string $apache_port {
|
||||
get => $this->GetEnvironmentalVariableOrConfig('APACHE_PORT', 'apache_port', '443');
|
||||
set { $this->set('apache_port', $value); }
|
||||
}
|
||||
|
||||
public function GetTalkPort() : string {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ readonly class DockerActionManager {
|
|||
$containerName = $container->identifier;
|
||||
$internalPort = $container->internalPorts;
|
||||
if ($internalPort === '%APACHE_PORT%') {
|
||||
$internalPort = $this->configurationManager->GetApachePort();
|
||||
$internalPort = $this->configurationManager->apache_port;
|
||||
} elseif ($internalPort === '%TALK_PORT%') {
|
||||
$internalPort = $this->configurationManager->GetTalkPort();
|
||||
}
|
||||
|
|
@ -261,7 +261,7 @@ readonly class DockerActionManager {
|
|||
$port = $value->port;
|
||||
$protocol = $value->protocol;
|
||||
if ($port === '%APACHE_PORT%') {
|
||||
$port = $this->configurationManager->GetApachePort();
|
||||
$port = $this->configurationManager->apache_port;
|
||||
// Do not expose udp if AIO is in reverse proxy mode
|
||||
if ($port !== '443' && $protocol === 'udp') {
|
||||
continue;
|
||||
|
|
@ -283,7 +283,7 @@ readonly class DockerActionManager {
|
|||
$port = $value->port;
|
||||
$protocol = $value->protocol;
|
||||
if ($port === '%APACHE_PORT%') {
|
||||
$port = $this->configurationManager->GetApachePort();
|
||||
$port = $this->configurationManager->apache_port;
|
||||
// Do not expose udp if AIO is in reverse proxy mode
|
||||
if ($port !== '443' && $protocol === 'udp') {
|
||||
continue;
|
||||
|
|
@ -565,7 +565,7 @@ readonly class DockerActionManager {
|
|||
'AIO_URL' => $this->configurationManager->AIO_URL,
|
||||
'RESTORE_EXCLUDE_PREVIEWS' => $this->configurationManager->restoreExcludePreviews ? '1' : '',
|
||||
'SELECTED_RESTORE_TIME' => $this->configurationManager->selectedRestoreTime,
|
||||
'APACHE_PORT' => $this->configurationManager->GetApachePort(),
|
||||
'APACHE_PORT' => $this->configurationManager->apache_port,
|
||||
'APACHE_IP_BINDING' => $this->configurationManager->apache_ip_binding,
|
||||
'TALK_PORT' => $this->configurationManager->GetTalkPort(),
|
||||
'TURN_DOMAIN' => $this->configurationManager->turn_domain,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue