Skip to content
No description, website, or topics provided.
C Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


File server for searches using various backends


This requires plan9port or a plan9 installation to build and run.


make sure PLAN9 is set, and that PLAN9/bin is set in your PATH variable.
Simply run `mk`, and the program will be available as 0.searchfs
TODO: mk install
This currently builds, but does not mount properly on FreeBSD. This is due to FreeBSD not packaging fusermount along with their fuse implementation.


mk install


# Some of these handlers don't exist, possibly won't exist. PRs are definitely welcome
# For inspiration or guidance on how to create these, look to
$ ls <dir>/
	google/     # Query Google (normal searches)
	youtube/    # Single videos, playlists, channels, users
	code/       # Search predefined directories for snippets of code
	dictionary/ # Wrap your favorite dict protocol
	documents/  # Search tags for matching (local) documents
	games/      # Search tags for matching games
	github/     # May be abandoned for a dedicated filesystem
	images/     # Multi-service image search
	bookmarks/  # Search tags for matching bookmarks (this will index your bookmark collection)
	lyrics/     # Lyrical snippets returning matching song or artist - title
	quote/      # Your local quote db, saved from IRC or other things
	music/      # Wrapper for your preferred music streaming service - initially just google music
	wikipedia   # May be abandoned for a dedicated filesystem


searchfs [ -m mtpt ] [ -S srv ] -d handlers
 -m Mountpoint for the server
 -S Service (Plan9 only) post service 
 -d directory containing handlers 

For each handler, searchfs will create a directory, and listen for file creations and reads. When data is requested, searchfs will invoke the handler, with the file name as the argument.

# This will call the `Google` handler, with the argument `mysearch`
# In turn, that will perform a Google query for the term, listing the results in mysearch.

$ cat <dir>/google/mysearch

$ cat <dir>/dict/'someword'
	Some result from

$ cat <dir>/lyrics/'Aqua - Barbie Girl'
	Hiya Barbie! Hi Ken!

$ cat <dir>/youtube/channel/feed/Level1techs
	Level1Techs -


There's not much to configure here. All configuration options are per-handler. A typical file looks like this:

	# Handler specific data here


## Handlers:

Really, dropping any executable, which takes command line arguments, and writes to stdout into your handlers dir should work. For things that need command line flags, write a small rc script which calls the underlying binary with the flags you require, make the script executable, and put that script into the handler dir instead.


ping -c 1 $1

Handlers really shine when they wrap API endpoints. Searching a service can be arduous on a web browser, where your favorite search provider may well not index the content usefully, be difficult to navigate, or otherwise garner much more of your time than is necessary. 

[ytcli]( required to use youtube handler

## Exporting as a network service

Assuming you ran searchfs -S search -d handlers

Modify to match your local machine that is running searchfs

On the host machine, listen on the network for incoming connections

aux/listen1 tcp!*!12345 /bin/exportfs -S /srv/search

On the client machine, connect to our new listener and mount it to /mnt/search

srv -c tcp!!19191 search /mnt/search

You can’t perform that action at this time.