Repository navigation
Conversation
A Node.js function that Chart reaches through $wgChartServiceUrl, so the wiki's host needs neither Node.js nor a looser shell memory limit. It bundles Wikimedia's chart-renderer at a pinned commit with esbuild, without its HTTP server. Chart cannot add headers, so the URL path carries a JWT that STS signs for the wiki's instance role with GetWebIdentityToken. The function checks its signature against the account's JWKS, its issuer, audience, subject and expiry before reading the body. No secret is stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WBX81tBhoTUA6zfe9snCjQ
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #230 +/- ##
=======================================
Coverage 96.05% 96.05%
=======================================
Files 10 10
Lines 1116 1116
=======================================
Hits 1072 1072
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 27, 2026
Member
Author
|
Closing: the renderer now lives in femiwiki/terraform-aws-mediawiki-chart-renderer, which ships the bundled code itself, and femiwiki/infra#1567 deploys it from there. Generated by Claude Code |
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.
Requested by lens0021 · project thread
Part of femiwiki/femiwiki#671. Adds
chart-renderer/, a Node.js function that Extension:Chart calls through$wgChartServiceUrl. With it, the wiki host needs neither Node.js nor a higher$wgMaxShellMemory. Node 22 does not start under the default 300 MBulimit -v, and it does not start under 600 MB either.How
It bundles Wikimedia's chart-renderer at commit
543b8eewith esbuild. OnlyrenderChart()andvalidateRequestParams()are used, not the express/service-runner server, so the zip holds one 4.8 MBindex.js(139 MB ofnode_modulesotherwise).No stored secret. Chart can't add headers, so the URL path is a JWT that STS signs for the instance role
FemiwikiwithGetWebIdentityToken. This is the same mechanismgoogle-subject-token.phpalready uses. The function checks the following before reading the body:iss,aud=chart-renderer,sub= the role ARN, andexpTokens live an hour and are refreshed every 15 minutes, so a URL leaked into a log stops working soon.
deploy.ymlgainsruntime/handlerper target. The uv steps skip Node targets, and a Node target runsnpm ci --ignore-scripts && npm testbefore zipping.test.ymlgets achart-rendererjob, and dependabot watches its npm lockfile.Measured locally
The five upstream examples render in 11–98 ms each, with about 80 MB RSS after loading and 113 MB peak, so 256 MB of memory should be enough. Cold load of the bundle takes 160 ms.
Order
The function itself (Node 22 on arm64, function URL, reserved concurrency) comes from a femiwiki/infra PR, which must be applied before this merges. Otherwise the deploy fails on a function that doesn't exist yet. The wiki side (token cron and
$wgChartServiceUrl) follows in docker-mediawiki.Generated by Claude Code