Add support to configure preserveAttributes and chown for backup sites

This commit is contained in:
Johannes Zellner
2025-10-09 13:07:04 +02:00
parent e8e05159d8
commit 3acceca32f

View File

@@ -35,6 +35,8 @@ const mountOptionsPassword = ref('');
const mountOptionsUser = ref('');
const mountOptionsPrivateKey = ref('');
const useHardlinks = ref(false);
const chown = ref(false);
const preserveAttributes = ref(false);
async function onSubmit() {
busy.value = true;
@@ -67,7 +69,15 @@ async function onSubmit() {
}
if ((provider.value === 'filesystem' || mountlike(provider.value)) && site.value.format === 'rsync') {
data.noHardlinks = !!useHardlinks.value;
data.noHardlinks = !useHardlinks.value;
}
if ((provider.value === 'mountpoint' || provider.value === 'cifs') && site.value.format === 'rsync') {
data.preserveAttributes = preserveAttributes.value;
}
if (provider.value === 'mountpoint' && site.value.format === 'rsync') {
data.chown = chown.value;
}
// only call if anything has changed
@@ -142,7 +152,15 @@ defineExpose({
}
if ((provider.value === 'filesystem' || mountlike(provider.value)) && site.value.format === 'rsync') {
useHardlinks.value = !!t.config.noHardlinks;
useHardlinks.value = !t.config.noHardlinks;
}
if ((provider.value === 'mountpoint' || provider.value === 'cifs') && site.value.format === 'rsync') {
preserveAttributes.value = !!t.config.preserveAttributes;
}
if (provider.value === 'mountpoint' && site.value.format === 'rsync') {
chown.value = !!t.config.chown;
}
await getMemory();
@@ -213,6 +231,10 @@ defineExpose({
<Checkbox v-if="(provider === 'filesystem' || mountlike(provider)) && site.format === 'rsync'" v-model="useHardlinks" :label="$t('backups.configureBackupStorage.hardlinksLabel')"/>
<Checkbox v-if="(provider === 'mountpoint' || provider === 'cifs') && site.format === 'rsync'" v-model="preserveAttributes" :label="$t('backups.configureBackupStorage.preserveAttributesLabel')"/>
<Checkbox v-if="provider === 'mountpoint' && format === 'rsync'" v-model="chown" :label="$t('backups.configureBackupStorage.chown')"/>
<FormGroup v-if="s3like(provider)">
<label for="accessKeyIdInput">{{ $t('backups.configureBackupStorage.s3AccessKeyId') }}</label>
<TextInput id="accessKeyIdInput" v-model="accessKeyId" required />