Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions apps/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ RUN pnpm install --frozen-lockfile --filter balatro-multiplayer-api-server...
COPY packages/ ./packages/
COPY apps/server/ ./apps/server/

# modzip: the deterministic mod-archive builder mods-sync.service.ts shells
# out to (see native/modzip/modzip.c) - links libzip so the hash it
# produces matches the launcher's own ZipWriter::zipDirectory() byte-for-
# byte. build-base (gcc/make) is only needed to compile it; removed
# afterward to keep the final image lean. libzip-dev is left installed
# since it's also how libzip's runtime shared library gets pulled in on
# Alpine - removing it risks taking the .so modzip needs at runtime with it.
RUN apk add --no-cache libzip-dev build-base \
&& gcc -O2 -std=c11 -D_POSIX_C_SOURCE=200809L -Wall -Wextra \
-o /usr/local/bin/modzip apps/server/native/modzip/modzip.c -lzip \
&& apk del build-base

RUN pnpm --filter @bmp/types build
RUN pnpm --filter @v-rtualized/bmp-internal build
RUN pnpm --filter balatro-multiplayer-api-server build
Expand Down
335 changes: 0 additions & 335 deletions apps/server/native/modzip/modzip.c

This file was deleted.

28 changes: 14 additions & 14 deletions apps/server/src/features/mods/backfill-mod-hashes.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/**
* Recomputes every mod_registry_versions row's sha256 under the corrected
* "prepared zip" algorithm (see mods-sync.service.ts's
* computePreparedZipHash doc comment) -- every hash stored before that
* rewrite was computed over the raw GitHub download, which
* RunController::currentZipMatchesServerHash() (new-launcher) never
* actually verifies against.
* folder-content-hash algorithm (see mods-sync.service.ts's
* computeModFolderHashForRelease doc comment and mod-folder-hash.ts) --
* every hash stored before that rewrite was computed over an archive (the
* raw GitHub download, and later a rebuilt deterministic zip -- see git
* history), never a plain directory's content, which is never what
* RunController::currentModMatchesServerHash() (new-launcher) actually
* verifies against now.
*
* One-time maintenance operation, not part of the regular hourly/startup
* sync -- run it explicitly, once, after deploying the prepared-zip-hash
* rewrite. Safe to re-run: recomputing an already-correct hash just
* produces the same value again.
* sync -- run it explicitly, once, after deploying the folder-hash rewrite.
* Safe to re-run: recomputing an already-correct hash just produces the
* same value again.
*
* Needs the same runtime as the server itself -- the modzip binary on
* PATH (only present in the built Docker image, see Dockerfile) and
* network access to every mod's GitHub download URL -- so run it inside
* the deployed container, e.g.:
* Needs the same runtime as the server itself -- network access to every
* mod's GitHub download URL -- so run it inside the deployed container,
* e.g.:
*
* docker compose exec api pnpm --filter balatro-multiplayer-api-server backfill-mod-hashes
*
* or locally against a real DATABASE_URL if you have modzip built and on
* PATH some other way:
* or locally against a real DATABASE_URL:
*
* tsx --env-file=.env src/features/mods/backfill-mod-hashes.ts
*/
Expand Down
Loading