95 Commits
Author SHA1 Message Date
Dylan M. Taylor f4416f8f7f Point the Omni API docs at the Cloudflare Worker and drop the Netlify rollback build 2026-11-18 12:05:38 -05:00
Dylan M. Taylor 1ce37b5f28 Serve the API docs on storyteller-docs.artcraft.team from a Cloudflare Worker 2026-11-18 12:03:54 -05:00
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
Dylan M. Taylor 766ead6629 Configure artcraft-dashboard for Cloudflare at dashboard.artcraft.team (#408)
## Problem

The admin dashboard is deployed only to Netlify
(`artcraft-dashboard.netlify.app`), while the rest of the frontends
deploy to Cloudflare from this repository. Move it to Cloudflare and
serve it at `dashboard.artcraft.team`.

## Change

- **`frontend/apps/artcraft-dashboard/wrangler.jsonc`** —
`artcraft-dashboard` static-assets Worker: SPA `not_found_handling`,
`run_worker_first: ["/api/*"]`, custom domain `dashboard.artcraft.team`.
- **`cloudflare_worker/index.ts`** — same-origin `/api/*` proxy to
`https://api.storyteller.ai`. The dashboard calls the API with
`credentials: "include"`, so its session cookie has to stay first-party;
`api.storyteller.ai` is a different site than `dashboard.artcraft.team`,
so a direct cross-site call would have the cookie dropped by browsers.
This replaces Netlify's `/api/*` rewrite.
- **`script/website/cloudflare_app.sh` + root `package.json`** —
`ARTCRAFT_APP=artcraft-dashboard`, plus `npm run build:dashboard` / `npm
run deploy:dashboard`.
- **`_redirects`** moved from `public/` to the app root and copied into
`dist/` by `netlify_build.sh`, so the Cloudflare upload never contains
the `/* /index.html 200` loop or the external-host proxy that Workers
reject. Netlify keeps working unchanged as the rollback target.
- **CORS** — `https://dashboard.artcraft.team` allowlisted in
`artcraft_admin_dashboard.rs`, the regression table, and the production
product-origin test.
- **`tsconfig.app.json`** — excludes spec files. `DebugLogCard.spec.ts`
imports `vitest`, which only resolved through the parent workspace's
`node_modules`; the standalone Cloudflare build never installs those, so
`tsc -b` failed.
- Docs: dashboard README (deploy, proxy rationale, rollback) and the
root README Worker table.

## Cloudflare settings

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

`VITE_API_HOST` is deliberately not set: the dashboard keeps calling
`/api`, and the Worker proxies it.

## Checklist before cutover

- [ ] `artcraft.team` is a zone in the Cloudflare account (Workers
custom domains require the zone).
- [ ] `artcraft-dashboard` Worker created from this repo with the
settings above.
- [ ] Domain attached; log in and confirm the session works at
`https://dashboard.artcraft.team`. A `*.workers.dev` URL is not
CORS-allowlisted, so test through the domain (or add the test host to
the CORS config first).
- [ ] Netlify site kept for rollback; reverting is pointing the domain
back at it.

## Testing

- `cargo test -p actix_cors_configs` — 81 passed, including the new
`dashboard_domain` case and the allowlist regression table.
- `pnpm install --frozen-lockfile && pnpm build` in
`frontend/apps/artcraft-dashboard` — succeeds (9014 modules); `dist/`
has no `_redirects`.
- `wrangler deploy --dry-run --config
frontend/apps/artcraft-dashboard/wrangler.jsonc` — clean: 5 assets,
`env.ASSETS` binding, no config warnings.
- Not run: an actual deploy, since there are no Cloudflare credentials
or account access in this environment.

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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* The ArtCraft Admin Dashboard is now available at
`dashboard.artcraft.team`, with dashboard API requests routed through
the new deployment.
* The dashboard’s production origin is now allowed for cross-origin
requests.
* **Documentation**
* Added deployment and build guidance for the dashboard, including its
Cloudflare hosting and API routing details.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-17 23:51:08 -05:00
Dylan M. Taylor 896824e56f Build the webapp on Cloudflare without the website's signing keys (#407)
## Problem

app.getartcraft.com serves `Hello world`. Its `artcraft-webapp` Worker
builds this repository with `npm run build`, which always built
**artcraft-website-next** and failed on the website's
`LAUNCHER_CATALOG_SIGNING_KEY`. The Worker never got a successful
deploy, so it kept its placeholder.

## Change

- `npm run build` / `npm run deploy` choose the app from the
`ARTCRAFT_APP` build variable via `script/website/cloudflare_app.sh`.
The default, `artcraft-website`, is the old behaviour, so the website
Worker needs no changes.
- `ARTCRAFT_APP=artcraft-webapp` builds only the Nx webapp. It needs
**no signing keys**.
- `frontend/apps/artcraft-webapp/wrangler.jsonc` is now a static-assets
Worker (`artcraft-webapp`). It uses SPA `not_found_handling` and the
`app.getartcraft.com` custom domain, replacing the unused Pages
`app-new` config.
- The Cloudflare `public/_redirects` no longer has the `/* /index.html
200` fallback, since Workers assets reject it as a loop. Netlify's
`_redirects` is untouched.
- `nx build --skipSync` plus the `nx sync` output for
pagedraw/pagescene. Nx refused to build in CI without those references,
and that also fails on current `main`.

## Cloudflare settings for the artcraft-webapp Worker

| Setting        | Value                                   |
|----------------|-----------------------------------------|
| Build command  | `npm run build`                         |
| Deploy command | `npm run deploy`                        |
| Build variable | `ARTCRAFT_APP=artcraft-webapp`          |
| Build variable | `VITE_GOOGLE_CLIENT_ID` (as on Netlify) |

## Testing

- `ARTCRAFT_APP=artcraft-webapp CI=true npm run build` with no signing
keys in the environment: succeeds, 239 files, none over 25 MiB.
- `wrangler deploy --config frontend/apps/artcraft-webapp/wrangler.jsonc
--dry-run`: clean, no `_redirects` warnings.
- An unknown `ARTCRAFT_APP` exits 1 with usage.
- Not run: the website build path, which is the unchanged command moved
into the script.
2026-11-17 18:34:12 -05:00
Dylan M. Taylor 0e13ad0b10 fix(scripts): revoke every source session when copying account credentials (#274)
## What was wrong
`script/database/copy_user_account.py` moves an account's email and
password onto another account and says it ends the source account's
sessions. The revocation `UPDATE` had `LIMIT 10` and also matched
sessions that were already deleted. If the source account had more than
ten session rows, some live sessions could survive the transfer and keep
working, because session lookups accept any row with `deleted_at IS
NULL` and `expires_at > NOW()`.

## What changed
- The revocation `UPDATE` has no row limit and only targets live
sessions (`deleted_at IS NULL`), so the timestamps on rows that were
already deleted stay as they were.
- After the update, the script counts the source's remaining live
sessions inside the same transaction. If any are left, it raises, and
the existing handler rolls back.
- The confirmation preview counts live sessions, and the docstring lists
the revocation step.

## Blast radius
This only affects the oncall script that an operator runs by hand. No
service code changed. Session lookups do not use a cache
(`crates/lib/actix_artcraft/src/sessions` reads MySQL directly), so
nothing else needs invalidating.

## Checks
- Run: `python3 -m py_compile script/database/copy_user_account.py`
- Not run: running the script against a database (it needs a live MySQL
and secrets.toml).

Addresses CodeRabbit security findings (CWE-613).


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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Account-copy operations now stop and roll back if any live source
sessions remain, rather than committing an incomplete transfer.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 11:11:19 -05:00
Dylan M. Taylor d903ff2e2c Sonar: [[ ]] in scripts, npm install --ignore-scripts, retired local-dev setup out of scope (#373)
- **shell:S7688 (43)**: `[[ ]]` in place of `[ ]` in
`script/metrics/apply_{dashboards,metric_configs,monitors}.sh`,
`script/common/frontend_preflight.sh` and
`script/website/unix_frontend_dashboard_dev.sh`. Every script has a bash
shebang and `bash -n` passes. No test uses `-a`/`-o`, escaped
parentheses or an unquoted pattern on the right of `=`. The numeric
operands are `$#`, internal flags, exit codes, a parsed Node major
version and curl's status code, so `[[ ]]`'s arithmetic reading changes
nothing.
- **shell:S6505 (4)**: `npm install --ignore-scripts` in
`frontend_preflight.sh`, `unix_frontend_webapp_dev.sh` and
`frontend/build_modules.sh`. The frontend has no install scripts of its
own, and this repo's CI already builds with `npm ci --ignore-scripts`.
Same change as storytold/artcraft#2818.
- **Scope**: `_docs/old/**` joins `sonar.exclusions`. It's the retired
local-dev setup (an old Dockerfile, `kubernetes.yml`, nginx config) that
nothing references, and it held the docker and kubernetes findings under
`_docs/old/old_localdev_setup`.

Same as the other PRs here: not merged without the owner's go-ahead
(production service).

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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
* Frontend dependency installation now skips package-provided lifecycle
scripts, including during development setup. This changes which scripts
run during installation but does not change the frontend’s intended
features or behavior.
* Updated internal checks used by dashboard, metric, and monitor scripts
without changing their conditions or outcomes.
* Expanded static-analysis exclusions to include archived documentation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 07:34:01 -05:00
Dylan M. Taylor 83cacf36ad security: pin Swagger UI, refuse npx installs, drop stale MinIO keys (SonarCloud) (#177)
Resolves the bundled-asset and script security findings SonarCloud
reports outside vendored code.

- **Web:S5725** `frontend/api_docs.html` — Swagger UI was loaded over
protocol-relative `//unpkg.com` URLs with no integrity check. Now
`https://` plus `integrity`/`crossorigin` on all three assets.
- **shell:S6505** the three remaining `npx` calls in Netlify/dev scripts
now pass `--no-install`, so they run the pinned local binary instead of
downloading and running one.
- **secrets:S6418** removed the long-dead MinIO access/secret key pair
commented out in the deprecated inference-job env file.
- **python:S4790** the Gravatar hash is an MD5 identifier required by
Gravatar's URL scheme, so it is marked `usedforsecurity=False`.

Verified: file contents diffed against the previous URLs; no
build-affecting script semantics changed (`--no-install` only rejects
on-demand downloads).

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

## Summary by CodeRabbit

* **Bug Fixes**
* API documentation resources now load over HTTPS with integrity
verification.
* Account-copying operations preserve their existing output while
supporting environments that restrict security-related hashing.

* **Chores**
* Build and cleanup commands use locally available tooling and continue
cleanup if the reset command fails.
* Removed commented-out credential settings from the development
configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-27 16:29:01 -04:00
Brandon Thomas 17373314ae remove old website (#63) 2026-10-09 11:31:28 -04:00
Brandon Thomas fc78787f30 better website hero text (#46) 2026-10-01 20:22:51 -04:00
Brandon Thomas ef2710fcc8 wip 2026-09-14 15:40:33 -04:00
Brandon Thomas cb1bea9d0a remove the desktop app from the repo 2026-09-12 12:23:46 -04:00
hanashi 0a84a3ce80 fix codegen + also codegen query cache (#1877) 2026-08-10 00:10:55 -04:00
hanashi ea4563c1a8 Frontend dev exp (#1866) 2026-08-08 19:17:34 -04:00
Brandon Thomas 35add74498 payment informatics 3 (#1706) 2026-06-30 08:19:52 -04:00
Brandon Thomas 9104faf806 fix frontend dev scripts (#1625) 2026-06-10 09:28:25 -04:00
Brandon Thomas 436d6d18a0 more dashboards 2026-05-23 15:55:20 -04:00
Brandon Thomas e518f42fdb metrics creation scripts 2026-05-23 12:46:33 -04:00
Brandon Thomas 69d26f6a86 metrics defs (#1554) 2026-05-23 11:26:14 -04:00
Brandon Thomas 1cd2900b98 webapp launch script 2026-05-18 23:19:33 -04:00
Brandon Thomas ad40798a12 chrome launch script (#1371) 2026-04-15 01:44:39 -04:00
Brandon Thomas e7bb263755 mysql backup tool 2026-04-01 13:15:27 -04:00
Brandon Thomas c7744ae545 update oncall script 2026-03-11 00:36:12 -04:00
Brandon Thomas d45b82109d script for handling oncall scenarios where the user has duplicate accounts (#1078) 2026-03-02 11:05:03 -05:00
Brandon Thomas 3654676a13 Fix netlify docs (#1077) 2026-03-02 07:11:17 -05:00
Brandon Thomas a18042d8e0 bump artcraft version -> 0.10.0 2026-03-01 01:36:36 -05:00
Brandon Thomas e0779897b6 single quotes in db migrations 2026-02-17 23:40:56 +07:00
Brandon Thomas 60461e9208 db migration tools 2026-02-15 11:45:31 +07:00
Brandon Thomas 7cc1c0209f database migration tool (primarily record deletion) (#1039)
We need to remove irrelevant FakeYou records that do not impact the
ArtCraft product

- 87M irrelevant media file records (no relation to ArtCraft)
- 105M jobs records (which we purge occasionally anyway)
- lots of other files: audit logs, old/irrelevant stripe event logs,
feed data, etc. etc.
2026-02-14 08:06:54 +07:00
Brandon Thomas dd8b6338a6 Vendor symphonia (#1036)
Two reasons for this:

- super brittle when pinned to non-main commit
e1a70095c4409478c1ded499fb8dd4afa540fb90

- I was recently stuck on a flight without good wifi and setting up a
new devenv. Cargo was totally unable to download the remote github
dependency, but was fine downloading the entire artcraft repo. Seems bad
to link to other repos that Cargo can't quickly pull on low bandwidth.

We'll need to slim this down later and eventually get back on main
branch.
2026-02-12 04:27:37 +07:00
Brandon Thomas 0eb8380949 useful script 2026-01-21 14:35:30 -05:00
Brandon Thomas 6b94196f2b cleanup root directory (#996) 2026-01-19 23:08:39 -05:00
BFlat 43d9b96d5e Feature/menu help button (#957)
replaced tutorial button with combined help menu with more links:
- tutorial
- discord server invite
- github link
- artcraft studios youtube
2026-01-05 22:57:51 +07:00
Brandon Thomas 5f29cd5f79 local "production build" dev script, fix sound singleton bug, soften language (#955) 2026-01-04 16:09:27 -05:00
Brandon Thomas 7a04b131f7 rename nx module editor3d -> artcraft (#951) 2026-01-02 00:45:22 -05:00
Brandon Thomas 0c6021e95c nano banana pro in tauri (#923) 2025-12-06 04:50:30 -05:00
Brandon Thomas 5c3760f9ec config+script to debug production builds (#871) 2025-10-09 05:07:27 -04:00
Brandon Thomas 90810231da fix release script 2025-10-04 12:50:14 -04:00
Brandon Thomas 04e3a56d18 script to build javascript 2025-09-26 18:02:31 -04:00
Brandon Thomas e54c29cd43 script to push release branch 2025-09-23 14:41:58 -04:00
Brandon Thomas 8477991327 misc: clarity csp, handle billing errors, notes (#831) 2025-09-18 14:49:46 -04:00
Brandon Thomas 9e57aacb05 remove unused tauri config files 2025-08-24 10:47:31 -04:00
Brandon Thomas 6a3693a7ce fix builds ssl (#762) 2025-08-15 13:59:06 -04:00
Brandon Thomasandbflatastic da859fc2f8 marketing updates for the website (#722)
This is currently a draft / work in progress.

---------

Co-authored-by: bflatastic <bombayapirat@gmail.com>
2025-07-17 10:49:14 -04:00
bflatastic a8bb7f2720 windows dev script sqlx offline 2025-07-14 09:51:27 +07:00
Brandon Thomas ec1257ccf6 fix sqlx sqlite build for dev and CI (#716) 2025-07-13 20:26:57 -04:00
Brandon Thomas 9bc24ac216 introduce sqlite with Tauri; task tracking database (#712) 2025-07-13 18:48:47 -04:00
Brandon Thomas 2af8fbd9e1 npm install verbose flags 2025-06-04 20:10:05 -04:00
bflatastic 72a1bb07e0 Update command in windows_frontend_dev.ps1 to use 'npx' for executing nx dev 2025-05-30 13:05:06 +07:00
Brandon Thomas 7aad79d16b timestamp when build finishes 2025-05-27 15:14:45 -04:00