Packerd is a simple service that generates on-demand backup bundles and serves them remotely to authorized clients.
Compile the project with:
go build -o build/packerdParameters can be passed via command line of be defined in a config file
$ ./packerd -h
Packerd is a backup utility for authenticated remote clients
Usage:
packerd [flags]
Flags:
--cert string the certificate file (TLS only)
--config string the config file to use
-h, --help help for packerd
--key string the TLS encryption key file
-p, --port int port to bind to (default 80)
--tls whether to use TLS encryption (cert and key required)
The config file is mandatory. However, CLI parameters can override the port, cert, key and tls for easier testing.
Copy config.template.yaml and adapt it to work for the data you want to back up.
port: 8443
tls: true
cert: /path/to/cert.pem # not needed it tls = false
key: /path/to/key.pem # not needed it tls = false
paths:
- id: media
token: "1234567890123456789012345678901234567890"
path: /var/lib/media
- id: other
token: "0123456789012345678901234567890123456789"
path: /var/lib/otherBy default, config.yaml is attempted on the current directory. Otherwise:
$ packerd --config my-config.yamlFrom a remote location, make a GET request like so:
$ NAME = "media"
$ TOKEN = "1234567890123456789012345678901234567890"
$ curl https://my-server.net:8443/backup/$NAME/$TOKEN > $NAME.tar.gz$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodesThen, run packerd:
$ packerd --tls --cert cert.pem --key key.pem -p 8443And finally, tell curl to accept the self-signed certificate.
$ NAME = "media"
$ TOKEN = "1234567890123456789012345678901234567890"
$ curl --insecure https://localhost:8443/backup/$NAME/$TOKEN > $NAME.tar.gz