Proton Drive
At a glance
Section titled “At a glance”| Capability | Support |
|---|---|
| rclone support tier | Tier 4: Experimental |
| Checksums | SHA-1 |
| Modification times | Kept, to 1 s |
| Case-insensitive names | No |
| Duplicate names allowed | No |
| Server-side copy | No |
| Server-side move and rename | Yes |
| Folder move and rename | Yes, in one step |
| Free space reporting | Yes |
| Empty folders | Yes |
| Change notifications | No |
| Uploads of unknown size | No |
| Public links | No |
Proton Drive is an end-to-end encrypted Swiss vault for your files that protects your data.
This is an rclone backend for Proton Drive which supports the file transfer features of Proton Drive using the same client-side encryption.
Due to the fact that Proton Drive doesn’t publish its API documentation, this backend is implemented with best efforts by reading the open-sourced client source code and observing the Proton Drive traffic in the browser.
NB This backend is currently in Beta. It is believed to be correct and all the integration tests pass. However the Proton Drive protocol has evolved over time there may be accounts it is not compatible with. Please post on the rclone forum if you find an incompatibility.
Setup notes
Section titled “Setup notes”In CloudMount you add this drive from the Add drive screen, and the wizard asks for the options listed under Options. The notes below come from rclone’s setup guide.
Modification times and hashes
Section titled “Modification times and hashes”Proton Drive Bridge does not support updating modification times yet.
The SHA1 hash algorithm is supported.
Restricted filename characters
Section titled “Restricted filename characters”Invalid UTF-8 bytes will be replaced, also left and right spaces will be removed (code reference)
Duplicated files
Section titled “Duplicated files”Proton Drive can not have two files with exactly the same name and path. If the conflict occurs, depending on the advanced config, the file might or might not be overwritten.
Please set your mailbox password in the advanced config section.
Caching
Section titled “Caching”The cache is currently built for the case when the rclone is the only instance performing operations to the mount point. The event system, which is the proton API system that provides visibility of what has changed on the drive, is yet to be implemented, so updates from other clients won’t be reflected in the cache. Thus, if there are concurrent clients accessing the same mount point, then we might have a problem with caching the stale data.
Options
Section titled “Options”Standard options
Section titled “Standard options”The wizard asks for these when you add the drive.
username
Section titled “username”The username of your proton account
Type: string · Required
password
Section titled “password”The password of your proton account.
NB Input to this must be obscured - see rclone obscure.
Type: string · Required
The 2FA code
The value can also be provided with –protondrive-2fa=000000
The 2FA code of your proton drive account if the account is set up with two-factor authentication
Type: string
otp_secret_key
Section titled “otp_secret_key”The OTP secret key
The value can also be provided with –protondrive-otp-secret-key=ABCDEFGHIJKLMNOPQRSTUVWXYZ234567
The OTP secret key of your proton drive account if the account is set up with two-factor authentication
NB Input to this must be obscured - see rclone obscure.
Type: string
Advanced options
Section titled “Advanced options”The wizard shows these under Advanced options. Most drives work without changing any of them.
mailbox_password
Section titled “mailbox_password”The mailbox password of your two-password proton account.
For more information regarding the mailbox password, please check the following official knowledge base article: https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password
NB Input to this must be obscured - see rclone obscure.
Type: string
encoding
Section titled “encoding”The encoding for the backend.
See the encoding section in the overview for more info.
Type: Encoding · Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot
original_file_size
Section titled “original_file_size”Return the file size before encryption
The size of the encrypted file will be different from (bigger than) the original file size. Unless there is a reason to return the file size after encryption is performed, otherwise, set this option to true, as features like Open() which will need to be supplied with original content size, will fail to operate properly
Type: bool · Default: true
app_version
Section titled “app_version”The app version string
The app version string identifies the client that is currently performing the API request. Third-party Proton Drive integrations should use the form external-drive-<project>@<version>. If this option is left empty, rclone derives a compliant value from its own version. This value is sent with every API request; the option itself is optional.Type: string
replace_existing_draft
Section titled “replace_existing_draft”Create a new revision when filename conflict is detected
When a file upload is cancelled or failed before completion, a draft will be created and the subsequent upload of the same file to the same location will be reported as a conflict.
The value can also be set by –protondrive-replace-existing-draft=true
If the option is set to true, the draft will be replaced and then the upload operation will restart. If there are other clients also uploading at the same file location at the same time, the behavior is currently unknown. Need to set to true for integration tests. If the option is set to false, an error “a draft exist - usually this means a file is being uploaded at another client, or, there was a failed upload attempt” will be returned, and no upload will happen.
Type: bool · Default: false
enable_caching
Section titled “enable_caching”Caches the files and folders metadata to reduce API calls
Notice: If you are mounting ProtonDrive as a VFS, please disable this feature, as the current implementation doesn’t update or clear the cache when there are external changes.
The files and folders on ProtonDrive are represented as links with keyrings, which can be cached to improve performance and be friendly to the API server.
The cache is currently built for the case when the rclone is the only instance performing operations to the mount point. The event system, which is the proton API system that provides visibility of what has changed on the drive, is yet to be implemented, so updates from other clients won’t be reflected in the cache. Thus, if there are concurrent clients accessing the same mount point, then we might have a problem with caching the stale data.
Type: bool · Default: true
description
Section titled “description”Description of the remote.
Type: string
Limitations
Section titled “Limitations”This backend uses the Proton-API-Bridge, which is based on go-proton-api, a fork of the official repo.
There is no official API documentation available from Proton Drive. But, thanks to Proton open sourcing proton-go-api and the web, iOS, and Android client codebases, we don’t need to completely reverse engineer the APIs by observing the web client traffic!
proton-go-api provides the basic building blocks of API calls and error handling, such as 429 exponential back-off, but it is pretty much just a barebone interface to the Proton API. For example, the encryption and decryption of the Proton Drive file are not provided in this library.
The Proton-API-Bridge, attempts to bridge the gap, so rclone can be built on top of this quickly. This codebase handles the intricate tasks before and after calling Proton APIs, particularly the complex encryption scheme, allowing developers to implement features for other software on top of this codebase. There are likely quite a few errors in this library, as there isn’t official documentation available.