Upspin part 5: Advanced tips and tricks [WIP]
Jul 2018    |    upspin   fuse   cacheserver   upspinfs   advanced   tips&tricks  


Please note: this is a work in progress and some items below may change without notice

FUSE daemon, upspinfs and cacheserver

The bread and butter of Upspin is being able to bring your remote data into the local namespace, so those items look and feel as if they are part of the local file tree.

Before we proceed we need tools:

https://github.com/osxfuse/osxfuse#build-instructions

brew install autoconf automake libtool gettext
brew link --force gettext

I’ll be grabbing the latest release from github.com/osxfuse/osxfuse. In this example I’m downloading and installing osxfuse-3.8.0.dmg with the defaults.

If you don’t have FUSE, or it’s installed incorrectly you’ll get an error:

FUSE for macOS is not installed. See https://osxfuse.github.io/

Next we update our Upspin config file to include a cache server (makes everything faster). By default the config file is located in $HOME/upspin/config

echo -e "cache: yes" >> $HOME/upspin/config

The cacheserver is started automatically when you run either the upspin or upspinfs command. We can override the default behaviour with config file and flags (if supplied, flags take precedent).

The default cache is located $HOME/upspin/frid.mike@gmail.com/fscache/tmp

As a personal preference I prefer the cacheserver to be in writethrough mode instead of writeback. So I add the following to my $HOME/upspin/config

echo -e "cmdflags:\n  cacheserver:\n    writethrough\n" >> $HOME/upspin/config
cat $HOME/upspin/config
# would look something like this
username: frid.mike@gmail.com
dirserver: upspin.mfridman.com
storeserver: upspin.mfridman.com
packing: ee
cmdflags:
  cacheserver:
    writethrough

My Upspin mountpoint is a directory located at $HOME/u

mkdir $HOME/u
upspinfs $HOME/u &
# good
[1] 33387

cd ~/u/frid.mike@gmail.com/Public
$ tree
.
├── Access
├── augie.png
├── gopherfest2017.webm
├── mikes_fav_book.txt
├── this_is_fine.jpg
└── this_is_fine_gopher.png

0 directories, 6 files

# once you're finished cd home, kill the process and unmount
cd && killall -9 upspinfs && umount $HOME/u

# if you forget to kill the process you'll get an error next time
# fuse.Mount failed: mount_osxfusefs: exit status 64

I lost my Domain keys

Well, if you have your “secret seed” string you’re in luck

upspin keygen -curve p256 -secretseed your-secret-seed-that.you-promised-to-save $HOME/upspin/deploy/frid.io

How expose a /Public folder

https://upspin.mfridman.com/frid.mike@gmail.com/Public

How to run a separate directory and store servers