Retro Bulletin Board Systems on atproto. Web app and TUI.
atbbs.xyz
python
tui
atproto
bbs
1#!/bin/sh
2set -e
3
4: "${PUBLIC_URL:?PUBLIC_URL environment variable is required (e.g. https://atbbs.app)}"
5
6# Strip trailing slash.
7PUBLIC_URL="${PUBLIC_URL%/}"
8
9SCOPE="atproto repo:xyz.atboards.site repo:xyz.atboards.board repo:xyz.atboards.news repo:xyz.atboards.thread repo:xyz.atboards.reply repo:xyz.atboards.ban repo:xyz.atboards.hide"
10
11# Runtime config read by the SPA at startup.
12cat > /usr/share/nginx/html/config.json <<EOF
13{
14 "client_id": "${PUBLIC_URL}/client-metadata.json",
15 "redirect_uri": "${PUBLIC_URL}/oauth/callback",
16 "scope": "${SCOPE}"
17}
18EOF
19
20# OAuth client metadata — fetched cross-origin by atproto auth servers.
21cat > /usr/share/nginx/html/client-metadata.json <<EOF
22{
23 "client_id": "${PUBLIC_URL}/client-metadata.json",
24 "client_name": "atbbs",
25 "client_uri": "${PUBLIC_URL}",
26 "redirect_uris": ["${PUBLIC_URL}/oauth/callback"],
27 "scope": "${SCOPE}",
28 "grant_types": ["authorization_code", "refresh_token"],
29 "response_types": ["code"],
30 "token_endpoint_auth_method": "none",
31 "application_type": "web",
32 "dpop_bound_access_tokens": true
33}
34EOF
35
36exec nginx -g 'daemon off;'