aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src
Commit message (Collapse)AuthorAgeFilesLines
...
* StreamPrefs: Re-alphabetise imports following renameIan Jackson2022-01-211-1/+1
| | | | Placates rustfmt
* StreamPrefs: rename from ConnectPrefsIan Jackson2022-01-211-3/+3
| | | | | | | | | | | | | The docs even say this is about stream. As @nickm writes in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/252#note_2771289 we generally call end-to-end connections that are tunneled over Tor "Streams" to distinguish them from everything else in the Tor protocols that could possibly be called a "Connection". That seems to apply here too.
* connection preferences: Take ConnectPrefs by referenceIan Jackson2022-01-191-3/+3
| | | | | This may save quite a bit of copying. The callees don't need to copy the whole struct; they copy the bits they need.
* Apply suggestions to better describe the purpose of LogGuards.Ian Jackson2022-01-101-4/+5
|
* Tracing configuration for logfiles, per-target filtersNick Mathewson2022-01-102-36/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we could only configure one global tracing filter that applied to stdout and journald. There was no support for log files, either. This patch fixes both issues, by substantially revising the configuration format: There are now separate filters for each log file, for journald, and for the console log. Because we want to allow multiple logfiles, they have to go into an array in the configuration. The configuration logic has grown a bit complicated in its types, since the tracing_subscriber crate would prefer to have the complete structure of tracing Layers known statically. That's fine when you know how many you have, and which kinds there will be, but for the runtime-configuration case we need to mess around with `Box<dyn Layer ...>`. I also had to switch from tracing_subscriber's EnvFilter to its Targets filter. It seems "EnvFilter" can only be applied as a Layer in itself, and won't work as a Filter on an individual Layer. Closes #166. Closes #170.
* Move tracing setup into a separate module.Nick Mathewson2022-01-102-43/+49
| | | | No code changes here yet.
* Use *_with_prefs() for Option<ConnectPrefs> callers in TorClient::connectNeel Chauhan2022-01-081-3/+5
|
* Move a comment to the right place.Nick Mathewson2022-01-061-4/+2
|
* extend lints to include 'clippy::all'Daniel Eades2021-12-281-2/+4
|
* proxy: introduce new functions to write_all & flush/closeMuhammad Falak R Wani2021-12-151-42/+42
| | | | Signed-off-by: Muhammad Falak R Wani <[email protected]>
* proxy: send SOCKS5 reply on failure casesMuhammad Falak R Wani2021-12-111-1/+14
| | | | Signed-off-by: Muhammad Falak R Wani <[email protected]>
* proxy: report an error if all listeners fail.Nick Mathewson2021-12-081-1/+1
|
* Resolve XXXXs in proxy.rsNick Mathewson2021-12-081-3/+3
| | | | These issues all have tickets, so can become TODOs.
* add semicolons if nothing returnedDaniel Eades2021-11-251-0/+1
|
* More typo fixes that I forgot to save :(Nick Mathewson2021-11-241-1/+1
|
* Fix a few typos.Nick Mathewson2021-11-241-1/+1
| | | | Also fix some commonwealth spellings that had slipped in.
* Move the socks_port option into a new proxy section.Nick Mathewson2021-11-181-1/+4
| | | | Now there are no options that aren't in a toml section.
* Move top-level configuration downwards from `arti` to `arti-config`.Nick Mathewson2021-11-182-264/+11
| | | | | | | | To do this at all neatly, I had to split out `tor-config` from `arti-config` again, and putting the lower level stuff (paths, builder errors) into tor-config. I also changed our use of derive_builder to always use a common error type, to avoid error type proliferation.
* In rust-nightly CI, forbid debugging prints.Nick Mathewson2021-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | This patch makes the rust-nightly CI task fail if it detects any dbg!(), println!(), or eprintln!() calls in production code. Because of clippy limitations, it may also gripe about calls to these macros in our tests. The preferred workarounds are to either instead. Both are acceptable. We're doing this check in CI rather than unconditionally with clippy directives, since we often want to have these calls in our code temporarily while we're developing. Some day we might want this test to go into a pre-push hook. This patch also adds #![allow()] directives for println!() and eprintln!() in the arti crate. Since that one isn't a library, it's okay for it to speak to stdout/stderr. Closes #218.
* Remove all remaining dbg! instances.Nick Mathewson2021-11-041-3/+0
|
* Typo fix in an expect() message.Nick Mathewson2021-10-281-1/+1
|
* Improve and future-proof the `arti` CLIeta2021-10-272-69/+136
| | | | | | | | | | | | | | | | | | | | | | | | This switches out `arti`'s argument-parsing library with `clap`, which is a lot more featureful (and very widely used within the Rust ecosystem). We also now use a lot of `clap`'s features to improve the CLI experience: - The CLI now expects a subcommand (currently, either "help", or "proxy" for the existing SOCKS proxy behaviour). This should let us add additional non-SOCKS-proxy features to arti in future. - `clap` supports default values determined at runtime, so the way the default config file is loaded was changed: now, we determine the OS-specific path for said file before invoking `clap`, so the help command can show it properly. - The behaviour of `tor_config` was also changed; now, one simply specifies a list of configuration files to load, together with whether they're required. - That function also way overused generics; this has been fixed. - Instead of using the ARTI_LOG environment variable to configure logging, one now uses the `-l, --log-level` CLI option. (The intent is for this option to be more discoverable by users.) - The `proxy` subcommand allows the user to override the SOCKS port used on the CLI without editing the config file.
* Update our disclaimers and limitations sections.Nick Mathewson2021-10-271-5/+3
|
* Tests and refactoring for IsolationMap.Nick Mathewson2021-10-261-13/+50
|
* TorClient::resolve_ptr should take an IpAddr.Nick Mathewson2021-10-261-1/+13
|
* Rename tor_client/arti_tor_client to arti_client.Nick Mathewson2021-10-212-7/+7
| | | | | | Solves a name conflict with the existing tor_client create. Closes #130.
* Fix most warnings from nightly.Nick Mathewson2021-10-191-1/+3
| | | | (One represents code that I forgot to write.)
* Make elements of TorClientConfig private.Nick Mathewson2021-10-192-14/+11
|
* tor-client: refactor TorClient::bootstrap's args into a config objecteta2021-10-191-10/+16
| | | | | | | | | | | | | The three arguments TorClient::bootstrap requires by way of configuration have been factored into a new TorClientConfig object. This object gains two associated functions: one which uses `tor_config`'s `CfgPath` machinery to generate sane defaults for the state and cache directories, and one that accepts said directories in order to create a config object with those inserted. (this commit was inspired by trying to use arti as a library and being somewhat overwhelmed by the amount of config stuff there was to do :p)
* Change how we connect to target addresses.Nick Mathewson2021-10-181-1/+1
| | | | | | | Now we all both address:port, (address, port), and more. We also allow SocketAddr and IpAddr, but only via a trait labeled as "Dangerous".
* Merge branch 'reject_bad_hostnames'Nick Mathewson2021-10-182-2/+16
|\
| * Rename is_localhost to allow_local_addrs, and apply it to IPs too.Nick Mathewson2021-10-181-2/+2
| |
| * Formatting fixesNeel Chauhan2021-10-061-1/+3
| |
| * Introduce ClientConfig for is_localhost config parameterNeel Chauhan2021-10-062-2/+14
| |
* | Do not use downcast_ref, use tor-client error.Jani Monoses2021-10-181-8/+6
| |
* | Add a cast to correct a type error about WSAEMFILENick Mathewson2021-10-151-1/+7
| |
* | arti: On startup, increase the NOFILE resource limit.Nick Mathewson2021-10-142-0/+28
| | | | | | | | | | | | | | | | | | | | | | The default soft limit is typically enough for process usage on most Unixes, but OSX has a pretty low default (256), which you can run into easily under heavy usage. With this patch, we're going to aim for as much as 16384, if we're allowed. Fixes part of #188.
* | proxy: Mark ENFILES and EMFILES as survivable.Nick Mathewson2021-10-141-2/+27
| | | | | | | | | | | | | | | | I don't love this approach, but those errors aren't distinguished by ErrorKind, so we have to use libc or winapi, apparently. At least nothing here is unsafe. Addresses part of #188.
* | Report errors in logging configuration a bit more usefullyNick Mathewson2021-10-131-2/+22
| |
* | Document trace_filter example in main.rs too.Nick Mathewson2021-10-131-0/+2
| |
* | Re-export configuration types from tor-client.Nick Mathewson2021-10-091-8/+10
| |
* | enable checked_conversions lint.Nick Mathewson2021-10-091-0/+1
|/
* Do not use set_ prefix on derive_builder settersJani Monoses2021-09-161-3/+3
|
* Merge remote-tracking branch 'origin/mr/77'Nick Mathewson2021-09-102-11/+21
|\
| * Create a separate logging section in config.Jani Monoses2021-09-092-11/+21
| |
* | Use derive_builder for the rest of tor_dirmgr::configNick Mathewson2021-09-091-3/+3
| |
* | Use derive_builder for NetworkConfig.Nick Mathewson2021-09-082-51/+5
|/
* Make journald an optional feature.Jani Monoses2021-09-071-6/+7
|
* Do not log to journald by defaultJani Monoses2021-09-071-1/+1
|
* Allow logging to journald.Jani Monoses2021-09-072-7/+30
| | | | | Log to journald when available, add journald config option. Separate logging setup into its own function.