conductor-remote 1.16.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -11,7 +11,7 @@
11
11
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
12
12
  <link rel="icon" type="image/svg+xml" href="/icon.svg" />
13
13
  <title>Conductor Remote</title>
14
- <script type="module" crossorigin src="/assets/index-CbgaQzcX.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-CkWIQoxg.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-DLTj56Tj.css">
16
16
  <link rel="manifest" href="/manifest.webmanifest"></head>
17
17
  <body>
package/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,i={};const n=(n,s)=>(n=new URL(n+".js",s).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(s,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(i[r])return;let t={};const l=e=>n(e,r),c={module:{uri:r},exports:t,require:l};i[r]=Promise.all(s.map(e=>c[e]||l(e))).then(e=>(o(...e),t))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"b74d3538a28fb5da75898594318ad00a"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/index-DLTj56Tj.css",revision:null},{url:"assets/index-CbgaQzcX.js",revision:null},{url:"apple-touch-icon.png",revision:"2b9301416b880d45d4bb655f2600d1f2"},{url:"icon-192.png",revision:"c5e01ac58768627e18ee7b8b6a9239ef"},{url:"icon-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon-maskable-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon.svg",revision:"c1aee186821798733dd477e69a0ef243"},{url:"manifest.webmanifest",revision:"cf88fbc5755108a7fe0616fa160a8a15"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api\//]}))});
1
+ if(!self.define){let e,i={};const n=(n,s)=>(n=new URL(n+".js",s).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(s,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(i[r])return;let t={};const c=e=>n(e,r),l={module:{uri:r},exports:t,require:c};i[r]=Promise.all(s.map(e=>l[e]||c(e))).then(e=>(o(...e),t))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"352bf5ca64a8d1beba18dbca20b4ff27"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/index-DLTj56Tj.css",revision:null},{url:"assets/index-CkWIQoxg.js",revision:null},{url:"apple-touch-icon.png",revision:"2b9301416b880d45d4bb655f2600d1f2"},{url:"icon-192.png",revision:"c5e01ac58768627e18ee7b8b6a9239ef"},{url:"icon-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon-maskable-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon.svg",revision:"c1aee186821798733dd477e69a0ef243"},{url:"manifest.webmanifest",revision:"cf88fbc5755108a7fe0616fa160a8a15"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api\//]}))});
@@ -81,9 +81,12 @@ function cacheControl(rel) {
81
81
  }
82
82
  function serveStatic(_req, res, pathname) {
83
83
  const rel = pathname === '/' ? 'index.html' : pathname.replace(/^\/+/, '');
84
- const filePath = path.join(cfg.publicDir, rel);
85
- // Contain to publicDir.
86
- if (!filePath.startsWith(cfg.publicDir)) {
84
+ const filePath = path.resolve(cfg.publicDir, rel);
85
+ // Contain to publicDir. The URL parser already collapses `..`/`%2e%2e` dot-segments, but don't lean on
86
+ // that: reject anything that resolves outside the dir (a bare `startsWith` would also admit a sibling
87
+ // like `dist-node/`). An empty relative (filePath === publicDir) falls through to the SPA shell below.
88
+ const within = path.relative(cfg.publicDir, filePath);
89
+ if (within.startsWith('..') || path.isAbsolute(within)) {
87
90
  res.writeHead(403).end();
88
91
  return;
89
92
  }
@@ -197,7 +200,9 @@ const server = http.createServer(async (req, res) => {
197
200
  return json(req, res, 404, { error: 'no route', pathname });
198
201
  }
199
202
  catch (err) {
200
- return json(req, res, 500, { error: err instanceof Error ? err.message : String(err) });
203
+ // Log the detail locally; don't reflect internals (paths, stack strings) back over the wire.
204
+ console.error(`[relay] ${req.method} ${pathname} failed:`, err);
205
+ return json(req, res, 500, { error: 'internal error' });
201
206
  }
202
207
  });
203
208
  server.listen(cfg.port, cfg.host, () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-remote",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "type": "module",
5
5
  "packageManager": "yarn@4.15.0",
6
6
  "description": "Phone control panel for local Conductor agents. Reads ride SQLite + git; prompts ride Conductor's own dispatch path.",