draw things
doodl.waow.tech
draw
atproto
1// builds doodl and deploys it to the PDS via wisp, served at the custom
2// domain doodl.waow.tech. the OAuth client_id points at the hosted metadata
3// on that same origin.
4//
5// one-time setup (run separately, see README):
6// wispctl domain claim <handle> --domain doodl.waow.tech # prints DNS records
7// <set DNS on the waow.tech zone>
8// wispctl domain add-site <handle> --domain doodl.waow.tech --site doodl
9import { $ } from "bun";
10
11const HANDLE = process.env.WISP_HANDLE ?? "zzstoatzz.io";
12const SITE = process.env.WISP_SITE ?? "doodl";
13const ORIGIN = process.env.DOODL_ORIGIN ?? "https://doodl.waow.tech";
14const base = `${ORIGIN}/`;
15// MUST stay in sync with SCOPE in src/data/oauth.ts — this generates the hosted
16// oauth-client-metadata.json the auth server validates against.
17const SCOPE =
18 "atproto " +
19 "repo:tech.waow.doodl.drawing?action=create&action=update&action=delete " +
20 "repo:tech.waow.doodl.iconset?action=create&action=update " +
21 "repo:tech.waow.doodl.preferences?action=create&action=update " +
22 "blob:*/*";
23
24const metadata = {
25 client_id: `${base}oauth-client-metadata.json`,
26 client_name: "doodl",
27 client_uri: base,
28 redirect_uris: [base],
29 scope: SCOPE,
30 grant_types: ["authorization_code", "refresh_token"],
31 response_types: ["code"],
32 token_endpoint_auth_method: "none",
33 application_type: "web",
34 dpop_bound_access_tokens: true,
35};
36
37await Bun.write(
38 "public/oauth-client-metadata.json",
39 JSON.stringify(metadata, null, 2),
40);
41console.log(`wrote oauth-client-metadata.json for ${base}`);
42
43await $`bun run build`;
44await $`cp public/oauth-client-metadata.json dist/oauth-client-metadata.json`;
45
46await $`wispctl deploy ${HANDLE} --path ./dist --site ${SITE} --spa`;
47console.log(`deployed → ${base}`);