Skip to content
Branch: master
Find file History
joshblum fix infinite recursion, redundant statements (#17686)
* remove unused file, infinite recursive call in protocol

* remove redundant statements
Latest commit b86b550 May 24, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.circleci blind replace kbfs to new repo Dec 14, 2018
cache setup the base read tree Dec 14, 2018
data kbfs: vloggify loquacious loggers Apr 18, 2019
dokan kbfs: fix lint Mar 5, 2019
env Desktop-only: only commit to coinflips when awake+unlocked (#16646) Mar 21, 2019
favorites mtime-based TLF sorting and use SimpleFS fav API (#17530) May 16, 2019
fsrpc libkbfs: move all data-related code into a new `data` package Apr 9, 2019
idutil plumb context through assertion parsing (#17324) May 10, 2019
ioutil kbfs: fix lint Mar 5, 2019
kbfsblock fix infinite recursion, redundant statements (#17686) May 24, 2019
kbfscodec libkbfs: move all data-related code into a new `data` package Apr 9, 2019
kbfscrypto libkbfs: move all data-related code into a new `data` package Apr 9, 2019
kbfsdokan go/*dokan: Log process exit much cleaner (#16846) Apr 4, 2019
kbfsedits kbfs: vloggify loquacious loggers Apr 18, 2019
kbfsfuse kbfs: vloggify loquacious loggers Apr 18, 2019
kbfsgit libgit: remove worktree Apr 22, 2019
kbfshash kbfsblock: use a new prefix for temporary block IDs May 3, 2019
kbfsmd fix infinite recursion, redundant statements (#17686) May 24, 2019
kbfssync go1.12.4 fmt Apr 25, 2019
kbfstool libkbfs: move all data-related code into a new `data` package Apr 9, 2019
kbpagesconfig fix gofmt Dec 14, 2018
kbpagesd libkbfs: Catch and attempt to unmount on SIGTERM Jan 25, 2019
libcontext libkbfs: move DelayedCancellation and friends to `libcontext` pkg Mar 13, 2019
libdokan Go1.12 symlink detection vs Dokan issue, pass test for now Apr 25, 2019
libfs improvements on online/offline detection for Files (#17428) May 8, 2019
libfuse fix infinite recursion, redundant statements (#17686) May 24, 2019
libgit libgit: remove worktree Apr 22, 2019
libhttpserver libkbfs: move all data-related code into a new `data` package Apr 9, 2019
libkbfs fix infinite recursion, redundant statements (#17686) May 24, 2019
libkey libkbfs: move all data-related code into a new `data` package Apr 9, 2019
libmime kbp: update mime types from nginx and add application/wasm Jan 25, 2019
libpages libkbfs: move all data-related code into a new `data` package Apr 9, 2019
metricsutil setup the base read tree Dec 14, 2018
redirector readlink in BinPath and get rid of osext (#15348) Jan 17, 2019
simplefs kbfs: print error stack traces in three cases May 20, 2019
stderrutils setup the base read tree Dec 14, 2018
sysutils setup the base read tree Dec 14, 2018
test cr_chains: when identifying types, handle self-contained subdirs May 3, 2019
tlf plumb context through assertion parsing (#17324) May 10, 2019
tlfhandle plumb context through assertion parsing (#17324) May 10, 2019
.gitignore setup the base read tree Dec 14, 2018
Dockerfile setup the base read tree Dec 14, 2018
LICENSE setup the base read tree Dec 14, 2018
Makefile setup the base read tree Dec 14, 2018
README.md libkbfs: move all data-related code into a new `data` package Apr 9, 2019
appveyor.yml Merge remote-tracking branch 'kbfs/jzila/monorepo-read-tree' into jzi… Dec 21, 2018
docker-compose.yml setup the base read tree Dec 14, 2018

README.md

Keybase Filesystem (KBFS) Build Status Build status

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.

Sharing

All code is written in the Go Language, and relies on the Keybase service.

Architecture

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:

  • cache: Generic cache data structures.
  • data: Data structures and logic for KBFS file and directory data.
  • dokan: Helper code for running Dokan filesystems on Windows.
  • env: Code to implement libkbfs.Context in terms of libkb.
  • favorites: Data structures for the favorited lists of top-level folders (TLFs) that appear under private/, public/, and team/.
  • fsrpc: RPC interfaces that connected clients can call in KBFS, to do certain operations, such as listing files.
  • idutil: Basic data structures, interfaces, and helper code for dealing with identity data for users and teams.
  • ioutil: Helper functions for I/O.
  • kbfsblock: Types and functions to work with KBFS blocks.
  • kbfscodec: Interfaces and types used for serialization in KBFS.
  • kbfscrypto: KBFS-specific cryptographic types and functions.
  • kbfsdokan: The main executable for running KBFS on Windows.
  • kbfsfuse: The main executable for running KBFS on Linux and OS X.
  • kbfsgit: The main executable for the Keybase git remote helper.
  • kbfshash: An implementation of the KBFS hash spec.
  • kbfsmd: Types and functions to work with KBFS TLF metadata.
  • kbfssync: KBFS-specific synchronization primitives.
  • kbfstool: A thin command line utility for interacting with KBFS without using a filesystem mountpoint.
  • kbpagesconfig: Configuration code for Keybase Pages.
  • kbpagesd: The main executable for Keybase Pages.
  • libcontext: KBFS-specific context helper code.
  • libdokan: Library code gluing together KBFS and the Dokan protocol.
  • libfs: Common library code useful to any filesystem presentation layer for KBFS.
  • libfuse: Library code gluing together KBFS and the FUSE protocol.
  • libgit: Library for git-related logic.
  • libhttpserver: Library for serving KBFS files with a local HTTP server.
  • libkey: Library for managing KBFS server keys and key metadata.
  • libkbfs: The core logic for KBFS.
  • libmime: Library for determining the MIME types of KBFS files.
  • libpages: Library for the logic behind Keybase Pages.
  • metricsutil: Helper code for collecting metrics.
  • redirector: The executable that redirects user FUSe requests to the correct user KBFS mount. The redirector is usually mounted at /keybase on Linux and macOS.
  • simplefs: A simple RPC-based interface to KBFS.
  • stderrutils: A simple library for dealing with stderr on different platforms.
  • sysutils: Library for dealing with platform-specific systems stuff.
  • test: A test harness with a domain-specific test language and tests in that language.
  • tlf: Code and structures for top-level folders (TLFs).
  • tlfhandle: The data structure for "Handles" to top-level folders (TLFs), which represent an identifier for each TLF, containing all the user or team IDs associated with the it.

Status

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.

To run from source against production KBFS servers

On Linux or OS X:

Prerequisites:

  • Go 1.7 or higher.
  • A running Keybase client service (see instructions).
  • On OS X, you may have to install FUSE yourself.
    • You may need to pass the --use-system-fuse flag to kbfsfuse if you install FUSE yourself.
  • Then, mount KBFS at /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.

On Windows:

See our kbfsdokan documentation.

On FreeBSD:

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.

To run from source against local in-memory servers

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".)

Code style

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 golint is easy from the top-level kbfs directory:

go get -u github.com/golang/lint/golint
make lint

Vendoring

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

Testing

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.)

Licensing

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.)

You can’t perform that action at this time.