summaryrefslogtreecommitdiff
path: root/crates/tor-config/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-config: small typo fix in docsSteven Engler2026-01-071-1/+2
|
* tor_config::listen: Warn on explicit port zero.Nick Mathewson2025-12-161-2/+17
|
* tor_config::Listen: Add methods to check for auto and port 0.Nick Mathewson2025-12-161-0/+37
|
* tor_config::Listen: Add "auto" itemsNick Mathewson2025-12-161-7/+55
| | | | These are a nicer syntax than using port "0" explicitly.
* tor_config::Listen: Deprecate localhost_port_legacy.Nick Mathewson2025-12-161-1/+5
| | | | Nothing actually uses it any more, which is good.
* tor_config::Listen: Refactor legacy methods.Nick Mathewson2025-12-161-22/+26
| | | | | Have the part of them that does the "no multiple addresses" work be common, so that we can simplify how they actually behave.
* tor-config: Make derive(Flattenable) use $crate.Nick Mathewson2025-12-091-4/+3
|
* Revert "tor-config: Code to serialize Option<Option<Duration>> via humantime"Nick Mathewson2025-12-093-28/+0
| | | | This reverts commit c7c8eb5a03439ce31319389183e64cb0db539fc9.
* tor-config: new derive_deftly(TorConfig) template.Nick Mathewson2025-12-092-0/+3040
| | | | | | | | This template is meant to replace most of our use of derive_builder for configuration objects. Where possible and reasonable, it delegates to existing macros, and automatically infers what special patterns we use for individual types. In other cases, it uses compile-time errors to inform the caller about pattern violations.
* tor-config: New Buildable trait.Nick Mathewson2025-12-091-2/+18
| | | | | | | | This trait will be implemented by every type that our derive_deftly(TorConfig) template generates. It will, among other things, help us figure out the Builder type for a given config type in cases where string-pasting magic is intractable, or where we want to use assert_not_impl to double-check the attributes.
* tor-config: Helper types for setters to take as argumentsNick Mathewson2025-12-092-0/+135
| | | | | The derive-deftly TorConfig template will use these as appropriate for the inputs to setter functions, based on field types.
* tor-config: Code to serialize Option<Option<Duration>> via humantimeNick Mathewson2025-12-093-0/+28
|
* tor_config: Make ListBuilders implement ExtendBuilder.Nick Mathewson2025-12-091-0/+11
|
* tor-config: Give Flattenable template a location.Nick Mathewson2025-12-091-0/+1
| | | | | | If we don't do this, then any attempt to use it from a derive-deftly template will cause a warning about referring to it as $crate::macroname.
* tor-config: Allow Flattenable to apply to types with generics.Nick Mathewson2025-12-091-1/+2
|
* map_builder: Alternative syntax for use by derive(TorConfig)Nick Mathewson2025-12-091-5/+51
| | | | | | | | | | derive_deftly wants to expand types before passing them to macro_rules macros, which is quite reasonable. But map_builder wants its input collection type to be an `ident`, not a `path`. (And macro_rules doesn't accept `path` before a `<`.) To fix this, we're providing an alternative syntax for map_builder, where the inputs are the map type and the builder map type.
* extend_builder: Implement ExtendBuilder for HashMap.Nick Mathewson2025-12-091-1/+17
|
* tor-config: missing #[allow(dead_code)] in derive_list_builder_helperNick Mathewson2025-12-091-0/+1
|
* tor-config: missing $crate in derive_list_builder_helperNick Mathewson2025-12-091-1/+1
|
* tor-config: obviate need for Educe in derive_list_builder_helperNick Mathewson2025-12-091-2/+11
| | | | | | We were only using it for Default, and it is easier to implement Default by hand than it is to keep this particular layer in our leaning tower of macros.
* tor-config: improve comments about adding functionalitySteven Engler2025-12-021-5/+7
|
* tor-config: add more comments to `ListenItem`Steven Engler2025-12-021-1/+10
|
* tor-config: rename `Listen::is_localhost_only` to `is_loopback_only`Steven Engler2025-12-021-2/+10
| | | | Assumes that 0.37.0 will be the next version number.
* tor-config: add new `CustomizableListen`Steven Engler2025-12-021-101/+193
|
* tor-config: fix some localhost vs loopback names/commentsSteven Engler2025-11-141-4/+5
|
* tor-config: made `InvalidListen` privateSteven Engler2025-11-141-1/+1
| | | | There was no reason for this to be public.
* tor-config: simplify a match statementSteven Engler2025-11-141-8/+4
| | | | This does a little extra cloning, but I think is easier to read.
* tor-config: add serde error messages to `ListenSerde` and `ListenItemSerde`Steven Engler2025-11-141-2/+13
| | | | | | | | | | | | | | | | | | | | For example the old message would look like: ```text target/debug/arti: error: read configuration: Config contents not as expected: Couldn't load configuration: data did not match any variant of untagged enum ListenSerde for key "default.proxy.socks_listen" in command line ``` The new message looks like: ```text target/debug/arti: error: read configuration: Config contents not as expected: Couldn't load configuration: value was not a bool, `u16` integer, string, or list of integers/strings for key "default.proxy.socks_listen" in command line ```
* tor-config: add more tests for `Listen`Steven Engler2025-11-141-0/+81
|
* tor-config: remove unneeded `Serialize`/`Deserialize`Steven Engler2025-11-131-2/+1
|
* 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
|