Files
bbs/Makefile
T
Claude 284d0e08f5 Add an HTTP API with JSON and protobuf WebSockets
[http] serves a REST API under /api/v1 (accounts, message areas, mail,
file areas with uploads and ranged downloads, chat rooms, paging, and
sysop administration including FidoNet polls and news syncs), with
server-sent events and two WebSocket endpoints speaking the bbs.v1
protocol from proto/bbs.proto: JSON text frames at /api/v1/ws and
binary protobuf at /api/v1/ws/proto.  Stream clients get a real node,
so web users chat with terminal callers, get node messages and page
the sysop.

Tokens are login sessions or API keys (bbs token add/list/revoke),
stored as SHA-256 hashes, with scopes.  TLS by default, per-token and
per-address rate limits, strict bodies, one CORS origin at most,
Prometheus metrics on their own address, and an OpenAPI 3.1 document
checked against the routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-11 16:40:57 +00:00

35 lines
923 B
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
clean:
rm -f bbs
.PHONY: all bbs test install clean doors-image proto