cloudfleet / blimp-parachute

Zero knowledge backups
Other
2 stars 0 forks source link

+TITLE: Parachute: a zero knowledge backup system

Running

+NAME: Basic installation of parachute in one command

+BEGIN_SRC shell

bash -x ./setup/install-parachute.bash

+END_SRC

with the appropiate permissions should enable all the following subclauses to be met automatically ** Historical Install instructions in detail if ~./setup/install-parachute.bash~ doesn't work *** Place chute.asd in ASDF3 system registry

+NAME: Configuration of ASDF3 system registry to find blimp-parachute

+BEGIN_SRC shell

bash -x ./chute/configure-asdf.bash

+END_SRC

*** Loading from ASDF

+BEGIN_SRC lisp

(asdf:load-system :chute)

+END_SRC

*** Testing from ASDF

+BEGIN_SRC lisp

(asdf:test-system :chute)

+END_SRC

*** Loading Quicklisp dependencies

  1. From the shell, download the Quicklisp install shim.

    +BEGIN_SRC shell

    wget https://beta.quicklisp.org/quicklisp.lisp

    +END_SRC

  2. From a Common Lisp implementation, execute the shim.

    +BEGIN_SRC lisp

    (load "~/quicklisp.lisp") (quicklisp-quickstart:install) (ql:add-to-init-file)

    +END_SRC

  3. Install the Quicklisp packages needed by chute.

    +BEGIN_SRC lisp

    (load (asdf:system-relative-pathname (asdf:find-system :chute) "quicklisp-setup.lisp"))

    +END_SRC

+END_EXAMPLE

Authentication to be handled via HTTP Headers submitted to spire.marina.io API.

** Basic transfer of opaque binary data

PUT with 'Byte-range' headers n bytes in m windows. Use timing of previous sessions to dynamically expand/contract number of bytes in each PUT request.

Each chunk of a blob is adressed as a URI of the form:

.../<domain>/<node>/<mount-path>/<timestamp>/<n-byte-chunks>/<mth-chunk>

MIME type for PUT content is "application/octet-stream".

A local management REST API is always available bound to ~tcp4:2002~ Client platform A Common Lisp implementation on ~x86_64~, ~arm32~, or ~arm64~. ** CCL Most efficient runtime on arm32 platform http://trac.clozure.com/ccl/wiki/PlatformNotes SBCL * ABCL * Server platform A Common Lisp implementation running on ~x86_64~. SBCL ~sbcl-1.3.1~ or later known to work CCL ~ccl-1.11~ ABCL ~abcl-1.5.0~

Therefore, the "/opt/cloudfleet/data/.snapshot/" must exist and be owned by root. Currently this is done once per node as part of installation when "setup/add-subvolume.bash" is executed. It should be made part of the setup done by setting up the encrypted volumes.

** DONE make a hard link to btrfs, setuid CLOSED: [2015-10-27 Tue 12:44]

** BTRFS/SEND *** DONE stdout/stderr mixing CLOSED: [2015-11-14 Sat 10:16]

*** DONE Use octet streams CLOSED: [2015-11-19 Thu 10:47]

Unfortunately, this doesn't seem to work:

+BEGIN_SRC lisp

(ccl:run-program "/bin/ls" nil :wait nil :output (ironclad:make-octet-input-stream (make-array 16 :element-type '(unsigned-byte 8))) :element-type '(unsigned-byte 8))

+END_SRC

complaining about

+BEGIN_EXAMPLE

There is no applicable method for the generic function:

<STANDARD-GENERIC-FUNCTION STREAM-WRITE-VECTOR #x30200006518F>

when called with arguments: (#<IRONCLAD::OCTET-INPUT-STREAM #x3020023CA75D> "chute LICENSE parachute.org setup ...

+END_EXAMPLE

Fortunately, CCL:RUN-PROGRAM takes an :ELEMENT-TYPE keyword which allows us to get octet streams out of the subprocesses.

** DONE parse id for PUT uri from POST CLOSED: [2015-12-14 Mon 14:09]

Best implementation: exec a bash process then read its environment table ** DONE MAKE-NEW-DIRECTORY CLOSED: [2015-12-13 Sun 10:40]

*** REST Transfer Implementation Initial mplementation completed. Mocks in place for many other systems.

*** Tests of transfer integrity

**** CHUTE.TEST::TRANSFER.BLOB.1
Transform a given file into a blob

**** CHUTE.TEST::TRANSFER.BLOB.2

Use results of BTRFS/SEND into a blob

** TODO Future interface for subaddressing components of a blob For resumable transfers

+NAME: REST for resumable transfers

+BEGIN_SRC

            PUT /<URI>/0/<chunk-bytes>/<nth-chunk>
            ->>   201 on success or [345]00 
              (json) "true" or "false"

            GET /<URI>/0/<chunk-bytes>/<nth-chunk>/hash/sha256  
            ->>   20x [345]xx (does 314 make sense?)
              (json) SHA256 Hash

+END_SRC

** (at first without byte ranges). Implementation use HTTP 'Byte-range' header to files attached/detatched via mmap().

TODO Tests for use cases TODO Metadata transcriptions * URI Scheme for previous link TODO Generalize filesytem snapshoting abstraction Implement ZFS.