diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 109d76d..b039564 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,12 @@ jobs: with: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 + - &linux-tray-deps + name: Install GTK and AppIndicator development files + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends libgtk-3-dev libayatana-appindicator3-dev - run: cargo fmt --all -- --check - run: cargo clippy --locked --workspace --all-targets -- -D warnings - name: Check Debian release candidate upgrade ordering @@ -39,11 +45,11 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - run: cargo test --locked --workspace --all-targets - - name: run the examples - run: | - cargo run --locked --example two_agents - cargo run --locked --example wireguard_mesh + - *linux-tray-deps + - name: Test the workspace, including peer exchange and WireGuard integration + run: cargo test --locked --workspace --all-targets + - name: Start the command line client + run: cargo run --locked --bin tsng -- --version # The library must keep building without the command line binary and # without interface support, for embedders that want neither. @@ -54,7 +60,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - run: cargo check --locked --no-default-features --lib + - run: cargo check --locked -p tsunagi-core --no-default-features --lib docs: name: rustdoc @@ -63,6 +69,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + - *linux-tray-deps - run: cargo doc --locked --workspace --no-deps env: RUSTDOCFLAGS: -D warnings @@ -74,4 +81,5 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.91.0 - uses: Swatinem/rust-cache@v2 + - *linux-tray-deps - run: cargo check --locked --workspace --all-targets diff --git a/crates/tsunagi-core/src/ipc/unix.rs b/crates/tsunagi-core/src/ipc/unix.rs index 32f4737..81733f9 100644 --- a/crates/tsunagi-core/src/ipc/unix.rs +++ b/crates/tsunagi-core/src/ipc/unix.rs @@ -3,7 +3,7 @@ //! One of the per-platform adapters; see [`super`]. It provides only what is //! particular to a Unix socket — binding a listener, connecting a client, and //! the owner-only permissions — and hands every accepted connection to the -//! shared [`serve_connection`](super::serve_connection). The request framing, +//! shared connection handler. The request framing, //! the dispatch and the client wrappers are the same on every platform and //! live in [`super`], re-exported here so `ipc::unix::request_status` and its //! siblings keep resolving. diff --git a/crates/tsunagi-core/src/ipc/windows.rs b/crates/tsunagi-core/src/ipc/windows.rs index 9e9c5ce..ab7ad5b 100644 --- a/crates/tsunagi-core/src/ipc/windows.rs +++ b/crates/tsunagi-core/src/ipc/windows.rs @@ -1,9 +1,9 @@ //! A named-pipe adapter for the local control interface. //! -//! The Windows counterpart of [`super::unix`]. It provides only what is +//! The Windows counterpart of the Unix socket adapter. It provides only what is //! particular to a named pipe — creating the server instance, opening a client //! and turning the state directory path into a pipe name — and hands every -//! accepted connection to the shared [`serve_connection`](super::serve_connection). +//! accepted connection to the shared connection handler. //! The framing, the dispatch and the client wrappers are the same on every //! platform and live in [`super`], re-exported here so `ipc::windows::request_status` //! and its siblings resolve just as their Unix equivalents do. diff --git a/crates/tsunagi-core/src/overlay/hostrules/macos.rs b/crates/tsunagi-core/src/overlay/hostrules/macos.rs index 81fa1b0..96b8b9b 100644 --- a/crates/tsunagi-core/src/overlay/hostrules/macos.rs +++ b/crates/tsunagi-core/src/overlay/hostrules/macos.rs @@ -66,8 +66,8 @@ fn firewall_todo(plan: &BroadcastRulesPlan) -> String { ) } -/// The macOS implementation: `route` for the route, no firewall yet, and -/// `pf` plus `route` for exit nodes (see [`super::macos_exit`]). +/// Installs macOS broadcast routes with `route` and manages exit routing with +/// `pf` and `route`. #[derive(Debug, Default)] pub struct MacosHostRules { /// The PF reference and the physical routes owned by this agent. diff --git a/crates/tsunagi/src/main.rs b/crates/tsunagi/src/main.rs index 97f8b9a..79440b8 100644 --- a/crates/tsunagi/src/main.rs +++ b/crates/tsunagi/src/main.rs @@ -6357,14 +6357,17 @@ mod service_log_tests { ); let big = std::fs::File::options() - .append(true) + .write(true) .open(logs.join("tsng.log")) .unwrap(); big.set_len(SERVICE_LOG_LIMIT + 1).unwrap(); drop(big); let file = open_log_in(&logs).unwrap(); assert_eq!(file.metadata().unwrap().len(), 0); - assert!(logs.join("tsng.log.old").exists()); + assert_eq!( + std::fs::metadata(logs.join("tsng.log.old")).unwrap().len(), + SERVICE_LOG_LIMIT + 1 + ); } #[test]