Generate gzip sidecars for JavaScript, CSS, and WebAssembly assets during the image build. Serve them through nginx when clients accept gzip, including proxied requests, while preserving uncompressed fallback and runtime HTML base-path rewriting.
* ci: move to pnpm 12, pnpm/setup v3 and faster, pinned CI
pnpm 12.6.0 is declared in devEngines.packageManager instead of
packageManager, so pnpm/setup, the Dockerfile and local installs all pick
the same version; the lockfile records the resolved binary. Every workflow
moves to pnpm/setup v3, and the Vercel workflows gain a setup step so
`vercel build` runs with that pnpm rather than whatever is on the runner.
CI time:
- ci runs format check, lint, unit tests, typecheck and build as parallel
steps instead of one after another.
- E2E builds the app once and shares dist with the three browser jobs
instead of rebuilding it in each.
- ci and E2E cancel superseded runs on the same ref.
- The Docker latest/baseurl workflows no longer repeat ci's checks. They
run on workflow_run after ci succeeds for a push, and build the commit
ci tested.
Runners are pinned to ubuntu-26.04-arm. CodeQL stays on x64
(ubuntu-26.04): only the x64 image ships the CodeQL bundle in its tool
cache. The Playwright cache key now includes the runner architecture.
Every action is pinned to its latest release by commit SHA with a version
comment, the Dockerfile base images by digest, and the pnpm and Vercel CLI
installs to exact versions, matching the Renovate presets already enabled
(helpers:pinGitHubActionDigests, docker:pinDigests).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
* ci: deploy to Vercel from one workflow with previews and a concurrency group
Replaces sharevb-vercel-preview.yml and sharevb-vercel-prod.yml with
deploy.yaml, which builds here and deploys the prebuilt output:
- One concurrency group per ref with cancel-in-progress, so a burst of
pushes costs one deployment instead of one per push.
- A GitHub environment per run (Production or Preview), which restores the
Environments sidebar and the PR's "View deployment" button.
- Pull requests build their own head commit, named after the PR branch so
Vercel shows the branch rather than "HEAD"; runs from forks are skipped,
since they get no secrets.
- Fails early on missing secrets, refuses to deploy a build without
index.html, and pins the Vercel CLI.
The production hostname for sitemap.xml and robots.txt comes from the
VERCEL_PRODUCTION_URL repository variable instead of being hardcoded, so
the same file serves any deployment. Secrets can live on the repository
or on the Production/Preview environments.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
* build: stop compiling tree-sitter's native addon
curlconverter depends on tree-sitter and tree-sitter-bash for its Node
shell parser, but the app only uses curlconverter in the browser, where its
`browser` field swaps in web-tree-sitter (WASM). The native addon is never
loaded.
Building it anyway broke installs: tree-sitter 0.21 ships prebuilds only for
darwin-x64 and win32-x64, so Linux compiles it from source, and its C++17
flags fail against Node 24.21's headers, which require C++20. That is what
failed pnpm install on the arm64 runners.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
* ci(e2e): run the browser jobs on x64
On ubuntu-26.04-arm the Playwright suite ran over 7x slower: chromium was
still in the test step after 27 minutes, against under 4 on x64. The build
job stays on arm; its output is architecture-independent.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
* test(e2e): stop the preview server with SIGTERM so runs exit
pnpm 12 starts the script it runs in its own process group. Playwright
stops its webServer by SIGKILLing the `pnpm preview` process group, which
no longer contains vite: vite survives, keeps the output pipes open, and
Playwright waits on it forever. The E2E jobs finished every test and then
hung until the job timeout.
pnpm 12.6 forwards SIGTERM to the script it runs, so stop the server with
SIGTERM instead. Locally with pnpm 12.6.0: 112 tests in 1.8 min, clean
exit, nothing left listening on the port.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
* Revert "ci(e2e): run the browser jobs on x64"
The slowdown blamed on arm was the Playwright webServer hang fixed in the
previous commit: every test had finished and the job was waiting on an
orphaned vite process. The suite is not slower on arm, so the browser jobs
go back to ubuntu-26.04-arm like the rest.
This reverts commit 9f5af383.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
* ci(docker): publish one image at a time, newest wins
Two workflow_run publishes could overlap, and whichever finished last set
the tags, even if it built the older commit. A single concurrency group per
workflow with cancel-in-progress fixes that: ci already cancels superseded
runs on the branch, so publishes arrive in commit order and cancelling the
older one leaves the newest commit on the tags. Raised in review.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>
* feat(docker): serve the app from any subpath with a runtime BASE_URL
BASE_URL was a build argument, so hosting under a subfolder meant building
your own image (or pulling the separate baseurl-it-tools tag, which is only
ever right for /it-tools/). Make it a runtime setting instead, so the regular
image works anywhere:
docker run -e BASE_URL=/it-tools/ ghcr.io/sharevb/it-tools:latest
The build is now path-agnostic. Vite's base is relative, so hashed assets and
lazy chunks resolve against the chunk that imports them, and the single
absolute anchor left in the output is a `<base href="/">` injected into
index.html. nginx rewrites that one tag per request (sub_filter) from the
normalised BASE_URL, and the app reads its base back from it at runtime
(src/utils/base-url.ts) for the router and for every URL it builds into
public/ -- import.meta.env.BASE_URL is meaningless in a relative build.
Also handled:
- both reverse-proxy styles: the prefix may reach the container (stripped by
the rewrite) or be stripped by the proxy first (nothing to do). The assets
location matches with or without it, so a missing chunk is still a 404
rather than the SPA shell.
- `/it-tools` redirects to `/it-tools/`, with a relative Location so the
scheme of the proxy hop does not leak into it.
- the PWA: manifest URLs are relative to the manifest, workbox precache
entries relative to the service worker, and the worker is registered
against the runtime base rather than the build-time one.
- BASE_URL is normalised (`it-tools`, `/it-tools`, `/it-tools/` all work) and
rejected if it is not a plain path, since it lands in an HTML attribute and
in an nginx regex.
Defaults are unchanged: with BASE_URL unset the rendered config and the
served page are what they were, except that index.html loses ETag/Last-Modified
to sub_filter. On a read-only filesystem the template cannot be re-rendered,
so BASE_URL is ignored there and the container now says so, like it already
had to for PORT.
Building with --build-arg BASE_URL still works but only moves the image
default; the baseurl-it-tools tag is now just latest with that default.
Closes sharevb/it-tools#403
* fix(docker): restore the PWA update reload, escape BASE_URL in the nginx regexes
Follow-up from review of the runtime BASE_URL change.
- registerSW() in autoUpdate mode reloaded the page when a newly deployed
worker took over (workbox-window's `activated` handler); hand-rolling the
registration dropped that, so a tab kept running the previous bundle until
it navigated. Reimplemented on `controllerchange`, guarded so a first
install -- which also claims the page -- does not reload. Verified by
counting document loads across an install and a simulated deploy: 1 load on
first visit, exactly 1 reload when a new worker takes over.
- The comment justifying the hand-rolled registration was wrong: register()
does resolve a relative URL against `<base href>`. The real reason is
workbox-window's own urlsMatch(), which resolves against location.href, so
a relative sw URL misidentifies the worker on a route deeper than one
segment. Comment now says that.
- BASE_URL allows `.`, which is a metacharacter in the two nginx regexes it
is spliced into: `/it.tools/` also matched `/itXtools/`. The entrypoint now
exports regex-escaped forms for those, keeping the literal value for the
sub_filter replacement and the redirect target.
- Dropped `$uri/` from try_files. Nothing in the build is a directory with an
index, so the only thing it ever produced was nginx's trailing-slash
redirect -- computed after the prefix rewrite, so `/it-tools/figlet-fonts`
answered `301 /figlet-fonts/` and bounced the browser out of the app.
- The sub_filter comment claimed index.html was the only response losing
ETag/Last-Modified; public/visualsubnetcalc/calc.html is HTML too and is
equally affected. Comment corrected.
- README: in the prefix-stripping proxy setup, `/it-tools` without the
trailing slash never reaches the container, so the proxy has to redirect it
(as the sample does). Said so.
- The new e2e test reloaded a page that had just started pulling in a tool's
chunks; WebKit cancelled the load ~1 run in 3 (the app reloads itself on an
aborted chunk fetch). It opens the URL in a second tab instead: 8/8 on
WebKit, 3/3 browsers green.
* fix(build): validate BASE_URL before it reaches the <base href>
From Copilot's review of #10.
The container validates its runtime BASE_URL, but the build-time one went
straight into an HTML attribute unchecked: a value carrying a quote rewrote
the tag around it, and one carrying a space or `..` quietly produced a page
that loads from the wrong place. Apply the same rule the entrypoint does --
a plain path of unreserved characters -- and fail the build otherwise.
Also: "can not" -> "cannot" in the read-only filesystem warning.
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Five fixes to the Docker image, found while running it-tools on
OpenShift, where containers run as an arbitrary UID. No application code
is changed.
Start on a read-only filesystem. `docker run --read-only` and Kubernetes
readOnlyRootFilesystem crash-loop the container, because
20-envsubst-on-templates.sh checks its output directory with
`[ ! -w $dir ]`. That only reads permission bits, so a read-only mount
passes the check, the write fails with EROFS and `set -e` stops the
entrypoint. 19-skip-envsubst-if-readonly.envsh now tests the directory
with a real write and, on failure, points NGINX_ENVSUBST_TEMPLATE_DIR at
a missing path so the envsubst script exits early. That is only safe if
the config in the image is already correct, and today it is nginx's
stock welcome config, so the Dockerfile renders the template at build
time as well. Writable setups are unchanged: the write test passes,
nothing is exported and the config is rendered at startup as before, so
a custom $PORT still works.
Skip IPv6 when the host has none. nginx.conf always listens on IPv6, so
where IPv6 is off nginx fails with `socket() [::]:8080 failed (97:
Address family not supported by protocol)`.
25-remove-ipv6-listen-if-unavailable.sh comments those lines out, using
the same /proc/net/if_inet6 check as nginx's own
10-listen-on-ipv6-by-default.sh, and exits at once when IPv6 works. It
probes the directory before editing, because `sed -i` rewrites through a
temporary file there, so a writable file in a read-only directory is not
enough, and it tolerates a failed edit so it can never stop the
entrypoint.
Match workers to the cpu limit. `worker_processes auto` counts the
host's cores, not the container's cpu limit, so the image starts 256
workers on a 256-core host in any container size. `docker run -m 192m`
is enough to be OOM-killed at startup. Setting
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE enables the script nginx
already ships. Containers without a cpu limit keep one worker per core.
This is the only change that affects a deployment that works today.
Return 404 for missing assets. All paths fall back to index.html, so a
missing build file returns 200 and text/html, and the browser reports a
confusing MIME error instead of a 404. /assets/ now skips the SPA
fallback. Sub-folder requests such as /it-tools/assets/... still match
`location /`, so those deployments do not change.
Stop remapping js. nginx.conf includes mime.types, which already maps
js, then maps it again, so every startup logs a duplicate extension
warning. mime.types has no entry for mjs, so mjs stays and js goes.
Signed-off-by: Sebastian Danielsson <sebastian.danielsson@proton.me>
* chore: upgrade toolchain to Vite 8, Vue 3.5, Vitest 4, TypeScript 6 and pnpm 11; adopt oxlint/oxfmt
- vite 4 -> 8.1.3 (rolldown-based: build.rollupOptions -> rolldownOptions,
drop optimizeDeps.esbuildOptions), @vitejs/plugin-vue 4 -> 6, plugin-vue-jsx 3 -> 5
- vue 3.3 -> 3.5.39, vue-tsc 1.8 -> 3.3.6, vitest 0.34 -> 4.1.9, jsdom 22 -> 29
- typescript 5.2 -> 6.0.3 with moduleResolution=bundler (baseUrl/node10 are
hard errors in TS 6, removed in TS 7); TS 7 RC not adoptable: its native
tsc lacks the JS compiler API vue-tsc needs (vuejs/language-tools#5381)
- unocss 0.57 -> 66 (presetUno -> presetWind3), unplugin-* to current majors
(unplugin-vue-components dtsTsx disabled: emits invalid declarations for
dotted component names)
- @vueuse/head 1.0.0 -> 1.3.1 (1.0.0 silently stopped applying page titles
under Vue 3.5)
- replace ESLint (@antfu config) + Prettier with oxlint + oxfmt; configs
mirror the previous style rules. Existing files are intentionally NOT
mass-reformatted (oxfmt has no brace-style/operator-position options to
match the old @antfu style) — only files with real changes are formatted
- pnpm 9 -> 11.10.0: settings move to pnpm-workspace.yaml, fresh lockfile
passing supply-chain policies, explicit allowBuilds decisions,
blockExoticSubdeps off (xlsx CDN override patches vulnerable npm 0.18.5)
- isolated-vm (17 MB) and onnxruntime-node (208 MB) stubbed via overrides:
native-only transitives already aliased to an empty module for the bundle
- elliptic overridden to npm ^6.6.1 (github fork tarball of
webcrypto-liner-shim unreachable from the build environment)
- CI: node 22 -> 24, all actions pinned to latest patch releases, automatic
Vercel workflows disabled (fork deploys via Vercel Git integration),
vercel.json: git.deploymentEnabled removed, buildCommand skips no-op vue-tsc
- Dockerfile: node:24-alpine, pnpm@11, ship pnpm-workspace.yaml and stubs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
* fix: resolve type, lint and runtime issues from the toolchain upgrade
vue-tsc 3 checks templates far more strictly than 1.8 and TS 5.7+ made
Uint8Array generic over its backing buffer. Widen shared component props
(InputCopyable, c-table, c-input-text, UnitsConverter), convert values at
call sites, fix invalid local .d.ts declarations, and repair issues the
new tooling exposed:
- WireGuard generator: pre-shared-keys checkbox used v-model:value which
never binds on a standalone n-checkbox (now v-model:checked)
- mask-closable="false" string attrs became real boolean bindings in
countdown/cron-alarm/time-alarm
- v-model casts (x as any) fail to compile under plugin-vue 6 + rolldown;
replaced with :value/@update:value split bindings
- invalid '::ffff::' IPv6 literal in ipv6registry.json, exposed by stricter
parsing in cidr-tools 11.3 (IPv4-mapped range never matched)
- fanger pinned to 0.3.1 (0.3.2 published without dist/)
- countries-and-timezones namespace imports, Vitest 4 snapshot format,
invalid ul-inside-p HTML in dead-pixel, test assertion outside it() block
vue-tsc clean; oxlint clean; vitest 665/665; vite build + PWA OK;
Playwright e2e 100/100; all 457 tool routes render without errors
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
* chore: drop whole-tree oxfmt from precommit instructions
The tree deliberately keeps its existing @antfu-era formatting; running
'pnpm fmt' (oxfmt over all of src) would reformat ~800 untouched files.
Format only the files you change, or run 'pnpm fmt' in a dedicated PR.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
* fix: escape backslashes before dots in parquet column keys
CodeQL flagged incomplete string escaping (js/incomplete-sanitization):
escaping '.' to '\.' without first escaping existing backslashes makes
column names containing backslashes ambiguous in naive-ui's nested-key
syntax. Escape backslashes first.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
* test: allow 30s for initial mermaid render in e2e
mermaid is a large lazy-loaded chunk; webkit on cold CI runners exceeds
Playwright's default 5s expect timeout even across retries.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
* refactor: replace 'as any' input type casts with proper typings
Copilot review on the upstream PR flagged the casts. c-input-text
renders any non-password type as a text input, so widen its type union
to include 'url' instead of casting; for naive-ui's NInput use the
documented input-props to set the native input's type=number.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit 906820336b271aa6d96ecb11efa03219bf869475)
* fix: reconcile lockfile with upstream sync; repair date-picker typing in Docker Label Generator
- fold upstream's new CodeMirror/picomatch dependencies into the pnpm 11
lockfile; add @lezer/highlight to optimizeDeps (kept from upstream)
- dockerfile-label-generator: n-date-picker emits a number timestamp,
not a Date — calling toISOString() on it would throw at runtime the
moment a date was picked. Type as number and convert via new Date()
- drop stray tsconfig.vite-config.tsbuildinfo build artifact; ignore
*.tsbuildinfo
vue-tsc clean; oxlint clean; vitest 665/665; vite build OK
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
* chore: keep upstream Vercel CLI deployment setup
The fork-specific Vercel changes (Git-integration deploys, disabled CLI
workflows, build:vercel command) are excluded from the upstream
contribution; upstream deploys via its own Vercel CLI workflows.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit ed182ec55648358556343e60e1667129acdbb966)
* fix: escape backslashes in Docker label values; raise global e2e expect timeout
- dockerfile-label-generator escaped quotes without escaping existing
backslashes first (CodeQL js/incomplete-sanitization, same class as
the parquets-reader fix): a value ending in a backslash would break
the generated LABEL quoting
- playwright: 15s global expect timeout — first paint of heavy lazy
chunks exceeds the 5s default on slow CI browsers (webkit), which
intermittently failed title assertions across retries
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit 5b3822e10113a49bc519661a5b01ad62660d56a9)
* Update .gitignore to include specific file types
* Add stats.html to .gitignore
* Delete tsconfig.vite-config.tsbuildinfo
* Delete stats.html
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>