Skip to main content

iroh_ssh/
lib.rs

1mod cli;
2mod service;
3mod ssh;
4
5use std::path::PathBuf;
6
7use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH};
8use iroh::{Endpoint, RelayUrl, protocol::Router};
9
10pub mod api;
11
12pub use cli::*;
13pub use service::Service;
14pub use service::ServiceParams;
15pub use service::{install_service, run_service, uninstall_service};
16pub use ssh::dot_ssh;
17
18#[derive(Debug, Clone)]
19pub struct IrohSsh {
20    #[allow(dead_code)]
21    pub(crate) secret_key: [u8; SECRET_KEY_LENGTH],
22    #[allow(dead_code)]
23    pub(crate) public_key: [u8; PUBLIC_KEY_LENGTH],
24    pub(crate) inner: Option<Inner>,
25    pub(crate) ssh_port: u16,
26}
27
28#[derive(Debug, Clone)]
29pub(crate) struct Inner {
30    pub endpoint: Endpoint,
31    #[allow(dead_code)]
32    pub router: Router,
33}
34
35#[derive(Debug, Clone)]
36pub struct Builder {
37    secret_key: [u8; SECRET_KEY_LENGTH],
38    accept_incoming: bool,
39    accept_port: Option<u16>,
40    key_dir: Option<PathBuf>,
41    relay_urls: Vec<RelayUrl>,
42    extra_relay_urls: Vec<RelayUrl>,
43}