feat(backups): add SFTP and FTP backup destination types#1462
Open
VladislavTsytrikov wants to merge 2 commits intoCortexFlow-AI:canaryfrom
Open
feat(backups): add SFTP and FTP backup destination types#1462VladislavTsytrikov wants to merge 2 commits intoCortexFlow-AI:canaryfrom
VladislavTsytrikov wants to merge 2 commits intoCortexFlow-AI:canaryfrom
Conversation
Add support for SFTP and FTP as backup destination types alongside existing S3 compatible storage. Uses rclone's native backends. Changes: - Add destinationType column to destination schema with migration - Add getRcloneFlags() and getRcloneRemote() to centralize rclone command generation for all destination types - Passwords are obscured via rclone obscure before storage - Shell-escape user inputs to prevent command injection - Update all backup, restore, and volume-backup modules - Add destination type selector in UI with conditional form fields - Add conditional validation (S3 fields required for S3, host/username required for SFTP/FTP) - Show destination type badge in destination list Fixes CortexFlow-AI#168
21cf4b5 to
799ca4c
Compare
S3-specific fields (accessKey, bucket, etc.) now default to empty string in the API schema instead of being required. Frontend only sends fields relevant to the selected destination type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #168
Adds SFTP and FTP as backup destination types alongside existing S3 compatible storage, using rclone's native backends.
What changed
Schema & Migration:
destinationTypecolumn (default"s3"for backward compat)host,port,username,password,basePathcolumns for SFTP/FTP0155_add_destination_types.sqlBackend (
packages/server):getRcloneFlags(destination)— generates rclone CLI flags based on destination type (S3/SFTP/FTP)getRcloneRemote(destination, subpath)— generates the rclone remote path (:s3:,:sftp:,:ftp:)obscureRclonePassword(password)— obscures passwords viarclone obscurebefore DB storageFrontend (
apps/dokploy):How I tested this
pnpm run dokploy:setup && dokploy:dev)docker run -d --name test-sftp -p 2222:22 atmoz/sftp user:pass:::backupsfor a test SFTP serverpnpm run test— 418 passed (4 pre-existing Docker integration failures)Backward compatibility
Existing S3 destinations continue to work without any changes. The
destinationTypecolumn defaults to"s3", and all existing code paths fall through to the original S3 logic./claim #168