Technical Manual sections
Reference › Technical Manual › Kitten’s internal web app
Every Kitten server also serves Kitten’s own web app, from web/. It is made of the same kinds of files as any Kitten app, and it has its own dependencies in web/package.json. The build installs them and copies the folder into the distribution, and the Kitten Server creates its routes with the same Routes class it uses for the app, from paths.KITTEN_WEB_APP_DIRECTORY_PATH (app/web/ in the data home). (See Initialisation (asynchronous) for the order in which the server adds these routes and the app’s routes.)
A 🔒 at the end of a folder name means that its routes require sign-in. It is not part of the URL (see The route handler). Only files under web/💕/ and web/🐱/ become Kitten routes.
Small Web protocol routes (/💕/):
hello/<domainToken>/: the one-time page where the owner creates their identity (see Identity and sign-in).
id/, id/ssh/, and id/pgp/: the owner’s ed25519, SSH, and PGP public keys, as plain text. Each responds with 404 until that key exists.
sign-in/ and sign-out/: sign-in and sign-out.
ok/: responds with 200, so a deployment can check that Kitten runs even when the app fails.
webhook/ (
POST): in production, runs a requested update check when thesecretfield of the body, or theAuthorizationheader, matcheskitten._db.settings.webhookSecret. It responds with 200 before the check runs.deploy/ (
POST): deploys another app on this server for a Catalyst instance that sends the domain token (kitten._db.settings.domainToken). It callskitten.deploy()(see Deploy).data🔒/backup/ (
GET) and data🔒/restore/ (POST): back up the app’s data directory (its _db, db, uploads, and repl folders) as a .tar.gz file, and restore it. The restore route exportsuploadLimits = { fileSize: Infinity }and anonUploadLimit()function that reports the limit to the backup and restore page. It takes the archive out of the uploads store as soon as it arrives (it moves the file tokitten.paths.KITTEN_SAME_DEVICE_TEMP_DIRECTORYand deletes itskitten._db.uploadsentry), extracts it into a staging folder beside the data directory, and only then swaps the staging folder in and requests a restart. It emits its progress to the session for the backup and restore page. If the restore fails, the data directory is unchanged.
Kitten routes (/🐱/):
settings🔒/: the Settings app, which opens at settings/kitten/ (Kitten’s version, automatic updates, and the update history). These are its other sections:
app
identity
secrets
domain
evergreen-web
uploads
db and _db
backup-and-restore
state (overview, sessions, pages, and requests)
images/ and library/: Kitten’s images, the client-side libraries, and the Measured syntax highlighting themes for highlight.js. The build adds most of their contents.
The Kitten Server itself adds two more routes:
/🐱/development-socket/: the websocket middleware, in development only.
/uploads/<id>/: uploaded files (see Uploads).
Source code: