mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Add feature
Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com>
This commit is contained in:
parent
3ccdd332a9
commit
f2e71532e7
5 changed files with 28 additions and 11 deletions
|
|
@ -71,7 +71,7 @@ class ConfigurationManager
|
|||
if (!file_exists(DataConst::GetBackupArchivesList())) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
$content = file_get_contents(DataConst::GetBackupArchivesList());
|
||||
if ($content === '') {
|
||||
return '';
|
||||
|
|
@ -91,7 +91,7 @@ class ConfigurationManager
|
|||
if ($lastBackupTime === "") {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
return $lastBackupTime;
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class ConfigurationManager
|
|||
if (!file_exists(DataConst::GetBackupArchivesList())) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
$content = file_get_contents(DataConst::GetBackupArchivesList());
|
||||
if ($content === '') {
|
||||
return [];
|
||||
|
|
@ -110,7 +110,7 @@ class ConfigurationManager
|
|||
foreach($backupLines as $lines) {
|
||||
if ($lines !== "") {
|
||||
$backupTimesTemp = explode(',', $lines);
|
||||
$backupTimes[] = $backupTimesTemp[1];
|
||||
$backupTimes[] = $backupTimesTemp[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ class ConfigurationManager
|
|||
if (!$this->isx64Platform()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isClamavEnabled']) && $config['isClamavEnabled'] === 1) {
|
||||
return true;
|
||||
|
|
@ -349,7 +349,7 @@ class ConfigurationManager
|
|||
$testUrl = $protocol . $domain . ':443';
|
||||
curl_setopt($ch, CURLOPT_URL, $testUrl);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||
$response = (string)curl_exec($ch);
|
||||
# Get rid of trailing \n
|
||||
|
|
@ -455,7 +455,7 @@ class ConfigurationManager
|
|||
if ($location === '') {
|
||||
throw new InvalidSettingConfigurationException("Please enter a path!");
|
||||
}
|
||||
|
||||
|
||||
$isValidPath = false;
|
||||
if (str_starts_with($location, '/') && !str_ends_with($location, '/')) {
|
||||
$isValidPath = true;
|
||||
|
|
@ -520,6 +520,10 @@ class ConfigurationManager
|
|||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
|
||||
public function IsOverwriteEnable() : bool {
|
||||
return getenv('DISABLE_OVERWRITE_URL') !== 'yes';
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
|
|
@ -698,7 +702,7 @@ class ConfigurationManager
|
|||
if (!preg_match("#^[0-1][0-9]:[0-5][0-9]$#", $time) && !preg_match("#^2[0-3]:[0-5][0-9]$#", $time)) {
|
||||
throw new InvalidSettingConfigurationException("You did not enter a correct time! One correct example is '04:00'!");
|
||||
}
|
||||
|
||||
|
||||
if ($enableAutomaticUpdates === false) {
|
||||
$time .= PHP_EOL . 'automaticUpdatesAreNotEnabled';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -297,6 +297,18 @@ class DockerActionManager
|
|||
$replacements[1] = $this->configurationManager->GetApachePort();
|
||||
} elseif ($out[1] === 'TALK_PORT') {
|
||||
$replacements[1] = $this->configurationManager->GetTalkPort();
|
||||
} elseif($out[1] === 'OVERWRITEHOST') {
|
||||
if ($this->configurationManager->IsOverwriteEnable()) {
|
||||
$replacements[1] = $this->configurationManager->GetDomain();
|
||||
} else {
|
||||
$replacements[1] = '';
|
||||
}
|
||||
} elseif($out[1] === 'OVERWRITEPROTOCOL') {
|
||||
if ($this->configurationManager->IsOverwriteEnable()) {
|
||||
$replacements[1] = 'https';
|
||||
} else {
|
||||
$replacements[1] = '';
|
||||
}
|
||||
} elseif ($out[1] === 'NEXTCLOUD_MOUNT') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudMount();
|
||||
} elseif ($out[1] === 'BACKUP_RESTORE_PASSWORD') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue