OverviewFilesCommitsIssuesDocsReleasesPeers

pgh-sidecar commits / e0768aa

0.2.50: read the bootstrap-serve admin setting
_isBootstrapServeEnabled reads apps.json `bootstrapServeAllArches` and passes it to reconcileBootstrapArtifacts as { serveAllArches } (pgh 0.1.130). Defaults FALSE, unlike _isAutoupdateEnabled's true — a machine that never answers a cold-start HTTPS /bootstrap fetch has no use for a foreign arch's tarball. Set on the backends behind the public endpoint: pgh app bootstrap-serve pgh-sidecar on Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
e0768aa334f1435bb56e85745c022dac1eefee92
by plankatron <fleeky@gmail.com> · 2026-07-30T02:00:52.000Z

Changed files (2) +20 -2

lib/index.js +19 -1
……@@ -855,6 +855,19 @@ export class Sidecar {
855855 return [...seen.values()]
856856 }
857857
858 // Admin setting, apps.json `bootstrapServeAllArches`. Unlike autoupdate this
859 // defaults to FALSE: holding another arch's ~150MB tarball only pays off on a
860 // machine that actually answers cold-start HTTPS /bootstrap fetches, i.e. a
861 // forge backend. Set with `pgh app bootstrap-serve <name> on`.
862 _isBootstrapServeEnabled (name) {
863 try {
864 const cfgPath = path.join(os.homedir(), '.config', 'pgh', 'apps.json')
865 if (!fs.existsSync(cfgPath)) return false
866 const cfg = JSON.parse(fs.readFileSync(cfgPath, 'utf8'))
867 return !!(cfg && cfg[name] && cfg[name].bootstrapServeAllArches === true)
868 } catch { return false }
869 }
870
858871 _isAutoupdateEnabled (name) {
859872 try {
860873 const cfgPath = path.join(os.homedir(), '.config', 'pgh', 'apps.json')
……@@ -893,7 +906,12 @@ export class Sidecar {
893906 async _reconcileBootstrap () {
894907 try {
895908 const { reconcileBootstrapArtifacts } = await import('pgh/bootstrap-artifacts')
896 await reconcileBootstrapArtifacts(this._treeStore, { log: (m) => console.log('[pgh-sidecar] ' + m) })
909 await reconcileBootstrapArtifacts(this._treeStore, {
910 log: (m) => console.log('[pgh-sidecar] ' + m),
911 // Admin opt-in — only forge backends serve arches they can't build.
912 // `pgh app bootstrap-serve pgh-sidecar on`
913 serveAllArches: this._isBootstrapServeEnabled('pgh-sidecar')
914 })
897915 } catch (err) {
898916 console.error('[pgh-sidecar] bootstrap reconcile (non-fatal):', err && err.message)
899917 }
package.json +1 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "pgh-sidecar",
3 "version": "0.2.49",
3 "version": "0.2.50",
44 "description": "Small optional user-level daemon for pgh \u2014 shared identity vault, OTA polling, device linking, bootstrap seed, NameRegistry host",
55 "type": "module",
66 "main": "lib/index.js",