Files
bbs/Makefile
T
Claude 56f022c8aa Image boards: Flash (SWF and FLV), played by Ruffle
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
2026-10-14 10:31:03 +00:00

51 lines
1.6 KiB
Makefile

PREFIX ?= /usr/local
GO ?= go
# go3270 is replaced by the Neo-Desktop/go3270-sec fork (go.mod): fetch it
# from GitHub directly, not through the public proxy and checksum database
export GOPRIVATE ?= github.com/Neo-Desktop/*
all: bbs
bbs:
$(GO) build -o bbs ./cmd/bbs
test:
$(GO) vet ./...
$(GO) test -race ./...
install: bbs
install -D -m 0755 bbs $(DESTDIR)$(PREFIX)/bin/bbs
@if [ ! -e $(DESTDIR)/etc/bbs/bbs.conf ]; then \
install -D -m 0640 bbs.conf.sample $(DESTDIR)/etc/bbs/bbs.conf; \
fi
# the dosemu2 image DOS doors run in (Docker; it builds dosemu2 from source)
doors-image:
docker build -t bbs-dosemu2 doors/dosemu2
# regenerates internal/api/pb from proto/bbs.proto (needs protoc and
# protoc-gen-go; the generated code is committed)
proto:
protoc --go_out=. --go_opt=module=github.com/Neo-Desktop/bbs-sec proto/bbs.proto
# regenerates internal/phone's tables from a checkout of Google's
# libphonenumber (git clone --depth 1 https://github.com/google/libphonenumber)
# and NANPA's area code report (curl -O https://reports.nanpa.com/public/npa_report.csv)
LIBPHONENUMBER ?= ../libphonenumber
NANPA ?= npa_report.csv
phone-data:
$(GO) run ./internal/phone/gen -src $(LIBPHONENUMBER) -nanpa $(NANPA)
# fetches Ruffle's self-hosted package (Flash for the image boards: [chan]
# ruffle = ./ruffle) from npm, unpacked into ruffle/
RUFFLE_VERSION ?= 0.7.1
ruffle:
rm -rf ruffle && mkdir ruffle
curl -fsSL https://registry.npmjs.org/@ruffle-rs/ruffle/-/ruffle-$(RUFFLE_VERSION).tgz | tar xz -C ruffle --strip-components=1
@ls ruffle/ruffle.js
clean:
rm -f bbs
.PHONY: all bbs test install clean doors-image proto phone-data ruffle