diff --git a/README.md b/README.md index 0c03f14..c45e399 100644 --- a/README.md +++ b/README.md @@ -375,3 +375,10 @@ An active recorder leaves a .recording marker; partial/crashed recordings with t its trace is written. The proxy forwards live requests and records their stream contents; header redaction stays on by default, but body contents may still be sensitive. Use only with trusted local clients and upstreams. + +On Linux, reading a session requires `/proc/self/fd` to be mounted and readable. +The check runs when opening each trace, not at server startup. Without procfs, +the recording proxy and panel still start, but recorded sessions show as +unavailable and session replay requests return HTTP400. The check fails closed +to keep opened file descriptors inside the session root. Standalone record/replay +CLI use remains available in containers without procfs. diff --git a/test/serve.test.ts b/test/serve.test.ts index 717fc69..806098e 100644 --- a/test/serve.test.ts +++ b/test/serve.test.ts @@ -61,7 +61,7 @@ test('active POST recording is unavailable and stopping cancels its upstream con await h.close();await Promise.race([closed,new Promise((_,reject)=>setTimeout(()=>reject(Error('upstream leaked')),1000))]);await response.body?.cancel().catch(()=>{}); }finally{await h.close();upstream.closeAllConnections();await new Promise(r=>upstream.close(()=>r()));await fs.rm(root,{recursive:true,force:true});} }); -test('recording marker prevents partial legacy session replay',async()=>{const f=await fixture();const h=await startServe({target:f.target,outDir:f.root,port:0,panelPort:0});try{await fs.mkdir(path.join(f.root,'partial'));await fs.writeFile(path.join(f.root,'partial','.recording'),'active');await fs.writeFile(path.join(f.root,'partial','events.jsonl'),'{}');expect((await fetch(h.url+'sessions/partial/stream')).status).toBe(400);}finally{await h.close();await f.done();}}); +test('recording marker prevents partial legacy session replay',async()=>{const f=await fixture();const h=await startServe({target:f.target,outDir:f.root,port:0,panelPort:0});try{await fs.mkdir(path.join(f.root,'partial'));await fs.writeFile(path.join(f.root,'partial','.recording'),'active');await fs.writeFile(path.join(f.root,'partial','events.jsonl'),JSON.stringify({v:1,kind:'meta',session:'partial',adapter:'sse',framing:'sse',protocol:'generic',startedAt:new Date(0).toISOString()})+'\n');expect((await fetch(h.url+'sessions/partial/stream')).status).toBe(400);await fs.unlink(path.join(f.root,'partial','.recording'));expect((await fetch(h.url+'sessions/partial/stream')).status).toBe(200);}finally{await h.close();await f.done();}}); test('SIGTERM during startup releases an acquired root lock',async()=>{