aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-ptmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* ptmgr todo: Remove dead code allowIan Jackson2022-11-301-2/+0
|
* ptmgr: No need for state_dir in PtMgrIan Jackson2022-11-301-4/+1
| | | | This is used exclusively by the reactor.
* ptmgr todo: Tolerate exposing the Vec for nowIan Jackson2022-11-301-1/+1
| | | | | We may want to change this later, but this API is in a low level crate, so this isn't a blocker.
* Merge branch 'no_empty_select' into 'main'eta2022-11-301-1/+9
|\ | | | | | | | | | | | | ptmgr: Do not construct an empty select_all future. Closes #672 and #670 See merge request tpo/core/arti!907
| * ptmgr: Do not construct an empty select_all future.Nick Mathewson2022-11-301-1/+9
| | | | | | | | | | | | Closes #670. Closes #672.
* | ptmgr: change error UnconfiguredTransportDueToConcurrentReconfigurationIan Jackson2022-11-302-6/+8
| | | | | | | | | | | | | | | | Rename it from UnconfiguredTransport. Change descriptions, kind, and retry. Add a TODO. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858455
* | ptmgr: Clarify E::NotAFileIan Jackson2022-11-301-2/+6
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858454
* | ptmgr: Fix kind for E::StatedirCreateFailedIan Jackson2022-11-301-1/+1
|/ | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858456
* ptmgr: report an error if PT transports don't match requested.Nick Mathewson2022-11-292-2/+9
| | | | | (I think this may be impossible now, since we check in ipc.rs, but IMO it's best to check.)
* Register transport in pt reactor even if it has no pending requestsNick Mathewson2022-11-291-1/+1
|
* ptmgr: Use anonymize_home when displaying paths in errorsNick Mathewson2022-11-291-3/+4
|
* ptmgr: Use PluggableTransport::identity in logs.Nick Mathewson2022-11-292-2/+10
| | | | This lets us avoid logging the user's path.
* Centralize the "find an identifier for the pt name" logic in one place.Nick Mathewson2022-11-292-11/+37
|
* Merge remote-tracking branch 'eta/ptreactor-v1' into merge_ptreactorNick Mathewson2022-11-293-39/+263
|\ | | | | | | | | Resolved several conflicts while doing so; mostly with !893 and !895.
| * tor-ptmgr: add PtReactoreta2022-11-293-37/+264
| | | | | | | | | | | | This fleshes out the PtReactor that was previously a stub, making it actually do reactor-ey things. Note that this is entirely untested, and might not work at all. Hopefully it does, though.
* | Clarify internal error.Ian Jackson2022-11-291-2/+2
| |
* | ptmgr: Refine RetryTime for ChildSpawnFailed.Nick Mathewson2022-11-291-1/+7
| |
* | ptmgr: Rename ClientTransportFailed, document, and correct its RetryTime.Nick Mathewson2022-11-292-6/+7
| |
* | ptmgr: Replace StdioUnavailable with a PtError.Nick Mathewson2022-11-292-11/+12
| |
* | Rename LocalLoginFailed to ExternalToolFailed.Nick Mathewson2022-11-291-1/+1
|/
* PtMgr: Use a persistent state directory for PT state.Nick Mathewson2022-11-281-9/+8
| | | | | | | | | | This makes a `pt_state` directory inside .local/share/arti (or the local equivalent), right next to our existing `state` dir. Ideally we would use a separate directory for each PT, but we have a very fuzzy "what is a specific PT" notion. Closes #667
* Revise the API of "PtMgr::reconfigure"Nick Mathewson2022-11-281-2/+7
| | | | | | | | I prefer that it not take `&mut self`, since PtMgr already has interior mutability. I also need it to take `tor_config::Reconfigure` argument, in case it gains any more smarts about validation in the future.
* ptmgr: Note a TODO issue around TempDir.Nick Mathewson2022-11-281-0/+2
|
* ptmgr: Fill in some error-related code; resolve TODOs.Nick Mathewson2022-11-282-8/+50
|
* ptmgr: clear up unused_import exceptions.Nick Mathewson2022-11-282-16/+21
|
* ptmgr: Mark PtMessage and next_message as experimental-api.Nick Mathewson2022-11-281-3/+4
| | | | | | | | These are implementation details and we don't want to mark them as stable. To do this, I needed to apply some additional options to the example code's configuration in Cargo.toml.
* Draft: Pluggable transport managereta2022-11-284-68/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements `PtMgr`, a pluggable transport manager responsible for keeping track of spawned PTs and spawning them to satisfy client requests on demand. It does this in two parts: the `PtMgr` type exported to the rest of the code, and the background `PtReactor` that actually does the spawning; this design ensures that only one attempt to spawn a PT is active at a time, and will prove useful later for implementing e.g. timeouts. A few changes were necessary to the rest of the code in order to make this all work out. Namely: - `TransportRegistry`'s API didn't make any sense for two reasons: - It wasn't feasible for implementors to implement `ChannelFactory`, since that'd require constructing a `ChanBuilder` (which requires a bootstrap reporting event sender). - Treating the PT manager as a registry is over-general; it's only necessary for it to spawn pluggable transports, so saddling it with other concerns didn't make any sense. - (It's possible to get extensibility for arbitrary user customization by just letting the user swap in a new `ChannelFactory`, anyway.) - Therefore, the `PtMgr` implements the new `AbstractPtMgr` trait, which is far more narrowly focused; this only exists to solve a dependency loop, and is documented as such. - This provides a `TransportHelper` instead of a `ChannelFactory`.
* Replace TransportRegistry with AbstractPtMgreta2022-11-221-32/+1
| | | | | | | | | | | | | | | | | | It doesn't make much sense to have the pluggable transport manager be a registry, so replace its interface with a more narrowly defined, less generic version. Other changes: - instead of returning a &-reference, it returns an owned Arc, which should make the ptmgr easier to implement while allowing efficient reuse - provision for error handling is added, but will probably be revised in a future commit pending discussion - tor-ptmgr code that would generate warnings as a result of this change is temporarily removed This is a split out version of arti!886, intended so work on arti#659 can proceed.
* tor-ptmgr: make configuration use builders, plumb into arti-clienteta2022-11-161-8/+39
| | | | | | | This brings the draft configuration mechanisms in tor-ptmgr in line with the config in other crates, using builders. It also plumbs the config type through into the main `arti-client` config, and adds some example lines to `arti-example-config.toml`.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* ptmgr::ipc: Try an alternate approach to initial quotes.Nick Mathewson2022-10-261-10/+5
| | | | This lets us use `chars()` rather than `char_indices()`.
* tor-ptmgr/ipc: First cut of pluggable transport spawningeta2022-10-263-0/+925
| | | | | | | | | | | | | | | | | | | | | | | The new `ipc` module inside `tor-ptmgr` implements the Pluggable Transport Specification version 1 (`pt-spec.txt`, https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/pt-spec.txt). This enables module users to spawn pluggable transport binaries inside a child process asynchronously, and receive structured information about how to connect to the transports provided by said binaries. Internally, this is structured as a pure set of serialisers and deserialisers for the protocol in the specification (in the form of environment variables, and the PT's stdout), a wrapper to run the PT binary and enable accessing its output asynchronously, and a user-facing wrapper that handles ensuring all the requested transports launched properly. The included `run-pt` example is an exceedingly minimal wrapper program that was useful in testing. More tests can and should be added in a further MR. closes arti#394; part of arti#69
* Merge branch 'factory_redux' into 'main'Nick Mathewson2022-10-131-3/+1
|\ | | | | | | | | chanmgr: Build and use chanmgr factory APIs See merge request tpo/core/arti!769
| * chanmgr: Clean up async-ness on factory types.Nick Mathewson2022-10-121-3/+1
| | | | | | | | | | | | | | | | The traits that launch connections need to be async; the traits that don't, shouldn't be async. Additionally, we need a few more "Sync" annotations here for the futures to work.
* | cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | | | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* | Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-34/+1
|/ | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Add a few comments based on review.Nick Mathewson2022-09-231-0/+3
|
* Add the skeleton of a tor-ptmgr crateNick Mathewson2022-09-232-0/+180
When complete, this crate will handle launching and using pluggable transports on demand.