sshler 1.1.0__tar.gz → 1.2.1__tar.gz
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.
- {sshler-1.1.0/sshler.egg-info → sshler-1.2.1}/PKG-INFO +1 -1
- {sshler-1.1.0 → sshler-1.2.1}/pyproject.toml +1 -1
- sshler-1.2.1/sshler/_pty_child.py +52 -0
- sshler-1.2.1/sshler/access.py +197 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/archive.py +22 -4
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/batch.py +37 -12
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/box_runner.py +25 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/claude_sessions.py +1 -1
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/failure.py +30 -9
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/file_contract.py +106 -26
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/files.py +15 -2
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/helpers.py +27 -6
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/local_files.py +452 -111
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/models.py +16 -1
- sshler-1.2.1/sshler/api/placement.py +313 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/recovery.py +66 -26
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/remote.py +12 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/remote_files.py +454 -90
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/search.py +1 -1
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/sessions.py +193 -97
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/terminal.py +2 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/transfer.py +50 -32
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/server.py +62 -40
- {sshler-1.1.0 → sshler-1.2.1}/sshler/ptyspawn.py +14 -5
- sshler-1.2.1/sshler/session.py +359 -0
- sshler-1.2.1/sshler/session_activity.py +151 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/snapshot.py +52 -45
- {sshler-1.1.0 → sshler-1.2.1}/sshler/ssh.py +25 -2
- {sshler-1.1.0 → sshler-1.2.1}/sshler/state.py +52 -19
- sshler-1.1.0/sshler/static/dist/assets/Alert-Bys2d40F.js → sshler-1.2.1/sshler/static/dist/assets/Alert-CKoH27Xv.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/ArtifactsView-B8797cSQ.js → sshler-1.2.1/sshler/static/dist/assets/ArtifactsView-Dv33f2Fs.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/BoxesView-Ob7u1Gao.js → sshler-1.2.1/sshler/static/dist/assets/BoxesView-9Vjlf5Iv.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/ClaudeSessionsView-pwB1a0LJ.js → sshler-1.2.1/sshler/static/dist/assets/ClaudeSessionsView-vF7gyCQp.js +2 -2
- sshler-1.2.1/sshler/static/dist/assets/CommanderView-4LyZJYDy.js +1 -0
- sshler-1.1.0/sshler/static/dist/assets/CommanderView-BHalPlOI.css → sshler-1.2.1/sshler/static/dist/assets/CommanderView-ThrOCSOS.css +1 -1
- sshler-1.1.0/sshler/static/dist/assets/DiffView-Dm_9sSvj.js → sshler-1.2.1/sshler/static/dist/assets/DiffView-BXCpZW0Z.js +2 -2
- sshler-1.1.0/sshler/static/dist/assets/DirectoryPickerModal-CqeY5OqJ.js → sshler-1.2.1/sshler/static/dist/assets/DirectoryPickerModal-3MJl9Fe_.js +27 -24
- sshler-1.2.1/sshler/static/dist/assets/DirectoryPickerModal-BchEuEbT.css +1 -0
- sshler-1.2.1/sshler/static/dist/assets/FilesView-BkB3GWQ_.css +1 -0
- sshler-1.2.1/sshler/static/dist/assets/FilesView-BtZrU3i_.js +772 -0
- sshler-1.1.0/sshler/static/dist/assets/GitBadge-B0LAKzSP.js → sshler-1.2.1/sshler/static/dist/assets/GitBadge-DBBiAe6y.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/InputNumber-iGAW1_0W.js → sshler-1.2.1/sshler/static/dist/assets/InputNumber-DLHiw-vi.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/LoginView-CDYCNUl2.js → sshler-1.2.1/sshler/static/dist/assets/LoginView-BPjMtIkt.js +2 -2
- sshler-1.2.1/sshler/static/dist/assets/MultiTerminalView-BY769dER.css +1 -0
- sshler-1.2.1/sshler/static/dist/assets/MultiTerminalView-D9Moh7Zr.js +1 -0
- sshler-1.2.1/sshler/static/dist/assets/OverviewView-Aq1mzCKn.css +1 -0
- sshler-1.2.1/sshler/static/dist/assets/OverviewView-CCyD27cf.js +1 -0
- sshler-1.2.1/sshler/static/dist/assets/PhArrowLeft.vue-Bx2QsCJM.js +1 -0
- sshler-1.2.1/sshler/static/dist/assets/PhClockCounterClockwise.vue-8fEtbkeo.js +1 -0
- sshler-1.1.0/sshler/static/dist/assets/Popconfirm-BZywE2Tu.js → sshler-1.2.1/sshler/static/dist/assets/Popconfirm-BzPxPplj.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/ProgressView-BlSML242.js → sshler-1.2.1/sshler/static/dist/assets/ProgressView-CPI0lyZX.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/RadioGroup-BAgkdPZa.js → sshler-1.2.1/sshler/static/dist/assets/RadioGroup-DwZph3HN.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/SettingsView-gtJzt1t-.js → sshler-1.2.1/sshler/static/dist/assets/SettingsView-B21c--4o.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/Spin-CpmehITF.js → sshler-1.2.1/sshler/static/dist/assets/Spin-DMtfGyTl.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/Switch-Crq5mBje.js → sshler-1.2.1/sshler/static/dist/assets/Switch-CUeyUos9.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/TerminalView-Do9fMp8e.css → sshler-1.2.1/sshler/static/dist/assets/TerminalView-Bxk8zgzW.css +1 -1
- sshler-1.2.1/sshler/static/dist/assets/TerminalView-C6hzrcMJ.js +2 -0
- sshler-1.1.0/sshler/static/dist/assets/abnfDiagram-S7VZAUFO-Bza4EJH_.js → sshler-1.2.1/sshler/static/dist/assets/abnfDiagram-S7VZAUFO-CRAuAPKn.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/architectureDiagram-YGSQEFNW-Bpjf2x3F.js → sshler-1.2.1/sshler/static/dist/assets/architectureDiagram-YGSQEFNW-DpqGi7F5.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/blockDiagram-APKKGZFW-CoAK-Bnt.js → sshler-1.2.1/sshler/static/dist/assets/blockDiagram-APKKGZFW-DDgqpToC.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/bootstrap-rZuhZQLd.js → sshler-1.2.1/sshler/static/dist/assets/bootstrap-B1hYOSMw.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/c4Diagram-KJ2TOQU5-pfcAOSiE.js → sshler-1.2.1/sshler/static/dist/assets/c4Diagram-KJ2TOQU5-C1xXULaU.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-6MUBBAK2-BpTpaawG.js → sshler-1.2.1/sshler/static/dist/assets/chunk-6MUBBAK2-CJDfnB2x.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-AXFCVDMN-BlsyqGU2.js → sshler-1.2.1/sshler/static/dist/assets/chunk-AXFCVDMN-BPNpFjIz.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-BG4553SI-DccVIvA2.js → sshler-1.2.1/sshler/static/dist/assets/chunk-BG4553SI-31NRIiO1.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-DQASFODM-DRX6GyxK.js → sshler-1.2.1/sshler/static/dist/assets/chunk-DQASFODM-PhNJXukx.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-HFQBQIA3-CUYWe3bn.js → sshler-1.2.1/sshler/static/dist/assets/chunk-HFQBQIA3-BJOOoMyZ.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-KQLB2F66-zvGjtH6h.js → sshler-1.2.1/sshler/static/dist/assets/chunk-KQLB2F66-Culypxju.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-KS47KZWR-DrnCH1gn.js → sshler-1.2.1/sshler/static/dist/assets/chunk-KS47KZWR-DC-0YsSj.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-LEVMRMFU-BrBIUKT4.js → sshler-1.2.1/sshler/static/dist/assets/chunk-LEVMRMFU-B0cxXb-O.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-M57EVK23-DSpLpwEh.js → sshler-1.2.1/sshler/static/dist/assets/chunk-M57EVK23-YCUPLlVX.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-OY52VR5R-uuDypNZT.js → sshler-1.2.1/sshler/static/dist/assets/chunk-OY52VR5R-Dt5cnDg4.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-QB3YPZ4I-DDZMLGwP.js → sshler-1.2.1/sshler/static/dist/assets/chunk-QB3YPZ4I-Bxd9TvGD.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-R3KSYZAL-Cg4M7SdI.js → sshler-1.2.1/sshler/static/dist/assets/chunk-R3KSYZAL-CDf2N8ls.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-STOXU5M4-Dkd5sMkP.js → sshler-1.2.1/sshler/static/dist/assets/chunk-STOXU5M4-DrkFUR4Q.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-TU62E6Q5-CCkV749z.js → sshler-1.2.1/sshler/static/dist/assets/chunk-TU62E6Q5-BjGh__rd.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/chunk-X4PVCEUW-BFWeBkhX.js → sshler-1.2.1/sshler/static/dist/assets/chunk-X4PVCEUW-VSKCw2t0.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/classDiagram-v2-L25IHNXF-edtI8Z1G.js → sshler-1.2.1/sshler/static/dist/assets/classDiagram-v2-L25IHNXF-Dc5jD78x.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/composables-BcvuwBgc.js → sshler-1.2.1/sshler/static/dist/assets/composables-BklhQYb_.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/cynefinDiagram-L36ESFBY-CbHfXIOQ.js → sshler-1.2.1/sshler/static/dist/assets/cynefinDiagram-L36ESFBY-D7tNGZw8.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/dagre-SPEB5RXH-CpZcOg_8.js → sshler-1.2.1/sshler/static/dist/assets/dagre-SPEB5RXH-DNdGxsVE.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/diagram-3B7GL73J-Q_X4_uu3.js → sshler-1.2.1/sshler/static/dist/assets/diagram-3B7GL73J-CqdGkx6m.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/diagram-DNEMPZML-DlUFMzKc.js → sshler-1.2.1/sshler/static/dist/assets/diagram-DNEMPZML-CnUwrV1Q.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/diagram-L3MUGCDN-yCsNt5Z8.js → sshler-1.2.1/sshler/static/dist/assets/diagram-L3MUGCDN-dVze692u.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/diagram-LA4NIPWU-DcjnBxMI.js → sshler-1.2.1/sshler/static/dist/assets/diagram-LA4NIPWU-BQ5wXtyf.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/diagram-MHCOC4E2-Bw47CZZo.js → sshler-1.2.1/sshler/static/dist/assets/diagram-MHCOC4E2-BRDZ4aI4.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/diagram-XPFHEONP-zI12RDRE.js → sshler-1.2.1/sshler/static/dist/assets/diagram-XPFHEONP-CK4hrnDe.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/ebnfDiagram-UZSYDL2S-Ds1At0Z0.js → sshler-1.2.1/sshler/static/dist/assets/ebnfDiagram-UZSYDL2S-DDWraZHo.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/elk-XV6XMXQE-CceZKnwI.js → sshler-1.2.1/sshler/static/dist/assets/elk-XV6XMXQE-CBaL4Ym6.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/erDiagram-EYBAPDEH-bPEPO_yc.js → sshler-1.2.1/sshler/static/dist/assets/erDiagram-EYBAPDEH-BVPB658E.js +1 -1
- sshler-1.2.1/sshler/static/dist/assets/favorites-xRCBAWJ7.js +1 -0
- sshler-1.2.1/sshler/static/dist/assets/flowDiagram-MALGAFMO-Dn6Ozus2.js +1 -0
- sshler-1.1.0/sshler/static/dist/assets/ganttDiagram-23REXITY-BoxEnDEy.js → sshler-1.2.1/sshler/static/dist/assets/ganttDiagram-23REXITY-CBlsecvz.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/gitGraphDiagram-STJD7YCW-DgBqQj0W.js → sshler-1.2.1/sshler/static/dist/assets/gitGraphDiagram-STJD7YCW-CTaWVdXt.js +1 -1
- sshler-1.2.1/sshler/static/dist/assets/http-BqXQFLQe.js +7 -0
- sshler-1.1.0/sshler/static/dist/assets/index-C_pJAxuZ.js → sshler-1.2.1/sshler/static/dist/assets/index-B3oOG2dl.js +43 -43
- sshler-1.1.0/sshler/static/dist/assets/infoDiagram-KBXO4MBG-BKuEjqX2.js → sshler-1.2.1/sshler/static/dist/assets/infoDiagram-KBXO4MBG-DkSOQT-R.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/ishikawaDiagram-M35NCXHK-DrXDbfFk.js → sshler-1.2.1/sshler/static/dist/assets/ishikawaDiagram-M35NCXHK-BgjsD5bI.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/journeyDiagram-OPLOXDXO-D841u2Zx.js → sshler-1.2.1/sshler/static/dist/assets/journeyDiagram-OPLOXDXO-CZ1ETyhW.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/kanban-definition-BZKZHSQY-9lVMVBHR.js → sshler-1.2.1/sshler/static/dist/assets/kanban-definition-BZKZHSQY-qkOaCBel.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/mermaid.core-Dp9Bc-eU.js → sshler-1.2.1/sshler/static/dist/assets/mermaid.core-D5w3hbD9.js +4 -4
- sshler-1.1.0/sshler/static/dist/assets/mindmap-definition-I2QAS2VK-BCMiYLNX.js → sshler-1.2.1/sshler/static/dist/assets/mindmap-definition-I2QAS2VK-C-g7iR5I.js +1 -1
- sshler-1.2.1/sshler/static/dist/assets/pathParts-CdTzPsGR.js +1 -0
- sshler-1.1.0/sshler/static/dist/assets/pegDiagram-FD4XPPHP-y9eIQ0a6.js → sshler-1.2.1/sshler/static/dist/assets/pegDiagram-FD4XPPHP-BD4SCum0.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/pieDiagram-J4AKIIQI-KowT_fFD.js → sshler-1.2.1/sshler/static/dist/assets/pieDiagram-J4AKIIQI-jgo_yfAe.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/quadrantDiagram-XTYBLID2-Xn_mvFVC.js → sshler-1.2.1/sshler/static/dist/assets/quadrantDiagram-XTYBLID2-CMNwkjsj.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/railroadDiagram-MRQ6NCDL-Dn9vUli5.js → sshler-1.2.1/sshler/static/dist/assets/railroadDiagram-MRQ6NCDL-CtghQNBS.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/requirementDiagram-Y7LWUY3S-Y_NLS8sc.js → sshler-1.2.1/sshler/static/dist/assets/requirementDiagram-Y7LWUY3S-D5lIq31W.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/sankeyDiagram-WGJFYUXA-Niby8DBc.js → sshler-1.2.1/sshler/static/dist/assets/sankeyDiagram-WGJFYUXA-BgJgBQSA.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/sequenceDiagram-5NDRBG5M-DLVU6c8y.js → sshler-1.2.1/sshler/static/dist/assets/sequenceDiagram-5NDRBG5M-Biszpcaf.js +1 -1
- sshler-1.2.1/sshler/static/dist/assets/sessionName-m9Owacal.js +1 -0
- sshler-1.1.0/sshler/static/dist/assets/stateDiagram-v2-FJ4FJNEA-Cz0kdwlO.js → sshler-1.2.1/sshler/static/dist/assets/stateDiagram-v2-FJ4FJNEA-Dgy1pNMu.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/swimlanes-UMQ2AFYF-DYZSABtE.js → sshler-1.2.1/sshler/static/dist/assets/swimlanes-UMQ2AFYF-BuWt8UN7.js +1 -1
- sshler-1.2.1/sshler/static/dist/assets/swimlanesDiagram-OMPLPG4O-DH2U0TbL.js +8 -0
- sshler-1.1.0/sshler/static/dist/assets/timeline-definition-SEUHKTQE-BOzJQm9M.js → sshler-1.2.1/sshler/static/dist/assets/timeline-definition-SEUHKTQE-CXhY3lRv.js +1 -1
- sshler-1.2.1/sshler/static/dist/assets/useFolderSearch-NCF-aCNV.js +1 -0
- sshler-1.1.0/sshler/static/dist/assets/useReplacePrompt-BlhhqtdY.js → sshler-1.2.1/sshler/static/dist/assets/useReplacePrompt-4JyUiYgK.js +2 -2
- sshler-1.1.0/sshler/static/dist/assets/usecaseDiagram-AFA6YXN4-BYltRG_Q.js → sshler-1.2.1/sshler/static/dist/assets/usecaseDiagram-AFA6YXN4-D2HPDd5g.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/vennDiagram-NNMJR3RB-CzSD6-SZ.js → sshler-1.2.1/sshler/static/dist/assets/vennDiagram-NNMJR3RB-DMr6IXjZ.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/wardleyDiagram-S7YFUSEH-LkLPSVLv.js → sshler-1.2.1/sshler/static/dist/assets/wardleyDiagram-S7YFUSEH-3O3u2OIU.js +1 -1
- sshler-1.1.0/sshler/static/dist/assets/xychartDiagram-GGNKY7IX-2motCwjE.js → sshler-1.2.1/sshler/static/dist/assets/xychartDiagram-GGNKY7IX-CUYbM1pN.js +1 -1
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/index.html +3 -3
- {sshler-1.1.0 → sshler-1.2.1}/sshler/terminal/local.py +37 -1
- {sshler-1.1.0 → sshler-1.2.1}/sshler/terminal/pump.py +31 -8
- {sshler-1.1.0 → sshler-1.2.1}/sshler/terminal/transport.py +7 -1
- {sshler-1.1.0 → sshler-1.2.1}/sshler/tmux.py +160 -40
- {sshler-1.1.0 → sshler-1.2.1}/sshler/webapp.py +229 -85
- {sshler-1.1.0 → sshler-1.2.1/sshler.egg-info}/PKG-INFO +1 -1
- {sshler-1.1.0 → sshler-1.2.1}/sshler.egg-info/SOURCES.txt +99 -89
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_api_body_models.py +2 -2
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_archive.py +101 -9
- sshler-1.2.1/tests/test_archive_existing_names.py +773 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_box_files_contract.py +713 -24
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_box_program_failure_reasons.py +3 -2
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_box_runner_contract.py +51 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_claude_sessions.py +2 -1
- sshler-1.2.1/tests/test_cli_stop.py +205 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_existing_name_rule.py +112 -382
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_failure_answers.py +16 -2
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_fake_tmux.py +2 -2
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_files_folder_zip_remote.py +17 -3
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_files_upload_local.py +2 -1
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_force_kill.py +187 -24
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_handshake_status.py +14 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_httpx_ws.py +3 -2
- sshler-1.2.1/tests/test_keep_both.py +568 -0
- sshler-1.2.1/tests/test_local_folder_copy.py +170 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_path_validation.py +39 -0
- sshler-1.2.1/tests/test_plain_shell.py +793 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_platform_support.py +1 -4
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_progress_websocket.py +4 -5
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ptyspawn.py +4 -2
- sshler-1.2.1/tests/test_remote_program_checks.py +352 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_remote_tilde_routes.py +48 -6
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_route_failure_reasons.py +17 -2
- sshler-1.2.1/tests/test_session_active_flag.py +1195 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_session_auth.py +171 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ssh_connection_leaks.py +97 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_state_store.py +1 -1
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_terminal_closes.py +14 -32
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_terminal_transport_contract.py +74 -5
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_tmux_subprocess.py +4 -2
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_windows_terminal.py +2 -0
- sshler-1.2.1/tests/test_ws_access.py +866 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ws_term_auth.py +53 -5
- sshler-1.1.0/sshler/_pty_child.py +0 -42
- sshler-1.1.0/sshler/access.py +0 -98
- sshler-1.1.0/sshler/api/placement.py +0 -141
- sshler-1.1.0/sshler/session.py +0 -226
- sshler-1.1.0/sshler/static/dist/assets/CommanderView-mqS2PzFq.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/DirectoryPickerModal-B2FkIRDB.css +0 -1
- sshler-1.1.0/sshler/static/dist/assets/FilesView-ibNv_HKE.css +0 -1
- sshler-1.1.0/sshler/static/dist/assets/FilesView-uJ-trLV1.js +0 -772
- sshler-1.1.0/sshler/static/dist/assets/MultiTerminalView-C7fyFZTS.css +0 -1
- sshler-1.1.0/sshler/static/dist/assets/MultiTerminalView-Cdbwt5-n.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/OverviewView-C3MmXZTm.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/OverviewView-DbhGC6oC.css +0 -1
- sshler-1.1.0/sshler/static/dist/assets/PhClockCounterClockwise.vue-Epcai9FF.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/TerminalView-dfL69hlt.js +0 -2
- sshler-1.1.0/sshler/static/dist/assets/favorites-Buonrxuk.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/flowDiagram-MALGAFMO-C3oc26mT.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/http-CTlrihU0.js +0 -7
- sshler-1.1.0/sshler/static/dist/assets/sessionName-DxZUIWUe.js +0 -1
- sshler-1.1.0/sshler/static/dist/assets/swimlanesDiagram-OMPLPG4O-PPNrSygP.js +0 -8
- sshler-1.1.0/tests/test_remote_program_checks.py +0 -83
- sshler-1.1.0/tests/test_ws_access.py +0 -337
- {sshler-1.1.0 → sshler-1.2.1}/LICENSE +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/MANIFEST.in +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/README.md +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/scripts/check_frontend_dist.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/setup.cfg +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/__init__.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/__init__.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/artifacts.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/auth.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/box_files.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/boxes.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/config.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/dependencies.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/diff.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/excel.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/git.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/grep.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/pdf.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/ping.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/progress.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/rate_limiting.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/run_failures.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/snippets.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/stats_stream.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/api/tunnels.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/artifacts.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/auth.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/claude_sessions.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/__init__.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/_main.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/artifacts.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/client.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/password.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/ping.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/progress.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/cli/runtime_token.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/config.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/config_cache.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/config_dir.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/pdf.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/proc.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/rate_limit.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/scripts/install-sshler-task.ps1 +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/scripts/remove-sshler-task.ps1 +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/scripts/run-sshler.ps1 +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/settings.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/spa.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/ssh_config.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/ssh_pool.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/Add-DVj_NAD5.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/ArtifactsView-afhw1qXI.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/BoxesView-C2c0xItr.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/ChevronRight-CB13mv_U.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/ClaudeSessionsView-xGWjqzNK.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/DiffView-BuaOaZHV.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/DiffViewer-BRAHvu6K.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/DiffViewer-CNSxZac5.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/GitBadge-i4R5k8Yn.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/Grid-C0Ybw0fx.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/LoginView-ZzJUJyPs.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/NotFoundView-DWZwQy5Q.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/NotFoundView-DwnT1Qmo.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhArrowsClockwise.vue-DIpXw-wC.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhArrowsLeftRight.vue-8OgBoRAo.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhArrowsOut.vue-DQptlW4v.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhCheck.vue-CEm_oMEb.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhCircle.vue-vHfAO3d-.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhCopy.vue-BLGEnEkX.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhCopySimple.vue-DEwhUG3v.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhFloppyDisk.vue-BzUr1KeQ.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhFolderOpen.vue-BliJ8f_D.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhGitBranch.vue-Bcy7lLT8.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhList.vue-KPsdW08_.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhPencilSimple.vue-CZyPwIW4.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhPlay.vue-YnRHvIIa.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhPushPinSimple.vue-B8qMbkV_.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhQuestion.vue-BG4hB2wF.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/PhTrash.vue-UcyRJtzp.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/ProgressView-DbwfQb8J.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/SettingsView-xAJiWU9o.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/Tag-BXB6UJbk.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/Warning-DQEelS-y.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/_baseEach-DRxRab5x.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/_plugin-vue_export-helper-BUbEWP3a.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/architecture-WOLXFQ4H-C6rElQ7Y.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-DUW6YSOI-Dgx8z5s3.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-J5ZVWO5B-oDCd-gWO.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-XXDRQBXY-i7MKP1NY.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/cose-bilkent-JH36ORCC-C6J2IoHg.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/cynefin-EF2NZ3EQ-lPUjyvIZ.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/cytoscape.esm-nTrd5EVq.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/d3-scale-CElPUUud.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/d3-selection-COWvaQNI.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/dist-DdXDFcej.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/eventmodeling-K75KTNOO-BEvQBdS3.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/flatten-blBgGSOx.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/get-Jkx-poUl.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/get-slot-6kXJmSMP.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/gitGraph-VSP46ZUC-DPePhKd7.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/graphlib-C-M0B7mD.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/happens-in-D4nrdV77.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/index-CEzH1A4_.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/info-OHQRW6UA-FXs-3RzV.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/isArrayLikeObject-DDw98r_w.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/katex-MEuSR36T.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/map-qc1plvxH.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/merge-DVfkhdQt.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/mermaid-parser.core-gWF4TbpQ.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/packet-JDAUHWVQ-DWI00mii.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/pageLoad-86LfyLdt.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/pie-XZMESJXO-mEep_piW.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/preload-helper-BSZHtiEo.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/radar-ABXABTNO-Co9rsjbw.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/railroad-I3PHUGI6-_QD7qyEP.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/railroad-abnf-LNEFI6M7-Dya2h1Ax.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/railroad-ebnf-DWYD2UWJ-xXJLDf9V.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/railroad-peg-JR7BVNR7-CCnFE6SM.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/rolldown-runtime-COiEfhsA.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/rough.esm-Dy-Kn_BL.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/runtime-core.esm-bundler-BrzYnu9e.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/sizeCapture-INFHLROL-3uHXrFqA.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/treeView-D4JQ5SDB-v1jaVIUB.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/treemap-SAJKECNS-DNI-q7O8.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/use-merged-state-CuoatQ1O.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/useReplacePrompt-g2-2SknS.css +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/assets/wardley-7MLQ67FV-B8BqdR-s.js +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/favicon.png +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/fonts/MonaspaceNeon-Bold.woff2 +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/fonts/MonaspaceNeon-Regular.woff2 +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/fonts/MonaspaceNeon-Variable.woff2 +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/icon-192.png +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/icon-512-maskable.png +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/icon-512.png +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/logo.png +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/static/dist/manifest.webmanifest +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/terminal/__init__.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/terminal/conpty.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/terminal/remote.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/validation.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/win_terminal_registry.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler/winpty_proc.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler.egg-info/dependency_links.txt +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler.egg-info/entry_points.txt +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler.egg-info/requires.txt +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/sshler.egg-info/top_level.txt +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_api_artifacts.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_api_diff.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_api_progress.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_api_v1.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_artifacts.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_basic.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_batch_ops.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_cli_artifacts.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_cli_imports.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_cli_progress.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_client_address.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_command_injection.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_config.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_database_indexes.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_dev_workflow.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_failure_reasons.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_git_refs.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_grep.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_local_git_runs.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_origin_csrf.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_page_failure_reasons.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ping_websocket.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_rate_limit.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_rate_limit_middleware.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_recovery.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_remote_git_info_quoting.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_remote_home_callers.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_remote_owners.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_require_token.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_search.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_serve_token_cache.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_session_name_parity.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_snapshot_loop_settings.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_snippets.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ssh.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ssh_loopback.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_ssh_pool_age.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_stats_stream.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_terminal_endings.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_terminal_teardown.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_tmux_window_list.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_tunnels.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_websocket.py +0 -0
- {sshler-1.1.0 → sshler-1.2.1}/tests/test_win_terminal_registry.py +0 -0
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "sshler"
|
|
8
|
-
version = "1.1
|
|
8
|
+
version = "1.2.1"
|
|
9
9
|
description = "A local FastAPI-powered SSH multiplexer for tmux-in-browser — from your laptop only."
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
requires-python = ">=3.12"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Run by path (never imported): become session leader on the PTY, then run the command.
|
|
2
|
+
|
|
3
|
+
``ptyspawn.spawn_on_pty`` starts this with the PTY slave on fds 0 to 2. The first
|
|
4
|
+
three arguments are optional values, each ``-`` for none or ``=`` and the value: the
|
|
5
|
+
``LC_CTYPE`` the command gets, the folder it starts in, and the name it reads as its
|
|
6
|
+
own (``argv[0]``). The rest is the command. An interpreter started in the C locale sets
|
|
7
|
+
``LC_CTYPE`` in its own environment; the command must get the environment the caller
|
|
8
|
+
gave, so it is put back.
|
|
9
|
+
``posix_spawn`` hands down every inheritable descriptor of the server (what its own
|
|
10
|
+
launcher left open, for one), so all above 2 are closed: the command gets the PTY only.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _value(word: str) -> str | None:
|
|
18
|
+
return word[1:] if word.startswith("=") else None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main() -> None:
|
|
22
|
+
argv = sys.argv[4:]
|
|
23
|
+
doing = f"run {argv[0] if argv else ''}"
|
|
24
|
+
try:
|
|
25
|
+
import fcntl
|
|
26
|
+
import termios
|
|
27
|
+
|
|
28
|
+
lc_ctype, cwd, arg0 = (_value(word) for word in sys.argv[1:4])
|
|
29
|
+
if lc_ctype is not None:
|
|
30
|
+
os.environ["LC_CTYPE"] = lc_ctype
|
|
31
|
+
else:
|
|
32
|
+
os.environ.pop("LC_CTYPE", None)
|
|
33
|
+
os.setsid()
|
|
34
|
+
fcntl.ioctl(0, termios.TIOCSCTTY, 0)
|
|
35
|
+
if cwd is not None:
|
|
36
|
+
doing, running = f"enter {cwd}", doing
|
|
37
|
+
os.chdir(cwd)
|
|
38
|
+
doing = running
|
|
39
|
+
for fd in map(int, os.listdir("/dev/fd")):
|
|
40
|
+
if fd > 2:
|
|
41
|
+
os.closerange(fd, fd + 1) # ignores the listing's own, already closed
|
|
42
|
+
os.execvp(argv[0], [arg0 if arg0 is not None else argv[0], *argv[1:]])
|
|
43
|
+
except (OSError, IndexError) as exc:
|
|
44
|
+
reason = exc.strerror if isinstance(exc, OSError) and exc.strerror else str(exc)
|
|
45
|
+
try:
|
|
46
|
+
os.write(2, f"sshler: cannot {doing}: {reason}\n".encode(errors="replace"))
|
|
47
|
+
finally:
|
|
48
|
+
os._exit(127)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
if __name__ == "__main__":
|
|
52
|
+
main()
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"""Who may open a WebSocket, and the comparisons the REST routes share with it."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
import contextlib
|
|
7
|
+
import hashlib
|
|
8
|
+
import hmac
|
|
9
|
+
import logging
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
from urllib.parse import urlparse
|
|
12
|
+
|
|
13
|
+
from fastapi import WebSocket
|
|
14
|
+
|
|
15
|
+
from .session import SocketHold, hold_on_session, live_session
|
|
16
|
+
from .settings import SshlerSettings
|
|
17
|
+
from .settings import get_settings as get_app_settings
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
21
|
+
CLOSE_UNAUTHORIZED = 4401
|
|
22
|
+
CLOSE_FORBIDDEN = 4403
|
|
23
|
+
SESSION_ENDED = "Session ended"
|
|
24
|
+
|
|
25
|
+
# Closes started by a session's end, kept until done so none is collected half-way.
|
|
26
|
+
_closing: set[asyncio.Task] = set()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _digest(value: str) -> bytes:
|
|
30
|
+
return hashlib.sha256(value.encode("utf-8", "surrogatepass")).digest()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def token_matches(supplied: str | None, expected: str) -> bool:
|
|
34
|
+
"""Compare a supplied token with the server's, in constant time.
|
|
35
|
+
|
|
36
|
+
Both sides are hashed first, so the comparison never raises (non-ASCII,
|
|
37
|
+
empty and very long inputs included) and always sees two values of the
|
|
38
|
+
same length: its time says nothing about where a wrong token differs from
|
|
39
|
+
the right one, nor about the right one's length.
|
|
40
|
+
"""
|
|
41
|
+
return hmac.compare_digest(_digest(supplied or ""), _digest(expected))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def allowed_origins(cli_settings, app_settings: SshlerSettings) -> list[str]:
|
|
45
|
+
"""Every origin a state-changing request or a socket may come from.
|
|
46
|
+
|
|
47
|
+
The command-line origins, the ``allowed_origins`` setting, and the origin of
|
|
48
|
+
``public_url``.
|
|
49
|
+
"""
|
|
50
|
+
origins = list(cli_settings.allow_origins) + app_settings.allowed_origins_list
|
|
51
|
+
if app_settings.public_url:
|
|
52
|
+
parsed = urlparse(app_settings.public_url)
|
|
53
|
+
public_origin = f"{parsed.scheme}://{parsed.netloc}"
|
|
54
|
+
if public_origin not in origins:
|
|
55
|
+
origins.append(public_origin)
|
|
56
|
+
return origins
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def origin_base(origin: str) -> str:
|
|
60
|
+
"""Reduce an Origin or Referer value to ``scheme://host:port``."""
|
|
61
|
+
parsed = urlparse(origin)
|
|
62
|
+
return f"{parsed.scheme}://{parsed.netloc}"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass(frozen=True)
|
|
66
|
+
class Refusal:
|
|
67
|
+
"""Why a socket is refused, and how.
|
|
68
|
+
|
|
69
|
+
``before_handshake`` is True only for a request whose Origin is present and not
|
|
70
|
+
allowed: such a socket is never upgraded (the server answers HTTP 403, and the
|
|
71
|
+
code and reason go no further than the log). Every other refusal is accepted and
|
|
72
|
+
closed at once, so the client receives ``code`` and ``reason``; nothing is read
|
|
73
|
+
from it first.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
code: int
|
|
77
|
+
reason: str
|
|
78
|
+
before_handshake: bool = False
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _foreign_origin(websocket: WebSocket, cli_settings, app_settings: SshlerSettings) -> bool:
|
|
82
|
+
"""True when the request carries an Origin header that is not allowed (``null`` too)."""
|
|
83
|
+
if not app_settings.origin_check_enabled:
|
|
84
|
+
return False
|
|
85
|
+
origin = websocket.headers.get("origin")
|
|
86
|
+
if origin is None:
|
|
87
|
+
return False
|
|
88
|
+
try:
|
|
89
|
+
listed = origin_base(origin) in allowed_origins(cli_settings, app_settings)
|
|
90
|
+
except ValueError:
|
|
91
|
+
# An Origin `urlparse` rejects (``http://[``) is not any listed origin.
|
|
92
|
+
listed = False
|
|
93
|
+
if listed:
|
|
94
|
+
return False
|
|
95
|
+
logger.warning("[Security] WebSocket refused: origin %r is not allowed", origin)
|
|
96
|
+
return True
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def websocket_refusal(websocket: WebSocket) -> Refusal | None:
|
|
100
|
+
"""Decide whether a socket may be opened; None means it may.
|
|
101
|
+
|
|
102
|
+
The code is chosen in this order: credentials (Basic header, else a live session
|
|
103
|
+
cookie) give 4401; the token (``token`` query parameter, else the
|
|
104
|
+
``x-sshler-token`` header) gives 4403 "Invalid token"; an Origin header that is
|
|
105
|
+
present and not allowed gives 4403 "Invalid origin". A request without an Origin
|
|
106
|
+
header is not a browser and passes, as for a POST. ``origin_check_enabled`` turns
|
|
107
|
+
the Origin check off.
|
|
108
|
+
|
|
109
|
+
How the socket is refused depends on the Origin alone: a present Origin that is not
|
|
110
|
+
allowed makes every refusal ``before_handshake``, whatever else is wrong with the
|
|
111
|
+
request, so a cross-site page never gets an upgraded socket. Pass the refusal to
|
|
112
|
+
``refuse``.
|
|
113
|
+
|
|
114
|
+
A socket let in by a session cookie carries that session's id in
|
|
115
|
+
``websocket.state.session_id`` for ``hold_socket``; one let in otherwise (a good
|
|
116
|
+
Basic header, or no password set) carries None and belongs to no session.
|
|
117
|
+
"""
|
|
118
|
+
cli_settings = websocket.app.state.settings
|
|
119
|
+
app_settings = get_app_settings()
|
|
120
|
+
websocket.state.session_id = None
|
|
121
|
+
foreign = _foreign_origin(websocket, cli_settings, app_settings)
|
|
122
|
+
|
|
123
|
+
if cli_settings.auth_manager:
|
|
124
|
+
authenticated = False
|
|
125
|
+
auth_header = websocket.headers.get("authorization")
|
|
126
|
+
if auth_header and cli_settings.auth_manager.verify_basic_auth_header(auth_header):
|
|
127
|
+
authenticated = True
|
|
128
|
+
if not authenticated:
|
|
129
|
+
cookie_sid = websocket.cookies.get(app_settings.cookie_name)
|
|
130
|
+
if cookie_sid and live_session(cookie_sid):
|
|
131
|
+
authenticated = True
|
|
132
|
+
websocket.state.session_id = cookie_sid
|
|
133
|
+
if not authenticated:
|
|
134
|
+
logger.warning("[Connection] WebSocket refused: no valid credentials")
|
|
135
|
+
return Refusal(CLOSE_UNAUTHORIZED, "Unauthorized", before_handshake=foreign)
|
|
136
|
+
|
|
137
|
+
if cli_settings.csrf_token:
|
|
138
|
+
supplied = websocket.query_params.get("token") or websocket.headers.get("x-sshler-token")
|
|
139
|
+
if not token_matches(supplied, cli_settings.csrf_token):
|
|
140
|
+
logger.warning("[Connection] WebSocket refused: invalid token")
|
|
141
|
+
return Refusal(CLOSE_FORBIDDEN, "Invalid token", before_handshake=foreign)
|
|
142
|
+
|
|
143
|
+
if foreign:
|
|
144
|
+
return Refusal(CLOSE_FORBIDDEN, "Invalid origin", before_handshake=True)
|
|
145
|
+
|
|
146
|
+
return None
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def refuse(websocket: WebSocket, refusal: Refusal) -> None:
|
|
150
|
+
"""Close a socket that is not yet accepted, as *refusal* says.
|
|
151
|
+
|
|
152
|
+
Before the handshake: closed unaccepted (the server answers HTTP 403). Otherwise
|
|
153
|
+
accepted and closed at once with the code and reason, so a browser sees them (a
|
|
154
|
+
close before the accept reaches it as 1006 with no reason). Nothing is read from
|
|
155
|
+
the socket, and no task or state is started for it.
|
|
156
|
+
"""
|
|
157
|
+
if not refusal.before_handshake:
|
|
158
|
+
await websocket.accept()
|
|
159
|
+
await websocket.close(code=refusal.code, reason=refusal.reason)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class _Unheld:
|
|
163
|
+
"""The place of a socket that belongs to no session: nothing to release."""
|
|
164
|
+
|
|
165
|
+
def release(self) -> None:
|
|
166
|
+
return None
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def hold_socket(websocket: WebSocket) -> SocketHold | _Unheld | None:
|
|
170
|
+
"""Put an accepted socket in the record of the session it was let in on.
|
|
171
|
+
|
|
172
|
+
When that session ends (signed out, or its time is up) the socket is closed with
|
|
173
|
+
4401, and whatever runs on it ends as on any close. A socket let in without a
|
|
174
|
+
session is not held. None means the session ended between ``websocket_refusal``
|
|
175
|
+
and this call: the socket has been closed with 4401 and the caller returns. The
|
|
176
|
+
caller releases the hold when the socket closes for any other reason.
|
|
177
|
+
"""
|
|
178
|
+
session_id = getattr(websocket.state, "session_id", None)
|
|
179
|
+
if session_id is None:
|
|
180
|
+
return _Unheld()
|
|
181
|
+
loop = asyncio.get_running_loop()
|
|
182
|
+
|
|
183
|
+
def end() -> None:
|
|
184
|
+
closing = loop.create_task(_close_ended(websocket))
|
|
185
|
+
_closing.add(closing)
|
|
186
|
+
closing.add_done_callback(_closing.discard)
|
|
187
|
+
|
|
188
|
+
hold = hold_on_session(session_id, end)
|
|
189
|
+
if hold is None:
|
|
190
|
+
await _close_ended(websocket)
|
|
191
|
+
return hold
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
async def _close_ended(websocket: WebSocket) -> None:
|
|
195
|
+
logger.info("[Connection] WebSocket closed: its session ended")
|
|
196
|
+
with contextlib.suppress(Exception): # the socket has already closed
|
|
197
|
+
await websocket.close(code=CLOSE_UNAUTHORIZED, reason=SESSION_ENDED)
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import logging
|
|
6
6
|
|
|
7
7
|
from fastapi import APIRouter, Depends, Request
|
|
8
|
-
from pydantic import BaseModel
|
|
8
|
+
from pydantic import BaseModel, StrictBool
|
|
9
9
|
|
|
10
10
|
from ..config import AppConfig
|
|
11
11
|
from ..validation import PathValidator, ValidationError
|
|
@@ -13,6 +13,7 @@ from .box_files import Answers, box_files
|
|
|
13
13
|
from .dependencies import APIDependencies
|
|
14
14
|
from .failure import REASON_INVALID, Failure
|
|
15
15
|
from .file_contract import MISSING_ARCHIVE
|
|
16
|
+
from .placement import refuse_replace_and_keep_both
|
|
16
17
|
from .rate_limiting import rate_limit_file_ops
|
|
17
18
|
|
|
18
19
|
logger = logging.getLogger(__name__)
|
|
@@ -27,11 +28,15 @@ class APIArchiveCreateRequest(BaseModel):
|
|
|
27
28
|
destination: str
|
|
28
29
|
archive_name: str
|
|
29
30
|
format: str # "tar.gz" | "tgz" | "zip"
|
|
31
|
+
overwrite: StrictBool = False
|
|
32
|
+
keep_both: StrictBool = False
|
|
30
33
|
|
|
31
34
|
|
|
32
35
|
class APIArchiveExtractRequest(BaseModel):
|
|
33
36
|
archive_path: str
|
|
34
37
|
destination: str
|
|
38
|
+
overwrite: StrictBool = False
|
|
39
|
+
keep_both: StrictBool = False
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
def _validate_archive_name(name: str, fmt: str) -> str:
|
|
@@ -60,6 +65,7 @@ def get_router(deps: APIDependencies) -> APIRouter:
|
|
|
60
65
|
application_config: AppConfig = Depends(deps.get_application_config),
|
|
61
66
|
_rate_limit: None = Depends(rate_limit_file_ops),
|
|
62
67
|
):
|
|
68
|
+
refuse_replace_and_keep_both(payload.overwrite, payload.keep_both)
|
|
63
69
|
if len(payload.paths) > MAX_ARCHIVE_PATHS:
|
|
64
70
|
raise Failure(REASON_INVALID, f"Too many paths (max {MAX_ARCHIVE_PATHS})")
|
|
65
71
|
if not payload.paths:
|
|
@@ -74,9 +80,15 @@ def get_router(deps: APIDependencies) -> APIRouter:
|
|
|
74
80
|
|
|
75
81
|
async with box_files(deps, box, application_config) as files:
|
|
76
82
|
archive_path = await files.create_archive(
|
|
77
|
-
payload.paths,
|
|
83
|
+
payload.paths,
|
|
84
|
+
payload.destination,
|
|
85
|
+
archive_name,
|
|
86
|
+
payload.format,
|
|
87
|
+
overwrite=payload.overwrite,
|
|
88
|
+
keep_both=payload.keep_both,
|
|
78
89
|
)
|
|
79
|
-
|
|
90
|
+
landed_name = files.name(archive_path)
|
|
91
|
+
return {"status": "ok", "message": f"Created {landed_name}", "path": archive_path}
|
|
80
92
|
|
|
81
93
|
@router.post("/boxes/{name}/archive/extract")
|
|
82
94
|
async def api_archive_extract(
|
|
@@ -86,10 +98,16 @@ def get_router(deps: APIDependencies) -> APIRouter:
|
|
|
86
98
|
application_config: AppConfig = Depends(deps.get_application_config),
|
|
87
99
|
_rate_limit: None = Depends(rate_limit_file_ops),
|
|
88
100
|
):
|
|
101
|
+
refuse_replace_and_keep_both(payload.overwrite, payload.keep_both)
|
|
89
102
|
box = deps.get_box_or_404(application_config, name)
|
|
90
103
|
|
|
91
104
|
async with box_files(deps, box, application_config, _ARCHIVE) as files:
|
|
92
|
-
destination = await files.extract_archive(
|
|
105
|
+
destination = await files.extract_archive(
|
|
106
|
+
payload.archive_path,
|
|
107
|
+
payload.destination,
|
|
108
|
+
overwrite=payload.overwrite,
|
|
109
|
+
keep_both=payload.keep_both,
|
|
110
|
+
)
|
|
93
111
|
return {"status": "ok", "message": "Extracted", "path": destination}
|
|
94
112
|
|
|
95
113
|
return router
|
|
@@ -5,13 +5,14 @@ from __future__ import annotations
|
|
|
5
5
|
import logging
|
|
6
6
|
|
|
7
7
|
from fastapi import APIRouter, Depends, Request
|
|
8
|
-
from pydantic import BaseModel, StrictBool
|
|
8
|
+
from pydantic import BaseModel, SerializerFunctionWrapHandler, StrictBool, model_serializer
|
|
9
9
|
|
|
10
10
|
from ..config import AppConfig
|
|
11
11
|
from .box_files import box_files
|
|
12
12
|
from .dependencies import APIDependencies
|
|
13
13
|
from .failure import REASON_INVALID, Failure
|
|
14
14
|
from .file_contract import BatchOutcome
|
|
15
|
+
from .placement import refuse_replace_and_keep_both
|
|
15
16
|
from .rate_limiting import rate_limit_delete, rate_limit_file_ops
|
|
16
17
|
|
|
17
18
|
logger = logging.getLogger(__name__)
|
|
@@ -26,14 +27,17 @@ class APIBatchDeleteRequest(BaseModel):
|
|
|
26
27
|
class APIBatchMoveRequest(BaseModel):
|
|
27
28
|
paths: list[str]
|
|
28
29
|
destination: str
|
|
29
|
-
# Applies to every item: replace a regular file that has the item's name
|
|
30
|
+
# Applies to every item: replace a regular file that has the item's name, or land
|
|
31
|
+
# beside a taken name under the first free name of its series; never both.
|
|
30
32
|
overwrite: StrictBool = False
|
|
33
|
+
keep_both: StrictBool = False
|
|
31
34
|
|
|
32
35
|
|
|
33
36
|
class APIBatchCopyRequest(BaseModel):
|
|
34
37
|
paths: list[str]
|
|
35
38
|
destination: str
|
|
36
39
|
overwrite: StrictBool = False
|
|
40
|
+
keep_both: StrictBool = False
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
class APIBatchResult(BaseModel):
|
|
@@ -42,13 +46,26 @@ class APIBatchResult(BaseModel):
|
|
|
42
46
|
# [{"path", "error", "reason"}]: `failure_entry` (`failure.py`) gives each item the
|
|
43
47
|
# reason and text a single request on that path would answer.
|
|
44
48
|
failed: list[dict]
|
|
49
|
+
# With `keep_both` only: [{"path": <as sent>, "placed": <landed path>}], one entry per
|
|
50
|
+
# item that landed under another name than asked; left out of every other answer.
|
|
51
|
+
placed: list[dict] | None = None
|
|
52
|
+
|
|
53
|
+
# No return annotation: pydantic would publish it as the answer's schema, a bare
|
|
54
|
+
# object, in place of the model's own fields.
|
|
55
|
+
@model_serializer(mode="wrap")
|
|
56
|
+
def _without_placed_unless_kept_both(self, handler: SerializerFunctionWrapHandler):
|
|
57
|
+
body: dict = handler(self)
|
|
58
|
+
if self.placed is None:
|
|
59
|
+
body.pop("placed", None)
|
|
60
|
+
return body
|
|
45
61
|
|
|
46
62
|
@classmethod
|
|
47
|
-
def of(cls, outcome: BatchOutcome) -> APIBatchResult:
|
|
63
|
+
def of(cls, outcome: BatchOutcome, *, keep_both: bool = False) -> APIBatchResult:
|
|
48
64
|
return cls(
|
|
49
65
|
status="ok" if not outcome.failed else "partial",
|
|
50
66
|
succeeded=outcome.succeeded,
|
|
51
67
|
failed=outcome.failed,
|
|
68
|
+
placed=outcome.placed if keep_both else None,
|
|
52
69
|
)
|
|
53
70
|
|
|
54
71
|
|
|
@@ -87,13 +104,7 @@ def get_router(deps: APIDependencies) -> APIRouter:
|
|
|
87
104
|
application_config: AppConfig = Depends(deps.get_application_config),
|
|
88
105
|
_rate_limit: None = Depends(rate_limit_file_ops),
|
|
89
106
|
) -> APIBatchResult:
|
|
90
|
-
|
|
91
|
-
box = deps.get_box_or_404(application_config, name)
|
|
92
|
-
async with box_files(deps, box, application_config) as files:
|
|
93
|
-
outcome = await files.place_many(
|
|
94
|
-
payload.paths, payload.destination, move=True, overwrite=payload.overwrite
|
|
95
|
-
)
|
|
96
|
-
return APIBatchResult.of(outcome)
|
|
107
|
+
return await _place_many(name, payload, application_config, move=True)
|
|
97
108
|
|
|
98
109
|
@router.post("/boxes/{name}/batch/copy", response_model=APIBatchResult)
|
|
99
110
|
async def api_batch_copy(
|
|
@@ -102,13 +113,27 @@ def get_router(deps: APIDependencies) -> APIRouter:
|
|
|
102
113
|
payload: APIBatchCopyRequest,
|
|
103
114
|
application_config: AppConfig = Depends(deps.get_application_config),
|
|
104
115
|
_rate_limit: None = Depends(rate_limit_file_ops),
|
|
116
|
+
) -> APIBatchResult:
|
|
117
|
+
return await _place_many(name, payload, application_config, move=False)
|
|
118
|
+
|
|
119
|
+
async def _place_many(
|
|
120
|
+
name: str,
|
|
121
|
+
payload: APIBatchMoveRequest | APIBatchCopyRequest,
|
|
122
|
+
application_config: AppConfig,
|
|
123
|
+
*,
|
|
124
|
+
move: bool,
|
|
105
125
|
) -> APIBatchResult:
|
|
106
126
|
_validate_batch_size(payload.paths)
|
|
127
|
+
refuse_replace_and_keep_both(payload.overwrite, payload.keep_both)
|
|
107
128
|
box = deps.get_box_or_404(application_config, name)
|
|
108
129
|
async with box_files(deps, box, application_config) as files:
|
|
109
130
|
outcome = await files.place_many(
|
|
110
|
-
payload.paths,
|
|
131
|
+
payload.paths,
|
|
132
|
+
payload.destination,
|
|
133
|
+
move=move,
|
|
134
|
+
overwrite=payload.overwrite,
|
|
135
|
+
keep_both=payload.keep_both,
|
|
111
136
|
)
|
|
112
|
-
return APIBatchResult.of(outcome)
|
|
137
|
+
return APIBatchResult.of(outcome, keep_both=payload.keep_both)
|
|
113
138
|
|
|
114
139
|
return router
|
|
@@ -52,6 +52,15 @@ connect that timed out is not taken for tmux that did. No tmux on the box raises
|
|
|
52
52
|
``tmux.run_local_tmux`` (on Windows tmux runs in WSL); a remote box sends
|
|
53
53
|
``tmux.remote_tmux_command``.
|
|
54
54
|
|
|
55
|
+
``force_kill(session)`` ends the session as the user's force kill asks: the session's own
|
|
56
|
+
``ts-<session>`` server is asked for its pane process ids and stopped, and each pane's
|
|
57
|
+
process group and process gets SIGKILL, so a process that ignores SIGHUP is gone too. No
|
|
58
|
+
other tmux server is touched and no process that server did not list is signalled; a
|
|
59
|
+
session that is already gone (or lives on the default server only) is not an error. The
|
|
60
|
+
limit, the timeout and a missing tmux are those of ``tmux``. Where the kinds differ: the
|
|
61
|
+
local box runs ``tmux.force_kill_local_session`` (best-effort: tmux missing or past its
|
|
62
|
+
limit is not raised); a remote box runs ``tmux.REMOTE_FORCE_KILL`` as one command.
|
|
63
|
+
|
|
55
64
|
A remote runner takes its box's pooled connection at the first call that needs it and
|
|
56
65
|
gives it back when the block ends.
|
|
57
66
|
"""
|
|
@@ -153,6 +162,10 @@ class BoxRunner(Protocol):
|
|
|
153
162
|
"""tmux on ``session``'s own server with ``args``: status, output, error output."""
|
|
154
163
|
...
|
|
155
164
|
|
|
165
|
+
async def force_kill(self, session: str) -> None:
|
|
166
|
+
"""Stop ``session``'s own server and SIGKILL every pane process it listed."""
|
|
167
|
+
...
|
|
168
|
+
|
|
156
169
|
|
|
157
170
|
class LocalRunner:
|
|
158
171
|
"""Runs a program on this machine with ``proc.run_bounded``; no shell. ``box`` is
|
|
@@ -219,6 +232,9 @@ class LocalRunner:
|
|
|
219
232
|
raise ProgramNotFoundError("tmux", self._box) from exc
|
|
220
233
|
return Ran(status, _text(stdout), _text(stderr))
|
|
221
234
|
|
|
235
|
+
async def force_kill(self, session: str) -> None:
|
|
236
|
+
await tmux_module.force_kill_local_session(session)
|
|
237
|
+
|
|
222
238
|
|
|
223
239
|
def remote_command_line(
|
|
224
240
|
words: Sequence[str],
|
|
@@ -310,6 +326,15 @@ class RemoteRunner:
|
|
|
310
326
|
raise ProgramNotFoundError("tmux", self._box)
|
|
311
327
|
return Ran(-1 if status is None else status, _text(result.stdout), _text(result.stderr))
|
|
312
328
|
|
|
329
|
+
async def force_kill(self, session: str) -> None:
|
|
330
|
+
words = tmux_module.remote_force_kill_words(session)
|
|
331
|
+
try:
|
|
332
|
+
await self.run(
|
|
333
|
+
words, folder=None, timeout=tmux_module.TMUX_COMMAND_TIMEOUT, program="tmux"
|
|
334
|
+
)
|
|
335
|
+
except TimeoutError as exc:
|
|
336
|
+
raise TmuxTimeoutError(f"tmux on {session} timed out") from exc
|
|
337
|
+
|
|
313
338
|
|
|
314
339
|
def over(connection: Any, box: str = "remote") -> RemoteRunner:
|
|
315
340
|
"""A remote runner on a connection the caller holds, for the box named ``box``."""
|
|
@@ -132,7 +132,7 @@ def get_router(deps: APIDependencies) -> APIRouter:
|
|
|
132
132
|
target = f"{session}:{window}"
|
|
133
133
|
|
|
134
134
|
# Ensure the repo-root session exists.
|
|
135
|
-
if session not in await discover_local_sessions():
|
|
135
|
+
if session not in (await discover_local_sessions()).names:
|
|
136
136
|
await _run_local_tmux_command(
|
|
137
137
|
session, ["new-session", "-d", "-s", session, "-c", session_dir]
|
|
138
138
|
)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"""The answer of every failed request: its reason, its status and its body.
|
|
2
2
|
|
|
3
3
|
Every failure answers ``{"detail": <text>, "reason": <word>}`` with the status of its
|
|
4
|
-
reason
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
reason; a refusal about many names of one request (an extract onto existing files) adds
|
|
5
|
+
``"taken": {"count": <number>, "names": [<the first few>]}``. ``Failure`` is the one
|
|
6
|
+
exception a route, an operation or a dependency raises to answer by reason;
|
|
7
|
+
``failure_of`` is the one function that names the reason of any other failure (of the
|
|
8
|
+
system, of SFTP or SSH, of a path check, of a time limit, of a program that is not on
|
|
9
|
+
the box) for both kinds of box; ``failure_entry`` gives a batch
|
|
8
10
|
item the same reason and text; ``failure_body`` is the body itself, which a stream's
|
|
9
11
|
``error`` event carries too; the handlers ``install`` registers write the body, and
|
|
10
12
|
``answer`` writes it for a check that answers before any route runs.
|
|
@@ -16,6 +18,7 @@ import errno
|
|
|
16
18
|
import logging
|
|
17
19
|
import os
|
|
18
20
|
from collections.abc import Callable, Mapping
|
|
21
|
+
from dataclasses import dataclass
|
|
19
22
|
|
|
20
23
|
import asyncssh
|
|
21
24
|
from fastapi import FastAPI, HTTPException, Request
|
|
@@ -85,10 +88,19 @@ _REASON_OF_STATUS: dict[int, str] = {
|
|
|
85
88
|
_TIMED_OUT = "Timed out"
|
|
86
89
|
|
|
87
90
|
|
|
91
|
+
@dataclass(frozen=True)
|
|
92
|
+
class Taken:
|
|
93
|
+
"""The names one request found taken: how many, and the first few of them."""
|
|
94
|
+
|
|
95
|
+
count: int
|
|
96
|
+
names: tuple[str, ...]
|
|
97
|
+
|
|
98
|
+
|
|
88
99
|
class Failure(HTTPException):
|
|
89
100
|
"""A failed request, raised by its reason: it answers the reason's status (or
|
|
90
101
|
``status`` where an answer kept its own, as the existing-name rule does) and
|
|
91
|
-
``{"detail": detail, "reason": reason}``, with ``headers
|
|
102
|
+
``{"detail": detail, "reason": reason}``, with ``headers``; with ``taken`` the body
|
|
103
|
+
also carries those names."""
|
|
92
104
|
|
|
93
105
|
def __init__(
|
|
94
106
|
self,
|
|
@@ -97,6 +109,7 @@ class Failure(HTTPException):
|
|
|
97
109
|
*,
|
|
98
110
|
status: int | None = None,
|
|
99
111
|
headers: Mapping[str, str] | None = None,
|
|
112
|
+
taken: Taken | None = None,
|
|
100
113
|
) -> None:
|
|
101
114
|
if reason not in STATUS_OF_REASON:
|
|
102
115
|
raise ValueError(f"not a reason of a failed request: {reason!r}")
|
|
@@ -106,6 +119,7 @@ class Failure(HTTPException):
|
|
|
106
119
|
headers=dict(headers) if headers else None,
|
|
107
120
|
)
|
|
108
121
|
self.reason = reason
|
|
122
|
+
self.taken = taken
|
|
109
123
|
|
|
110
124
|
|
|
111
125
|
def _reason_of_status(status: int) -> str:
|
|
@@ -254,11 +268,18 @@ def failure_entry(
|
|
|
254
268
|
return {"path": path, "error": str(found.detail), "reason": found.reason}
|
|
255
269
|
|
|
256
270
|
|
|
257
|
-
def failure_body(exc: BaseException) -> dict[str,
|
|
258
|
-
"""The body of the failure ``exc``: ``{"detail": <text>, "reason": <word>}``,
|
|
259
|
-
failed request answers it and as a stream's
|
|
271
|
+
def failure_body(exc: BaseException) -> dict[str, object]:
|
|
272
|
+
"""The body of the failure ``exc``: ``{"detail": <text>, "reason": <word>}``, and
|
|
273
|
+
``taken`` when it has one, as a failed request answers it and as a stream's
|
|
274
|
+
``error`` event carries it."""
|
|
260
275
|
found = failure_of(exc)
|
|
261
|
-
|
|
276
|
+
body: dict[str, object] = {"detail": _text(found.detail), "reason": found.reason}
|
|
277
|
+
if found.taken is not None:
|
|
278
|
+
body["taken"] = {
|
|
279
|
+
"count": found.taken.count,
|
|
280
|
+
"names": [_text(name) for name in found.taken.names],
|
|
281
|
+
}
|
|
282
|
+
return body
|
|
262
283
|
|
|
263
284
|
|
|
264
285
|
def answer(
|