sphinx
A search engine powered by you and your pals for finding answers to your riddles.
sphinx keeps a directory of listings: apps, groups, notebook posts and links. The listings you publish go to your mutual pals and on to their mutual pals, theirs come to you, and you search everything you've received.
Install
sphinx runs on the kernels listed in desk/sys.kelvin, currently
[%zuse 408]. Check your ship first: in the dojo, +vats %base must show
/sys/kelvin: [%zuse 408]. If it shows an older kernel, let your ship finish
its update first. If the update is blocked, Landscape lists the apps that
block it, and |bump suspends them.
Then, in your ship's dojo:
|install ~donmec-sallud %sphinx
For a new install, you can also search for ~donmec-sallud in Landscape and install sphinx from there.
sphinx shares listings through %pals. Install it with
|install ~paldev %pals and add your friends as pals. Without %pals you only
see your own listings.
Moving from ~nocsyx-lassul
sphinx used to be distributed from ~nocsyx-lassul. Its last release there
only supports [%zuse 412], so it can't run on a current ship. On a
[%zuse 412] ship it blocks the kernel update until you |bump. After the
kernel check above, switch it to ~donmec-sallud in the dojo:
|install ~donmec-sallud %sphinx
Your listings are kept. Use the dojo for this: Landscape's Get App can't switch an existing install. It asks ~nocsyx-lassul again, and docket refuses because sphinx is already installed.
If you ran |install before your ship reached [%zuse 408], sphinx stays
suspended after the update, and another |install only prints
already syncing. Run |uninstall %sphinx, then
|install ~donmec-sallud %sphinx again. Your listings are kept.
Development
The repo has two parts:
desk/: the Hoon agent, its marks and libraries, and the docket file.ui/: the web interface, built with React, TypeScript, Tailwind CSS and Vite.
Build
With Nix:
nix build .#desk -o result-desk # the desk; Nix makes its files read-only
nix build .#glob -o result-glob # the UI, built for /apps/sphinx/
To put the desk on a test ship, copy it writable and with --delete, as in
RELEASING.md step 2. vere aborts at |unmount if the mount is read-only.
chmod -R u+w result-desk-rw 2>/dev/null; rm -rf result-desk-rw &&
cp -RL result-desk result-desk-rw && chmod -R u+w result-desk-rw &&
rsync -rpc --delete result-desk-rw/ <pier>/sphinx/
The desk output adds what desk/ needs from urbit's base-dev and
landscape's desk-dev. Both are pinned in flake.nix for the kelvin in
desk/sys.kelvin. When you port sphinx to a new kernel, update those two
inputs together with desk/sys.kelvin.
Without Nix, run npm install and npm run build in ui/ to build the UI
into ui/dist/. Use the Node version in ui/.nvmrc.
To publish a release from ~donmec-sallud, follow RELEASING.md.
Working on the UI
You need a running ship with sphinx installed. In ui/:
- Run
npm install. - Create
ui/.env.localwithVITE_SHIP_URL=<URL>, where<URL>is your ship's web address, for examplehttp://localhost:8080. Git ignores this file. - Run
npm run devand open the address it prints.
The dev server sends every request except those for the interface itself to the ship, so you see live data. Vite reloads the page as you change the code.
The tile image
The tile is inlined in desk/desk.docket-0 as a data: URI, so Landscape
doesn't load it from another server.
To get the SVG out:
sed -n "s|^ image+'data:image/svg+xml;base64,\(.*\)'\$|\1|p" desk/desk.docket-0 | base64 -d > tile.svg
To put a new one in, print a new image+ line and replace the old line in
desk/desk.docket-0 with it:
printf " image+'data:image/svg+xml;base64,%s'\n" "$(base64 < tile.svg | tr -d '\n')"
Keep the rest of the file as it is. Docket rewrites the file when a glob is uploaded, and the hash copy-back in RELEASING.md should only change the hash. A new tile doesn't need a new glob.