- Notifications
You must be signed in to change notification settings - Fork2
A JavaScript implementation of the Spring 83 protocol 🌸https://github.com/robinsloan/spring-83-spec
License
rpj/spring83
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An implementation of theSpring 83 protocol.
Very much a work-in-progress. This was built in reference todraft-20220616.md
@0f63d3d2
.
Requiresnode.js 16 or greater.
$ npm install
Robin has a truly impressive client availableonline here (GitHub). It is the ideal way to view and post boards from and to multiple S83 hosts. His host is running athttps://bogbody.biz.
This implementation is running athttps://0l0.lol andhttps://spring83.rkas.net. If you'd like to be listed here, just send mail toinclude-my-key@0l0.lol with your hex public key as the subject, or submit a PR with your key added topublic-boards.json
.
Name | Language | Instance |
---|---|---|
davemenninger/exspring83 | elixir | |
njbennett/elderflower | elixir | |
llimllib/springer | golang | |
motevets/springboard | golang | https://spring83.kindrobot.ca/ |
pteichman/ahoy | golang | |
royragsdale/s83 | golang | https://may83.club |
cellu_cc/so83-gpu (gitlab) | opencl | |
michael-lazar/lets-dance | python | https://spring83.mozz.us |
Runs a Spring-83 server on port specified by environment variableSPRING83_BIND_PORT
(or1783
by default) & binding toSPRING83_BIND_HOST
(orlocalhost
by default).
Writes boards intoSPRING83_CONTENT_DIR
(or./.content
by default).
If Docker is available, an image is published to Docker Hubas0l0lol/serve
orserve
can be run from this repo directly:docker compose up --build -d serve
.
SeeDEPLOYMENT.md.
This implementation supports an early and limited form of server federation per the discussiononIssue #6.
Federation will not work correctly on your instance unless you have:
- specified
SPRING83_FQDN
correctly for your setup and - added that FQDN to
constants.federate.knownS83Hosts
Any incomingPUT
request with either:
- a
Via
header - a
<meta name="spring:share" content="false">
tag in the body
willNOT be queued for federation.putnew
(detailed below) adds this meta tagby default, behavior that can be disabled with--share true
.
The response to a successfulPUT
request thatlacks one of the above will include thespring-federated-to
header, the value of which is a comma-separated list of external hoststhat the board has beenqueued to be shared with.
This server implements an extension to the (current) protocol:POST /key
.
Accepting exactly the same body & header set asPUT /key
(plus an additional optional header, detailed below), this endpoint will minify the board & auto-shorten any HTTP(S) links it finds, returning the resulting document to be re-signed andPUT
normally by the user in possesion of the private key matchingkey
. It does not modify anything server-side, only transforming and returning the original request body.
Either (or both, though what's the point of that) behaviors can be disabled via theSpring-Shortener-Disable
header, a comma-separated list of behavior to disable. The values for these are:shorten-links
, andminify
. Additionally, the valueshorten-board-links
can be included to disable shortening links to other Springboards, ensuring they can render inline as expected in clients such asthe Follower Sentinel.
The following endpoints generate a QR code of the specified Spring '83 public key, by default with no adornment.
Forimage/png
:
GET /key
withContent-Type: image/png
orGET /key.png
Fortext/html
with live decode example:
GET /qrcode/key
full
— presence of this option generates a QR code with the full URL, not just thekey.springHost
— the Spring '83 host to generate a QR code, defaults to this host. Just the hostname (no protocol scheme "http://").
Equivalent:
curl https://0l0.lol/f539c49d389b1e141c97450cdabc83d41615303106c07f63c8975b5dc83e0623.png
curl -H 'Content-type: image/png' https://0l0.lol/f539c49d389b1e141c97450cdabc83d41615303106c07f63c8975b5dc83e0623
Different hosts:
- https://0l0.lol/f539c49d389b1e141c97450cdabc83d41615303106c07f63c8975b5dc83e0623.png?full&springHost=bogbody.biz
- https://0l0.lol/f539c49d389b1e141c97450cdabc83d41615303106c07f63c8975b5dc83e0623.png?full&springHost=spring83.kindrobot.ca
Live-decode HTML:
To put a single board: putnew host privKeyHex htmlFileTo put a path of boards: putnew boardPath hostsCommaSeperatedBoards will be minified & have HTTP(S) links shortened by default (except Springboard links).Pass --no-minify and/or --no-shorten to disable these behaviors.To also shorten Springboard links, pass --shortenBoardLinks trueBy default, boards will be marked to NOT be shared with other federated hosts. This adds at least 42 bytes.To instead mark your board to be shared, pass: --share true
Available onDocker Hub as0l0lol/putnew
toenable usage without needingnode
locally, like so:
$ docker run -it --rm -v $PWD:/home 0l0lol/putnew:latest ...
Operates in two modes: single board PUT or multi-board PUT.
Puts a new board with HTML sourcehtmlFile
tohost
with private key (in hex)privKeyHex
.
Will insert the required<time datetime="...">
tag, with the appropriatedatetime
value, if it doesn't exist in the document already.
An example via the Docker Hub image:
$ docker run -it --rm -v $PWD:/home 0l0lol/putnew:latest https://0l0.lol ... f13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623.htmlf13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623.html: appended <time>, which added 84 bytesf13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623.html: minified 4% (5 bytes) -> 107 totalhttps://0l0.lol PUT https://0l0.lol/f13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623 200
ExpectsboardPath
to be a directory containing board HTML files named with their full hex public key, and keypair files named according to the canonical pattern. So for example, a path named./my-boards
with the following contents is valid (assuming the keypair files are valid of course):
1b30ed15e51e6faa3afb3605212d8cdb80177dfedc30a0d0939d26ec683e1023.html977b0a43de51225240128101105f0397cb2cde59801a74c40ad99c69183e0423.htmlspring-83-keypair-2022-06-19-1b30ed15e51e.txtspring-83-keypair-2022-06-19-977b0a43de51.txt
Ifputnew
is then invoked like so:
$ putnew ./my-boards https://bogbody.biz,https://0l0.lol
it will post both boards to both listed hosts.
An example via the Docker Hub image:
$ docker run -it --rm -v $PWD:/home 0l0lol/putnew:latest ./dockerTest/ https://0l0.lolPosting 1 boards to: https://0l0.lolf13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623.html: appended <time>, which added 83 bytesf13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623.html: minified 4% (5 bytes) -> 107 totalhttps://0l0.lol PUT https://0l0.lol/f13571200686a9a1bae0952bf2b741e6ad4fb84082ad02cebd32fa8ea83e0623 200
Update: This script is left in the repo for posterity, butPT's Go keyfinder ismuch faster and generates canonically-formatted keys as well. It's what I'm using now.
Randomly generates Ed25519 key pairs until one matching the specified format has been found.
If called with--strict
, willonly return when a key pair is found that is validthis calendar year.
The output format matches the format thatthe client and will be named in the same format.
Contributions are encouraged & welcomed! SeeCONTRIBUTING.md for process information.
Copyright (c) 2022 Ryan Joseph & contributors
About
A JavaScript implementation of the Spring 83 protocol 🌸https://github.com/robinsloan/spring-83-spec