aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-config/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-config: Listen: Clarify localhost_port_legacyIan Jackson2023-09-121-1/+1
| | | | | The previous phrasing was ambiguous and set us up for bugs, see https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1582#note_2942240
* tor-config: Listen: Fix a typoIan Jackson2023-09-121-2/+2
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-239-0/+9
|
* Resolve warnings about ambiguous/redundant doc linksNick Mathewson2023-08-221-1/+1
| | | | | Nightly rustdoc now warns if you have a link that isn't necessary, and if you have a link that might refer to two different things.
* tor-config: Expand NoProjectDirs error messageIan Jackson2023-08-081-1/+1
|
* tor-config: Add ConfigurationSources::try_from_cmdlineIan Jackson2023-08-071-7/+34
| | | | We'll use this in crates/arti in a moment.
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* tor-config: Remove unused ItemOrBool helper.Gabriela Moldovan2023-07-131-63/+0
| | | | | `ItemOrBool` is currently not used anywhere (it was previously used by the keymgr config).
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-109-0/+10
|
* Merge branch 'allow_missing_panics' into 'main'Ian Jackson2023-07-071-1/+0
|\ | | | | | | | | | | | | add_warning: Tolerate clippy::missing_panics_doc Closes #950 See merge request tpo/core/arti!1380
| * Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | | | | | Closes #950.
* | tor-config: Use next_back() instead of rev().next()Nick Mathewson2023-07-031-1/+1
|/ | | | This is a new warning^Wsuggestion from clippy nightly.
* tor-config: Make ItemOrBool an experimental feature.Gabriela Moldovan2023-06-291-0/+4
|
* config: Add ItemOrBool helper for deserializing a bool or a value.Gabriela Moldovan2023-06-291-0/+59
| | | | | | | | | | | | | | | | | | | | This will enable us to support the new `keystore_dir` field, which can be either a boolean indicating whether the keystore is disabled or enabled and initialized with the default keystore dir, or a string which points to a custom keystore directory (and implies the keystore is enabled): ``` # use this path, fail if compiled out # keystore = "/path/to/arti/keystore" # # use default path, fail if compiled out # keystore = true # # disable # keystore = false ``` Part of #891
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Use bool::then_some() as appropriateNick Mathewson2023-04-111-1/+1
| | | | | | Now that we require a version of Rust that allows `b.then_some(v)`, clippy complains about our use of `b.then(|| v)`.
* Fix typosDimitris Apostolou2023-03-241-1/+1
|
* tor-config: Apply deferred rustfmt churnIan Jackson2023-03-211-4/+4
|
* tor-config: Do minimal $ and ~ handling even without expand-pathsIan Jackson2023-03-211-2/+54
| | | | Fixes #790
* tor-config: Make CfgPathError PartialEq but only when testingIan Jackson2023-03-211-0/+1
| | | | So, this is not a semver addition.
* tor-config: Fix build when expand-paths is disabledIan Jackson2023-03-211-2/+5
|
* tor-config: paths, unexpanded: use infallible conversionIan Jackson2023-03-211-2/+1
| | | | str can always be made into a PathBuf.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-279-0/+9
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Upgrade toml to version 0.6.Nick Mathewson2023-01-251-27/+41
| | | | | | | This required rewriting some of our error handling code in command-line processing, since the toml crate now displays and reports errors differently. (Admittedly, this code still is kind of ugly, but at least it is nicely hidden.)
* Fix typosDimitris Apostolou2023-01-071-1/+1
|
* test lint blocks: Add many many automaticallyIan Jackson2022-12-123-0/+25
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* test lint blocks: Do some semi-manuallyIan Jackson2022-12-122-2/+18
| | | | | | | This is the hunks from running the rune in maint/adhoc-add-lint-blocks but which require some subsequent manual fixup: usually, deleting now-superfluous outer allows, but in some cases manually putting back lints that the adhoc script deleted.
* tor-config: Update to shellexpand 3.xIan Jackson2022-12-061-1/+5
| | | | | | | | | | | | | | | | | | | | | This is the new upstream version (published by me, recently). It has the same MSRV and one breaking change: The caller who specifies a home dir function for substituting into strings, must now supply a string, not Path. Previously shellexpand would allow the caller to supply non-unicode data, and then simply not substitute it. That was an infelicity in the shellexpand API. Now this infelicity is pushed into our code. The overall behaviour of Arti hasn't changed as a result. And it seems reasonable to me. shellexpand 3.x also has a module for expanding Paths instead, in response to requests for this filed as upstream tickets. We *could* use that but I am not sanguine about that approach: the Pathness would spread throughout much of our config and file handling code. I think we should at the very least postpone trying to work with invalid-unicode-paths as long as we can.
* tor-config: home dir handling: fmt pre-patchIan Jackson2022-12-061-1/+3
|
* tor-basic-utils: list_builder: Use standard test lint blockIan Jackson2022-11-291-0/+8
| | | | This gets rid of a spurious warning on nightly about the use of dbg!
* tor-config MultilineListBuilder: Test deserialisationIan Jackson2022-11-291-0/+45
|
* tor-config MultilineListBuilder: Print line number starting at 1, not 0Ian Jackson2022-11-291-1/+1
|
* tor-config list_builder tests: Move Outer up a levelIan Jackson2022-11-291-19/+19
| | | | We're going to reuse this.
* MultilineListBuilder: Use a manual implementation of DeserializeIan Jackson2022-11-291-2/+52
| | | | | | The error message from `#[serde(untagged)]` would otherwise start to appear when we try to deserialise unsupported PT configurations, when compiled with bridge but not PT support.
* tor-config: Rename to ReconfigureError::UnsupportedSituationIan Jackson2022-11-241-1/+1
| | | | | | | | From Unsupported. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873 This was added in this MR. Also add the missing semver note.
* tor-config: Rename to ConfigBuildError::NoCompileTimeSupportIan Jackson2022-11-241-2/+2
| | | | | | | | | From Unsupported. Following one of the suggestions here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873 This was added in 2c3711614908d0c9cf1663b20b67a3fc233301f4 which was not yet in a release so this isn't a semver break. I have added the semver note that was omitted in that MR.
* tor-guardmgr: Refuse to configure bridges if we don't have the lockIan Jackson2022-11-231-0/+11
| | | | Fixes #612
* tor-config: introduce ConfigBuildError::UnsupportedIan Jackson2022-11-211-0/+14
| | | | And use it in bridge configuration parsing.
* tor-config: ConfigBuildError::within: Introduce add_prefixIan Jackson2022-11-211-3/+4
|
* Make the bridge list in the builder be a list of BridgeConfigBuilderIan Jackson2022-11-211-26/+24
| | | | By changing MultilineListBuilder.
* tor-basic-utils: list_builder: Introduce DirectDefaultEmptyListBuilderAccessorsIan Jackson2022-11-211-0/+63
| | | | | This trait can have this ludicrously long name because no-one needs to import it.
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-1/+1
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Fix various typos (using typos tool and hand-inspection)Nick Mathewson2022-10-181-1/+1
|
* 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-57/+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
* Fix error messageNick Mathewson2022-10-121-1/+1
|
* tor-config: Provide MultilineListBuilderIan Jackson2022-10-122-0/+208
| | | | This is what we'll use to parse the `bridges.bridges` config key.
* tor-config: Remove unneeded braces in an exampleIan Jackson2022-10-121-1/+1
|