go/kbfs/README.md
This repository contains the official Keybase implementation of the client-side code for the Keybase filesystem (KBFS). See the KBFS documentation for an introduction and overview.
All code is written in the Go Language, and relies on the Keybase service.
This client allows you to mount KBFS as a proper filesystem at some
mountpoint on your local device (by default, /keybase/). It
communicates locally with the Keybase service, and remotely with three
types of KBFS servers (block servers, metadata servers, and key
servers).
The code is organized as follows:
/keybase on Linux and macOS.KBFS currently works on both Linux (at least Debian, Ubuntu and Arch), OS X, and Windows. It is approaching release ready, though currently it is still in alpha. There may still be bugs, so please keep backups of any important data you store in KBFS. Currently our pre-built packages are available by invitation only.
KBFS depends in part on the following awesome technologies to present a mountpoint on your device:
See our vendor directory for a complete list of open source packages KBFS uses.
Currently, our server implementations are not open source.
Prerequisites:
--use-system-fuse flag to kbfsfuse if
you install FUSE yourself./keybase/ as follows: cd kbfsfuse
go install
mkdir -p /keybase && sudo chown $USER /keybase
KEYBASE_RUN_MODE=prod kbfsfuse /keybase
Note that our pre-built packages for OS X include a branded version of FUSE for OS X, to ensure that it doesn't conflict with other local FUSE installations. It is still open source -- see here to see how we build it.
See our kbfsdokan documentation.
There are instructions for getting KBFS running on FreeBSD here. This is a user-supported effort, which is not officially supported by the Keybase team at the moment.
kbfsfuse -bserver=memory -mdserver=memory -localuser strib /keybase
(Use -bserver=dir:/path/to/dir and -mdserver=dir:/path/to/dir if
instead you want to save your data to local disk.)
Now you can do cool stuff like:
ls /keybase/private/strib
echo blahblah > /keybase/private/strib/foo
ls /keybase/private/strib,max
(Note that "localuser" mode has only four hard-coded users to play with: "strib", "max", "chris", and "fred".)
We require all code to pass gofmt and govet. You can install our
precommit hooks to make sure your code passes gofmt and govet:
go get golang.org/x/tools/cmd/vet
ln -s $GOPATH/src/github.com/keybase/client/git-hooks/pre-commit $GOPATH/src/github.com/keybase/client/go/kbfs/.git/hooks/pre-commit
Though it doesn't happen automatically, we also expect your code to be as "lint-free" as possible. Running golangci-lint is easy:
golangci-lint --deadline 15m
KBFS vendors all of its dependencies into the local vendor
directory. To add or update dependencies, use the govendor tool, as
follows:
go install github.com/kardianos/govendor
govendor add github.com/foo/bar # or `govendor update`
git add --all vendor
From kbfs/:
go test -i ./... # install dependencies
go test ./... # run tests
If you change anything in interfaces.go, you will have to regenerate the mock interfaces used by the tests (make sure you have mockgen installed):
cd libkbfs
./gen_mocks.sh
(Right now the mocks are checked into the repo; this isn't ideal and we should probably change it.)
Most code is released under the New BSD (3 Clause) License. If subdirectories include a different license, that license applies instead. (Specifically, dokan/dokan_header and most subdirectories in vendor are released under their own licenses.)