Release history
Changelog
Every new feature, fix and speed-up on s&box Explorer, newest first.
- Last 30 days
- 90
- Features shipped
- 233
- Fixes
- 218
- Days with changes
- 66
38 changes in September 2026 Clear filters
September 2026
3
-
Fix
1:41 AM
Mark staff with the logo in the badge instead of a red square
Details
The Facepunch logo PNG is fully opaque - every pixel including the corners is #EC1C24 - so using it as a faint backdrop painted a red square across the author column and underneath the badges, whatever the size or opacity. The logo now sits inside the Facepunch badge, where it is meant to be solid, and the staff tint carries the rest of the signal.
Post one no longer carries a Started this badge: the post number already says it, and dropping the second badge row takes the card from 216px to 169px.
e435c95 -
Fix
1:31 AM
Drop the broken score glyph and pull the staff watermark inside the card
Details
The score prefix was written as a star but stored mis-encoded, so it rendered as stray characters in front of every score. The Facepunch watermark was an 8.5rem layer offset -1.6rem past the corner, which the card had to clip and which sat underneath the badges and the score. It is now a 3.25rem mark inset inside the column.
c5af5ff -
Fix
12:42 AM
Link the right profiles, and render what Trix was hiding
Details
Every author link was built from the display name - /u/xraybeesx - which 404s, because a name is not an address. The API hands us the address in Author.Url, either a vanity (/u/weregonlose) or the steam id for the many people who never set one, and forumAuthorUrl() now uses it: vanity when there is one, steam id otherwise, and nothing at all when the id is not a steam id, which is how the Facepunch "Bot" account stopped pointing at /u/1. A private profile has no page here - player/{id}/overview 404s upstream for those - so those names link out to sbox.game rather than to a dead end on this site. 56 author links across the forum now resolve; before this, any author without a vanity url was a broken link.
Quotes were being deleted. Facepunch stores them as a Trix attachment whose visible content is an empty <span>, with the author, the text and the quoted post id in a JSON attribute - and the sanitiser strips attributes, so a reply quoting someone rendered with no quote at all, just the response. The sanitiser now expands that attachment into a real blockquote before the allowlist runs, links the attribution to the quoted post (an in-page anchor when it is on the same page, sbox.game when it is not), and keeps escaping everything it reads out of the JSON, so markup in a quoted post is text.
Link attachments got the same treatment: a YouTube url becomes a click-to- play facade - the thumbnail plus a play button, no iframe until someone asks for one, so a thread full of videos costs a few images rather than a few players and nothing is requested from Google on page load. Other urls stay as plain links. Only the four class names this code writes survive the sanitiser, so none of this lets an author style their own post.
The thread page itself is rebuilt around the two-column shape a forum wants: a bar carrying the date and the post number, an author column with avatar, name, badges and score, and the body beside it. Posts by Facepunch staff - read from organization/facepunch, 38 members, cached six hours - carry a Facepunch badge, a blue frame and the logo as a watermark; when you are signed in, your own posts are framed in green with a "You" badge, the way sbox.game marks them. The thread header now reads "Started by X · 15 days ago · 14 posts · 815 views", which meant caching those fields alongside the title when a listing is fetched.
Also: forum.css had the same token drift the jam sheet had - var(--border-color) and var(--accent-color) are not tokens here, so every rule naming them fell back to a hard-coded colour. All of it names real tokens now. The badge modifier rules had landed after the base rule at equal specificity and were losing to it, so the staff and "You" badges were rendering identical to a plain one; measured in the browser, fixed, re-measured.
Verified: 18 routes clean, 0 broken author links, every piece of forum text at or above 4.5:1, no horizontal overflow, 57 sanitiser checks covering the quote, embed and profile-link paths.
254f27e
1
-
Fix
11:47 PM
Escape every meta tag exactly once
Details
Every branch in meta-tags.php pre-escaped its dynamic parts with htmlspecialchars and then concatenated raw literals onto them - the " - s&box Explorer" suffix, the "s&box, sbox, packages" keyword list. The output then disagreed with itself about what that left: og:title, og:url, description and keywords echoed the value raw, so a bare & reached the attribute, while twitter:title, twitter:description and both image:alt tags ran htmlspecialchars over it again and double-escaped whatever the branch had already escaped. A package titled "Tom & Jerry" shipped one tag saying "Tom & Jerry" and another saying "Tom &amp; Jerry".
Rather than chase the escaping through ten branches, the values are normalised once after they are all built: html_entity_decode then htmlspecialchars, which lands on the canonical single-escaped form no matter how the branch assembled it, and is idempotent, so a value that was already correct passes through unchanged. Re-encoding means nothing can come out less escaped than it went in. The four duplicate htmlspecialchars calls at the output are gone.
og:url picks up the fix too - a query string's & was reaching the attribute bare on every paginated and sorted page on the site.
Checked across 23 routes: no bare &, no &amp;, no PHP notices, and og:title now matches twitter:title on all of them.
2671346
5
-
Fix
10:55 AM
Version theme stylesheet URLs so edge caches release them
Details
.htaccess stamps every .css with `public, max-age=31536000, immutable`, by extension and without checking for a version query. head.php's inline preloader already appends ?v=<bundle filemtime>, but loadThemeCSS and preloadAllThemeCSS built bare `/frontend/css/ee/NAME.css` URLs. Those are therefore pinned in browser and Cloudflare caches for a year with no revalidation.
The theme repair deployed correctly and is right at origin - a cache-busted fetch returns the new NAME-theme selectors, and the five removed themes 404 - but the edge kept serving copies from before the deploy, including 200s for files that no longer exist. Every future theme change would have been swallowed the same way.
Both builders now route through themeHref(), which reads the asset version off the data-asset-version attribute the inline script in head.php already carries, so the URL changes whenever the bundle does and no purge is required. Versioned URLs are what makes the immutable header correct, so the header stays as is.
fafdf79 -
Fix
10:36 AM
Repair the 14 themes that never rendered, then curate the rest
Details
Fourteen of the thirty-seven themes targeted `body.theme-NAME` while all four class-derivation sites (themes.php, UtilityController, SettingsValidator, generate-critical-css) produce `NAME-theme`. Nothing server-side ever supplied the prefix form, so picking any of them applied a class matching zero selectors and silently did nothing. theme-template.css taught the broken convention, so anything copied from it was born dead. That is why the retro/console set looked unfinished - it was never rendering. Renaming their selectors also fixes the critical CSS, which had been emitting rules for 14 classes that did not exist.
Removed five themes that are perceptually redundant, measured in OKLab rather than judged by eye: brutalist (distance 0.0 from amoled-dark - identical ground and accent), moonlight (identical accent to palenight), catppuccin-frappe and catppuccin-macchiato (keeping mocha, the darkest, and latte, the only light theme), and midnight-blue (invented rather than an upstream palette, and crowded by kanagawa and tokyo-night).
Raised muted-text contrast to at least 4.5:1 on 21 themes by moving each colour toward that theme's own body text, so palettes stay intact. Game Boy is the one exception and is left failing: an authentic four-shade DMG LCD spans too little luminance to reach 4.5, and the first attempt reached it only by making muted identical to body text, which destroyed the text hierarchy. It now uses the fourth authentic shade.
Stripped dead duplicated rule blocks from 20 files, including a second differing *:focus block in sunset and brutalist where the earlier one was already dead under the cascade. Fixed rust.css's corrupted .beta-badge selector and win95's mojibaked checkbox glyph, whose font-size also referenced --fs-title on a 13px mark.
Deleted DARK_THEMES and the dark-mode class: the class was added and removed by the theme manager and read by nothing, and the list named a phantom theme-gta6 while omitting some twenty real dark themes. Fixed isCurrentTheme, whose startsWith('theme-') test marked Default as selected while a theme was active. Added pruneUnknownTheme so a stored theme that no longer exists is cleared instead of requesting a 404 stylesheet on every page load.
All 32 surviving themes now carry a display name and a distinct icon; the picker previously showed one generic palette icon for every theme, under names like "Ps1" and "Win95".
tests/test_themes.php asserts every theme targets the class the API derives and that the unreachable form cannot come back.
9e4cc5c -
Fix
9:52 AM
Three more entry points, found by sweeping the rest
Details
Probing every read-only endpoint under /api/ turned up three more failures beyond the four already fixed, and the same root cause in a new disguise.
/api/search answered 500 with an empty body. It does require bootstrap, but on line 11, after SearchAnalytics and SearchIndex on lines 9 and 10 - and SearchIndex pulls in cache_manager, which calls CacheManager::init() and dies on DB_HOST before bootstrap has run. Requiring bootstrap is not enough; it has to come first. The body was empty because the guard around those requires catches Exception, and an undefined constant throws Error, so nothing answered at all. It now catches Throwable.
/api/package-comparison and /api/cache-management had no bootstrap. Both reach the database transitively through cache_manager rather than naming it, which is why the first version of this test did not see them. cache-management is the worse of the two: it checks $_SESSION['is_admin'] and a CSRF token before doing anything, but it fatalled before reaching either check, and bootstrap is what starts the session those checks read.
analytics-api used a float as an array offset when picking a median ($durations[floor($count / 2)]). intdiv says what was meant and clears the only two errors PHPStan reported for backend/api.
The test now checks the rule that actually holds: an entry point that requires anything reaching config - cache_manager, api_functions, PostgreSQLManager, SearchIndex and friends - must require config/bootstrap.php, and it must be the first require. That rule flags all three of these and nothing else.
Confirmed working and not touched: storage returns 400 for missing params, settings and featured-badges return 401, docs returns its listing, package-leaderboard, similar-packages, package-info, package-types, organization-details, code-search, player-extended and package-changelists all answer correctly.
27fa6e6 -
Fix
9:44 AM
Four legacy endpoints died on every request
Details
.htaccess maps /api/<name> straight at backend/api/<name>.php, so those files are entry points, but four of them were written as though something had already set the process up.
/api/themes and /api/profanity-words called apache_setenv() unguarded. That function only exists under mod_php, and this host runs PHP as FastCGI, so both died with "Call to undefined function apache_setenv()" before sending a byte. backend/api/settings.php already had the function_exists guard; the other two now match it.
/api/health and /api/player-history died with "Undefined constant DB_HOST" in PostgreSQLManager, because neither loaded config/bootstrap.php and so no config had ever been read. similar-packages.php, which works, requires bootstrap first; these now do the same. A health check that fatals when called is worse than no health check, since an uptime monitor sees HTTP 200 with a stack trace in the body.
Reproduced locally before and after: the CLI has no apache_setenv either, so running the files directly shows the same fatal, and now shows JSON. health.php reports status healthy with a live database check.
tests/test_legacy_api_entrypoints.php holds the rule rather than the fix: apache_setenv only behind function_exists, and every database-using entry point in backend/api loads bootstrap.
Not changed: /api/leaderboard, /api/counters and /api/activity-stream answer 503 "Redis not available" by design - RedisHelper::isAvailable() returns false whenever CACHE_DRIVER is not redis, and production deliberately runs the SQLite cache. Their /api.php/ equivalents work.
f096548 -
Fix
8:51 AM
Stop repeating the jam win Facepunch already flairs, link it instead
Details
Every one of the twenty category winners across the four jams already carries a contest-winner flair reading "Won Best Least in Tech Jam, January 2025", so the badge added in the previous commit was a second copy of it on every winner page. The flair says it better than a chip can, but it goes nowhere.
The flair is now the link: jamForFlair matches a flair's tooltip to a jam by name, longest title first so "Game Jam III" is never read as "Game Jam II", and the badge becomes an anchor to that jam's page. A jam already named by a flair is dropped from the chip row, so nothing is said twice.
The winner chip is kept for the case the flair does not cover it. All twenty winners are flaired today, but the entry search is missing seven of them, so the two sources still disagree and the chip is what shows a winner the flair has not caught up with.
Checked against the live API: gbonn.surreal renders one badge linking to Tech Jam, apetavern.micromayhem one linking to Game Jam II, limestudio.roundbound its unlinked "new" flair plus a Game Jam III entry chip.
0e8436a
7
-
Fix
10:31 PM
Apply the cache-key and shell-escape fixes to the cron that actually runs
Details
2e945aa fixed backend/api/auto-refresh.php, but the caller in production is tools/scheduled-refresh.php, run from cron every 30 minutes. Minutes after the deploy it started a refresh for a "user" named player_all_packages_76561198162354937 - a cache key the player pages write, read back as a username by the same str_replace bug. It now requires the expected prefix and skips anything else, and the name reaches the shell through escapeshellarg rather than bare double quotes.
The same pattern is in tools/cron-refresh.php, tools/refresh-endpoint.php, tools/cleanup-invalid-cache.php and admin/refresh-status.php. None of them run: they are not in the crontab, nothing references them, and the admin page only displays. Left alone.
f600468 -
Fix
10:19 PM
Read the prune list from a file, since the host has no /dev/fd
Details
The first deploy to run tools/deploy-prune.sh printed
tools/deploy-prune.sh: line 29: /dev/fd/62: No such file or directory prune: moved 0 file(s) deleted since 09cea795
The host's bash has no /dev/fd, so the process substitution feeding the loop failed and the loop read nothing. "moved 0 file(s)" was true only because this deploy deleted nothing; a deploy that removed files would have reported the same and left them live. The list now goes through a temp file. Redirecting a pipeline also exposes its exit status to set -e, and git check-ignore exits 1 when no path is ignored, so the pipeline is guarded.
Verified on the server: process substitution fails there, the temp-file pipeline lists all 14 files deleted in 09cea79. The test now also rejects process substitution, which no local shell would have caught.
5d19018 -
Fix
9:21 PM
End the refresh worker's retry loop, and make deploys remove deleted files
Details
The background refresh failed 204 of its last 218 runs and retried the same handful of orgs every few seconds, attempt 309 and counting. Three bugs:
- BackoffStrategy cast 30 * 2^(n-1) to int before capping it. Past ~58 failures the float no longer fits and PHP casts it to 0, so the wait collapsed to nothing. It now caps first; a long streak waits 30 minutes.
- The worker treated an org with no packages as a failed fetch. codira, shadowstudio and lore are real orgs with zero packages, so they could never succeed. Only a failed request is a failure now; an empty list is cached.
- auto-refresh read every TYPE_USER_PACKAGES cache key as a username, including the player_all_packages_{steamid} keys the player pages write, and started workers for a user of that name. Keys without the expected prefix are skipped, and the name now reaches the shell through escapeshellarg.
The worker also re-queried eleven types for every org, one of them "texture", which Facepunch ignores and answers with the whole catalogue. The per-type sweep now runs only when the first pass hit its 2,000 cap, over the types that exist, including clothing, sound, vsnd and tmat, which it never asked for.
Deploys never removed anything: rsync has no --delete, so all 14 files removed in 09cea79 stayed live, and the dropped 2027 theme stayed in the theme picker. tools/deploy-prune.sh moves files deleted in git since the recorded build into ~/sbox-backups, skipping whatever .deployignore excludes, so server-owned paths are never touched. It does not use .gitignore, which ignores /tools/* and would have left deleted cron scripts executable. A failure only reports; the deploy carries on.
Also: browse chips for Addons, Collections, Entities and Terrain Materials (each larger than the Prefab or Shader lists), German "Prefabs" and "Sounds" in place of "Fertighäuser" and "Klingt", a successful webhook no longer written to error_log, and the comments removed from code deployed earlier.
2e945aa -
Fix
6:19 PM
What the pages told visitors that had stopped being true
Details
- Org links: org pages and the classic package sidebar read website, X and Discord off the Org object inside package results, which Facepunch now fills with Ident, Title and Thumb only. No org page showed its links or summary. They now come from the organization record (fetchOrganization, already cached 5 minutes), through orgSocialLinks(), which also stops owner-typed non-http(s) values becoming links and points handles at x.com rather than twitter.com.
- Sound Files filter: it asked for type:soundfile, which does not exist, and Facepunch ignores an unknown type - so it listed all 33,000 packages. It now asks for vsnd (8,876 sound files); /t/soundfile/ redirects there, and the label key is renamed in all 30 languages.
- Empty search: the advice to "try different boolean operators" was wrong - Facepunch search matches AND, OR and NOT as words ("car AND boat" finds more than "car"). A search with no results now says so, instead of suggesting the server might be down.
- Error state: the heading rendered as the raw key "common.errorLoadingPackages", and "contact support" pointed nowhere.
- Translations: a key missing from a language rendered raw, because the English fallback applied only when a whole file was missing. Every one of the 29 languages lacked the same 66 keys. Languages are now layered over English key by key.
chore(views): drop the comments added with the stale-copy fixes
f5c992b -
Fix
5:23 PM
Clear what the production logs were full of, and a few real bugs
Details
Found by reading error_log, the app log and ~/error_log on the server:
- Client errors: ~90% of the app log was unactionable. One crawler's bare "Script error." (154 in ten days), Applebot and Mediapartners-Google running tippy before Popper had loaded (107), and ResizeObserver loop notices. client-errors.php now drops those three before logging.
- form-validation.js called matches() on window/document, which Firefox hands a captured blur listener: 51 TypeErrors in ten days.
- The Facepunch circuit breaker counted only in Redis, so it did nothing in exactly the outage it exists for. It now falls back to APCu, verified on the production host with Redis absent.
- Bots asking for ?page=913198702 became skip=22829967525 and a 400 from Facepunch. getCurrentPage() caps at 10,000 (Facepunch lists ~33,000 packages, ~1,300 pages), and hidden gems uses it.
- 404s on org news posts join the suppression list; their links outlive the posts.
- fetchPackagesBatch remembers a failed ident for five minutes instead of refetching and relogging it on every view, and a 404 is not an error.
- Webhook "cooldown active" skips were ~2,000 error_log lines a month of the cooldown working; they go to debugLog.
- newspost.css used --text-color, which nothing defines. It resolved to the inherited --text-secondary, so that is now named explicitly and the CSS integrity check passes again.
- CSP (report-only): AdSense's googlesyndication, doubleclick and adtrafficquality hosts, and a frame-src, whose absence sent every ad iframe to default-src 'self'. The live .htaccess is patched by hand as before.
4ab05fa -
Fix
2:22 PM
Stop the gc_divisor startup warning and the Steam key in error_log
Details
The "PHP Startup: session.gc_divisor must be greater than 0" lines were not the site. getCliPhpBinary() started background jobs with the host's /usr/local/bin/ea-php84, whose php.ini sets the divisor to 0; the site itself serves from alt-php84, which is fine. Each spawn inherited the docroot as its working directory, so the warning landed in our error_log roughly every half hour. The CLI next to the serving PHP (PHP_BINDIR/php) now comes first: same version, same ini, no warning.
Steam outages also logged full request URLs, and every Steam Web API URL carries the account key. HttpService and SteamHttpClient now replace the key= value before a URL reaches a log line or exception message.
a31eb90 -
Fix
9:08 AM
Serve the last good catalogue, and keep the address that works
Details
"Unable to load skins data right now" was showing most of the time, and it was mostly this site rather than sboxskins.gg, which answers every page in about 0.2s. Two faults, each enough on its own.
The fallback never worked. Production caches in SQLite, and there a plain CacheManager::get() of an expired entry deletes it. fetchSkinsCatalogue() did that read first, then - once the fetch had failed - asked for a stale copy of the entry it had just destroyed. So any failure upstream reached visitors as an empty market for the ten minutes the failure was remembered. The last catalogue that loaded is now kept as its own entry for a week and served whenever a fetch fails; tests/test_skins_fallback.php reproduces the old behaviour against those SQLite semantics and fails on master.
The address pinning discarded the one address that works. sboxskins.gg's DNS rotates through a pool, and from this host part of it is unreachable: 216.150.16.1 and .16.129 time out every time, .16.65 and .1.129 answer in 0.2s. The remembered good address was only used when the current DNS answer happened to contain it, and it expired after ten minutes - shorter than the fifteen between catalogue refreshes - so each refresh gambled on the rotation again, and an answer of two dead addresses failed outright. It is now tried first regardless and kept for a day; it is re-proven on every use, and TLS still checks the certificate against the hostname.
fetchCachedEndpoint(), added for the jam and platform-stats pages, had the same stale-read pattern and so the same hole. It keeps a last-good copy too, so an outage at Facepunch shows slightly old jam data rather than none.
9f8a9b1
8
-
Fix
8:03 PM
Cover cdnjs, the loading-screen videos and GA's region host
Details
Second pass over the report-only log, from a package detail page rather than the listings.
cdnjs is a real dependency, not stray markup: Font Awesome loads on the profile and package pages and highlight.js on /mcp-knowledge, so it needs script, style and font rather than removing.
media-src was never declared at all, so the loading-screen videos fell back to default-src 'self' and every package page with one logged a violation.
The analytics host is the subtle one. connect-src already listed region1.google-analytics.com, but GA4 collects on region1.analytics.google.com
- a different domain - and picks the region by visitor location, so the
wildcard covers the other numbered hosts rather than waiting to learn each one from a fresh console.
1842d79 -
Fix
7:54 PM
Allow the hosts the service worker and Cloudflare actually use
Details
The report-only policy has been logging two violations on every page load.
Both are false alarms in the sense that nothing is blocked, but they bury anything real. service-worker.js caches thumbnails through fetch(), and a service worker fetch is governed by connect-src even when the response is an image - img-src already permits these hosts, which is why the pictures render while the console fills up. Cloudflare injects its own beacon script, so static.cloudflareinsights.com was never going to be in a policy we wrote.
The docroot .htaccess is excluded from the rsync, so this file documents the policy rather than shipping it; the live header needs the same edit by hand.
e5f605e -
Fix
5:34 PM
Shim requestIdleCallback, which Safari was throwing on
Details
The app log is 285 reports a day of "Can't find variable: requestIdleCallback", by an order of magnitude the largest entry in it. That is Safari's wording: Safari only shipped the API in 16.4 and older iOS has none, and three call sites used it bare.
The costly one is in theme-manager's UI init, which throws partway through, so date pickers, sliders, tags, the lightbox, charts, drag and drop, gridstack and masonry never initialise for those visitors. Nothing is visible in Chrome, which is why a full front-end audit went straight past it - it only showed up in the errors real browsers were reporting back.
Shimmed once at the top of main.js: it loads first in the shared runtime and everything after it is deferred, so it is defined before any caller, and a native implementation is left alone.
Reproduced against production with the API deleted before page scripts run - "ReferenceError: requestIdleCallback is not defined" - and confirmed gone against the same page with the shim.
bf85998 -
Fix
5:30 PM
Send expected skins-host timeouts to the app log
Details
sboxskins.gg is a small community server that is often slow, and its connect timeouts were the bulk of what was left in error_log - crowding out the faults that actually need someone to look.
They are not faults. Everything downstream already handles them: the failure is remembered for ten minutes and callers fall back to stale data, which is the whole point of the cache added earlier. So httpCode 0 from that host now goes through Logger::warning into logs/app-<date>.log, where it keeps more context than error_log ever had - endpoint, request id, IP, the cURL error - and stops sitting next to real problems.
A real status code still goes to error_log, because a 403 or a 500 means something changed upstream. So does a malformed body.
With the per-attempt suppression already in HttpService, an unreachable skins host now writes nothing to error_log at all.
fab45db -
Fix
5:17 PM
Stop a Redis outage writing a log line per cache lookup
Details
RedisCache::init() guarded on $redis being null, but a failed connect sets $redis back to null in the catch - so the guard never tripped. Every isAvailable() call reconnected from scratch and logged again, which is why a 70-second outage on 4 September put roughly 140 identical "Connection refused" lines in error_log: one per cache lookup rather than one per request. Each of those also paid a connect attempt before failing.
Tracked with an explicit attempted flag now, set before anything that can throw, so one attempt is made per request whatever the outcome.
Also suppresses 404s for organization/ lookups, which the list beside it already does for player/, package/get/, package/versions/, news/package/ and package/stats/. A miss there means the ident does not exist upstream - a stale link or a bot walking the URL space - and because any unknown top-level path is resolved as an org ident, every probe for /env, /weapon or /crashes wrote a line. Non-404s from the same endpoints still log.
tests/test_log_noise.php pins both, including the exact state the storm ran in: no handle, but already attempted.
f57d3a2 -
Fix
6:34 AM
/claim-org 404s in production
Details
The route was registered only in router.php, which serves the dev server. Production goes through .htaccess into index.php and reaches routing_logic's list instead, so the page worked locally and returned 404 on the live site - found by sweeping production after the deploy rather than localhost.
Every other route in router.php's $frontendRoutes is already in routing_logic. claim-org was the one gap.
Verified by serving the site through a router that mimics .htaccess - straight to index.php, no dev-only route table - where it now redirects to login like its siblings instead of 404ing.
3b5c1a6 -
Fix
6:05 AM
Keep the cPanel .htaccess out of the rsync
Details
The docroot .htaccess is tracked here but is cPanel's file, not ours. It carries the MultiPHP handler block, which cPanel regenerates and marks do-not-edit, and which the repo copy has never contained - so a deploy overwrote it, AddHandler went away, .php stopped executing and the site served an Apache directory listing until the original was restored from backup.
That is recorded in the changelog but nothing stopped it happening again: the file was still tracked and still absent from .deployignore, so the next deploy would have repeated it exactly.
The rewrite rules the repo copy adds were checked after that incident and are redundant against the server copy, and the server copy's protections are confirmed live - config.php, logs/, data/, .git/ and .env all answer 403 while index.php renders. So the server keeps ownership of this one file.
config/.htaccess and mcp/.htaccess are ours and still deploy.
e0bad46 -
Fix
5:52 AM
Build a sitemap for this site, and let the deploy carry it
Details
robots.txt advertises https://sbox.grimtech.co.uk/sitemap.xml. The file on the server listed thirteen URLs and every <loc> pointed at https://sbox.game/ - the upstream platform, not this site - so every URL handed to a crawler was the wrong domain. It also named /stats and /org/<name>, which are not routes here.
Nothing in the repo generated it, and .deployignore listed /sitemap.xml alongside .env and the server-owned config, so no deploy could ever correct it. tools/generate-sitemap.php builds it from this site's real routes and runs as part of npm run build, the same hook the changelog uses.
Package types come from the platform, filtered. Anyone can coin a type by publishing with it, so the raw list is mostly single-package noise - "exe", "jpg", and one obscenity that would have gone straight into a file submitted to Google. ShowOnIndex plus a count threshold leaves seventeen real ones. --verify checks every URL against a running server before writing, so a sitemap of 404s cannot ship; all 38 currently answer 200.
The same exclusion was hiding a second problem. meta/ holds dev tooling next to meta/changelog.json, which frontend/changelog.php reads at runtime, and the whole directory was excluded - so the build regenerated the file and rsync then dropped it. The live changelog stops at April 2, 2026 and shows ten commits. The tooling is excluded by name now and the data ships.
SITE_URL is defined rather than assumed: admin/warmup-redis.php already referenced it with a hardcoded fallback that was always the one being used.
756c326
14
-
Fix
4:14 PM
Deny the dev tooling still sitting in the docroot
Details
composer.lock, package-lock.json, phpstan.neon, phpunit.xml, router.php and three JS configs were uploaded by hand before the deploy system existed and were serving 200 to anyone. .deployignore keeps them out of new deploys but the rsync has no --delete, so it cannot remove them. The lockfiles are the part that matters: they hand out exact dependency versions to check against known CVEs.
Named individually rather than by extension, because manifest.json and locales/*.json are fetched by the site itself.
743ec9d -
Fix
9:58 AM
Repair org search, package paging and the MCP org field
Details
Three faults surfaced by the production error log.
org/list has returned 404 since at least June and Facepunch has no bulk replacement (organization/<ident> serves one org at a time). Both callers caught the failure and returned an empty array, so organisation search quietly found nothing rather than reporting a problem, then cached that empty result for an hour. Orgs are now recovered from package search: q=org:<ident> is an exact lookup and a plain term surfaces the orgs owning matching packages. Verified live: "face" finds facepunch, "rat" finds rats and ratman, "studio" finds six, where all three returned nothing before. Both call sites now share one implementation.
package/find silently ignores page and count; only skip and take work. Four call sites sent page/count, so /player/packages returned the same first results on every page and handed back 200 items where the caller asked for 20, while the response advertised correct pagination. Now skip/take, with the offset from Pagination::offset so the existing int32 clamp applies.
mcp/tools/package.php read Org as a string in five places. It is an object everywhere else in the codebase, which is why the log carried a steady drip of "Array to string conversion" and the tool printed Array where the organisation name belongs.
Also stops the settings API writing two INFO lines to the error log on every request, which was most of that file's volume.
tests/test_api_params.php locks all of it in.
42dbb8c -
Fix
9:34 AM
Confirm dialog swallowed the click on form-level data-confirm
Details
A submit button inside a form carrying data-confirm resolves through closest() to the form, not the button. The click handler then called .click() on the form, which has no activation behaviour, so nothing happened: the dialog appeared, you pressed Confirm, and the delete never ran. Fourteen actions across eight pages were affected (announcements, cleanup-invalid-users, donations, manifest-removals x3, mcp-api-keys x5, mcp-knowledge, moderation-logs, webhook-settings). The nine that put data-confirm on the button itself worked, which is why the dashboard and player-history tested fine.
The click handler now defers to the submit handler for forms.
tests/admin-confirm.test.js covers both entry points in jsdom, including cancel and Escape. Verified it fails without the fix.
91505cc -
Fix
4:39 AM
Close CSRF and XSS holes in the admin panel
Details
CSRF: player-history, steam-friends-cache and warmup-redis handled POST with no token check at all. player-history's actions include TRUNCATE of all three player_history tables and exec() of the collector scripts, so a logged-in admin visiting a hostile page could be made to wipe that data. All three now validate and carry a token field, and badge-management drops its local 16-byte, !== comparison in favour of the shared 32-byte hash_equals helpers (its version also left csrf_token_time unset, disabling token expiry for every other page sharing the session).
XSS: Advanced Analytics rendered Steam usernames and avatar URLs into innerHTML unescaped, and Org Claims did the same for usernames, org idents and review notes, including an org ident spliced into an inline onclick="revokeOrg('...')". Steam personas and org idents are user controlled, so both were stored XSS into an authenticated admin session. The revoke button now passes its ident through a data attribute.
The activity heatmap's two third-party scripts get SRI hashes and crossorigin, so a compromised unpkg or d3js.org fails closed.
7491ab8 -
Fix
4:35 AM
Repair buttons, tables and icons that had no styles behind them
Details
- api-test.css was written against --card-bg, --border-color, --hover-bg and --text-color, none of which exist. Every rule fell through to a hardcoded dark value, so API Test ignored the theme and was unreadable on the light ones. Rewritten against the real tokens.
- 11 buttons across five pages used class="btn-primary" and friends without the base .btn, which only supplies colour: no padding, radius or alignment.
- .btn-action on Refresh Status was defined nowhere at all.
- table-responsive (also undefined) becomes admin-table-container, so those tables scroll instead of overflowing on narrow screens.
- 32 <i class="material-symbols-rounded"> become <span>, matching the rest of the codebase.
- Adds the .admin-badge-info, .badge-sm, .org-cell, .org-link, .timestamp and .pending-card-* rules that markup referenced but nothing defined.
bd35f08 -
Fix
4:31 AM
Drop the dead Migrate Schema control and route
Details
The Reputation page offered a 'Migrate Schema' button that POSTed to backend/api/migrate-reputation-schema.php, a file that does not exist and is not in git history; router.php carried a matching dead route. Removed both rather than inventing a schema migration.
Both reputation recalculation buttons now report through adminToast instead of alert(). Their endpoints are left alone: recalculate-reputation.php covers users with claimed orgs, recalculate-all-users-reputation.php covers everyone in batches, and they are not interchangeable.
198038e -
Fix
3:59 AM
Resolve /api/* by pattern so production matches the dev server
Details
/api/package-leaderboard had no rewrite rule, so it fell through the catch-all to backend/api/package-leaderboard, missed, and landed on the front controller. The browser asked for JSON and got the homepage back, at HTTP 200, so the In-Game Leaderboards panel showed zero entries with no error anywhere. It worked on localhost the whole time, because router.php has the route.
That is the real problem: router.php and .htaccess are two hand-kept lists of the same thing and they drifted, 13 routes against 5. Missing alongside package-leaderboard were manifest-removal-request, steam-friends, kofi-webhook and four reputation endpoints.
.htaccess now resolves by pattern, trying <name>-api.php then <name>.php, each guarded by an -f check so a name only resolves when the file exists. The character class allows no dot or slash, so neither rule can be walked out of the directory, and everything reachable this way was already reachable through the catch-all, so nothing is newly exposed.
Also drops the military_tech icon from the leaderboards heading: nine of the eleven package sections have no heading icon.
And wires ?refresh=1 into fetchSpecificPackage, admin-gated, matching the switch that already works on player profiles and org package lists. Package pages were the one place it silently did nothing, leaving no way to bypass the hour-long cache except waiting.
5aa42db -
Fix
3:38 AM
Cap pagination offset so crafted page numbers cannot 500
Details
A crawler walking synthetic pagination reached
package/find/2/?skip=7202577550&take=25&q=849152367+type:model
and every hit logged an upstream 500.
Probed the endpoint: Facepunch holds skip in a signed 32-bit int. skip=2147483647 returns 200, skip=2147483648 returns 500. Anything past TotalCount returns 200 with zero packages, so deep offsets are useless long before they are harmful.
Pagination::parse floored the page at 1 but had no ceiling, so any integer a visitor put in the URL became an offset. Every controller reads its page from there, so the cap goes in the one place rather than in each of them. Page is clamped rather than the offset, so the page number a caller gets back still matches the results it is given.
browse-api.php and code-search-api.php read skip straight from the query string and bypass the parser; code-search-api did not even floor it at zero. Both now go through Pagination::clampOffset.
MAX_OFFSET is 100000: far below the overflow, and more than ten times the largest package type (model, under 10000 entries), so it can only clip requests that would have returned nothing.
The test caught a bug in the first version of this fix: at PHP_INT_MAX the offset multiplication overflows to a float and the int-typed clamp threw a TypeError, which would have been a 500 of our own making.
9a2fd78 -
Fix
3:34 AM
Ignore build output so the clone stays deployable
Details
cPanel will not deploy a repository whose working tree is dirty, and .cpanel.yml runs npm run build inside that clone. frontend/css/dist was untracked rather than ignored, so the build left the tree dirty and cPanel reported deployable: 0 with no error anywhere: the push was accepted, the checkout advanced, and the tasks silently never ran.
Ignoring both dist directories keeps the tree clean across builds. The old negation lines were inert anyway, since nothing ignored those paths in the first place.
acc26c6 -
Fix
3:22 AM
Stop shipping .htaccess, cPanel owns it
Details
The repo copy lacks the cPanel-generated PHP handler block, which is marked 'do not edit' because cPanel regenerates it on any MultiPHP change. Deploying the repo version therefore removed the AddHandler directive, .php stopped executing, and the site served an Apache directory listing until the original was restored from backup.
Verified afterwards that the five /api/* rewrite rules the repo copy adds are redundant: /api/code-search, /api/package-changelists, /api/organization-details and /api/player-extended all return 200 on the restored file. The only other difference was a .dump deny, which belongs on the server copy.
84d191c -
Fix
3:05 AM
Stop calling the Facepunch storage endpoints that always 401
Details
The error log was filling with lines like
HttpService Error (401): - URL: .../storage/query?steamid=...&package=...
one per visit to the storage tab of the data explorer.
Probed the endpoint directly. storage/query and storage/get return 401 for every package and every steamid, including pcjr.oreworks, whose package/stats/2 data is public and returns 200 from the same host. They answer only to a Bearer token minted by a live in-game client session, and Steam OpenID sign-in cannot produce one. storage-explorer.php has said as much in its own UI copy since it was written; the code just never acted on it.
So the request could never succeed. Both service methods now return the failure locally without leaving the process, keeping the exact shapes their three callers already switch on: the 401 array for query, null for get. The explorer page renders identically, because it gates on the httpCode key either way.
storage-api.php was separately answering 200 with "success": true wrapped around the failure payload, which told callers nothing. It now returns 501 with the reason.
Test asserts the shapes hold and that neither method makes a network call, using elapsed time as the proof: a real round trip measured about 200ms, these return in microseconds.
b3ee80a -
Fix
2:19 AM
Sweep leaked scratch files, and guard the tool scripts
Details
Rate limit counters and refresh locks were only ever cleaned up lazily, by the next request for the same identifier. An IP that visits once, or an org refreshed once and never again, left its file on disk permanently. That had grown to roughly 8000 files, which had to be deleted by hand. Redis is disabled in production, so the file fallback is the live path, not a contingency.
RateLimiter::gc() removes counters whose window has long closed, and runs on roughly 1 in 500 fallback writes so the directory maintains itself. It reads mtime rather than opening files, so clearing a backlog does not parse thousands of JSON blobs. mt_rand rather than random_int for the sampling: it needs no entropy guarantee and sits in a path that must never throw.
Refresh locks leak the same way but are written from five places into three directories, so cache-sweeper.php covers all of them in one place. It sweeps at 300s against a 120s lock timeout, leaving a wide margin so it can never pull a lock out from under a refresh that is still running. The test plants a 5-second-old lock and asserts it survives.
The sweep piggybacks on the existing scheduled-refresh cron rather than needing an entry of its own, and runs before the refresh work so a lock left by a killed run does not block the current one.
Also closes two holes found while making cleanup-cache.php reachable over HTTP, since nothing in .htaccess blocks backend/tools/:
- notify-package-update.php checked only that the X-Cron-Key header was present, never its value, so any value at all got in
- check-package-updates.php had no guard whatsoever
Both send push notifications to every follower. tool-auth.php is now the single check all four scripts route through: CLI, a signed-in admin, or CRON_KEY compared with hash_equals. It fails closed when the key is unset or still the placeholder, so the window between deploying and configuring is shut rather than open.
cleanup-cache.php preflights its own dependencies by name, because production runs with display_errors off and this deploys over FTP, where a half-finished upload otherwise surfaces as an unexplained blank 500.
4298dff -
Fix
2:19 AM
Show every live game, and make the cards visible
Details
Two separate bugs made the page look mostly empty.
The trending grid rendered every card at opacity 0. The CSS gates card opacity on a .visible class that nothing in the codebase ever added, so the cards were in the DOM, taking up layout space, and invisible. Only readers with prefers-reduced-motion saw them, because that media query forces opacity back to 1, which is presumably how it shipped. filter() already knows which cards should show, so it toggles the class there rather than adding an IntersectionObserver; that covers first paint, tag filtering, search and Show More in one place.
The counts were also wrong. The API has no sort that surfaces live games: every sort: token it does not recognise (players, active, online, usersnow, hot) falls back to the same default order, and live games are scattered right through all 1600+ results. One take=100 page saw about a third of them. It now sweeps every page concurrently, with take=500 because that is the hard cap, deduplicating by FullIdent since pages are fetched in parallel and the result set shifts underneath them.
Playing Now 68 -> 148, Active Games 21 -> 63.
The grid slice was also a flat 50, which would cut live games off the bottom the moment more than 50 had players in them.
8fc4311 -
Fix
2:18 AM
Correct the Facepunch endpoint contract
Details
Four things were wrong about how we call public.facepunch.com:
The leaderboard endpoint was still on its pre-versioning shape and returned nothing. It now takes a stat name, defaulting to kills. The stat is validated against a character whitelist and, separately, rejected if it is made only of dots: curl normalises dot-segments in a path, so a stat of ".." would silently rewrite which endpoint the request actually hits.
The TTL map keyed leaderboard responses on "package/leaderboard", which stopped substring-matching once the stat moved into the path, quietly downgrading those entries from 600s to the 300s default. Keyed on "/leaderboard/" now.
package/find/2/ takes skip and take, not page and count, and caps take at 500 (take=1000 returns a 400). count=100 was being ignored, so the caller silently got the 200-item default.
Code search exposes the kind and year facets the API already supported. kind is matched against a whitelist because the API compares it case-sensitively and silently returns nothing for a near miss.
tests/test_facepunch_endpoints.php covers all of it, including that the kind buckets partition the total and the year buckets sum to it.
545ac53
Generated from the project's commit history whenever the site is deployed. Times are server time.