Commit Graph
90 Commits
Author SHA1 Message Date
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
Brandon Thomas f4e998d945 cleanup deps (#635) 2025-05-26 01:38:27 -04:00
Brandon Thomas 8a886e9033 cleanup scripts (2) 2025-05-25 22:57:01 -04:00
Brandon Thomas 3101df8211 cleanup scripts 2025-05-25 22:53:40 -04:00
8ccc8927a9 Feature/merge 2d 3d diverge (#593)
Co-authored-by: Michael Chung <michaelchung@michaels-mbp-2.home>
Co-authored-by: Tanish Manku <tanish2k09.dev@gmail.com>
2025-05-08 23:46:30 -04:00
Brandon Thomas 83cecad280 build script for mac 2025-05-07 23:13:23 -04:00