Commit Graph

18 Commits

Author SHA1 Message Date
AJ ONeal
70067a620e fix(api): only apply libc filter when caller pinned a meaningful libc
filterReleases unconditionally rejected libc=musl entries unless the
host was libc=musl, even when the caller never specified a libc in
the request. serve-releases.js defaults the libc parameter to 'libc'
(the catch-all glibc-host bucket the installer-side resolver uses),
so the website's release table and the WEBI_RELEASES probe were both
stripped of every musl entry that the cache actually contained — even
though the installer would happily consider those builds on a glibc
host (its waterfall is [none, gnu, musl, libc]).

Treat libc='libc' (and missing) as 'no preference' so the filter only
runs when the caller pinned a real libc (musl, gnu, msvc, etc.).
Specific-libc queries (?libc=musl, ?libc=gnu) still filter exactly as
before.
2026-05-08 11:48:24 -06:00
AJ ONeal
07ad89ce46 ref(builds-cacher): cache-only Node server, no fetches or writes
Make _webi/builds-cacher.js and _webi/transform-releases.js read
exclusively from ~/.cache/webi/legacy/<name>.json and remove every code
path that fetched from upstream or wrote to disk. The Go cache daemon
(webicached) is now the sole writer; the Node server is a thin reader.

builds-cacher.js:
- Resolve cache files via Os.homedir() + '/.cache/webi/legacy/' instead
  of the cacheDir argument. Drop the 'caches' constructor parameter.
- Remove getLatestBuilds / getLatestBuildsInner — they require()d
  per-package releases.js modules, fetched upstream, and wrote
  <yyyy-mm>/<name>.json + .updated.txt to disk.
- Remove the process.nextTick stale-refresh hook in _doGetPackages.
  Cold reads return what's on disk; if the file is missing, return
  empty meta instead of fetching.
- Remove freshenRandomPackage and its supporting state
  (bc._staleNames, bc._freshenTimeout, bc._staleAge). The hourly
  background freshener competed with webicached for the same files.
- In getProjectTypeByEntry, decide selfhosted vs valid by probing for
  the cache file rather than require()-ing releases.js. Drop the
  not_found / 'PROBLEM/SOLUTION/npm clean-install' diagnostic in
  getProjectsByType — the cache-file probe replaces the module-load
  failure mode.

transform-releases.js:
- Remove Releases.get and the _normalize import. Replace
  getCachedReleases's fetch+race+stale-age machinery with a single
  Fs.readFile of ~/.cache/webi/legacy/<pkg>.json.
- Drop the in-process version re-sort in createFormatsSorter; the
  cache file is already version-sorted by webicached, so the sorter
  only re-orders within the same version.

No callers' public signatures change. Every other file is untouched —
the per-package releases.js modules, _common/*.js fetchers, and
_webi/normalize.js still exist on disk but are no longer reachable
from the request path.
2026-05-08 11:48:24 -06:00
AJ ONeal
14cebeeb61 ref(webi): complete transition from 'request' for 'fetch' 2024-12-16 00:01:13 +00:00
AJ ONeal
15098ba1d2 ref: use Releases.latest() and Releases.sample() 2024-09-13 08:33:32 +00:00
AJ ONeal
546aee8fbb ref: releases.js => installers.js 2023-12-12 02:57:03 -07:00
AJ ONeal
3966d3adf8 fix(releases): bump timeout to 15s for uncached github requests 2023-12-12 01:44:11 -07:00
AJ ONeal
3c05298c6a fix(arm): don't match 'arm64' for 'arm' without bit or version specifier 2023-11-14 10:55:07 -07:00
AJ ONeal
fc36f3e93e ref(webi): add explicit libc detection 2023-11-06 18:50:02 -07:00
AJ ONeal
5dd3a79faa ref!: release info from git tags 2023-10-31 15:09:48 -06:00
AJ ONeal
a3954bad3d ref(alpine): enable musl filtering 2023-07-05 20:03:04 +00:00
AJ ONeal
9e523f0c0e fix(windows): detect Windows ARM64, with AMD64 fallback 2023-05-28 23:46:36 +00:00
AJ ONeal
e5685b9025 ref: make fresh/stale/expires cache access more readable 2023-02-13 19:23:14 +00:00
AJ ONeal
6c76ff728c hotfix: never hard fail when usable data is available 2023-02-13 19:08:54 +00:00
AJ ONeal
2bcc903f80 hotfix: don't use debug stale times values in production, DUH! 2023-02-13 18:44:15 +00:00
AJ ONeal
90a919736b fix: allow installers without releases 2023-01-30 07:16:00 +00:00
AJ ONeal
bab564bdeb fix(k9s): add release update timeout 2023-01-24 18:02:53 +00:00
AJ ONeal
21c668b4b7 chore(fmt): set .prettierrc.json.trailingComma = "all" 2023-01-24 17:54:39 +00:00
AJ ONeal
0cbdcc9387 feat: move more templating code to public repo 2022-06-01 17:15:54 +00:00