server: handle pcre2 now returning -1 for "no match"
[rb-79.git] / README
blob8441032bb41cc962764b05801fdaf77a9192e42c
1 This is an image board written in C. It has few features.
3 You need:
5  - fcgi            [ https://fastcgi-archives.github.io  ]
6  - gmime           [ https://github.com/GNOME/gmime , the 2.6 branch ]
7  - libmagic        [ https://www.darwinsys.com/file  ]
8  - libsodium       [ https://libsodium.org ]
9  - pcre2           [ http://www.pcre.org  ]
10  - spawn-fcgi      [ http://redmine.lighttpd.net/projects/spawn-fcgi ]
11  - sqlite3         [ https://sqlite.org/ ]
12  - a web server that works with fcgi (I dunno, most of them?)
13  - the programs you reference in config.h (see filetypes), which
14    for the default config are:
15     - ffmpeg       [ https://ffmpeg.org/ ]
16     - imagemagick  [ https://www.imagemagick.org/ ]
17     - jhead        [ http://www.sentex.net/~mwandel/jhead/ ]
18  - a C implementation defining __STDC_ISO_10646__ and conforming
19    to POSIX.1-2008, with the IPV6 extensions
21 (I'd like to drop GMime dep, but RFC 7578 is a bear, and I don't
22 want a gazillion CVEs on my head.)
24 Use it by:
26  - put the following in nginx.conf. If you don't use nginx, translate
27    it and send me a patch, okay?
29         server {
30                 listen 127.0.0.1;
31                 server_name localhost;
32         
33                 access_log /var/log/nginx/localhost.access_log main;
34                 error_log /var/log/nginx/localhost.error_log info;
35         
36                 # This is static_www_root in config.h
37                 root /where/all/your/static/files/live
38         
39                 location /action {
40                         include fastcgi_params;
41                         fastcgi_pass 127.0.0.1:9000;
42                         client_max_body_size 5M;
43                 }
44         }
46  - copy config.def.h to config.h, edit to define boards and stuff,
47    then recompile with
49     make # that's it; no autohell.
51    Optionally, you can install it with `make install'.
53  - make sure you read the file_description_prog bit in config.def.h.
55  - copy example/* to /where/all/your/static/files/live/ and edit
56    _templates/* as desired (no seriously, you GOTTA edit as desired).
57    The variables you can use are
59      o ${BOARD}: expands to something like "m"
61      o ${BOARD_TITLE}: expands to something like "mecha"
63      o ${CHALLENGE_ID}: the (random) index of ${CHALLENGE}
65      o ${CHALLENGE}: text and image for a CAPTCHA
67      o ${PAGELINKS}: links to /m/1, /m/2, &c
69      o ${POSTS}: posts for this thread
71      o ${RANDOM_HEADER}: an image from the banners list
73      o ${RECENT_POSTS}: the last 10 or so posts, for /recent
75      o ${THREADS}: thread summaries for this board
77    These can only be used where they make sense (you can't post on
78    /recent, for example, so ${CHALLENGE} doesn't work there).
80  - write index.html to your desires. Maybe add an FAQ or a Rules
81    page? Also look at the .user.js file to see if you want fancy
82    features.
84  - make sure all the directories (your static_www_root and work_path)
85    are writable (don't worry, it'll test and warn you in the next
86    step if you screw this up).
88  - run
90     spawn-fcgi -n -a 127.0.0.1 -p 9000 -- /path/to/rb79-server
92    If you want the system to handle it, put that in a service script
93    or add it to /etc/s6-rc/source or whatever you cool kids are
94    doing these days.
96  - if you want to use /recent, put /path/to/rb79-update-recent-page
97    in a cronjob.
99  - whenever you need to ban someone or sticky a thread or something,
100    use the acompanying programs (rb79-view-thread, etc.) or edit
101    the db manually, then issue a REBUILD command (see API). You can
102    also check out the manuals.
104 That's pretty much it.
107          ██▄▄
108            ▀██▓▄▄
109               ▀▀██▓▄▄
110                  ▀▀███▓▄
111                      ▀████▓▄
112                         ▀▀███▓▄▄
113                            ▀▀████▓▄▄
114                                ▀████▓▓▄▄
115                                   ▀▀████▓▓▄▄
116                                       ▀█████▓▓▓▄
117                                          ▀██████▓▓▄▄
118                                            ▀███████▓▓▓▄
119                                             ▀██████████▓▓▄ ▄
120                                              ▀█████▓▓▀▓█████▓▓▄▄
121                                          ▄▄▄▄▓▓█▓▓█▓▒▒▓█████▓▓▓▌
122                                       ▄▄█▓▓█▓▀▒▀▒▓▀▓▌   █████▓█▌
123                                    ▄░▀▀░░▓▀░░░░░░░░░▐░▄  ████▓█▌
124                                 ▄▒▄▄▒░░▐▓░░░░░▀▀▀▀▀▀▒▒▒▄▒▓█████▌
125                               ▄▓▀░░░░░░▓░░░░▐▓░░░░░░░░░░░▒▀███▀▀
126                             ▄▒░░░░▐█▓▄▓▓▓▓█▓████▄░░░░░░░░░░░▐▄
127                            ▄░░░▐█████████████████▒░░░░░░░░░░░░▄
128       ▄▄▄▄                ▐░░░░██████████████████▌░░░░░░░░░▄██▄▄
129    ░░▒▒░▒▀▌▌              ▌░░░▐█████████▓▓▓▓██████▄▄▄▄░░░░░▓███▓
130  ▐░▒▀▓██▒▌▐▌▌            ▐░░▄▄▓███████▓▓▓▓▓▓▓▓████░▐▀▀▀▀▀▒▒▄███▓▌
131 ▀▀  ▒████▒▒▓▌            ▐▒▀░░▐███████▓▓▓▓▓▓▓████▌░░░░░░░░░░░▒▓▓▌
132    ▄▓▓▀▄▄▓▓▓▓             ░░░░░█████████▓████████░░░░░░░░░▐░▓▀▀▓▌
133   ▀    ▀▓▓▓▓▓█            ▀░░░░▐████████████████░░░░░░░░░▄░▐▐██▓▌▄
134        ▐▓▀▒▌▀▐▌            ▒░░░░▐▀▀▀▀▐█▌░░░░░░░░░░░░░░░░▒▌░▐░█▌▓▌▌
135         ▀░░░░░░            ▐▄░░░░░░░░░▐█░░░░░░░░░░░░░░▒▓▀░░▌░██▓▒▌
136          ▒░░░░░▒            ▒▒▄░▄▄▒▒░░░▐▌░░░░░▒▀▀▀▓▓▓▓▓░░░░▌▐██▓▌▌
137           ▄░░░▄▓            ░░▐▀▓▓▄▄▄░░░▀▌░▒▄▄▄▓▓▓▓▒▓▓▄▓▓▓▓▒░█▓█▓
138            ▀▓▓▓▀            ▒▒▒▒▒▓▓▓▓▓▓▀▓█▓▓▓▓▓▓▓▓▓▓█▌░▓▒▓▒▓▀█▒██
139              ▄░░▄      ▄▄▄▀▒░▒▄░▒▀▓▌▓▓█▌███▌████▓███▓▓▌▒▒▒▒▓▌▐█▀█
140              ▐░░▐▄▄▄▄▒█▒▓▒▐▒░▄▓▓▓▓█▓▓▓▓▓▓▓████▓▓▓▓▓▓█▓▓▓▄▌▌██▓▓▓▓
141              ▄▓▄▄▀▒▀█▓▐▓▓▓▓▓▓▓▌▓▓▓▒▒▓▓▓██▓███▓▓██▓▓▀▀▀███▄▄▄▓▄▓▓▀
142              ▌█▄▓▓▓▄██▀▀       ▀▀▀▀▀▀▀ ▐▀▀▀███▀▀▀      ▐▌▒▐▌▒█▒▌
143               ▀▀▀▀▀▀▀                                  ▐▌▌▒▌▄▓█▀░▄   ▄▄▒▀▄░░▄
144                                                          ▀▀ █▒░░▄▐▓▒▒▓▒▐░▓░░▐▄
145                                                              ▓▓▓░▌▌▄▒▄▒▓▓▒▓░░░▄
146                                                               ▀██▓▒▒▒▓▓▓▓▓▓░░░▐
147                                                                 ▀▀▓▀▀▒▀▓▓▓▓▄
148                                                                       ▀▒▓▓▓▓▄
150                              Fig 1. The RB-79 Ball