Files
Dylan M. Taylor 590ecaf9b1 Deploy artcraft-dashboard without the website's signing keys (#409)
## Why

`artcraft-dashboard` was documented (and configured) with the shared
Cloudflare
commands:

| Setting        | Value                             |
|----------------|-----------------------------------|
| Build command  | `npm run build`                   |
| Deploy command | `npm run deploy`                  |
| Build variable | `ARTCRAFT_APP=artcraft-dashboard` |

Both scripts fall back to `ARTCRAFT_APP=artcraft-website`, so a
dashboard deploy
that was missing the build variable did two wrong things:

- the build ran the website's static export, including
  `signLauncherCatalog()`, so the deployment failed without
  `LAUNCHER_CATALOG_SIGNING_KEY`;
- the deploy handed Wrangler the **root** config instead of the
dashboard's:

```
✘ [ERROR] The directory specified by the "assets.directory" field in your
  configuration file does not exist:
  /opt/buildhome/repo/frontend/apps/artcraft-website-next/out
```

## What changed

- The dashboard README now configures the Worker with `npm run
build:dashboard`
  and `npm run deploy:dashboard`. Those npm scripts set
  `ARTCRAFT_APP=artcraft-dashboard` inline and pass
`frontend/apps/artcraft-dashboard/wrangler.jsonc` to Wrangler, so the
Worker
  needs no build variable at all beyond `NODE_VERSION=22`.
- Added a "Build secrets" section stating the dashboard reads neither
  `LAUNCHER_CATALOG_SIGNING_KEY` nor `LINUX_SIGNING_KEY`, and that plain
  `npm run build` / `npm run deploy` must not be used for this Worker.
- The root README table now lists the per-app build/deploy commands
instead of an
  `ARTCRAFT_APP` column, and documents the same trap.
- `cloudflare_app.sh` header comment updated to match.
- Added the missing `deploy:website` script so all three apps have a
symmetric
  `build:<app>` / `deploy:<app>` pair.

No build logic changed: `artcraft-dashboard` never referenced the
signing keys
before this PR either. The change removes the misconfiguration path that
made
them appear to be required.

## Verification

- `env -u LAUNCHER_CATALOG_SIGNING_KEY -u LINUX_SIGNING_KEY pnpm install
--frozen-lockfile && pnpm build`
in `frontend/apps/artcraft-dashboard` — exit 0, `dist/` produced without
  `_redirects`.
- `wrangler deploy --dry-run --config
frontend/apps/artcraft-dashboard/wrangler.jsonc`
  — reads 5 files from `dist/`, binds `env.ASSETS`, clean exit.
- `node -e require('./package.json')` parses; `bash -n` on
`cloudflare_app.sh` and
  `build_cloudflare.sh` passes.

## After merge

In the Cloudflare `artcraft-dashboard` Worker, set build command
`npm run build:dashboard`, deploy command `npm run deploy:dashboard`,
and drop
the `ARTCRAFT_APP` build variable. Keep `NODE_VERSION=22`. No signing
secret
needs to be added to this Worker.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Clarified the app-specific Cloudflare build and deployment commands
for the website, webapp, and dashboard, including that the bare commands
default to the website and require `ARTCRAFT_APP` to select another app.
* Added dashboard Workers Builds guidance, including its Node.js version
requirement and app-specific Wrangler configuration.
* Clarified that only the website build uses signing credentials and its
launcher assets, and warned against deploying the dashboard with the
default Wrangler command.
* **Deployment**
  * Added a dedicated command for deploying the website.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-18 00:14:10 -05:00

3.1 KiB

ArtCraft Admin Dashboard

Admin dashboard for managing ArtCraft, served at https://dashboard.artcraft.team.

Deployment

Production is a Cloudflare Worker with static assets (wrangler.jsonc). Deploy from the repository root:

npm run build:dashboard
npm run deploy:dashboard

Workers Builds settings for the artcraft-dashboard Worker:

Setting Value
Build command npm run build:dashboard
Deploy command npm run deploy:dashboard
Build variable NODE_VERSION=22

npm run build:dashboard and npm run deploy:dashboard set ARTCRAFT_APP=artcraft-dashboard inline and pass this app's wrangler.jsonc to Wrangler, so the Worker needs no build variables beyond NODE_VERSION. Vite 7 needs Node >= 20.19 / 22.12, so NODE_VERSION=22 is required; it cannot be pinned in the repository because the rest of the workspace builds on the same Node version.

Build secrets

This app needs none. LAUNCHER_CATALOG_SIGNING_KEY and LINUX_SIGNING_KEY belong to the website's static-export pipeline (sign-launcher-catalog.mjs), which only artcraft-website-next runs. Nothing under this app reads them.

Do not configure this Worker with the shared commands. Plain npm run build / npm run deploy default to ARTCRAFT_APP=artcraft-website, so the build runs the website's signing step and fails without LAUNCHER_CATALOG_SIGNING_KEY.

The default deploy command npx wrangler deploy fails even when the build did select this app: with no --config, Wrangler resolves the root wrangler.jsonc and looks for the website's assets directory. Both paths report

The directory specified by the "assets.directory" field in your configuration
file does not exist: .../frontend/apps/artcraft-website-next/out

Set both Workers Builds fields to the commands in the table above.

/api proxy

cloudflare_worker/index.ts forwards /api/* to https://api.storyteller.ai. The dashboard calls the API with credentials: "include", so the session cookie has to be first-party; a direct cross-site call would be dropped by browsers. The Worker forwards the browser's Origin, so https://dashboard.artcraft.team must stay in the API's CORS allowlist (artcraft_admin_dashboard.rs). The Worker's *.workers.dev host is not on that allowlist, so API calls only work through dashboard.artcraft.team — add the test host to the CORS config if you need to exercise a deployment before attaching the domain.

Netlify rollback

netlify.toml and script/netlify_build.sh are kept so the previous site can still build and serve. Netlify's routing rules live in _redirects at the app root and are copied into dist/ by that script; Cloudflare does not get them, because Workers reject the /* /index.html 200 fallback and cannot proxy external hosts from _redirects.