Skip to content

feat: add SFTP and FTP backup destinations#1466

Open
Lumantis wants to merge 1 commit intoCortexFlow-AI:canaryfrom
Lumantis:feat/168-sftp-ftp-backup-destinations
Open

feat: add SFTP and FTP backup destinations#1466
Lumantis wants to merge 1 commit intoCortexFlow-AI:canaryfrom
Lumantis:feat/168-sftp-ftp-backup-destinations

Conversation

@Lumantis
Copy link
Copy Markdown

Closes #168

Summary

Adds SFTP and FTP as backup destination types alongside the existing S3-compatible storage.

  • New destinationType field on destinations (s3 | sftp | ftp, defaults to s3 for backward compatibility)
  • getRcloneFlags() and getRcloneRemote() helpers dispatch rclone syntax per type — all 15+ backup/restore files updated in one consistent pass
  • obscureRclonePassword() uses execFileAsync("rclone", ["obscure", password]) (no shell injection) to store rclone-obscured passwords for SFTP/FTP
  • Database migration 0150 adds new columns with safe defaults so existing S3 destinations are unaffected
  • UI: type selector (S3 / SFTP / FTP) with conditional form fields; destination list shows a type badge

How it works

rclone already ships in the dokploy Docker image and supports SFTP/FTP natively via :sftp: and :ftp: remotes with inline flags. No new dependencies needed.

Test plan

  • Create an S3 destination — existing flow unchanged
  • Create an SFTP destination, test connection succeeds
  • Create an FTP destination, test connection succeeds
  • Run a postgres backup to SFTP — file appears on server
  • Restore from SFTP backup
  • Existing S3 destinations unaffected after migration

🤖 Generated with Claude Code

Extends the backup destination system to support SFTP and FTP in addition
to the existing S3-compatible storage.

Changes:
- Add destinationType, host, port, username, password, basePath columns
  to the destination table (migration 0150)
- Add getRcloneFlags() and getRcloneRemote() helpers that dispatch to
  the correct rclone remote syntax based on destination type
- Add obscureRclonePassword() using execFileAsync to safely obscure
  passwords for rclone without shell injection risk
- Update all backup, restore, and volume-backup files to use the new
  helpers instead of hardcoded :s3: paths
- Update destination router to obscure SFTP/FTP passwords on save and
  build type-aware test connection commands
- Add destination type selector (S3/SFTP/FTP) to the UI with
  conditional form fields per type
- Show destination type badge in the destinations list

Closes CortexFlow-AI#168

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to backup to more destination types

1 participant