summaryrefslogtreecommitdiff
path: root/crates/tor-config/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-config: fix error source for `ConfigLoadError`Steven Engler2025-11-131-1/+7
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0613-14/+14
| | | | 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
|
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* config: clarify TODO on PaddingLevel.Nick Mathewson2025-09-171-1/+3
|
* clippy: fix `clippy::implicit_clone` errorsSteven Engler2025-08-111-1/+1
| | | | | | | | | | | | | | | | | ```text error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> crates/tor-config/src/lib.rs:109:32 | 109 | V::String(_, s) => s.to_string(), | ^^^^^^^^^^^^^ help: consider using: `s.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone note: the lint level is defined here --> crates/tor-config/src/lib.rs:20:9 | 20 | #![deny(clippy::implicit_clone)] | ^^^^^^^^^^^^^^^^^^^^^^ ```
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-075-6/+12
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Fix errors from rustdoc nightly.Nick Mathewson2025-08-051-1/+1
|
* tor-config: impl `NotAutoValue` for `ByteQty`Steven Engler2025-07-311-0/+3
|
* tor-config: add `ExplicitOrAuto::map` and `From<T> for ExplicitOrAuto<T>`Steven Engler2025-07-311-0/+18
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-config: Removed dependency on `once_cell`hashcatHitman2025-06-141-2/+2
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* tor-config: listen: Replace use of std::net (fmt)Ian Jackson2025-04-081-8/+4
|
* tor-config: listen: Replace use of std::netIan Jackson2025-04-081-9/+8
| | | | | | | | Almost the only remaining use of this was for SocketAddr which we should just import. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2918#note_3185858
* tor-config: Listen: Provide single_address_legacyIan Jackson2025-04-081-1/+23
| | | | | We're going to need this because of deficiencies in metrics-exporter-prometheus.
* tor-config: fix `clippy::double_ended_iterator_last`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | ```text warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator --> crates/tor-config/src/load.rs:606:18 | 606 | .last() | ^^^^^^ help: try: `next_back()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last note: the lint level is defined here --> crates/tor-config/src/lib.rs:9:9 | 9 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::double_ended_iterator_last)]` implied by `#[warn(clippy::all)]` ```
* file_watcher: Remove some now-unused thingsIan Jackson2025-02-061-8/+10
|
* file_watcher: Use .borrow_mut and sync MutexIan Jackson2025-02-061-10/+4
|
* file_watcher: Add some commentary about Event semanticsIan Jackson2025-02-061-0/+10
|
* 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: Test that uninteresting events get ignored.Gabriela Moldovan2025-01-091-3/+21
|
* tor-config: Rewrite match for readability.Gabriela Moldovan2025-01-091-3/+5
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2696#note_3145971
* tor-config: Avoid using EventKind::Any in the tests.Gabriela Moldovan2025-01-091-3/+4
| | | | Events of type `Any` now get discarded by the event handler.
* tor-config: Handle rescan events before filtering.Gabriela Moldovan2025-01-091-3/+2
| | | | | This enables us to catch "rescan" events, regardless of their underlying `EventKind`.
* tor-config: Make the `FileWatcher` ignore non-mutating file events.Gabriela Moldovan2025-01-091-1/+13
| | | | | | | | Without this, setting `watch_configuration = true` results in endless config reloading due to arti accessing the config (which triggers an access event, which in turn, triggers a config reload, and so on). Closes #1794
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* map_builder: Document deserialize implemntation.Nick Mathewson2024-12-191-0/+3
|
* ExtendBuilder: Try to document more clearly what it doesNick Mathewson2024-12-191-0/+4
|
* map_builder: Extensively rework example.Nick Mathewson2024-12-191-9/+64
|
* extend_builder: document more about why it works.Nick Mathewson2024-12-191-0/+33
|
* extend_builder: Tests for strip_option, default.Nick Mathewson2024-12-191-0/+206
|
* map_builder: Add support for default settings.Nick Mathewson2024-12-191-10/+133
| | | | | | This is a little tricky (beyond the usual macro fun) because we needed to use ExtendBuilder to get reasonable behavior for our default trees.
* Define macros to create a map-builder type.Nick Mathewson2024-12-192-0/+216
| | | | | | | | | | | | We're about to need this to define some of the configuration for RPC listeners. The provided map-builder type is much less voluminous in terms of APIs added than the list-builder type: It just uses Deref* and sub_builder. I think this simplicity may be a win. I'll need to rethink how this type handles defaults in order to implement connect points properly; I've left XXXXs for that issue.
* tor-config: Add "extend" functionality for config builders.Nick Mathewson2024-12-192-0/+180
| | | | We'll use this to implement defaults for maps in our configuration.
* list_builder: fix a very typoed line.Nick Mathewson2024-12-191-1/+1
|
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-config: removed re-export of `CfgPath`Steven Engler2024-11-041-1/+0
| | | | | Also updated other packages to get `CfgPath` directly from `tor-config-path' instead of 'tor-config'.
* tor-config-path: moved `tor_config::path` to hereSteven Engler2024-10-292-506/+1
| | | | This is a direct move of the `path` module from tor-config.
* tor-config: remove `CfgPathError::BadUtf8`Steven Engler2024-10-281-20/+1
|
* tor-config: use 'path' feature of shellexpandSteven Engler2024-10-281-40/+15
|
* tor-config: Document the limitations of the FileWatcher.Gabriela Moldovan2024-10-161-0/+9
|
* tor-config: Compare the file contents when testing.Gabriela Moldovan2024-10-161-0/+7
| | | | | | | When testing, compare the contents of the files too, not just their mtime Otherwise, because the polling backend detects changes based on mtime, if the test creates/writes files too fast, it will fail to notice changes (this can happen, for example, on a tmpfs).
* tor-config: Configure the polling interval.Gabriela Moldovan2024-10-161-2/+17
| | | | | | | | | The default is 30s, which feels a bit too long. Also, when testing, we use a much shorter interval. This is meant to be a temporary solution, so we hard-code the interval rather than make it configurable.
* tor-config: Use a polling watcher on non-windows platforms that don't have ↵Gabriela Moldovan2024-10-161-2/+9
| | | | | | | | | | | | | | | inotify. On windows and platforms that support inotify (i.e. linux and android), we continue using the recommended watcher. On platforms that use kqueue, we switch to a polling watcher to work around a [notify bug] that manifests when using a non-recursive watcher to watch a directory. This commit is best reviewed with `git diff --ignore-all-space`. Closes #1644 [notify bug]: https://github.com/notify-rs/notify/issues/644
* tor-config: Add a type alias for the underlying watcher (fmt).Gabriela Moldovan2024-10-161-2/+2
|
* tor-config: Add a type alias for the underlying watcher.Gabriela Moldovan2024-10-161-3/+6
| | | | | This type will soon become platform-dependent, so I am preemptively adding a type alias.
* tor-config: Expose assert_config_error test helper.Gabriela Moldovan2024-10-082-0/+19
| | | | | | This moves the `assert_config_error` helper from the restricted discovery config tests to a `testing` module in `tor-config` (I am about to reuse it for the C Tor keystore config tests too).
* tor-config: Add Listen::is_localhost_only.Nick Mathewson2024-09-251-0/+33
|
* tor-config: move Listen to its own module.Nick Mathewson2024-09-253-377/+402
|