As 4chan's, a thread pruned off a board's last page is archived, not
deleted: off the board's pages and catalog, whole, its files kept,
read-only. No one replies to it, staff neither (store.AddPost refuses
too, for a reply already on its way); its posts are not deleted by
their passwords (staff still can). Its page says it is archived in
place of the form and its first post wears a badge.
- /chan/b/archive lists a board's archived threads, the last first;
/chan/b/archive.json is 4chan's (the numbers, oldest first); an
archived thread's JSON has archived and archived_on, and boards.json
is_archived
- [chan] archive_days (3; 0: always) is how long they stay: then they
are deleted with their files, looked to when a thread is made and
when the archive or the thread is looked at
- a board's archive setting (bbs chan board set DIR archive no) prunes
as before, deleting at once; boards have one by default, as do
those of an older database
- the terminals: a board's thread list has Archive (A), to read them;
archived threads offer no reply
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A board takes Flash when its files say swf or flv (bbs chan board set f
files swf,flv), as 4chan's /f/ did, and [chan] ruffle names Ruffle's
self-hosted package (make ruffle fetches it from npm into ruffle/).
- SWF: FWS and CWS read for the stage, frames, rate and sounds, the
tags walked as they unpack with nothing kept (a zlib bomb costs no
memory and is refused); ZWS (LZMA) taken as 550x400 with sound
- FLV: onMetaData (AMF0) for size and length, the tags for sound and
the video codec (Sorenson, Screen, VP6, VP6 alpha, H.264); ffmpeg
thumbnails it, a movie gets a card
- sound needs the board's sound; an FLV is held to max_video
Clicking a Flash thumbnail plays it in a sandboxed frame (/chan/flash:
allow-scripts alone, by its CSP and the frame's attribute): no origin,
no cookies, nothing of the page. The page fetches the file with its own
cookies and hands the bytes over; Ruffle runs with networking, scripting
and links off. Ruffle 0.7.1 does not play a standalone FLV, so the BBS
makes a small AVM1 movie of its own (/chan/flvplayer.swf: NetStream
into a Video of the FLV's size) that plays it from a blob of the frame.
Ruffle's files are served at /chan/ruffle/ with CORS open (the frame
has no origin), only the package's .js, .wasm and .map.
Played in Chromium with Ruffle 0.7.1: a movie, and a Sorenson FLV with
sound through the player; both frames of origin "null", cookies
refused, no CSP violations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A board takes files besides images when its file types say so (bbs chan
board set DIR files webm,mp4,pdf; sound yes), as 4chan's take WebM and
/po/ PDFs. Each file is known by its bytes and read before it is kept:
- WebM: its EBML walked for the doc type (webm, not any Matroska), the
tracks' codecs (VP8, VP9, AV1; Vorbis, Opus), size and length
- MP4: its boxes walked for the movie header and tracks (H.264, AV1,
VP9; AAC, Opus); HEVC and the like refused, as browsers do not all
play them
- PDF: whole (%PDF- to %%EOF), its pages counted and first page's size
found where its objects are not compressed
Videos are at most 4096 pixels a side and [chan] max_video seconds long
(120; one that does not say is refused while there is a limit), and
silent unless the board takes sound. Thumbnails come from [chan]
ffmpeg (the first frame, the container named to it) and pdftoppm (the
first page), else a card saying what the file is.
In the page a video's thumbnail plays it in place with [Close]; a PDF's
opens it in a tab, served without the boards' CSP (a viewer will not
run under it) and nosniff. The post form lists what the board takes;
posts say a video's length, a PDF's pages; the JSON has 4chan's
webm_audio and max_webm_duration, and duration_ms, page_count,
file_types. Terminals show their thumbnails.
Fuzzing the readers found an EBML element head read past its parent
(a panic); fixed, the input kept as a regression case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A board with ids gives each poster an ID in each thread, as 4chan's: a
keyed hash of their address, the board and the thread, the same all
through a thread, another in the next. Each has its colour; hovering
counts its posts, clicking marks them.
A board with flags shows each poster's country's flag (an emoji, its
name on hovering), from [chan] geoip: a country database read by the
new internal/geoip, which reads MaxMind DB files (GeoLite2, DB-IP
Lite, IPinfo's...; tested on files made by MaxMind's own writer in
each record size, and broken ones) and CSVs of ranges (DB-IP's,
IP2Location LITE's), plain or gzipped, read again when the file
changes. Country names from ISO 3166.
Both are kept with each post, shown on the terminals by the name, and
given in the JSON as 4chan's id, country and country_name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Posting without signing in takes a captcha, drawn here: crooked
letters over noise, its answer sealed in its token (AES-GCM with the
boards' secret), good once and for ten minutes, a new one by script.
[chan] captcha = yes (the default) or no. Signed-in users and the
terminals' callers post without one.
Posts by signed-in users are marked as a member's (a check by the
name, member in the JSON, [member] on the terminals); ticking Sign it
as NAME posts under the account's own name, which no one else can use
(account in the JSON, [signed] on the terminals). forced_anon boards
mark but never sign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
A board with oekaki = yes has a drawing board in its post form (pen,
eraser, fill, palette, sizes, undo and redo), in plain JavaScript. The
drawing is posted as a PNG through the usual upload, carrying its
strokes and their timing in a private okST chunk (zlib-compressed
JSON), so the file replays wherever it goes. The server checks the
chunk on every PNG (size, canvas, limits, a guard against bombs) and
takes out a bad one, keeping the picture; a good one gives the post a
Replay link, its drawing time, and on oekaki boards Draw over, which
starts a reply from its strokes. boards.json and posts' JSON say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Boards by directory with anonymous posts and images: thumbnails made
in Go (JPEG, PNG, GIF, WebP, told by their bytes), JPEG metadata
stripped, duplicates refused by MD5. Threads bump until a bump limit,
sage, image limits, pruning off the last page, stickies and closed
threads. Tripcodes are 2channel's (a DES crypt(3) of our own, checked
against libc's) and secure ones; greentext, >>quotes with backlinks,
cross-board links, spoilers and code. Index, thread pages, catalog,
password deletion, reports; staff (sysops, a board's mods) delete,
ban by address or range, and post with capcodes. Yotsuba, Yotsuba B,
Futaba, Burichan, Photon and Tomorrow styles, and 4chan's read-only
JSON. bbs chan board|ban on the command line; [chan] in bbs.conf.
[http] trusted_proxies: requests from those take their caller's
address from X-Forwarded-For (Forwarded, X-Real-IP), the last hop that
is not a trusted proxy, for rate limits, logs, the deny lists and the
image boards' bans; a proxy's connections are not held to max_per_ip.
secure_cookies for TLS at the proxy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr