You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/example.config.inc.php
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
// copy this file to config.inc.php
4
4
// and edit to your needs
5
5
6
+
7
+
// AGE encryption settings
8
+
// More info on age encryption: https://github.com/FiloSottile/age
9
+
define('ENCRYPTION_AGE_SSH_PUBKEY',''); // Enter your SSH public key here to automatically encrypt all uploads
10
+
define('ENCRYPTION_AGE_PUBKEY',''); // Enter an "age public key" created with `age-keygen -o key.txt` here to automatically encrypt all uploads with this key
11
+
6
12
// global settings for retention and version control
7
13
// 0 means unlimited
8
14
define('KEEP_N_BACKUPS',0); // How many uploads will be saved. Oldest one will be deleted if this number is surpassed
Copy file name to clipboardExpand all lines: rtfm/encryption.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,27 @@
2
2
3
3
You really should encrypt before uploading it to BackupDrop but if that's not an option, we've got you covered.
4
4
5
-
If you are encrypting on your machine I'd reccomend [Age](https://github.com/FiloSottile/age). It's awesome and easy to use and you can encrypt files by SSH public keys (so the encrypting machine never needs to have the private key needed to decrypt).
5
+
If you are encrypting on your machine I'd reccomend [Age](https://github.com/FiloSottile/age). It's awesome and easy to use and you can encrypt files by SSH public keys (so the encrypting machine never needs to have the private key needed to decrypt). But BackupDrop comes with age support so all uploads can be encrypted using an SSH public key or an age public key (or both).
6
+
7
+
## Method 1: BackupDrop builtin age support
8
+
To use age in BackupDrop you only have to set one of two (or both) configuration options in the config file:
9
+
10
+
- ENCRYPTION_AGE_SSH_PUBKEY
11
+
- ENCRYPTION_AGE_PUBKEY
12
+
13
+
If you configure both entries then all uploads will be encrypted against both, your SSH public key and your age public key which means you can decrypt the backups with both of your (private) keys.
14
+
15
+
### SSH key based encryption
16
+
You can put your SSH keys public key in the `ENCRYPTION_AGE_SSH_PUBKEY` option and age will automatically encrypt all uploads against your key.
17
+
18
+
For example if you upload `secrets.txt`, it will be stored as `secrets.txt.age` in the data directory. To decrypt you can run `age -d -i ~/.ssh/id_rsa secrets.txt.age > secrets.txt`
19
+
20
+
Read more about age and SSH key based encryption [here](https://github.com/FiloSottile/age?tab=readme-ov-file#ssh-keys)
21
+
22
+
### age public key encryption
23
+
You can generate an age public and private key by running `age-keygen -o key.txt` which will generate a key file and print out the public key. You can put this public key in the config option `ENCRYPTION_AGE_PUBKEY` and all uploads will automatically be encrypted against your key.
24
+
25
+
For example if you upload `secrets.txt`, it will be stored as `secrets.txt.age` in the data directory. To decrypt you can run `age --decrypt -i key.txt secrets.txt.age > secrets.txt`
6
26
7
27
## Method 1: Encrypt using Public Key
8
28
This method should only be used on **smaller files**. Because of the nature of the algorithm we can only encrypt 245 characters at a time which means encrypting of large files will be painfully slow.
return ['status'=>'error','reason'=>'Failed to encrypt. Is the Key valid?'];
61
61
}
62
+
elseif(defined('ENCRYPTION_AGE_SSH_PUBKEY') || defined('ENCRYPTION_AGE_PUBKEY') && (newEncryption)->checkAge()) //if the user wants to encrypt it using the predefined key
0 commit comments