| … | … | @@ -855,6 +855,19 @@ export class Sidecar { |
| 855 | 855 | return [...seen.values()] |
| 856 | 856 | } |
| 857 | 857 | |
| 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 | |
| 858 | 871 | _isAutoupdateEnabled (name) { |
| 859 | 872 | try { |
| 860 | 873 | const cfgPath = path.join(os.homedir(), '.config', 'pgh', 'apps.json') |
| … | … | @@ -893,7 +906,12 @@ export class Sidecar { |
| 893 | 906 | async _reconcileBootstrap () { |
| 894 | 907 | try { |
| 895 | 908 | 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 | }) |
| 897 | 915 | } catch (err) { |
| 898 | 916 | console.error('[pgh-sidecar] bootstrap reconcile (non-fatal):', err && err.message) |
| 899 | 917 | } |