git-e2ee-rclone
In this example we'll set up an end-to-end encrypted (E2EE) Git remote with Rclone. It will be accessible via the WebDAV protocol.
Note: we cannot use
rclone serve sftp
for this project because Git over SSH relies on real shell commands, not SFTP.Important: this has been tested on Debian 12 (bookworm).
First of all, download Rclone if it's not already installed on your system:
Bash | |
---|---|
Then set up a new Rclone crypt
remote following the official instructions (see https://rclone.org/crypt/). Hereinafter, we'll refer to it as mycrypt
.
Create a new empty bare Git repo locally, and enable and run the post-update
hook for it (required for "dumb" WebDAV Git remotes):
Bash | |
---|---|
Now upload your new blank Git bare repo onto the mycrypt
remote:
Bash | |
---|---|
And finally you can serve your end-to-end encrypted Git remote with WebDAV:
Bash | |
---|---|
Warning: this is just an example. It's considered a bad practice to specify passwords with command-line flags.
You can now clone your repo and do some Git operations to check that everything is working properly:
Bash | |
---|---|
Warning: again, this is just an example. It's considered a bad practice to specify the password directly in the Git remote URL.