Make 'borgRetentionPolicy' an attribute

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-26 10:06:53 +01:00
parent 0ed83c5258
commit 365e1e34e4

View file

@ -657,11 +657,9 @@ class ConfigurationManager
set { $this->set('nextcloud_max_time', $value); } set { $this->set('nextcloud_max_time', $value); }
} }
public function GetBorgRetentionPolicy() : string { public string $borgRetentionPolicy {
$envVariableName = 'BORG_RETENTION_POLICY'; get => $this->GetEnvironmentalVariableOrConfig('BORG_RETENTION_POLICY', 'borg_retention_policy', '--keep-within=7d --keep-weekly=4 --keep-monthly=6');
$configName = 'borg_retention_policy'; set { $this->set('borg_retention_policy', $value); }
$defaultValue = '--keep-within=7d --keep-weekly=4 --keep-monthly=6';
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
} }
public function GetFulltextsearchJavaOptions() : string { public function GetFulltextsearchJavaOptions() : string {
@ -1077,7 +1075,7 @@ class ConfigurationManager
'NEXTCLOUD_UPLOAD_LIMIT' => $this->nextcloudUploadLimit, 'NEXTCLOUD_UPLOAD_LIMIT' => $this->nextcloudUploadLimit,
'NEXTCLOUD_MEMORY_LIMIT' => $this->nextcloudMemoryLimit, 'NEXTCLOUD_MEMORY_LIMIT' => $this->nextcloudMemoryLimit,
'NEXTCLOUD_MAX_TIME' => $this->nextcloudMaxTime, 'NEXTCLOUD_MAX_TIME' => $this->nextcloudMaxTime,
'BORG_RETENTION_POLICY' => $this->GetBorgRetentionPolicy(), 'BORG_RETENTION_POLICY' => $this->borgRetentionPolicy,
'FULLTEXTSEARCH_JAVA_OPTIONS' => $this->GetFulltextsearchJavaOptions(), 'FULLTEXTSEARCH_JAVA_OPTIONS' => $this->GetFulltextsearchJavaOptions(),
'NEXTCLOUD_TRUSTED_CACERTS_DIR' => $this->GetTrustedCacertsDir(), 'NEXTCLOUD_TRUSTED_CACERTS_DIR' => $this->GetTrustedCacertsDir(),
'ADDITIONAL_DIRECTORIES_BACKUP' => $this->GetAdditionalBackupDirectoriesString() !== '' ? 'yes' : '', 'ADDITIONAL_DIRECTORIES_BACKUP' => $this->GetAdditionalBackupDirectoriesString() !== '' ? 'yes' : '',