Skip to content

Commit 7871cbd

Browse files
committed
fix: prefix rustic backups with rustic-repos in s3
1 parent 5cd92f4 commit 7871cbd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/server/backup/backup_rustic.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,18 @@ func (r *RusticBackup) createSecureS3ConfigFile(creds *remote.S3Credentials) (st
715715
}
716716
defer file.Close()
717717

718-
// Build S3 configuration - use server UUID for clean, deduplicated paths
718+
// Build S3 configuration - extract root path from panel-provided repository path
719+
// Panel provides: bucket/prefix/server-uuid, we need: prefix/server-uuid as root
719720
repoRoot := r.serverUuid
721+
if r.panelRepositoryPath != "" {
722+
// Parse the panel path to extract everything after the bucket name
723+
// Expected format: bucket/prefix/server-uuid
724+
pathParts := strings.Split(r.panelRepositoryPath, "/")
725+
if len(pathParts) >= 3 {
726+
// Take everything after the bucket (first part)
727+
repoRoot = strings.Join(pathParts[1:], "/")
728+
}
729+
}
720730

721731
// Create TOML configuration content for opendal:s3 backend
722732
configContent := fmt.Sprintf(`[repository]

0 commit comments

Comments
 (0)