Skip to content

Xanderful/proton-drive-for-linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Proton Drive for Linux

⚠️ Unofficial Client - This is an independent, unofficial desktop client for Proton Drive on Linux. It is not affiliated with, maintained by, or endorsed by Proton Technologies.

Native C++/GTK4 desktop application for accessing and synchronizing files with Proton Drive on Linux.


πŸš€ Features

Cloud Browser

  • Full Cloud Explorer - Browse, search, and preview your Proton Drive files with a native GTK4 interface
  • Full-Text Search - Instant search across all cloud files using SQLite FTS5
  • File Details - View file metadata, creation dates, and version history

Folder Synchronization

  • Two-Way Sync - Automatic bidirectional synchronization between local folders and cloud
  • Scheduled Sync - Configurable sync intervals (manual, 15-min, hourly, etc.)
  • Conflict Resolution - Intelligent handling of files modified on both sides
  • Delete Protection - Prevents accidental mass deletion with configurable thresholds
  • Drag & Drop Upload - Drop files directly onto the cloud browser

Desktop Integration

  • System Tray Icon - Minimalist D-Bus StatusNotifierItem with sync status
  • Real-Time Notifications - Alerts for sync errors, completed jobs, and conflicts
  • No Dependencies - Pure GTK4, no WebView, no Electronβ€”fast and lightweight

Security

  • Secure Authentication - OAuth2 through Proton's official APIs
  • Keyring Storage - Credentials stored in XDG Secret Service (system keyring)
  • Search Privacy - Cloud filenames indexed locally, never exposed to plaintext

⚠️ Important Limitations

Proton Sentinel May Block Syncing

If you have Proton Sentinel enabled on your account, it may block this application from syncing.

  • Symptom: Authentication works, but sync operations fail or get blocked
  • Cause: Proton Sentinel flags third-party API access as suspicious activity
  • Solution: Either disable Proton Sentinel in your account settings, OR contact Proton Support to whitelist this application
  • Support Ticket: If you want to keep Sentinel enabled, you'll need to open a support ticket with Proton to request whitelisting for third-party rclone access

Note: This is a Proton security feature, not a bug in this application. Official Proton clients don't have this limitation.

Sync Behavior: Polling-Based, Not Real-Time Cloud-to-Local

This app uses rclone's polling mechanism for synchronization, which has an important limitation:

Cloud-to-Local Changes (Limited):

  • βœ… Changes made locally are uploaded to cloud immediately when detected
  • ❌ Changes made in the web app or other clients are NOT automatically downloaded to your local machine
  • ⏱️ Cloud changes are only detected during scheduled sync intervals (default: every 15 minutes)

Why? Proton Drive has no real-time push notification API. rclone must poll the server periodically to detect cloud changes. This is a limitation of how Rclone works Proton's API, not this application.

Recommended Workaround:

  • Set sync intervals to 5-10 minutes for active folders if you frequently make changes in the web app
  • Or manually trigger sync from the app's sync panel when you know cloud changes have been made

Local-to-Cloud Sync is Fully Automatic:

  • Files/folders added locally are uploaded within seconds of creation (inotify-based)
  • File modifications are detected and uploaded automatically
  • Deletions are synced (subject to delete protection rules)

πŸ“‹ System Requirements

Build Dependencies

Debian/Ubuntu:

sudo apt install build-essential cmake pkg-config \
  libgtk-4-dev libcurl4-openssl-dev libsqlite3-dev libssl-dev

Fedora/RHEL:

sudo dnf install gcc g++ cmake gtk4-devel libcurl-devel \
  sqlite-devel openssl-devel

Arch Linux:

sudo pacman -S base-devel cmake gtk4 curl sqlite openssl

Runtime Dependencies

  • GTK 4.0+ (libgtk-4-0)
  • libcurl (libcurl4-openssl)
  • SQLite 3 (libsqlite3-0)
  • OpenSSL (libssl3)
  • rclone 1.73+ with Proton Drive patch (for sync functionality)

πŸ”¨ Building

From Source

git clone https://github.com/Xanderful/proton-drive-for-linux.git
cd proton-drive-for-linux

# Build release binary
mkdir -p src-native/build && cd src-native/build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

# Binary at: src-native/build/proton-drive
./proton-drive

Using Makefile Shortcuts

make build      # Build release binary
make dev        # Build and run with debug output
make clean      # Clean build artifacts
make help       # Show all available targets

πŸ“¦ Installation

From Source (Recommended)

git clone https://github.com/Xanderful/proton-drive-linux.git
cd proton-drive-linux
make build
sudo make install     # Installs to /usr/local/bin

AppImage (Portable)

# Build the AppImage
make build-appimage

# Or download from releases and run directly
chmod +x ProtonDrive-*.AppImage
./ProtonDrive-*.AppImage

πŸš€ Getting Started

1. First Run & Authentication

  1. Launch the application: proton-drive
  2. Click "Login" in the cloud browser panel
  3. Enter your Proton Account credentials
  4. Authenticate with OAuth2 (opens in browser)
  5. Authorization tokens are stored securely in your system keyring

2. Set Up a Sync Job

# Option A: Via GUI (Recommended)
1. Click the sync icon in the sidebar
2. Click "Add Sync Job"
3. Select a local folder: ~/Documents (or any folder)
4. Select a cloud folder: /Backups (or any Proton Drive folder)
5. Choose sync type: Two-Way (recommended)
6. Set interval: 15 minutes (adjust as needed)
7. Enable and start sync

# Option B: Via CLI (Manual Sync)
proton-drive --sync-now ~/Documents /Backups

3. Monitor Sync Status

  • Sync Panel: Shows active jobs, progress, and status
  • System Tray: Click icon for quick status overview
  • Notifications: Alerts for errors, completion, conflicts
  • Logs: View detailed logs in Preferences β†’ Logs

πŸ—οΈ Architecture

src-native/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main_native.cpp              # Application entry point
β”‚   β”œβ”€β”€ app_window.cpp               # Main window (UI core)
β”‚   β”œβ”€β”€ app_window_*.cpp             # UI features (cloud, sync, actions, etc.)
β”‚   β”œβ”€β”€ sync_manager.cpp             # Sync orchestration & rclone integration
β”‚   β”œβ”€β”€ sync_job_metadata.cpp        # Job registry & persistence
β”‚   β”œβ”€β”€ file_watcher.cpp             # inotify-based local change detection
β”‚   β”œβ”€β”€ file_index.cpp               # SQLite FTS5 cloud file search index
β”‚   β”œβ”€β”€ cloud_browser.cpp            # Cloud explorer UI
β”‚   β”œβ”€β”€ tray_gtk4.cpp                # D-Bus system tray integration
β”‚   β”œβ”€β”€ notifications.cpp            # Desktop notifications
β”‚   β”œβ”€β”€ settings.cpp                 # User preferences persistence
β”‚   └── logger.cpp                   # Debug logging to ~/.cache/proton-drive.log
β”‚
β”œβ”€β”€ CMakeLists.txt                   # Build configuration
└── packaging/
    └── proton-drive.desktop         # Desktop integration

scripts/
β”œβ”€β”€ setup-rclone.sh                  # rclone configuration wizard
β”œβ”€β”€ setup-sync-service.sh            # systemd user service setup
β”œβ”€β”€ manage-sync-job.sh               # Sync job lifecycle management
└── build-local-appimage.sh          # AppImage packaging

docs/
β”œβ”€β”€ SYNC_SAFETY_FEATURES.md          # Safety features & conflict resolution
β”œβ”€β”€ SYNC_CONFLICT_FIX.md             # Conflict scenarios & resolution
β”œβ”€β”€ FOLDER_DELETION_HANDLING.md      # Handling deleted sync folders
β”œβ”€β”€ PREVENTING_FALSE_POSITIVES.md    # Cache management & validation
β”œβ”€β”€ FILE_INDEX_SECURITY.md           # File search encryption details
└── CROSS_DISTRO_TESTING.md          # Testing matrix for distributions

Key Components

Component Purpose
app_window.cpp Main GTK4 window, UI state management, event handling
sync_manager.cpp Orchestrates bisync jobs, manages rclone lifecycle
file_watcher.cpp Monitors local filesystem changes with inotify
file_index.cpp Caches cloud file metadata, provides instant search
cloud_browser.cpp GTK4 widget tree for cloud file explorer
tray_gtk4.cpp StatusNotifierItem D-Bus tray icon

πŸ“š Documentation

Document Purpose
SYNC_SETUP.md Detailed rclone setup, troubleshooting, upload fixes
SYNC_SAFETY_FEATURES.md Delete protection, conflict resolution, versioning
SYNC_CONFLICT_FIX.md Understanding & resolving sync conflicts
FOLDER_DELETION_HANDLING.md Recovering from accidental folder deletions
PREVENTING_FALSE_POSITIVES.md Cache validation, stale lock cleanup
FILE_INDEX_SECURITY.md Search privacy & encryption design
CROSS_DISTRO_TESTING.md Compatibility matrix & distribution testing

πŸ› Troubleshooting

Authentication Issues

Problem: Login button stuck or browser doesn't open
Solution:

# Clear credentials from keyring
secret-tool delete service proton-drive

# Restart app and try login again

Sync Stuck or Stalled

Problem: Sync job not progressing
Solution:

# Check for stale rclone locks
rm -f ~/.cache/rclone/bisync/*cache*

# View detailed logs
tail -f ~/.cache/proton-drive/proton-drive.log

# Manually restart sync service
systemctl --user restart proton-drive-sync

Upload Failures (422 Error)

Problem: Files fail to upload with "422 Invalid Request"
Note: This requires rclone with Proton Drive patch. AppImage includes this; if building from source, see SYNC_SETUP.md


🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Commit with clear messages describing changes
  4. Test on at least one supported distribution
  5. Push and submit a Pull Request

Development Setup

# Clone and build with debug symbols
git clone https://github.com/Xanderful/proton-drive-linux.git
make dev          # Builds with --debug, shows detailed output

Reporting Issues

  • Include distribution (Debian, Fedora, Arch, etc.) and version
  • Include logs from ~/.cache/proton-drive/proton-drive.log
  • Include steps to reproduce the issue
  • Attach relevant screenshots or recordings

πŸ“„ License

Licensed under the Apache License 2.0. See LICENSE for details.


βš–οΈ Legal Notice

This project is not affiliated with, endorsed by, or supported by Proton Technologies AG. Proton Drive is a trademark of Proton Technologies AG. This is a community-maintained integration for Linux users.

About

Native C++/GTK4 desktop client for Proton Drive on Linux

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages