summaryrefslogtreecommitdiff
path: root/crates/arti/src
Commit message (Collapse)AuthorAgeFilesLines
* arti tests: Suppress a lint locallyIan Jackson2023-09-051-1/+2
| | | | | There's a complaint (seen in a CI build log) about over-eager iterator item cloning. This is a perf complaint and not very relevant in tests.
* Bump to trust-dns-proto 0.23.0Nick Mathewson2023-09-051-4/+4
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-232-0/+2
|
* arti::cfg tests: Use fold to make nightly clippy happierNick Mathewson2023-08-221-4/+5
|
* arti: Use ConfigurationSources::try_from_cmdlineIan Jackson2023-08-071-3/+3
| | | | | | | | | | This will allow us to proceed if * the default config file locations can't be established (eg due to failure of the `directories` crate), but * configuration files are explicitly specified, so the defaults wouldn't be used
* arti: Add context to default config files error messageIan Jackson2023-08-071-1/+1
| | | | | | | | | | | | Improves the error mesage in #989 somewhat. Before: target/debug/arti: error: Can't construct project directories to resolve a path element After: target/debug/arti: error: identify default config file locations: Can't construct project directories to resolve a path element
* Run add_warnings on all files.Nick Mathewson2023-08-042-4/+4
|
* Fix typosDimitris Apostolou2023-07-222-10/+10
|
* arti cfg tests: Add keystore to example config.Gabriela Moldovan2023-07-132-14/+22
| | | | Closes #939
* arti config: Remove extraneous whitespace.Gabriela Moldovan2023-07-131-5/+5
|
* arti-client: Use the config struct from tor-keymgr.Gabriela Moldovan2023-07-131-1/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-104-0/+4
|
* Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-075-16/+15
| | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-062-2/+0
| | | | Closes #950.
* Merge branch 'log_precision' into 'main'Nick Mathewson2023-07-064-4/+377
|\ | | | | | | | | | | | | arti: Add a `logging.time_granularity` option with 1s default. Closes #551 See merge request tpo/core/arti!1376
| * arti: comments about catch_unwindNick Mathewson2023-07-061-0/+9
| |
| * time_granularity: Make sure formatter can't panicNick Mathewson2023-07-061-17/+49
| | | | | | | | | | | | I was unable to assure myself that tracing_subscriber could withstand a panicking Timer, so instead I'm trying to make sure our own LogTimer can't panic.
| * arti: Add a `logging.time_granularity` option with 1s default.Nick Mathewson2023-07-064-4/+336
| | | | | | | | | | | | | | This lets us provide less information in our logs: in particular, it lets us avoid logging with microsecond precision. Closes #551.
* | arti: Note possibility for future use of other tracing panic providerNick Mathewson2023-07-061-0/+5
| |
* | arti: On panic, avoid allocation even more.Nick Mathewson2023-07-061-7/+5
| | | | | | | | | | | | | | | | | | | | The original version of our panic handler would allocate a string for the panic `Location`. But if we're panicking we'd like to keep allocations to a minimum: so instead format the `Location` conditionally. This also drops a useless `std::borrow::Cow`. (The possibility of a "Don't have a `Cow`" commit message was considered and rejected.)
* | Add TODO comments about possibly migrating away from the backtrace crate.Nick Mathewson2023-07-051-1/+2
| |
* | arti: Install a panic hook that sends messages to `tracing`Nick Mathewson2023-07-051-0/+31
|/ | | | | | | (Also leaves installed the default handler that sends messages to stderr.) Closes #921.
* Merge branch 'keymgr-config' into 'main'gabi-2502023-06-291-0/+22
|\ | | | | | | | | arti-client: Add keystore_dir to StorageConfig. See merge request tpo/core/arti!1312
| * arti cfg tests: Add declare_exceptions for storage.keystore_dir.Gabriela Moldovan2023-06-291-1/+22
| | | | | | | | | | This moves `storage.keystore_dir` to a separate `declare_exceptions` block and explains why we have this exception.
| * example-config: Temporarily remove keystore_dir example.Gabriela Moldovan2023-06-292-17/+1
| | | | | | | | | | | | Let's remove this until we figure out how the config should behave when the `keymgr` feature is disabled (should it accept or reject `keystore_dir = true`?)
| * arti-client: Add keystore_dir to StorageConfig.Gabriela Moldovan2023-06-292-0/+17
| |
* | Turn off HS client connections by defaultIan Jackson2023-06-291-1/+10
|/ | | | As per IRC discussion, re lack of Vanguards.
* arti cfg tests: Suppress an undesriable clippy lintIan Jackson2023-06-281-0/+1
|
* arti cfg tests: declare_exceptions: Annotate the types for clarity (fmt)Ian Jackson2023-06-281-6/+4
|
* arti cfg tests: declare_exceptions: Annotate the types for clarityIan Jackson2023-06-281-1/+6
|
* arti cfg tests: Point the reader to the types used in declarationsIan Jackson2023-06-281-0/+12
|
* arti cfg tests: Move InCode into declare_config_exampleIan Jackson2023-06-281-19/+19
| | | | It's used for declarations only, and they should all be here.
* arti cfg tests: Make declare_exception take distinguished old/new typesIan Jackson2023-06-281-15/+27
| | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1320#note_2916689 and IRC followup.
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-282-0/+8
| | | | | | | I think these should go in `[circuit_timing]`. That section already has some retry parameters, so is not strictly *timing*. This is not honoured yet.
* HS configuration: Add and honour `allow_onion_addrs` in configurationIan Jackson2023-06-282-0/+14
| | | | | | | We put this in `[address_filter]`. The interaction with the corresponding stream preference is a bit complicated. We must turn the stream pref into a `BoolOrAuto`.
* art cfg tests: Fix garbled doc wordinggabi-2502023-06-281-2/+2
|
* arti cfg tests: Fix doc commentgabi-2502023-06-281-1/+1
|
* arti cfg tests: Overhaul exception handling (fmt)Ian Jackson2023-06-281-36/+32
|
* arti cfg tests: Overhaul exception handlingIan Jackson2023-06-281-92/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was super confusing and fragile. Amongst the problems: * Information about exceptional config keys was spread across a number of places, manipulated in ad-hoc ways (conditional Vec appends, etc). * As a consequence, each exceptional table has confusing and unclear semantics. * It doesn't deal well with the way that cargo sometimes enables features for dependency crates even if arti itself wouldn't demand them; this can lead to sub-crates supporting config keys when the tests in arti don't expect them to, causing spurious test failures. Fix this: * Introduce a new, systematic, way of writing information about configuration keys that need some kind of special handling. * Use this new approach in *both* sets of "thorough" config tests. * Be more relaxed about deprecated keys. We don't want to tightly couple this to absence in the supported file, I think. * Understand more clearly the concept of keys of which we don't know, in the current build config, whether the code is expected to accept them. I have tested this locally with: for p in '-p arti' '--workspace'; do for f in '--no-default-features --features=tokio,native-tls' '--all-features' ''; do nailing-cargo test $p $f; done; done
* arti cfg tests: Remove a comment relating to work already doneIan Jackson2023-06-281-4/+0
| | | | | | We *do* have a thing that works like this. It's fragile and confusing and that's what I'm about to fix.
* arti cfg tests: Code motionIan Jackson2023-06-281-206/+214
| | | | | Bring the exciting tests together, and move some more normal tests out of the middle.
* Mark a builder as non-exhaustiveIan Jackson2023-06-281-0/+1
| | | | | | | If all the fields vanish, this generates a warning with cargo clippy --locked --offline --workspace --all-targets Fix that.
* Corrected the order of imports in order to make the 'rust-checks' job ↵Andy2023-06-231-1/+1
| | | | complete successfully.
* Provided a fix for #831 - 'Unused import' warnings on WindowsAndy2023-06-232-6/+8
|
* Remove onion service descriptor-related errorkinds.Nick Mathewson2023-06-221-4/+0
| | | | | | | | These have been subsumed by other errorkinds, mostly OnionServiceProtocolViolation and TorProtocolViolation. In particular please review the change in tor-hsclient closely; I am not sure about the new errorkinds for the error there.
* Merge branch 'socks_errorkinds' into 'main'Nick Mathewson2023-06-221-12/+10
|\ | | | | | | | | | | | | Generate correct-ish socks5 errors for onion service errors. Closes #736 See merge request tpo/core/arti!1279
| * arti: Resolve TODO HS items related to extended SOCKS5 errorsNick Mathewson2023-06-221-6/+8
| | | | | | | | | | | | | | | | | | This takes an approach discussed in #736: Instead of trying to distinguish INTRO/REND failures perfectly, we instead map our existing ErrorKinds as best we can, in respect to the fact that this distinction is not super important in practice. Closes #736
| * New ErrorKind for invalid onion addressesNick Mathewson2023-06-221-0/+2
| | | | | | | | Use this to emit HS_BAD_ADDRESS as appropriate.
| * Remove ErrorKind::OnionService{Intro,Rend}FailedNick Mathewson2023-06-221-6/+0
| | | | | | | | | | These errors are orthogonal to our actual error kinds. See discussion on #736.
| * Generate correct ErrorKinds for hsdesc decryption failures.Nick Mathewson2023-06-211-2/+2
| | | | | | | | Part of #736