2.5 KiB
2.5 KiB
Cloud Backup Implementation Plan (Complete)
1. Frontend Implementation (Flutter)
- ApiService Updates: Added
uploadBackupanddownloadBackupmethods to interact with the backend (endpoints/backups/uploadand/backups/download). - LocalKeyBackupService Refactor:
- Updated
createEncryptedBackupto acceptincludeKeysandincludeMessagesflags. - Added
uploadToCloudmethod which defaults to Messages Only (no keys) for security. - Added
restoreFromCloudmethod to fetch and decrypt backups.
- Updated
- UI Overhaul (LocalBackupScreen):
- Added "Cloud Mode" vs "Local Mode" toggle.
- Implemented "Zero Knowledge" warning UI when Cloud Mode is active (keys excluded by default).
- Added visual cues for "Secure Mode".
- Integrated
uploadToCloudandrestoreFromCloudcalls with progress indicators and error handling.
2. Backend Implementation (Go)
- Database Schema: Created migration
000003_e2ee_backup_recovery.up.sqlfor:cloud_backupstable (stores encrypted blobs).backup_preferencestable.user_devicestable.sync_codestable.recovery_guardiansandrecovery_sessionstables (for future social recovery).
- API Endpoints:
POST /backups/upload: Accepts encrypted blob, metadata, and version.GET /backups/download: Retrieves latest backup.GET /backups/download/:backup_id: Retrieves specific backup.
- Data Models: Defined
CloudBackup,UploadBackupRequest,DownloadBackupResponsestructs matching frontend expectations. - Handler Logic: Implemented "blind storage" logic - backend stores opaque blobs and does not attempt decryption.
3. Deployment Status (Pending)
- Compilation: Successfully compiled
sojorn-api-linuxandmigrate-linuxbinaries locally. - Upload: Failed to upload binaries to VPS (
194.238.28.122) due to SSH authentication failure ("Permission denied") with provided credentials. - Migration: Database migration failed from local machine due to port 5432 being closed/filtered. Needs to be run from the VPS.
- Restart: Service restart pending successful SSH access.
4. Next Steps
Once SSH access is restored (verify password or add public key):
- Upload Binaries:
scp sojorn-api-linux migrate-linux root@194.238.28.122:/root/ - Run Migration:
ssh root@... "./migrate-linux -path ... up" - Restart Service:
ssh root@... "systemctl restart sojorn-api"