A sister protocol to Gemini to allow file uploads.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.1 KiB

Iapetus

Iapetus (eye-app-etus) is a sister protocol for Gemini influenced by Titan (hence the name, another moon of Saturn). Whereas Titan is meant to be used mainly without client certificates Iapetus keeps them mandatory and follows the Gemini protocol pattern more closely.

In the same format as the Gemini documentation:

C: Opens connection to the host eg. iapetus://oppen.digital

S: Accepts connection

C/S: Complete TLS handshake

C: Validates server certificate

C: Sends file upload intent data (one CRLF terminated line) (see File Intent below)

S: Sends response header (one CRLF terminated line), under non-success conditions closes connection (see Initial Response below)

C: Sends file data

S: Sends response header (one CRLF terminated line) (See Confirmation below)

C: Handles response

File Intent

This follows the same pattern as Gemini, the client and server do the usual Gemini TLS checks, but where in Gemini the client now writes the uri of the entity it's requesting, in Iapetus the client writes it's file intent: iapetus://oppen.digital/memex/posts/mu/filename.gmi 123\r\n - the full file path followed by the filesize in bytes.

Initial Response

Once the server has the file intent it can choose to accept or deny. If the client certificate is authorised to upload the server responds with a continue line: 10 Continue\r\n, if the client certificate is missing or not recognised the server responds with an error line and closes the socket: 60 Invalid certificate\r\n or 60 Client certificate required\r\n, or for muti-user servers possibly: 50 You are not authorised to create a file outside of /~oppen/\r\n

Confirmation

When the client has sent the file data successfully the server completes the transaction before closing the connection: 20 Success\r\n, or for an error: 50 Error writing file: some exception\r\n

Notes

  • How to handle directory creation, maybe iapetus://oppen.digital/new/folder/path/ 0\r\n is enough