misc: update gmime dependency 2.6 -> 3.0
[rb-79.git] / API
blob5074459c9eca5e4e551eb870b06279453e3ca892
1 Apparently having a sane external interface is an accomplishment
2 these days, so here's ours.  No JSON, because I don't give a damn.
4  - Boards are at <root>/<board>
5  - Threads are at <root>/<board>/res/<thread number>
6  - Media files are at <root>/<board>/src/<timestamp>.<extension>
8 Everything that's not reading files, you do by POST. Everything
9 goes through one place: <root>/action (that's the literal word
10 "action").  You know what?  I'm just going to give this in terms
11 of curl. Make sure you use multipart/form-data (so -F, not -d)
12 because otherwise it'll get dropped.
14 The only interesting thing is the challenges.  Replying or newthreading
15 needs a challengeid and a response or else you might be banned for
16 a while. Any correct combination will work.
18  - curl -X POST http://example.com/action \
19        -F action=reply \
20        -F board=m \
21        -F thread=123 \
22        -F name=John \
23        -F email=sage \
24        -F subject=Hello \
25        -F challengeid=1 \
26        -F challengeresponse=Ball \
27        -F file=@/home/john/pictures/char.jpg
29  - curl -X POST http://example.com/action \
30        -F action=newthread \
31        -F board=m \
32        -F name=Mary \
33        -F email=noko \
34        -F subject=Space \
35        -F challengeid=2 \
36        -F challengeresponse=hArO \
37        -F file=@/home/mary/pictures/space.mp3
39 Administration is done locally, through rb79-ban-ip, rb79-delete-post,
40 etc. Also, if you fiddle with the database manually, the server
41 accepts exactly one extra action, which can only be triggered from
42 the local IP:
44  -  curl -X POST 127.0.0.1/action -F action=rebuild
46 That will regenerate all static files.