Modernize: toolchain, tests, containerization + GHCR/Coolify deploy - #2
Open
ddbruce wants to merge 1 commit into
Open
Modernize: toolchain, tests, containerization + GHCR/Coolify deploy#2ddbruce wants to merge 1 commit into
ddbruce wants to merge 1 commit into
Conversation
Behavior-preserving modernization pass. No app functionality changes. - Extract pure helpers (safeCompare, month/division/mush logic, run-number formatting) into lib.js; server.js consumes them unchanged. - Add Jest unit tests for the extracted logic (13 tests). - Migrate ESLint 8 (EOL) -> ESLint 9 flat config (eslint.config.js), same rule set; bump ecmaVersion 2018 -> 2022. - Dockerfile: pin node:24-alpine, set NODE_ENV, add HEALTHCHECK, copy lib.js. - package.json: add engines, lint/test scripts, dev deps; patch transitive body-parser/qs advisories via lockfile (npm audit: 0 vulnerabilities). - Add GitHub Actions CI (lint + test + amd64 image build). - Add scripts/deploy.sh + config.example.sh: build linux/amd64, push to GHCR, trigger Coolify redeploy. Real secrets live in gitignored scripts/config.sh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Behavior-preserving modernization pass on
strng. No app functionality changes — same routes, same run-number logic, same auth/CSRF behavior. Verified: boots on example config,/login→ 200,/→ 302 →/login; 13/13 unit tests pass; amd64 image builds with 0 npm vulnerabilities.strngwas already on current Express 5 / EJS 5, so this is mostly deploy scaffolding + toolchain hygiene.Changes
safeCompare, month/division/mush logic, run-number formatting) so they're unit-testable;server.jsconsumes them with identical behavior.ecmaVersion2018 → 2022.node:24-alpine,NODE_ENV=production,HEALTHCHECK.engines,lint/testscripts; patched transitivebody-parser/qsadvisories via lockfile →npm auditclean.scripts/deploy.sh(buildlinux/amd64→ push GHCR → trigger CoolifyPOST /api/v1/deploy?uuid=),scripts/config.example.sh. Real secrets live in gitignoredscripts/config.sh.Before this can deploy
Populate
scripts/config.shfrom the example (GHCR org/user/PAT, Coolify base URL/token/app UUID).Recommended follow-ups (NOT done — would change behavior/infra, need your OK)
data.jsonvolume writable by that user).data.json(the current sync whole-file write can race under concurrent generates).