A server that implements the publishing API for a site must:
- store files as received, except for conversions it documents and reports with
warninglines (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/8tmlfor 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
putleaves the old file in place; - manage only files of the types it accepts:
listleaves out, quotas don’t count anddeleterefuses withbad-typeevery 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
busywhen 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-keyerror 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.