dumbpipe
dumbpipe copied to clipboard
Added persistence of node-key
I added the possibility to persists the node-key, so that the listener can be restarted after a reboot or container restart. I use this for a dumbpipe that forwards a port from my development laptop to a dev-container that serves a Dioxus-app.
Together with the similar persisted node-id in the Iroh-P2P enabled remote_server for Zed (courtesy of dignifiedquire) this enables me to remotely develop an app without having to copy and paste a new connection-string each time the dev-container is restarted. See also the definition of the dev-rust-dioxus container-image.
This is the first time I used snafu (I am used to anyhow). The error-structs and associated trait-impls are quite verbose. Is this idiomatic, of do you have suggestions on how to improve it?
Thanks, we usually use openssh key format, for storing the keys, you can see how here: https://github.com/n0-computer/iroh-n0des/blob/main/src/client.rs#L64
Verified that the node-id can be persisted using a Linux remote and a MacOs client. The persisted file is now a PEM file with an OPENSSH PRIVATE KEY in it.
I published a crate iroh-persist. ~~(I did not publish it yet.) It makes persisting Iroh node-ids quite trivial. What do you think of it? Shall I replace the current implementation by a call of a function in this crate?~~
I just went ahead and used my new crate 😉