tools tier

tools-socks-route

Configures the browser's SOCKS egress path end to end: a systemd --user ssh dynamic-forward unit and the matching Firefox proxy prefs, applied idempotently and revertible in one command. Replaces hand-editing a unit file and about:preferences and getting the two out of step.

Configures the browser's SOCKS egress path end to end: a systemd --user ssh dynamic-forward unit and the matching Firefox proxy prefs, applied idempotently and revertible in one command. Replaces hand-editing a unit file and about:preferences and getting the two out of step.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/socks-route
Edition2021
Targetstools-socks-route, tools_socks_route, oracle
Public items16 across 0 modules
Tests14

What it is for

tools-socks-route -- the decidable core. Nothing here touches the filesystem, the network, or systemd; main.rs is the only place that does I/O.

Capabilities

crate root

tools-socks-route -- the decidable core. Nothing here touches the filesystem, the

Item
pub const BEGIN: & str
pub const END: & str
pub const DEFAULT_USER: & str
pub const DEFAULT_SSH_PORT: u32
pub const DEFAULT_LOCAL_PORT: u32
fn revert_user_js(existing : & str) -> String
fn block_port(user_js : & str) -> Option <u32>
pub const PORT_SEARCH_SPAN: u32
fn port_candidates(start : u32) -> Vec <u32>
fn session_restore_enabled(prefs : & str) -> bool
fn is_main_firefox(argv : & String) -> bool

RouteSpec

tools-socks-route -- the decidable core. Nothing here touches the filesystem, the

Item
pub struct RouteSpec
RouteSpec :: fn validate(& self) -> Result <(), String>
fn render_unit(spec : & RouteSpec) -> String
fn user_js_block(spec : & RouteSpec) -> String
fn apply_user_js(existing : & str, spec : & RouteSpec) -> String

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub const BEGIN: & strOpening marker of the block this tool owns inside user.js.
pub const END: & strClosing marker of the block this tool owns inside user.js.
pub const DEFAULT_USER: & str
pub const DEFAULT_SSH_PORT: u32
pub const DEFAULT_LOCAL_PORT: u32
pub struct RouteSpec
RouteSpec :: fn validate(& self) -> Result <(), String>Every field lands in a systemd ExecStart= line and an ssh argument vector
fn render_unit(spec : & RouteSpec) -> StringThe systemd --user unit
fn user_js_block(spec : & RouteSpec) -> StringThe block written into user.js
fn apply_user_js(existing : & str, spec : & RouteSpec) -> StringAdd or replace the managed block, neutralizing any hand-written proxy pref first
fn revert_user_js(existing : & str) -> StringRemove the managed block and restore every pref it neutralized, byte for byte.
fn block_port(user_js : & str) -> Option <u32>The SOCKS port the browser is currently pointed at, if the managed block is present.
pub const PORT_SEARCH_SPAN: u32How many ports past the requested one to try before giving up.
fn port_candidates(start : u32) -> Vec <u32>Ports to try, in order, when the requested one is already held
fn session_restore_enabled(prefs : & str) -> boolWhether Firefox will reopen the current windows and tabs after a restart
fn is_main_firefox(argv : & String) -> boolWhether a process's argv identifies the ONE parent Firefox process

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/socks-route
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
clap^4derivenoalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["tools-socks-route"]
  SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
bintools-socks-route`src/main.rs`
libtools_socks_route`src/lib.rs`
testoracle`tests/oracle.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
HOMEsrc/main.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests1
Integration tests13
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root1500

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1216
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 12
    "No rustdoc detected" : 4

Metrics

MetricValue
Rust source files2
Source lines889
Code lines721
Public API items16
Public modules0
Tests14
Examples0
Cargo features0
Direct runtime dependencies2
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 6
    "function" : 8
    "method" : 1
    "struct" : 1
pie showData
    title Rust source composition
    "Code" : 721
    "Blank or comment" : 168

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All tools · Manual