mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-22 07:48:26 +00:00
Add an outbound-only Nym mixnet transport that tunnels FMP peer links through a local nym-socks5-client SOCKS5 proxy into the Nym mixnet. It structurally mirrors the Tor SOCKS5 transport (connection pool, connect-on-send background promotion, FMP-v0 framing reused from TCP) with the onion, inbound-listener, and control-port machinery removed. Wires the transport through the full TransportHandle dispatch, NymConfig (standard transport-instance pattern), and node instantiation, and surfaces its counters in fipstop. Includes a mock SOCKS5 harness and unit coverage for the address-parsing paths. Also adds an isolated single-container example (examples/sidecar-nostr-mixnet-relay/) demonstrating FIPS peering across the mixnet end to end. No new crate dependencies: tokio_socks, socket2, and futures are already pulled in by the Tor transport.
38 lines
1.7 KiB
Bash
38 lines
1.7 KiB
Bash
# FIPS-over-Nym-mixnet demo configuration.
|
|
# Override these values or create a .env.local file.
|
|
|
|
# Node identity — generate with: fipsctl keygen
|
|
# Must be set before running: export FIPS_NSEC=<your-nsec>
|
|
FIPS_NSEC=
|
|
|
|
# Peer configuration (leave FIPS_PEER_NPUB empty for standalone operation).
|
|
# The peer MUST expose a TCP endpoint in nym mode — the Nym SOCKS5 proxy
|
|
# tunnels TCP streams. Find more public peers at https://join.fips.network/
|
|
# Default peer test-us03 exposes tcp:54.183.70.180:443 and udp:…:2121.
|
|
# For udp mode (see FIPS_PEER_TRANSPORT below) change FIPS_PEER_ADDR to
|
|
# 54.183.70.180:2121.
|
|
# The alias doubles as the peer's .fips hostname (<alias>.fips), so it
|
|
# must be a plain hostname label — no dots.
|
|
FIPS_PEER_NPUB=npub136yqae6na688fs75g95ppps3lxe07fvxefj77938zf47uhm6074sxw8ctm
|
|
FIPS_PEER_ADDR=54.183.70.180:443
|
|
FIPS_PEER_ALIAS=test-us03
|
|
|
|
# Transport — THE switch that selects mixnet vs. direct: nym | tcp | udp
|
|
# nym : peer traffic goes through the Nym mixnet via the in-container
|
|
# nym-socks5-client (started automatically, before FIPS). DEFAULT.
|
|
# tcp : direct TCP to FIPS_PEER_ADDR; the nym client is NOT started.
|
|
# udp : direct UDP — also set FIPS_PEER_ADDR to the peer's :2121 endpoint.
|
|
# To go back to a direct link, just set this to tcp (or udp) and re-run
|
|
# `docker compose up`. Nothing else needs to change for tcp.
|
|
FIPS_PEER_TRANSPORT=nym
|
|
|
|
# ----- Nym mixnet (only used when FIPS_PEER_TRANSPORT=nym) -----
|
|
# Network-requester service provider. Leave empty to auto-discover the
|
|
# best-scored provider from https://harbourmaster.nymtech.net/ at startup.
|
|
NYM_SERVICE_PROVIDER=
|
|
NYM_CLIENT_ID=fips-nym-client
|
|
FIPS_NYM_SOCKS5_ADDR=127.0.0.1:1080
|
|
|
|
# Logging
|
|
RUST_LOG=info
|