Commit Graph
143 Commits
Author SHA1 Message Date
zk 48362dddec fix: there is no dev bot (#1684) 2026-06-17 23:46:27 +01:00
zk 3df85b4cf7 fix: deploy to ceres, as the server is no longer just the tachi server (#1679) 2026-06-17 00:11:27 +01:00
zk 3e9b80c618 feat: add VITE_SKIP_RULES for skipping rules (#1648)
* feat: add VITE_SKIP_RULES for skipping rules

* feat: and then skip rules
2026-06-06 22:16:32 +01:00
zk a815848fb6 fix: ensure some sanity in .env files (#1640) 2026-06-04 21:17:39 +01:00
zk 1cdae85a24 fix: new sitekeys 2026-05-24 16:24:25 +00:00
zk 559a02e6c9 fix: use the sitekeys lol 2026-05-24 16:09:57 +00:00
zk dcb7c8d41b feat: recaptcha->hcaptcha (#1577) 2026-05-24 16:09:23 +01:00
zk 0c130ad965 fix: docs ci 2026-05-23 14:45:25 +00:00
zk 42de1999a6 fix: through the wire 2026-05-23 14:16:55 +00:00
zk 7b3d9d2392 fix: mkpath in rsync stuffs 2026-05-23 14:09:32 +00:00
zk ae5e72aa89 fix: resize profile images on upload and cache redirect responses (#1564)
* fix: resize profile images on upload and add cache headers

Profile pictures were stored at original upload size (up to 1 MB) but
only ever displayed at 32–128 px, so every page load downloaded the full
original image. Additionally, no Cache-Control headers were set anywhere
in the pipeline, forcing a fresh round-trip through the API redirect and
CDN on every page view.

- Resize JPEG/PNG pfps to max 256×256 and banners to max 1920×1080 via
  sharp before storing; re-encode to WebP at 85% quality (GIFs skipped
  to preserve the animated-GIF easter egg)
- Hash the resized buffer so the CDN path reflects what's on disk
- Set ContentType and CacheControl: immutable on S3 PutObject so CDN
  edges and browsers cache the objects indefinitely (safe because paths
  are content-addressed via SHA-256)
- Add Cache-Control: public, max-age=3600, stale-while-revalidate=86400
  to the GET /pfp and GET /banner redirect responses so browsers cache
  the userId→CDN-URL mapping and skip the API hop on repeat visits

Fixes #1553

* chore: apply biome formatting

* chore: generate ImportTimestop kanel type

* feat: add backfill-media script to migrate existing profile images

One-off script that reads every user's existing pfp and banner from S3,
runs them through the same sharp resize/WebP pipeline as new uploads,
stores the result under the new content-addressed key with immutable
cache headers, and updates custom_pfp_location/custom_banner_location
in the DB.

Features:
- --dry-run flag to preview changes without writing anything
- Skips objects already at optimal size (idempotent)
- Gracefully handles missing S3 objects (logs + skips)
- Summary stats at the end
- Reads S3 config from CLI args or TACHI_CDN_SAVE_LOCATION_* env vars

* chore: apply biome formatting to backfill-media

* fix: resize animated GIFs to animated WebP via sharp animated:true

* test: rewrite change-pfp/banner tests as real S3 + sharp integration

Remove the CDN mock entirely. Tests now pass real image buffers through
sharp and verify the stored S3 object via CDNRetrieve:

- PNG/JPEG input → assert stored object is WebP, dimensions ≤256×256,
  smaller than the original
- GIF input → assert stored object is WebP
- Hash returned from the action == SHA256 of the stored WebP bytes
  (not the original upload)
- Delete tests upload a real pfp then delete it and verify CDNRetrieve
  throws afterwards

Also move change-pfp.test.ts from the isolated vitest project back to
the default pool now that it no longer uses vi.mock.

* chore: apply biome formatting to test file

* fix: use POSTGRES_TEST_HOST env var in bot vitest setup

Both vitest.globalSetup.ts and vitest.setup.ts hardcoded 'tachi-postgres'
(the dev server), but just bot-db-test-template-reset creates the template
on 'tachi-postgres-test' (the tmpfs test server). Workers then failed to
clone the template because they were looking on the wrong host.

Mirrors the pattern already used in the server package:
  process.env.POSTGRES_TEST_HOST ?? 'tachi-postgres-test'

* fix: update pfp router tests for WebP resize pipeline

The PUT tests were comparing the stored S3 bytes directly to the original
upload buffer. Since we now resize and re-encode to WebP, this always
fails. Also, following the mockApi redirect to fetch the bytes added a
slow supertest round-trip.

Replace with: read custom_pfp_location from the DB after PUT, fetch the
stored object directly via CDNRetrieve, and assert it is smaller than the
original (non-deterministic WebP compression makes exact byte comparison
inappropriate).

* fix: update banner router tests for WebP resize pipeline

* fix: tests

* fix: ci
2026-05-23 13:48:49 +01:00
zk f53d44b638 feat: homepage (#1563)
* feat: githooks, check before push

* feat: homepage
2026-05-23 10:07:48 +01:00
zk e363bd2532 docs: migrate from mkdocs to mdbook (#1558)
* docs: migrate from mkdocs to mdbook

- Rename old mkdocs docs/ to old-docs/ for reference
- Set up new docs/ with mdbook (book.toml + src/ tree)
- Mirror full nav structure from mkdocs.yml into SUMMARY.md
- Add Justfile-docs with docs-serve, docs-build, docs-check, docs-install recipes
- Import Justfile-docs from root Justfile
- Rewrite .github/workflows/docs.yml: build step uses taiki-e/install-action
  to install mdbook, split into separate build + deploy jobs, PR builds
  run the check step too

* ci(docs): pin actions to SHAs, install mdbook via release binary

* ci(docs): install mdbook from apt instead of curling a release binary

* dev: replace mkdocs python stack with mdbook in dev image

* ci(docs): apt only works on Debian; restore release binary install for Ubuntu CI

* docs: fix duplicate file entries in SUMMARY.md

* docs: remove docs-install recipe

* docs: remove site-url from book.toml to fix asset loading

* dev: install mdbook from upstream release binary, not Debian apt

The Debian package (0.4.x+ds) strips bundled font assets, leaving the
built site without fonts/fonts.css. Use the upstream tarball (same as CI)
so the theme is complete. Handles x86_64 and aarch64.

* docs: vendor mdbook tarballs in dev/mdbook/, install from there

Dockerfile.dev uses COPY + tar to install the right arch at build time.
CI extracts the x86_64 tarball directly from the checkout.
No network access required for either — and no stripped-fonts Debian package.

* fix: unwritten
2026-05-22 20:43:07 +01:00
zk aa402be116 feat: check.yml (#1541) 2026-05-21 17:53:40 +01:00
zk 9be4426ab5 feat: move beatoraja IR into monorepo (#1517) 2026-05-20 02:05:09 +01:00
zk 6d77ed3c48 feat: significantly better ci images (#1516) 2026-05-20 01:20:32 +01:00
zk 95b01155b9 feat: ultrafast tests (#1511)
* feat: ultrafast tests

* fix: lint

* fix: misc fixes and remove this dense perf code

* fix: update server.yml appropriately

* fix: nice one

* fix: improve our luck
2026-05-20 00:35:33 +01:00
zk 4ffc001580 ci: run bot and github-bot checks on pull requests (#1509)
Add PR workflows for tachi-bot (lint, typecheck, vitest with Postgres) and
tachi-github-bot (lint, typecheck). Gate image build and deploy on passing
tests. Fix github-bot path filters and add eslint scripts to the package.
2026-05-20 00:33:28 +01:00
zk ae94f723b8 feat: v3! 2026-05-18 17:50:10 +00:00
zk d93e54ce4a fix: new migration; fix broken showcase stats 2026-05-17 20:26:30 +00:00
zk 6b85f158be fix: i push my fingers into my eeeeeyyyeees 2026-05-17 21:04:44 +01:00
zk 0338769d2b fix: why does github@'git checkout' depend on Node.JS 20, and why should I care that it's deprecated. Why? 2026-05-17 20:49:13 +01:00
zk 0dcd5325b6 refactor: change how hashes work 2026-05-16 13:42:22 +00:00
zk 9f2ca87665 fix: harden ci, don't log any kamal stuff here, it's a liability 2026-05-16 13:15:32 +00:00
zk c732034a6d fix: update github workflows to use kamal 2026-05-16 12:39:39 +00:00
zk da1fdafa51 fix: improve Dockerfiles 2 2026-05-15 20:34:56 +00:00
zk 2771244005 fix: dwa 2026-05-15 18:20:15 +01:00
zk b6ae8a70c0 fix: enable flo eag 2026-05-12 18:08:36 +01:00
zk 0ea7954489 fix: littlefury inconsistencies 2026-05-10 13:28:20 +00:00
zk ea98706c75 fix: i'd be dangerous if i could read 2026-05-08 18:48:44 +01:00
zk 38e652de92 ?? 2026-05-08 17:44:07 +00:00
zk efcd7652ae rebel shell 2026-05-08 16:54:34 +00:00
zk e02e42e69a wire all or die 2026-05-03 18:00:58 +00:00
zk 1a37735ad5 antimony (2, redux) 2026-05-03 16:59:53 +00:00
zk a7905c80ec remove zgoat and use non :latest patching 2026-05-03 16:39:50 +00:00
zk 4fd3b17185 latest tag simulator 2026-05-03 15:42:57 +00:00
zk d5c28aa61a unfuck sqlite 2026-05-03 15:04:24 +00:00
zk 622ce1ef21 hard leather hard house 2026-05-03 15:13:23 +01:00
zk c04afbc755 more ci fixes 2026-05-03 15:11:21 +01:00
zk 857ccee0bd minio von fixington 2026-05-03 14:52:37 +01:00
zk 04fc9da213 Veehuehhuhhf.h.. (2) 2026-04-30 23:44:23 +01:00
zk c18f7a8371 Veehuehhuhhf.h.. 2026-04-30 23:31:44 +01:00
zk d81d3cd675 skraijnal 2026-04-30 23:19:27 +01:00
zk b1aaa76255 fajnel 2026-04-30 21:33:23 +00:00
zk 6c0692c9ed hajnal 2026-04-30 21:16:08 +00:00
zk 374f1af8e0 something to do with... (#59)
* something to do with...

* kill and die

* ririri midori
2026-04-28 22:56:24 +01:00
zk edda03e916 sunday 5th apr (rip mark hollis) (#52)
* lots of work

* feat: move rg-stats in, ensure consistency in db queries

* the clocks dont work

* almost

* ok jesus been and gone now back to usual
2026-04-06 01:25:30 +01:00
zk e33db85253 untenable speed 2026-03-28 21:19:28 +00:00
zk 5ea514cfa8 feat: first v3 refactor 2026-03-11 00:06:28 +00:00
beerpsi af2665a9ff [chunithm] Update to X-VERSE (#1395)
* [chunithm] Update to CHUNITHM X-VERSE

* add xverse-omni to every chart

* xverse-intl

* add search terms

* fix(tests): songTitle match type must be case-insensitively unique

* daydreama + energizing flame

* ci: add concurrency control between server and seeds deploy

* chunithm: rank PBs by noteLamp and clearLamp too

This prevents the scenario where a user's rank on a chart goes down because they
improved their skill lamp and thus counts as a "raise".

* add search term for mayonnaise fried chicken

* random ass revival
2025-11-20 23:43:56 +00:00