summaryrefslogtreecommitdiff
path: root/crates/tor-config/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* tor-config: Provide BoolOrAutoIan Jackson2022-10-121-0/+107
| | | | | We're going to use this for the config item `bridges.enabled`, but it seems general enough that it ought to go here.
* tor_config: define_list_builder_helper: Support custom serdeIan Jackson2022-10-121-2/+42
| | | | | | | | We're going to want something that has the standard list builder methods at the Rust API, but which has different serialisation. Sadly the implementation is annoying, because macro_rules makes it hard to parse a nice input syntax.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-123-0/+3
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* tor-config: CfgPath: Fix two typos "expaneded"Ian Jackson2022-10-111-2/+2
|
* CfgPath: Add support for ${PROGRAM_DIR}.Nick Mathewson2022-10-071-2/+42
| | | | | | | | | | | `${PROGRAM_DIR}` expands to the equivalent of `std::env::current_exe().parent()`, with appropriate unwrapping and conversions. It is expected to be useful for finding the locations of pluggable transports in some kinds of bundles. Closes #586.
* fix clippy::needless_borrowtrinity-1686a2022-09-101-1/+1
|
* Fix a rustdoc link error.Nick Mathewson2022-08-311-1/+1
|
* Merge branch 'refactor-anyhow-arti-crate' into 'main'Nick Mathewson2022-08-312-3/+4
|\ | | | | | | | | Remove `anyhow` from `tor-config` crate See merge request tpo/core/arti!707
| * Remove `anyhow` from `tor-config` crateArturo Marquez2022-08-282-3/+4
| |
* | tor-config: DisfavouredKey: Linkify DisplayIan Jackson2022-08-301-1/+1
| |
* | tor-config: DisfavouredKey: Widen applicability of .to_string()Ian Jackson2022-08-301-1/+1
| | | | | | | | And linkify it.
* | Add documentation note on `to_string()` usage for DisfavouredKey.Alexander Færøy2022-08-301-0/+2
|/
* Merge branch 'clippy' into 'main'Nick Mathewson2022-08-261-0/+8
|\ | | | | | | | | tor-config: tests: Apply standard lint block in sources.rs See merge request tpo/core/arti!694
| * tor-config: tests: Apply standard lint block in sources.rsIan Jackson2022-08-251-0/+8
| | | | | | | | Fixes a spurious clippy warning on nightly, about a dbg!
* | Improve error from bad escapes in a toml config.Nick Mathewson2022-08-254-16/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whereas previously we would say: ``` target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml ``` we now say: ``` target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml (If you wanted to include a literal \ character, you need to escape it by writing two in a row: \\) ``` The implementation is a bit of a hack, I'm afraid, but I don't think it's all that bad. Closes #549.
* | tor-config Listen: Rename localhost_port_legacy (from _deprecated)Ian Jackson2022-08-251-2/+2
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/602#note_2830847
* | tor-config Listen: Add a note about EADDRINUSEIan Jackson2022-08-251-0/+1
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/602#note_2830848
* | tor-config; Listen: Return addresses in groups for error behaviourIan Jackson2022-08-251-8/+20
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/602#note_2830766
* | tor-config: Provide resolve_alternative_specsIan Jackson2022-08-251-0/+78
| |
* | tor-config: Support tracking deprecated config keysIan Jackson2022-08-251-9/+68
| |
* | tor-config: Introduce ResolutionResultsIan Jackson2022-08-253-21/+49
| | | | | | | | This will allow us to handle new kinds of warnigns etc.
* | tor-config: Rename UnrecognizedKey to DisfavouredKeyIan Jackson2022-08-251-18/+18
| | | | | | | | We're going to want the to use the same type for deprecated keys.
* | tor-config: Provide misc::ListenIan Jackson2022-08-251-0/+310
| |
* | tor-config misc tests: Add standard lint suppression blockIan Jackson2022-08-251-0/+8
|/
* tor-config source: just ConfigurationSource, not FoundConfigFileIan Jackson2022-08-251-60/+21
| | | | | FoundConfigFile existed to hide something that ConfigurationSource now exposes.
* tor-config: Replace dir detection with ConfigurationSource enumIan Jackson2022-08-252-31/+81
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/682#note_2830860 And subsequent IRC discussion. Having done the work as per review comments, I don't much like the result. It's quite un-ergonomiuc. If we can't have fs autodetection, I think syntactic autodetection within sources.rs would be nearly as nice. However, I seem to be outvoted. At least the externally visible functionality (of an arti binary, say) is reasonably ergonomic.
* tor-config: Provide is_syntactically_directory helper functionIan Jackson2022-08-251-0/+48
|
* tor-config: MustRead: Make publicIan Jackson2022-08-251-1/+2
| | | | I think this ought to be exhaustive.
* config sources: Read arti.d as well as arti.tomlIan Jackson2022-08-251-8/+10
| | | | Fixes #474 aka #271
* config sources tests: Test results of directory scanIan Jackson2022-08-251-1/+12
|