dcent-archiver
v1.2.0
Published
Archive files into a hyperdrive
Maintainers
Readme
Dcent Archiver
Archive files into a hyperdrive, so they can be backed-up on other devices.
Dcent archiver uses peer-to-peer connections and append-only logs to distribute the files, so it works reliably and at scale, on all networks. Notably, it works on home networks, and does not require the backuppers to be online at all times. This means you can ask friends and family to help back up your data.
Supports encryption. When enabled, the back-ups are not readable without the encryption key.
Intended for files which do not change, such as images or video.
Any seeder in the hypercore ecosystem can be used to replicate the drives. Examples include blind peer and stupid seeder.
Description
This tool adds all files in a directory to a hyperdrive. After the files are added, they can be deleted (they will remain available on the hyperdrive).
There is a delay of 10 minutes before a file is added to the hyperdrive. Once a file is added, it will never be added again. So for files which change (such as a document which is updated), only the first version will be archived. The exception is when a file is updated during the grace period of 10 minutes.
Install
npm i -g dcent-archiverUsage
Parameters are passed in as environment variables.
The DCENT_ARCHIVER_DIR environment variable has to be set to the directory you wish to archive.
Optional parameters include:
DCENT_ARCHIVER_ENCRYPTION_KEY=mysecretkey # default not encrypted
DCENT_ARCHIVER_KEY_FILE=my/key/file # alternative way of passing in an encryption key
DCENT_ARCHIVER_CORESTORE=my/corestore/loc # Defaults to ~/.dcent-archiver
DCENT_ARCHIVER_LOG_LEVEL=debug # defaults to info. See pino docs for the options.CLI
DCENT_ARCHIVER_DIR=/dir/to/watch/ dcent-archiver | pino-prettyNote: piping the output into pino-pretty is optional, but shows human-readable logs. Run npm i -g pino-pretty to install it.
Docker
Replacing /my/dir/to/archive/, run:
sudo docker run --rm --network=host --mount type=bind,source=/my/dir/to/archive/,target=/home/dcent-archiver/dir/,readonly --mount type=volume,source=dcent-archiver-corestore-volume,target=/home/dcent-archiver/corestore hdegroote/dcent-archiverRestoring
dcent-archiver-restore <drive key>Optional parameters include:
DCENT_ARCHIVER_RESTORE_ENCRYPTION_KEY=mysecretkey # default assumes not encrypted
DCENT_ARCHIVER_RESTORE_KEY_FILE=my/key/file # alternative way of passing in an encryption key
DCENT_ARCHIVER_RESTORE_CORESTORE=my/corestore/loc # Defaults to ~/.dcent-archiver-restore
DCENT_ARCHIVER_RESTORE_TARGET=dir/to/restore/to # Defaults to ~/dcent-archiver-restoreThe files are restored under a sub directory. This ensures you never accidentally overwrite other files.
For example, restoring a drive with key aaaaaa' will by default unpack it at ~/dcent-archiver-restore/aaaaaa.../
Security
Security relies on the capability system of Hypercore: only people who know its key can download the Hyperdrive.
You should share the key with other machines so they can replicate the archive, to have redundant backups.
For some use cases, the content of the Hyperdrive should not be shared with the back-uppers. For example if the backups contain private data, or if the backup machines run in publicly accessible spaces without an encrypted hard disk. For those cases: define an encryptionKey.
Knowing the key of an encrypted hyperdrives gives the capability of backing it up, but not of reading its content.
Note: the device where the dcent-archiver process runs is assumed to be secure and fully trusted (no effort is made to hide the encryption key there).
Disclaimer: in theory, encrypted drives can be safely backed up by hostile third parties, but I would recommend against such usage until the tool is more battle tested. For now, stick to friends and your own devices.
