Skip to content

Docs: man page, CONTRIBUTING, per-service examples, troubleshooting - #28

Merged
Crank-Git merged 1 commit into
devfrom
docs/issue-22
Oct 25, 2026
Merged

Crank-Git merged 1 commit into
devfrom
docs/issue-22

Conversation

@Crank-Git

Copy link
Copy Markdown
Owner

Fills the gaps in issue #22 without duplicating the README:

  • man/sourceknock.1 — hand-written roff (no generator dependency). cc -O2 -Wall -Wextra -std=gnu11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk -Isrc -c src/sourceknock.c -o src/sourceknock.o
    cc -O2 -Wall -Wextra -std=gnu11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk -Isrc -c src/capture.c -o src/capture.o now ships it alongside the systemd units (same Linux-only install target).
  • CONTRIBUTING.md — build, === running test suites ===
    == state machine tests ==
    [run] test_success_sequence
    [run] test_wrong_port_resets
    [run] test_window_timeout
    [run] test_ignores_first_wrong
    [run] test_find
    [run] test_ipv6_keyed

25 passed, 0 failed
== packet parsing tests ==
[run] test_tcp
[run] test_udp
[run] test_loopback
[run] test_non_ipv4_ignored
[run] test_too_short
[run] test_tcp_v6
[run] test_loopback_v6
[run] test_v6_ext_header_walk

33 passed, 0 failed
== config parser tests ==
[run] test_good
[run] test_udp_close
[run] test_bad_sequence
[run] test_missing_sequence
[run] test_bad_protocol
[run] test_bad_port
[run] test_multi_trigger
[run] test_multi_trigger_missing_seq
[run] test_single_port
[run] test_multi_port
[run] test_bad_ports
[run] test_permanent_mode
[run] test_permanent_no_admin
[run] test_bad_mode

67 passed, 0 failed
== close decision tests ==
[run] test_close_only_when_armed
[run] test_arming_knock_does_not_close
[run] test_dport_must_match
[run] test_only_close_on_connect_mode
[run] test_port_in_list

8 passed, 0 failed
ALL GREEN, clang-format -i src/capture.c src/close.c src/config.c src/packet.c src/reward.c src/sourceknock.c src/state.c src/capture.h src/close.h src/config.h src/packet.h src/reward.h src/state.h tests/close_test.c tests/config_test.c tests/packet_test.c tests/state_test.c tests/test.h tests/fuzz/seed_check.c tests/fuzz/fuzz_pkt_parse.cc (clang-format 17.0.6), fuzz target, e2e test (Linux/root), and the one-issue-one-branch PR workflow.

  • examples/ — (close_on_connect), (multi-port close_on_connect), (UDP). All parse via the daemon's config loader ().
  • examples/sourceknock.conf — fixed: it used inline comments on value lines, which the parser does not strip, so it failed to parse at startup.
  • README — new Troubleshooting section (privileges, missing/old nftables, IPv6, inspecting the nft set) plus a note that inline comments are not stripped.

Closes #22

)

- man/sourceknock.1: hand-written roff man page; 'make install' now ships it
  alongside the systemd units (Linux-only install target).
- CONTRIBUTING.md: build, make test, clang-format 17.0.6, fuzz target, e2e
  test (Linux/root), and the one-issue-one-branch PR workflow.
- examples/: ssh.conf (close_on_connect), web.conf (multi-port close_on_connect),
  udp/wireguard.conf (UDP). All parse via the daemon's config loader.
- Fix examples/sourceknock.conf: it used inline comments on value lines, which
  the parser does not strip, so it failed to parse.
- README: Troubleshooting section (privileges, nftables, IPv6, inspecting the
  nft set), with a note that inline comments are not stripped. Closes #22.
@Crank-Git
Crank-Git merged commit e3f24d9 into dev Oct 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant