summaryrefslogtreecommitdiff
path: root/crates/tor-config/src/sources.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-config: remove stale comment on `ConfigurationSources::try_from_cmdline`Steven Engler2025-10-081-2/+0
|
* tor-config: add `ConfigurationSources::options()`Steven Engler2025-10-081-0/+7
|
* Fix errors from rustdoc nightly.Nick Mathewson2025-08-051-1/+1
|
* tor-config: Improve mistrust documentationClara Engler2025-01-231-0/+12
| | | | | | | | This commit improves the documentation for `ConfigurationSources::set_mistrust`, by explaining that this option is unrelated to the paths defined within the configuration file itself, referring to the `storage.permissions.dangerously_trust_everyone` option.
* tor-config: Deprecate ConfigError::Permissions, use FileAccessIan Jackson2024-07-101-1/+1
|
* Add an action field to Io error in tor-config.Nick Mathewson2024-04-221-9/+10
|
* Convert tor-config to use figment.Nick Mathewson2024-04-221-33/+28
| | | | | There are probably ways to make this a bit more elegant, but at least the tests still pass.
* Merge branch 'encapsulate_config_rs' into 'main'Nick Mathewson2024-03-131-27/+45
|\ | | | | | | | | Encapsulate usage of config-rs inside tor-config. See merge request tpo/core/arti!2040
| * tor-config: Update documentation to not refer to config crate.Nick Mathewson2024-03-131-5/+6
| |
| * config: Remove From impls from config::ConfigErrorNick Mathewson2024-03-131-7/+10
| | | | | | | | These are another case of exposing the config crate.
| * tor-config: Put config::Config inside a wrapper type.Nick Mathewson2024-03-131-5/+5
| | | | | | | | This will let us replace Config with something better.
| * tor-config: Allow ConfigurationSource to be verbatim text.Nick Mathewson2024-03-131-12/+26
| | | | | | | | | | This will let us test our configuration logic without having to use the `config` crate directly.
* | Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|/
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* 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: Add ConfigurationSources::try_from_cmdlineIan Jackson2023-08-071-7/+34
| | | | We'll use this in crates/arti in a moment.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* tor-config: Use next_back() instead of rev().next()Nick Mathewson2023-07-031-1/+1
| | | | This is a new warning^Wsuggestion from clippy nightly.
* Fix typosDimitris Apostolou2023-03-241-1/+1
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* 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.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* fix clippy::needless_borrowtrinity-1686a2022-09-101-1/+1
|
* Fix a rustdoc link error.Nick Mathewson2022-08-311-1/+1
|
* Remove `anyhow` from `tor-config` crateArturo Marquez2022-08-281-2/+3
|
* 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-251-14/+18
|/ | | | | | | | | | | | | | | | | 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 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-251-30/+80
| | | | | | | | | | | | | | | 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
|
* config sources tests: Break out sources_nodefaultsIan Jackson2022-08-251-5/+12
|
* config sources tests: Introduce test of reading directoryIan Jackson2022-08-251-0/+29
|
* config sources: Supporting reading directoriesIan Jackson2022-08-251-12/+106
|
* config sources: Introduce scan() and FoundConfigFilesIan Jackson2022-08-251-46/+135
| | | | | | | | | | | | | | We're going to need to do config file reading in two phases. Right now this isn't actually necessary, because the set of files is fixed since we don't support dynamically scanning directories. But the new API will be needed in a moment. Code motion and API changes, but no overall functional change. Review with `git show -b` may be helpful. The new API also provides for dealing with directories, but right now that doesn't happen.
* tor-config sources: Remove some unneeded .to_string() from testsIan Jackson2022-08-251-4/+4
|
* Add a few coverage-based tests to tor-config.Nick Mathewson2022-05-311-0/+28
| | | | There's nothing major here, but it does fill in a few gaps.
* Merge branch 'bug475' into 'main'Ian Jackson2022-05-251-1/+6
|\ | | | | | | | | | | | | ConfigurationSources: Allow config files to be world-readable. Closes #475 See merge request tpo/core/arti!528
| * ConfigurationSources: Allow config files to be world-readable.Nick Mathewson2022-05-241-1/+6
| | | | | | | | Fixes #475.
* | fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-241-2/+2
|/ | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* tor-config: Provide useful documentation for sources moduleIan Jackson2022-05-131-0/+14
|
* arti-config abolition: Move functionality to tor-configIan Jackson2022-05-131-0/+235
This crate no longer has any reason to exist. All its remaining functionality is generic enough to go into tor-config. In this commit, we move the contents of lib.rs into a new file in tor-config. It contains: * Code motion * The minimal "mod" and "use" changes * The minimal doc comment * A new a compat alias for ConfigurationSources. The compat alias is there because various crates currently speak of arti_config::ConfigurationSources and it is most convenient to fix them up after the type is available in tor_config.