anathema icon indicating copy to clipboard operation
anathema copied to clipboard

WIP: feature/SSH

Open alexanderbh opened this issue 5 months ago • 0 comments

Adds an Anathema SSH server that can serve Anathema apps to client SSH connections.

No breaking changes to existing code.

Changes to exisiting code

  • Adds a new way to create a Backend which takes in the "output"/Writer. So it is not hardcoded to stdout.
  • Added more modifier keys to the Key event (maybe needs to be mapped from crossterm as well)

New code

  • Added a feature "ssh" for this. Not sure if this is needed since you just don't use the SSH server if you don't need it
  • anathema-ssh crate which exposes the AnathemaSSHServer and SSHBackend
  • SSHBackend is a think wrapper on TuiBackend but instead of reading events from crossterm (stdin) it directly pop events from the event queue
  • AnathemaSSHServer takes in a "runtime factory" which is a function that will start the runtime. This is called for each new client.
    • It is therefore the AnathemaSSHServer that instantiates the SSHBackend for each client. It will hook it up with the SSH sesession. The runtime factory then get's the new SSHBackend instance.

Demo:

https://github.com/user-attachments/assets/cbd29934-2f0c-42c3-b841-314e5c1503c7

alexanderbh avatar Jul 18 '25 10:07 alexanderbh