Uplink Developer docs Get Uplink
APIs

Relay server API

The relay server's HTTP routes: files, the Marketplace, feedback and the rest.

The relay is mostly two WebSockets, the hub and the pairing relay. Beside them it answers a small set of plain HTTP routes: a circle's sealed files, the plugin Marketplace, feedback, bounties, the pages that link a handle, and, where it is given the folder, the app built for a browser. This page lists every one. Relays that talk to each other, home records and a call's media relay have no HTTP routes of their own: they are spoken over the hub's socket. The public relay is at https://gogho.st. Anyone can run their own from the source: dart run relay/bin/relay.dart --port 8787. The WebSocket protocols are on The hub and pairing protocols, and a Postman collection of these routes is on API overview and Postman.

Conventions

Each module says no in its own shape:

ModuleA refusalNotes
Files{"err": "No such space."}A sentence. A few carry more: have, done, seq.
Feedback{"error": "Feedback is sent with POST."}A sentence, under error, not err.
Marketplace{"ok": false, "error": "not_found", "message": "There's nothing here by that name."}error is a fixed code; message is for people. Every success carries "ok": true.
Bounties{"error": "Not here."}A sentence, under error, as feedback's.
The app in a browserNot foundPlain text with 404. A wrong method is 405 with no body.

Outside the modules, a path or a query whose percent-escapes are not UTF-8 answers 400 with no body, and an error nothing else caught answers 500 with no body. Both close the connection.

Signing a request

Writes to Files, feedback, and most of the Marketplace are signed with the install's own key, the same one the hub knows it by. No account or password is involved. A bounty is signed the same way, by one key the relay was given.

ThingFormat
KeyP-256 (secp256r1). The public key is 33 bytes compressed: 02 or 03, then x. In a header it is standard base64 with padding, 44 characters.
SignatureECDSA over the SHA-256 of the signed string. 64 bytes: r (32, big-endian) then s (32). Not DER. Standard base64, 88 characters.
IdThe first 16 bytes of the SHA-256 of the 33 key bytes, as 32 lowercase hex digits. This is who the relay says wrote something.
Body hashSHA-256 of the body's bytes, 64 lowercase hex digits. For an empty body: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.

All three modules take the same three headers and sign five lines joined by a line feed (\n), as UTF-8, with no line feed after the last. Only the first line and a few rules differ.

x-ghost-key:  <base64 of the 33-byte public key>
x-ghost-time: <milliseconds since 1970>
x-ghost-sig:  <base64 of the 64-byte signature>

The relay remembers what each key signed, so the same request sent twice is refused the second time. To try again, sign again with a new time.

Files

Every Files route but GET /files also carries the space's token: Authorization: Ghost <token>, 64 lowercase hex digits. Reads need only the token. Writes need the token and the signature.

ghost-files v1
<METHOD>
<path and query, as sent>
<time>
<body sha256 hex>

Feedback

ghost-feedback v1
POST
/feedback
<time>
<body sha256 hex>

Marketplace

ghost-market v1
<METHOD>
<path>
<time>
<body sha256 hex>

A signed GET /market/mine looks like this:

GET /market/mine HTTP/1.1
Host: gogho.st
x-ghost-key: AqGyw9Tl9gcYKTpLXG1+j5ChssPU5fYHGCk6S1xtfo+Q
x-ghost-time: 1795000000000
x-ghost-sig: <88 base64 characters>

and its signature is over these bytes:

ghost-market v1
GET
/market/mine
1795000000000
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Bounties

ghost-bounty v1
POST
/bounty
<time>
<body sha256 hex>

Signatures inside Marketplace bodies

Review's decisions are signed a second time, by the reviewer's key, so that the apps can check them without trusting the relay. Each is the same kind of signature over lines joined by \n, and travels as a JSON object with exactly the fields shown. Here key and sig are strict base64: the standard alphabet, padded, no whitespace.

WhatSigned stringObject
Approvalghost-market approve v1\n<plugin>\n<version>\n<sha256>{"v": 1, "plugin", "version", "sha256", "key", "sig", "at"}
Revocationghost-market revoke v1\n<plugin>\n<sha256>\n<at>\n<why>{"v": 1, "plugin", "sha256", "at", "why", "key", "sig"}
Retirementghost-market retire v1\n<key> (the key's base64 text){"v": 1, "key", "at", "sig"}

General

The relay has one answer for anything it does not recognise. A script can use it to see that a relay is there.

GET /

The answer to any request, of any method and path, that no other route takes. There is no separate health route.

Who Anyone

Answers 200 text/plain: Ghost Messaging relay

Refusals 400 (empty) a path whose percent-escapes are not UTF-8 404 text/plain: Ghost Messaging relay a WebSocket upgrade whose last path segment is neither hub nor 32 hex digits 400 (empty) a WebSocket upgrade to the hub or a channel whose Sec-WebSocket-Key is not 1 to 64 printable ASCII characters

These are pages for a browser, not an API to call. When someone links a Discord, Telegram or X handle, the app asks the hub for a sign-in address and opens it. The address holds a state made for that install, good for 10 minutes and for one sign-in. The relay checks the sign-in with the network, links the handle, and tells the install over the hub. A network whose keys are not set on the server is off, and its page says the link is no good.

Invite words

A circle can be joined by a word. The relay keeps, under the SHA-256 of the word, a sealed link of at most 1024 characters that the app gave it over the hub. It never sees the word or what the link opens. This one route is how the site's join page looks a word up.

GET /word/{h}

The sealed invite link kept under a word's hash. The word itself is never sent.

Who Anyone

FieldWhereNeededWhat
hpathyesSHA-256 of the word, as the app works it out: 64 lowercase hex digits.

Answers 200 {"b": "<sealed link>"}

Refusals 404 {"b": null} no such word, a hash of the wrong shape, or a method other than GET

Files

A space's files live on the relay as sealed blobs, beside an ordered log of sealed operations that says what the files are. The relay can't read either: names, keys and contents are sealed by the apps. It sees the space's id, each blob's size, when things were written, and the id of the install that wrote them.

A space is named by an id (32 hex digits) and guarded by a token (64 hex digits), both made by the apps from the space's secret. The relay keeps only the token's hash, and a wrong token is answered exactly as a space that isn't there. Anyone with the token can read. Writing also takes a signature, so a blob is written and finished only by whoever started it, and removed by them, the space's owner, or a moderator who shows the space's signed roster.

Uploading a file is three steps: reserve a blob with its size, send its pieces in order, then finish it. An upload cut short carries on from have. A blob not finished holds its room in the space until it is finished or dropped, and the space's state lists the newest hundred of them under parts, so an app can show an upload that stopped halfway and carry it on or remove it.

LimitDefault
One file50,004,194,304 bytes
One space100,000,000,000 bytes, 10,000 blobs
One piece of a blob8 MiB
One log operation32,768 bytes
A space's log20,000 entries, 16 MiB
Writes by one install600 a minute
Spaces made by one install20
A space nobody opensRemoved after 90 days
An unfinished blobDropped 24 hours after its last write

GET /files

Says the relay keeps files, and its limits. Answers any method.

Who Anyone

Answers 200 {"files": 1, "maxFile": 50004194304, "quota": 100000000000}

Refusals

PUT /files/{space}

Makes a space, or opens one that exists. The first PUT sets the space's token. The answer is the space's state, as GET gives it.

Who Holder of the space token, signed

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
ownerbodyThe owner's public key, 66 hex digits. Taken only when it is the signer's own key.
rvbodyA roster announcement: {"v": version, "h": sha256 hex of its signed bytes, "ad": [admins' ids], "g": the owner's grant (128 hex), from a non-owner}. Ignored when not believed.

Answers 201 (made) or 200 (existed) {"seq": 0, "used": 0, "quota": 100000000000, "maxFile": 50004194304, "files": 0, "owner": "02a1…", "rv": 0, "cas": 1, "parts": []}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 413 {"err": "Too big."} body over 65536 bytes 401 {"err": "Bad signature."} 429 {"err": "Slow down."} 403 {"err": "Too many Files spaces made by this device."} 429 {"err": "Too many Files spaces made from here today."} 507 {"err": "Full."}

GET /files/{space}

The space's state: its last log number, bytes used, limits, owner and roster version, and in parts the newest 100 uploads not finished yet: each blob's id, who started it (by), its size (z), the bytes here (h) and when it last moved (at).

Who Holder of the space token

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.

Answers 200 {"seq": 8, "used": 1048592, "quota": 100000000000, "maxFile": 50004194304, "files": 1, "owner": "02a1…", "rv": 3, "cas": 1, "parts": [{"id": "5d41402abc4b2a76b9719d911017c592", "by": "<id>", "z": 1048592000, "h": 8388608, "at": 1763900000000}]}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 405 {"err": "No."} any method but PUT, GET, DELETE

DELETE /files/{space}

Removes the space and everything in it. The body is not read: sign the empty body's hash.

Who Signed: the space's owner

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.

Answers 200 {"ok": true}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 401 {"err": "Bad signature."} 403 {"err": "Only the space's owner can remove it."}

GET /files/{space}/log

Reads the log after a number, a page at a time: at most 500 entries or about 1 MiB.

Who Holder of the space token

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
afterqueryReturn entries numbered above this. Default 0.

Answers 200 {"ops": [{"s": 1, "by": "<id>", "at": 1763900000000, "rv": 3, "c": 1, "o": "<base64>"}], "seq": 1, "more": false}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 503 {"err": "Busy. Try again in a moment."} with Retry-After: 2

POST /files/{space}/log

Appends one sealed operation to the log. The body is the operation's raw bytes, 1 to 32768.

Who Holder of the space token, signed

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
afterqueryThe log number this was written against. The entry lands at after + 1 or not at all.

Answers 200 {"seq": 8}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 413 {"err": "An operation is at most 32768 bytes."} also an empty body 401 {"err": "Bad signature."} 429 {"err": "Slow down."} 409 {"err": "The list has moved on. Read it again.", "seq": 8} 507 {"err": "This space's list is full."} 507 {"err": "This space is full."} 507 {"err": "The files server is full."}

POST /files/{space}/blobs

Asks for room for one sealed file and gets its id. The size counts against the space from now.

Who Holder of the space token, signed

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
sizebodyyesThe sealed file's length in bytes: 16 to maxFile.
prebodytrue: every piece will say its hash first (x-ghost-body-sha256); pieces without are refused.

Answers 201 {"id": "5d41402abc4b2a76b9719d911017c592", "have": 0}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 413 {"err": "Too big."} body over 1024 bytes 401 {"err": "Bad signature."} 429 {"err": "Slow down."} 400 {"err": "No size."} 400 {"err": "Too small."} 413 {"err": "A file may be at most 50004194304 bytes."} 507 {"err": "This space is full."} 507 {"err": "The files server is full."} 507 {"err": "This space holds as many files as it can."} 429 {"err": "Too many files on their way from here. Finish those first."}

GET /files/{space}/blobs/{blob}

Downloads a finished blob, whole or one byte range of it.

Who Holder of the space token

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
blobpathyesThe blob's id, as POST /files/{space}/blobs answered it: 32 lowercase hex digits.
RangeheaderOne range: bytes=a-b, bytes=a- or bytes=-n.

Answers 200 or 206 application/octet-stream, with Accept-Ranges: bytes and, for 206, Content-Range

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 404 {"err": "No such file."} 409 {"err": "Not all of it is here yet."} 416 (empty) with Content-Range: bytes */<length>

HEAD /files/{space}/blobs/{blob}

The headers of a download (Content-Length, Accept-Ranges) without the bytes.

Who Holder of the space token

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
blobpathyesThe blob's id, as POST /files/{space}/blobs answered it: 32 lowercase hex digits.
RangeheaderOne range, as for GET.

Answers 200 or 206, headers only

Refusals 404 no such space or file 401 no token 409 not finished 416 bad range

PUT /files/{space}/blobs/{blob}

Uploads the next piece of a blob, at most 8388608 bytes. Pieces go in order, one at a time.

Who Signed: whoever reserved the blob

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
blobpathyesThe blob's id, as POST /files/{space}/blobs answered it: 32 lowercase hex digits.
offsetqueryyesWhere this piece starts. Must equal the bytes the relay has (have).
x-ghost-body-sha256headerSHA-256 of this piece, 64 hex digits. Sent, it is the body hash that is signed, and the signature is checked before the body is read. Required when the blob was reserved with pre.
x-ghost-body-lengthheaderWith x-ghost-body-sha256: the piece's length. Defaults to Content-Length and must equal it.

Answers 200 {"have": 8388608}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 404 {"err": "No such file."} 409 {"err": "Already finished.", "have": 1048592, "done": true} 409 {"err": "Send from where it has got to.", "have": 0} 413 {"err": "A piece is at most 8388608 bytes."} 400 {"err": "The body's hash and length don't match the request."} 413 {"err": "More than the file was said to be."} 401 {"err": "Bad signature."} 403 {"err": "Not yours."} 403 {"err": "Say the piece's hash first."} 429 {"err": "Slow down."} 400 {"err": "The body isn't what its hash said."} 500 {"err": "Something went wrong."} the body stalled for 30 seconds; the piece is dropped

GET /files/{space}/blobs/{blob}/state

How much of a blob has arrived, to carry on an upload.

Who Holder of the space token

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
blobpathyesThe blob's id, as POST /files/{space}/blobs answered it: 32 lowercase hex digits.

Answers 200 {"have": 8388608, "size": 1048592000, "done": false}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 404 {"err": "No such file."}

POST /files/{space}/blobs/{blob}/done

Finishes a blob once every byte is there, so it can be downloaded. The body is ignored: sign the empty body's hash.

Who Signed: whoever reserved the blob

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
blobpathyesThe blob's id, as POST /files/{space}/blobs answered it: 32 lowercase hex digits.

Answers 200 {"have": 1048592, "done": true}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 404 {"err": "No such file."} 401 {"err": "Bad signature."} 403 {"err": "Not yours."} 409 {"err": "Not all of it is here yet."}

DELETE /files/{space}/blobs/{blob}

Removes a blob, finished or not, and frees its room. A moderator or admin sends the space's signed roster as proof.

Who Signed: its uploader, the space's owner, or a moderator with a roster

FieldWhereNeededWhat
spacepathyesThe space's id: 32 lowercase hex digits.
blobpathyesThe blob's id, as POST /files/{space}/blobs answered it: 32 lowercase hex digits.
rosterbody{"r": base64 of the bytes the roster's author signed, "s": the signature, 128 hex}. Looked at only when the signer is neither the uploader nor the owner.

Answers 200 {"ok": true}

Refusals 404 {"err": "No such space."} (also a wrong token) 401 {"err": "No token."} 404 {"err": "No such file."} 413 {"err": "Too big."} body over 65536 bytes 401 {"err": "Bad signature."} 403 {"err": "Only whoever added it, the space's owner, or a moderator can remove it."} 429 {"err": "Slow down."} 403 {"err": "No roster."} or "Not a roster." 403 {"err": "This space's owner hasn't opened it yet, so no roster can be checked."} 403 {"err": "That roster isn't signed by this space's owner or an admin."} 403 {"err": "That roster is older than one this space has seen."} 403 {"err": "This space has seen another roster at that version."} 403 {"err": "That roster skips ahead of what this space has seen."} 403 {"err": "This space's roles don't let you remove that file."}

Feedback

The app's Share feedback sends one signed report. The relay files it on the server's feedback board and answers with the ticket's id. It keeps nothing itself. A username in the report is filed as given when the signing key holds that username, and marked not verified otherwise. On a relay with no board set up the route answers 503.

Limits: 5 reports an hour and 20 a day from one install, 300 a day from everyone, 10 MiB a report, three screenshots of 3 MiB each.

POST /feedback

Files one report, with up to three screenshots. The whole body is at most 10485760 bytes.

Who Signed: any install

FieldWhereNeededWhat
typebodyyesbug, feature, confusing, praise or other.
textbodyyesWhat happened. Cut to 5000 characters.
titlebodyCut to 120 characters. Left out, the text's first line is used.
usernamebodyThe sender's username. Filed as "(not verified)" unless the signing key holds it.
platformbodyandroid, iphone, mac, windows or linux.
versionbodyThe app's version. Cut to 40 characters.
OriginheaderFrom the app in a browser at the address the relay is set to allow (GHOST_APP_ORIGIN), the answer carries Access-Control-Allow-Origin for it.
shotsbodyUp to 3 of {"name", "mime", "data"}: mime image/png, image/jpeg, image/webp or image/gif; data base64, at most 3145728 bytes decoded. A bad one is skipped.

Answers 200 {"ok": true, "id": "GMFB-12"}

Refusals 405 {"error": "Feedback is sent with POST."} 503 {"error": "Feedback isn't set up on this server yet."} 413 {"error": "That's too big to send. Try fewer or smaller screenshots."} 400 {"error": "The feedback didn't arrive whole. Try again."} 401 {"error": "The app's signature didn't check out. Make sure your clock is right, then try again."} 429 {"error": "That's a lot of feedback at once. Thank you! Try again in a while."} 400 {"error": "The feedback couldn't be read."} 400 {"error": "Say what happened, in a few words at least."} 502 {"error": "The feedback board didn't take it just now. Try again in a while."} 502 {"error": "The feedback board couldn't be reached. Try again in a while."}

Marketplace

The Marketplace holds plugins from other developers and the queue they wait in for review. A plugin's package is one JSON file in the ghost-plugin/1 format, sent in canonical form (keys sorted, no whitespace) and named by its SHA-256.

Anyone can read the catalog, the withdrawals list, approved packages and listed screenshots. A developer signs with the key that holds the username in the plugin's developer field. Review is an install that holds one of the relay's admin usernames and signed in to the admin page over the hub in the last 8 hours, or the last 30 minutes for approving, revoking, blocking and listing. No password travels over these routes.

The relay is not trusted with a plugin. An approval is the reviewer's own signature over the plugin's id, version and hash, and the app checks it against review keys it already knows before it adds anything. The catalog carries no names or pictures: the app fetches each package and reads them from it.

The relay keeps packages, screenshots, submissions with their notes, reports, and a log of what review did. A report is kept without its sender's key.

The same review takes reports of people and messages (/market/abuse). The app seals each one to the review keys before it sends it, so the relay holds an envelope it can't read, and never who sent it. It keeps the newest 150, letting go first of the oldest one marked done.

LimitDefault
One package262,144 bytes
Screenshots4, PNG, 1 MiB each, 64 to 2,400 pixels a side
A signed body6 MiB
Submissions5 a day and 3 waiting, by one developer
A new usernameCan submit 7 days after it is claimed
Public reads240 a minute from one address; the catalog and withdrawals 10 a minute
Signed requests300 an hour by one key, 60 a minute from one address
Reports of people5 an hour and 15 a day by one key, 20 a day from one address, 15 a day by one verified number or account; 48,000 characters sealed

GET /market

Whether the Marketplace is open, its limits, and the labels, shelves, hues and permissions a plugin may name. Answers even when it is off.

Who Anyone

Answers 200 {"ok": true, "market": 1, "format": "ghost-plugin/1", "open": true, "limits": {"package": 262144, "icon": 48000, "shot": 1048576, "shotSide": 2400, "shots": 4, "body": 6291456, "notes": 1000}, "labels": [...], "shelves": [...], "hues": [...], "permissions": [...]}

Refusals 429 {"ok": false, "error": "rate_limited"} 405 {"ok": false, "error": "method"}

GET /market/catalog

Every listed plugin's current version: its id, hash, size and the reviewer's signed approval. At most 2000, newest first. Names and pictures are in each package.

Who Anyone

FieldWhereNeededWhat
If-None-MatchheaderThe ETag from an earlier answer. A match answers 304 with no body.

Answers 200 {"ok": true, "v": 1, "at": 1795000000000, "plugins": [{"id", "version", "sha256", "size", "approval": {...}, "listedAt", "updatedAt"}]} with an ETag

Refusals 429 {"ok": false, "error": "rate_limited"} 503 {"ok": false, "error": "off"} or "busy"

GET /market/revoked

The withdrawals list: signed revocations of approved versions, and review keys no longer to be trusted. Oldest first.

Who Anyone

FieldWhereNeededWhat
If-None-MatchheaderThe ETag from an earlier answer. A match answers 304 with no body.

Answers 200 {"ok": true, "v": 1, "at": 0, "revoked": [], "retired": []} with an ETag

Refusals 429 {"ok": false, "error": "rate_limited"} 503 {"ok": false, "error": "off"} or "busy"

GET /market/packages/{sha256}

An approved version's package: the plugin's canonical JSON bytes, current or earlier, listed or not.

Who Anyone

FieldWhereNeededWhat
sha256pathyesSHA-256 of the package: 64 lowercase hex digits.

Answers 200 application/octet-stream, filename "<id>-<version>.uplinkplugin"

Refusals 404 {"ok": false, "error": "not_found"} 410 {"ok": false, "error": "revoked"} 429 {"ok": false, "error": "rate_limited"} 503 {"ok": false, "error": "off"} or "busy"

GET /market/shots/{sha256}

A screenshot of a listed plugin's current version.

Who Anyone

FieldWhereNeededWhat
sha256pathyesSHA-256 of the picture: 64 lowercase hex digits.

Answers 200 image/png

Refusals 404 {"ok": false, "error": "not_found"} 429 {"ok": false, "error": "rate_limited"} 503 {"ok": false, "error": "off"} or "busy"

POST /market/report

Reports a plugin to review. The sender's key is not kept with the report.

Who Signed: any install

FieldWhereNeededWhat
pluginbodyyesThe plugin's id. It must have an approved version.
versionbodyyesThe version, as 1.0.0.
reasonbodyyesmisleading, harmful, spam, privacy, broken or other.
textbodyAt most 1000 characters.
usernamebodyThe sender's username. Marked verified when the signing key holds it.

Answers 201 {"ok": true, "id": "<16 hex>"}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 400 {"ok": false, "error": "bad_json"} or "bad_request" 404 {"ok": false, "error": "not_found"} 429 {"ok": false, "error": "rate_limited"}

POST /market/submissions

Sends a plugin for review, or with check: true only checks it and keeps nothing. A new submission replaces the plugin's open ones.

Who Signed: the developer

FieldWhereNeededWhat
packagebodyyesBase64 of the plugin's canonical JSON bytes (keys sorted, no whitespace). At most 262144 bytes decoded.
shotsbodyUp to 4, each {"mime": "image/png", "data": base64} or {"keep": sha256 of an earlier one}. Their hashes, in order, must be the plugin's shots list.
notesbodyNotes for the reviewer. At most 1000 characters.
listbodynow (the default) or later: approved, it waits for its developer to list it.
agreebodyMust be true to submit: agreement to the Marketplace guidelines. Left out with check.
checkbodytrue: check only. The body is then exactly check and package.

Answers 201 {"ok": true, "submission": {"sid", "plugin", "version", "sha256", "size", "status": "submitted", ...}}; check: 200 {"ok": true, "checked": true}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "blocked"} or "needs_verified", "too_new", "not_owner" 400 {"ok": false, "error": "bad_json"} or "bad_request" 400 {"ok": false, "error": "must_agree"} 400 {"ok": false, "error": "invalid_package", "issues": [{"code", "path", "message", "severity"}]} 400 {"ok": false, "error": "not_canonical"} or "bad_shot" 413 {"ok": false, "error": "too_large"} 409 {"ok": false, "error": "name_used"} or "id_taken", "version_not_newer", "duplicate" 429 {"ok": false, "error": "too_many_plugins"} or "open_limit", "rate_limited" 507 {"ok": false, "error": "developer_full"} or "full"

GET /market/mine

The caller's own submissions (newest first, at most 100) and plugins, and whether they are blocked.

Who Signed: any install

Answers 200 {"ok": true, "blocked": false, "submissions": [...], "plugins": [{"id", "listing", "current", "by", "note", "noteAt"}]}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 429 {"ok": false, "error": "rate_limited"}

GET /market/submissions/{sid}

One submission: its status, the plugin's words and the notes between developer and reviewer.

Who Signed: its developer, or review

FieldWhereNeededWhat
sidpathyesThe submission's id: 24 lowercase hex digits.

Answers 200 {"ok": true, "submission": {...}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 404 {"ok": false, "error": "not_found"} 403 {"ok": false, "error": "not_admin"}

GET /market/submissions/{sid}/package

A submission's package bytes, approved or not.

Who Signed: its developer, or review

FieldWhereNeededWhat
sidpathyesThe submission's id: 24 lowercase hex digits.

Answers 200 application/octet-stream, filename "<plugin>-<version>.uplinkplugin"

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 404 {"ok": false, "error": "not_found"} 403 {"ok": false, "error": "not_admin"}

GET /market/submissions/{sid}/shots/{n}

One of a submission's screenshots.

Who Signed: its developer, or review

FieldWhereNeededWhat
sidpathyesThe submission's id: 24 lowercase hex digits.
npathyesWhich screenshot, from 0: one digit.

Answers 200 image/png

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 404 {"ok": false, "error": "not_found"} 403 {"ok": false, "error": "not_admin"}

DELETE /market/submissions/{sid}

Withdraws a submission that is still waiting.

Who Signed: its developer

FieldWhereNeededWhat
sidpathyesThe submission's id: 24 lowercase hex digits.

Answers 200 {"ok": true, "submission": {..., "status": "withdrawn"}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 404 {"ok": false, "error": "not_found"} also another developer's 409 {"ok": false, "error": "wrong_state"}

GET /market/review

The review queue: every open submission, the 50 most recently decided, and counts, with the reports of plugins and of people not yet done.

Who Review

Answers 200 {"ok": true, "open": [...], "recent": [...], "counts": {"submitted": 0, "in_review": 0, "changes_requested": 0, "reports": 0, "abuse": 0}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"}

GET /market/review/{sid}

Everything a reviewer needs for one submission: its package, the listed version it would replace, what was asked for before, and its developer.

Who Review

FieldWhereNeededWhat
sidpathyesThe submission's id: 24 lowercase hex digits.

Answers 200 {"ok": true, "submission": {...}, "package": "<base64>", "previous": null, "asked": null, "history": [], "developer": {"id", "username", "blocked", "plugins", "submissions", "firstAt"}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"} 404 {"ok": false, "error": "not_found"}

POST /market/review/{sid}

A decision on a submission. An approval carries the reviewer's own signature over the plugin, which the apps check themselves.

Who Review (approve: signed in within 30 minutes)

FieldWhereNeededWhat
sidpathyesThe submission's id: 24 lowercase hex digits.
decisionbodyyesstart, approve, changes or reject.
notebodyRequired for changes and reject. 1 to 2000 characters.
approvalbodyRequired for approve, refused otherwise: {"v": 1, "plugin", "version", "sha256", "key", "sig", "at"}, signed by the request's own key.
revokesbodyapprove only: up to 5 revocations of earlier versions, each as POST /market/plugins/{id}/revoke takes.

Answers 200 {"ok": true, "submission": {...}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"} 400 {"ok": false, "error": "bad_json"} or "bad_request" 404 {"ok": false, "error": "not_found"} 409 {"ok": false, "error": "wrong_state"} or "version_not_newer" 400 {"ok": false, "error": "bad_approval"} 507 {"ok": false, "error": "withdrawals_full"}

POST /market/plugins/{id}/listing

Lists an approved plugin in the catalog or takes it off. Its versions stay downloadable either way.

Who Signed: its developer, or review (signed in within 30 minutes)

FieldWhereNeededWhat
idpathyesThe plugin's id: a lowercase letter, then 2 to 23 lowercase letters or digits.
listedbodyyestrue to list, false to unlist.
notebody1 to 500 characters, kept with the plugin.

Answers 200 {"ok": true, "plugin": {"id": "tidyup", "listing": "unlisted", "current": "1.0.0", "by": "owner", "note": "...", "noteAt": 1795000000000}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 400 {"ok": false, "error": "bad_json"} or "bad_request" 404 {"ok": false, "error": "not_found"} 403 {"ok": false, "error": "not_admin"} 409 {"ok": false, "error": "wrong_state"} or "admin_unlisted" 403 {"ok": false, "error": "blocked"}

POST /market/plugins/{id}/revoke

Withdraws one approved package. Its download answers 410 from then on, and the signed revocation joins the withdrawals list.

Who Review (signed in within 30 minutes)

FieldWhereNeededWhat
idpathyesThe plugin's id: a lowercase letter, then 2 to 23 lowercase letters or digits.
vbodyyesAlways 1.
pluginbodyyesThe plugin's id, the same as in the path.
sha256bodyyesThe hash of one of its approved versions.
atbodyyesWhen, in milliseconds. Covered by the signature.
whybodyyes1 to 200 characters, one line.
keybodyyesThe request's own signing key, base64.
sigbodyyesBase64 signature over the revocation's words.

Answers 200 {"ok": true, "revoked": {...}, "plugin": {...}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"} 400 {"ok": false, "error": "bad_json"} or "bad_approval" 404 {"ok": false, "error": "not_found"} 507 {"ok": false, "error": "withdrawals_full"}

GET /market/reports

The newest 500 reports, newest first.

Who Review

Answers 200 {"ok": true, "reports": [{"rid", "plugin", "version", "reason", "text", "username", "verified", "at", "done", "doneAt"}]}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"}

POST /market/reports/{rid}

Marks a report done.

Who Review

FieldWhereNeededWhat
ridpathyesThe report's id: 16 lowercase hex digits.
donebodyyesAlways true. The body is exactly this.

Answers 200 {"ok": true}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"} 400 {"ok": false, "error": "bad_json"} or "bad_request" 404 {"ok": false, "error": "not_found"}

POST /market/abuse

Reports a person or a message to review. The report is sealed in the app to the review keys: the relay can't read it, and keeps the envelope without its sender's key. The newest 150 are kept.

Who Signed: any install

FieldWhereNeededWhat
sealedbodyyesThe sealed report: strict base64, at most 48000 characters, at least 64 bytes decoded. The body is exactly this.
OriginheaderFrom the app in a browser at the address the relay is set to allow (GHOST_APP_ORIGIN), the answer carries Access-Control-Allow-Origin for it.

Answers 201 {"ok": true, "id": "<16 hex>"}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 400 {"ok": false, "error": "bad_json"} or "bad_request" 413 {"ok": false, "error": "too_large"} 429 {"ok": false, "error": "rate_limited"} 5 an hour and 15 a day by one key, 20 a day from one address

GET /market/abuse

The reports of people and messages that are kept, newest first, each still sealed. Only a holder of a review key can open one.

Who Review

Answers 200 {"ok": true, "reports": [{"rid", "sealed", "at", "done", "doneAt"}]}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"}

POST /market/abuse/{rid}

Marks a report of a person or a message done.

Who Review

FieldWhereNeededWhat
ridpathyesThe report's id: 16 lowercase hex digits.
donebodyyesAlways true. The body is exactly this.

Answers 200 {"ok": true}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"} 400 {"ok": false, "error": "bad_json"} or "bad_request" 404 {"ok": false, "error": "not_found"}

POST /market/developers/{dev}/block

Blocks a developer from submitting and from listing again, or lifts the block.

Who Review (signed in within 30 minutes)

FieldWhereNeededWhat
devpathyesThe developer's id: 32 lowercase hex digits.
blockedbodyyestrue to block, false to unblock.
notebody1 to 500 characters, kept with the developer and their plugins.
unlistbodytrue: every listed plugin of theirs is unlisted.

Answers 200 {"ok": true, "developer": {"id": "<32 hex>", "username": "sam.dev", "blocked": true, "plugins": 2, "submissions": 5, "firstAt": 1795000000000}}

Refusals 401 {"ok": false, "error": "unsigned"} or "bad_signature" 403 {"ok": false, "error": "not_admin"} 400 {"ok": false, "error": "bad_json"} or "bad_request"

POST /market/retire

Retires a review key: its approvals are refused from then on, and the retirement joins the withdrawals list. The request is not signed; the body carries the key's own signature.

Who Anyone holding the review key

FieldWhereNeededWhat
Content-LengthheaderyesThe body's length: at most 4096.
vbodyyesAlways 1.
keybodyyesThe review key, base64. One that has approved or revoked something here.
atbodyyesWhen, in milliseconds. Not covered by the signature.
sigbodyyesBase64 signature by that key over the retirement's words.

Answers 200 {"ok": true, "retired": {"v": 1, "key": "...", "at": 1795000000000, "sig": "..."}}

Refusals 429 {"ok": false, "error": "rate_limited"} 10 an hour from one address 400 {"ok": false, "error": "bad_json"} or "bad_request" 413 {"ok": false, "error": "too_large"} 404 {"ok": false, "error": "not_found"} a key that has signed nothing here 401 {"ok": false, "error": "bad_signature"} 507 {"ok": false, "error": "withdrawals_full"}

Bounties

A relay can be given one key that may give souls: the bounty key. Its holder signs a POST /bounty naming an install, a number of souls and a reason. The relay adds the souls, writes the grant in the admin log beside the admin page's own, and tells the install over the hub if it is connected. The key can do nothing else. On a relay with no bounty key the route answers 404.

Limits: 1 to 500 souls at a time, 30 grants a day, a body of 4,096 bytes, a reason of 200 characters.

POST /bounty

Gives souls to one install, with a reason, and records it in the admin log. Signed by the bounty key alone, over ghost-bounty v1. At most 30 a day; the body is at most 4096 bytes.

Who Holder of the bounty key

FieldWhereNeededWhat
x-ghost-keyheaderyesThe bounty key's public half: base64 of its 33 bytes. It must be the key the relay was given.
x-ghost-timeheaderyesMilliseconds since 1970, within 5 minutes of the relay's clock.
x-ghost-sigheaderyesBase64 of the 64-byte signature over the five lines: ghost-bounty v1, POST, /bounty, the time, the body's SHA-256 in hex.
tobodyyesWho gets them: an install's id, 32 lowercase hex digits.
soulsbodyyesA whole number from 1 to 500.
whybodyyesThe reason, shown to the person: 1 to 200 characters.

Answers 200 {"ok": true, "to": "0f1e…", "souls": 50, "n": 150} n is their total after

Refusals 405 {"error": "A bounty is paid with POST."} 404 {"error": "Not here."} no bounty key is set 413 {"error": "Too long to be a bounty."} 400 {"error": "It didn't arrive whole."} the body stalled for 15 seconds 401 {"error": "Not signed by the bounty key, or too old."} also a repeat 400 {"error": "It couldn't be read."} 400 {"error": "to is an Uplink id: 32 hex characters."} 400 {"error": "Between 1 and 500 souls."} 400 {"error": "Say why (the ticket), in at most 200 characters."} 429 {"error": "That's 30 bounties today; more tomorrow."}

Sending souls

A person can send some of their souls to someone else on the same relay. The sender signs a POST /souls/send with their own hub key, so the relay knows whose souls to move: the id of the key that signed. The headers are the three a bounty carries, over the five lines ghost-souls v1, POST, the path, the time and the body's SHA-256 in hex.

Souls only move. The sender's count goes down and the receiver's goes up by the same number in one step, with a receipt, and all three are written to disk together before the relay answers. The receiver must hold a username on this relay, so souls can't be sent to nobody. Both people are told their new count over the hub if they are connected.

Each sending carries an id the sender makes up. The relay moves souls once for an id: a request sent again because its answer was lost gets the first receipt back with "again": true. The app writes that id into the card it puts in the chat, and the other person's app asks POST /souls/receipt before it shows the card as souls sent. A receipt is given only to the two people in it.

Limits: 1 to 100 souls at a time; 300 souls and 10 sendings from one person in 24 hours; 20 askings to send and 300 receipt checks an hour by one key; 600 signed requests an hour from one address; a body of 1,024 bytes. Receipts are kept for a day at least, and the newest 5,000 after that.

Every answer of these two routes is JSON with ok. A relay from before them answers the paths as it answers any it doesn't know, with 200 and a line of text, and the app reads that as "not available yet".

POST /souls/send

Moves souls from the signer to another person on this relay and answers a receipt. Nothing is made or lost: what leaves one count arrives in the other. Asked again with the same id, it answers the first receipt and moves nothing. At most 100 souls at a time, 300 souls and 10 sendings in 24 hours; the body is at most 1024 bytes.

Who Signed: the sender

FieldWhereNeededWhat
x-ghost-keyheaderyesThe sender's hub key: base64 of its 33 bytes. Its id is whose souls are sent.
x-ghost-timeheaderyesMilliseconds since 1970, within 5 minutes of the relay's clock.
x-ghost-sigheaderyesBase64 of the 64-byte signature over the five lines: ghost-souls v1, POST, /souls/send, the time, the body's SHA-256 in hex.
tobodyyesWho gets them: an Uplink id, 32 lowercase hex digits, that holds a username on this relay.
soulsbodyyesA whole number from 1 to 100.
idbodyyesThe sender's own name for this sending: 32 lowercase hex digits, made up afresh each time. Souls move once for each id.

Answers 200 {"ok": true, "receipt": {"id": "6b1f…", "at": 1764000000000, "from": "a4bb…", "to": "0f1e…", "souls": 20}, "n": 80} n is the sender's total after; "again": true for a repeat of the same id

Refusals 405 {"ok": false, "error": "method"} 413 {"ok": false, "error": "too_large"} 401 {"ok": false, "error": "bad_signature"} not signed, too old, or the same signed request again 429 {"ok": false, "error": "rate_limited"} 20 askings an hour by one key, 600 an hour from one address 400 {"ok": false, "error": "bad_request"} a body that can't be read, or a to or id that isn't 32 hex digits 400 {"ok": false, "error": "amount"} not a whole number from 1 to 100 400 {"ok": false, "error": "yourself"} 409 {"ok": false, "error": "no_account"} the sender holds no username here 409 {"ok": false, "error": "no_receiver"} nobody with a username here has that id 409 {"ok": false, "error": "id_used"} that id was another sending's 409 {"ok": false, "error": "not_enough"} 429 {"ok": false, "error": "daily_limit"} 300 souls or 10 sendings in 24 hours

POST /souls/receipt

Reads the receipt of one sending, for one of the two people in it. The app asks before a card in a chat may say souls were sent. Signed as /souls/send is, over its own path.

Who Signed: the sender or the receiver

FieldWhereNeededWhat
x-ghost-keyheaderyesThe asker's hub key: base64 of its 33 bytes.
x-ghost-timeheaderyesMilliseconds since 1970, within 5 minutes of the relay's clock.
x-ghost-sigheaderyesBase64 of the 64-byte signature over the five lines: ghost-souls v1, POST, /souls/receipt, the time, the body's SHA-256 in hex.
idbodyyesThe sending's id, as its sender made it: 32 lowercase hex digits.

Answers 200 {"ok": true, "receipt": {"id": "6b1f…", "at": 1764000000000, "from": "a4bb…", "to": "0f1e…", "souls": 20}} "receipt": null where there is none, or the asker is neither person

Refusals 401 {"ok": false, "error": "bad_signature"} 429 {"ok": false, "error": "rate_limited"} 300 askings an hour by one key 400 {"ok": false, "error": "bad_request"}

The app in a browser

A relay started with --web <folder> serves the app built for a browser under /app/, as plain files. A page in a browser may speak only to where it came from, and the hub sends no CORS headers, so the page and the hub have to be one address: this is how a relay gives its people the app in a browser. Without the folder there is no /app/, and these paths get the root answer.

GET /app/

The app's page, index.html. /app without the slash answers 301 to /app/, keeping any query.

Who Anyone

FieldWhereNeededWhat
If-None-MatchheaderThe ETag from an earlier answer. A match answers 304 with no body.

Answers 200 text/html; charset=utf-8, with an ETag and Cache-Control: no-cache

Refusals 404 text/plain: Not found the folder has no index.html 405 (empty) with Allow: GET, HEAD

GET /app/{path}

One file of the build. Its type goes by its ending. A file with a hash of its contents in its name is kept for a year; any other is asked for again each time. Where name.br or name.gz lies beside it and the browser takes that packing, that is what is sent. A folder is not listed.

Who Anyone

FieldWhereNeededWhat
pathpathyesThe file, as the page names it: one or more parts with slashes between. No part may be . or .., start with a dot, or hold a backslash, a colon or a control character.
If-None-MatchheaderThe ETag from an earlier answer. A match answers 304 with no body.
Accept-Encodingheaderbr or gzip: a copy packed beforehand is sent where there is one, with Content-Encoding.

Answers 200 the file, with Content-Type, ETag, Vary: Accept-Encoding and Cache-Control: no-cache, or public, max-age=31536000, immutable

Refusals 404 text/plain: Not found no such file, a folder, a name that isn't plain, or a link that leads outside the folder 405 (empty) with Allow: GET, HEAD

HEAD /app/{path}

The headers of a file (Content-Type, Content-Length, ETag, Cache-Control) without its bytes.

Who Anyone

FieldWhereNeededWhat
pathpathyesThe file, as for GET. Left empty, index.html.

Answers 200, headers only

Refusals 404 text/plain: Not found 304 (empty) If-None-Match matched

GET /app/clear-site-data

Tells the browser to clear what this address keeps. The app's page asks for it as it signs out or is removed. Answered only to the page itself; anything else gets 404, as a file that isn't there.

Who The app's own page

FieldWhereNeededWhat
Sec-Fetch-Siteheaderyessame-origin, as the browser sets it on the page's own fetch.

Answers 204 (empty) with Clear-Site-Data: "storage" and Cache-Control: no-store

Refusals 404 text/plain: Not found any other Sec-Fetch-Site, or none

Running your own

The relay is one Dart program with no dependencies beyond Dart's own library. It listens over plain HTTP on this machine alone unless told otherwise, so on a server it sits behind a web server that holds the certificate.

dart run relay/bin/relay.dart [--host 127.0.0.1] [--port 8787] [--data relay-data] [--web <folder>] [--verbose]
FlagDefaultMeaning
--host <address>127.0.0.1Where to listen.
--port <number>$PORT, else 8787The port.
--data <folder>relay-dataWhere everything it keeps is written.
--web <folder>$GHOST_WEB_DIR, else noneThe folder flutter build web made, served under /app/.
--verboseoffSays when an install joins or leaves. Never an address, never a whole id.
--help, -hPrints the flags.

Everything else is set in the environment. Each family is optional: a feature whose values are not set is off, and every limit has a default.

FamilyWhat it setsMost useful
GHOST_PUBLIC_URLThe relay's public address, used to build sign-in links and the networks' return addresses.Default https://ghost-sms.com: set it to your own.
GHOST_HUB_NAMESThe hosts the hub is reached at, commas between. With them the hub takes a sign-in bound to the host the app dialled.Unset, the hub takes the older sign-in alone. See Signing in to the hub.
GHOST_FED, GHOST_FED_*, GHOST_PUBLIC_HUBWhether this relay links with other relays, with which, and how much it takes from each.GHOST_FED (off, the default; open; list), GHOST_PUBLIC_HUB (this relay's own hub address, wss://relay.example.com/hub: without it no other relay's hello is taken), GHOST_FED_ALLOW and GHOST_FED_BLOCK (hosts or relay names), GHOST_FED_VIA, GHOST_FED_STANDING, GHOST_FED_PACKETS_A_MINUTE (1200), GHOST_FED_BYTES_A_DAY (512 MiB), GHOST_FED_LOOKUPS_AN_HOUR (600), GHOST_FED_PORTS, GHOST_FED_PLAIN. See Relays that talk to each other.
GHOST_TURN_*The media relay a call falls back on: a TURN server's shared secret and addresses. The hub hands a short-lived username and password to whoever joins a room.GHOST_TURN_SECRET and GHOST_TURN_URLS (commas between; both, or calls are direct only), GHOST_TURN_TTL (seconds; 86400).
GHOST_LINK_HELPERSServers that help two devices link directly, told to each app as it signs in.Up to 4 https:// addresses, commas between, 200 characters each.
GHOST_WIRE_*What all WebSocket connections may hold in memory together, and when one is ended for it.GHOST_WIRE_MB (64; 8 to 4096), GHOST_WIRE_EACH_MB (8; 1 to 1024), GHOST_WIRE_STALL_S (10; 2 to 600), GHOST_WIRE_IN_STALL_S (20; 2 to 600).
GHOST_WEB_DIR, GHOST_APP_ORIGINThe app in a browser: the folder served under /app/, and the one other address whose page may read the answers to feedback and reports.GHOST_APP_ORIGIN is an origin as a browser names it: https://host, with a port where there is one. Anything else is left off, and said on stderr.
GHOST_BOUNTY_KEYThe bounty key's public half: 33 bytes as 66 hex digits.Unset, POST /bounty answers 404.
GHOST_DISCORD_*, GHOST_X_*, GHOST_TELEGRAM_*Each network's sign-in.GHOST_DISCORD_ID and GHOST_DISCORD_SECRET; GHOST_X_ID (GHOST_X_SECRET optional); GHOST_TELEGRAM_BOT and GHOST_TELEGRAM_TOKEN.
GHOST_TWILIO_*, GHOST_TEXT_TO, GHOST_TEXTS_A_DAYVerifying a phone number by a texted code.GHOST_TWILIO_SID, GHOST_TWILIO_TOKEN, GHOST_TWILIO_VERIFY (all three, or it is off); GHOST_TEXT_TO (number prefixes that may be texted, default +1); GHOST_TEXTS_A_DAY (200).
GHOST_ADMIN_*The admin page, and so who review is.GHOST_ADMIN_USER, GHOST_ADMIN_HASH (empty: nobody can sign in), GHOST_ADMIN_NAMES (usernames that may).
GHOST_APNS_*Waking a closed iPhone.GHOST_APNS_KEY_FILE, GHOST_APNS_KEY_ID, GHOST_APNS_TEAM_ID, GHOST_APNS_TOPIC. Without them tokens are kept and nothing is sent.
GHOST_FILES_*Files' limits.GHOST_FILES_MAX_FILE, GHOST_FILES_SPACE_QUOTA, GHOST_FILES_TOTAL (300,000,000,000 bytes for all spaces), GHOST_FILES_IDLE_DAYS (90), GHOST_FILES_WRITES_PER_MINUTE (600), GHOST_FILES_MAX_BODY (8 MiB, at most 10).
GHOST_NOTION_*Feedback's board.GHOST_NOTION_TOKEN and GHOST_NOTION_FEEDBACK. Both, or feedback answers 503.
GHOST_MARKET_*The Marketplace's switch, limits and review keys.GHOST_MARKET_ON (1; 0 turns it off), GHOST_MARKET_REVIEW_KEYS (a comma list of review keys in base64; empty takes the signed-in admin's own key), GHOST_MARKET_NEED_VERIFIED (0), GHOST_MARKET_NAME_AGE_DAYS (7), GHOST_MARKET_MAX_PACKAGE (262144), GHOST_MARKET_TOTAL (1 GiB on disk), GHOST_MARKET_REPORTS_A_DAY (500: what installs with no verified number or linked account may report in a day, all together).

A relay that links with others makes a key of its own the first time it starts, relay-key.json in the data folder, readable by its own user alone. Its name to other relays is made from that key: keep the file, and keep it private.

The full list of variables, with each one's least and most, is in the source: relay/lib/files.dart, relay/lib/market.dart, relay/lib/handles.dart, relay/lib/feedback.dart, relay/lib/pushes.dart, relay/lib/federation.dart, relay/lib/turn.dart, relay/lib/ws_door.dart and relay/bin/relay.dart.

Something wrong or missing here? Tell us in the Alpha testers circle, or at the app's GitHub.