Endpoint rules

8TML > Reference > Publishing API

A server that implements the publishing API for a site must:

  • store files as received, except for conversions it documents and reports with warning lines (for example, changing non-ASCII characters in text files to ASCII);
  • serve the stored files as Hosting 8TML pages describes: plain HTTP without a redirect to HTTPS, text/8tml for pages, names regardless of case;
  • never run an uploaded file as a program (no PHP, CGI or server-side includes in site folders), and never serve uploads as HTML, SVG or JavaScript;
  • write a file completely or not at all: a failed or cut put leaves the old file in place;
  • manage only files of the types it accepts: list leaves out, quotas don’t count and delete refuses with bad-type every other file in the site folder, such as the endpoint’s own scripts and settings;
  • limit challenges and requests per key and per address, and answer with busy when the limit is reached;
  • keep keys secret and let the owner revoke them;
  • accept a plain key only over HTTPS, and answer a key that arrives over plain HTTP with an insecure-key error saying that this is unsafe.

The reference endpoint, a PHP script for ordinary web hosting, is being tested on T8wn (http://t8wn.com/api/publish, for T8wn’s residents); it will be part of the publishing package.