summaryrefslogtreecommitdiff
path: root/crates/tor-config
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions for tor-* and arti-* cratesSteven Engler2026-08-031-6/+6
| | | | | | | ```bash readarray -t bump < <(maint/list-crates | grep -P '^tor-|^arti-') for crate in "${bump[@]}"; do cargo set-version --bump minor -p "${crate}"; done ```
* Require derive-deftly 1.11.4Ian Jackson2026-07-231-1/+1
| | | | | | | | | We're about to *use* the fix that was in 1.11.4. We already updated the lockfile in !4228, so this is just Cargo.toml changes (which will prevent the minimal-versions tests failing when we change the code to rely on the fix). git-grep -l '^derive-deftly' |xargs perl -i~ -pe 's{\b\Q1.11.3\E\b}{1.11.4}g'
* Use "extend" for tor-config mistrust::BuilderExtIan Jackson2026-07-163-10/+6
|
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-151-1/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-151-1/+1
| | | | | | | | Removed unnecessary lint
* | multiple crates: Fix clippy warningshjrgrn2026-07-101-1/+1
|/
* Merge branch 'upgrade-itertools' into 'main'Nick Mathewson2026-07-011-1/+1
|\ | | | | | | | | Upgrade itertools to 0.15.0 See merge request tpo/core/arti!4192
| * Upgrade to itertools 0.15.0Nick Mathewson2026-07-011-1/+1
| | | | | | | | | | | | Additionally, fix itertools usage in maybenot_padding.rs The definition of `Position` changed in 0.15.0.
* | Merge branch 'fix/MissingOneOf' into 'main'Nick Mathewson2026-07-011-0/+16
|\ \ | |/ |/| | | | | Added ConfigBuildError::MissingOneOf and did TODO See merge request tpo/core/arti!4131
| * fix: apply rustfmtpryty262026-06-201-2/+5
| |
| * Added ConfigBuildError::MissingOneOfpryty262026-06-191-0/+13
| |
* | Remove semver.md filesNick Mathewson2026-06-301-1/+0
| |
* | Version bumps for 2.5.0Nick Mathewson2026-06-301-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Closes #2617. We've lucked out this time, and it turns out that every one of our published crates gets a minor bump. So this was generated with: ``` for cr in $(./maint/list-crates); do cargo set-version -p $cr --bump minor done ```
* | Merge branch 'deftly-impl' into 'main'Ian Jackson2026-06-232-19/+10
|\ \ | | | | | | | | | | | | Try out deftly $impl feature, mostly in tor-config See merge request tpo/core/arti!4095
| * | tor-config: Flattenable: use beta_deftly $impl featureIan Jackson2026-06-111-3/+2
| | |
| * | tor-config: derive.rs: use beta_deftly $impl featureIan Jackson2026-06-111-16/+8
| |/
* | Merge branch 'msrv-1.91' into 'main'gabi-2502026-06-181-1/+1
|\ \ | | | | | | | | | | | | Bump MSRV to 1.91 See merge request tpo/core/arti!4105
| * | Bump MSRV to 1.91Clara Engler2026-06-151-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit bumps the MSRV to 1.91 which was released on 2025-10-30. The Cargo.toml files were updated as follows: ```sh git ls-files | \ grep ".*Cargo\.toml$" | \ xargs sed -i '' 's/^rust-version = "1\.89"$/rust-version = "1\.91"/g' ``` The following files were updated manually: ``` modified: .gitlab-ci.yml modified: README.md modified: flake.nix modified: maint/docker-android/Dockerfile ```
* | Merge branch 'misc_string_slices_1' into 'main'Clara Engler2026-06-181-6/+6
|\ \ | |/ |/| | | | | Fix string_slice exceptions outside of netdoc See merge request tpo/core/arti!4092
| * config: remove str slice usageNick Mathewson2026-06-101-6/+6
| |
* | assert_not_impl: Promote to tor-basic-utilsIan Jackson2026-06-102-42/+3
| | | | | | | | | | | | | | I want this in tor-netdoc (which doesn't use tor-config and probably shouldn't). Almost entirely code motion. Review with --color-moved.
* | assert_not_impl: Change example to use CellIan Jackson2026-06-101-2/+3
| | | | | | | | | | | | | | I want to mvoe this to tor-basic-utils, so it can't use tor-config in its example. Also, Cell is just a nicer example. (The rule identifier was already wrong.)
* | assert_not_impl: Introduce some `use`sIan Jackson2026-06-101-2/+6
|/ | | | | IMO this makes the example clearer. It will also make moving this macro to tor-basic-utils less noisy.
* Merge branch 'clippy-string-slice' into 'main'Nick Mathewson2026-06-1014-0/+16
|\ | | | | | | | | Lint for clippy::string_slice See merge request tpo/core/arti!4086
| * everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+1
| | | | | | | | | | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
| * maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0914-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* | Bump derive-deftly to 1.11.3Ian Jackson2026-06-091-1/+1
|/ | | | New beta semver policy means we should pin the patchlevel.
* Remove semver.md files post-releaseGabriela Moldovan2026-06-011-1/+0
|
* Bump all the unstable tor- and arti- crates to 0.43.0Gabriela Moldovan2026-06-011-6/+6
| | | | | | | | | | Done using: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.43.0 done ```
* Bump the versions of the non-{arti-,tor-} cratesGabriela Moldovan2026-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list-crates | rg -v '^(tor|arti)' oneshot-fused-workaround web-time-compat slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy ``` We split them in the following categories: * crates with no changes (no version bumps): ``` oneshot-fused-workaround: No change. web-time-compat: No change. slotmap-careful: No change. test-temp-dir: No change. caret: No change. safelog: No change. retry-error: No change. futures-copy: No change. ``` Obtained with: ``` maint/changed-crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-' ``` * crates that only have non-functional changes (bump the patch version, but not the dependend-on version): - equix * crates where functional changes were made, but no APIs were broken (bump patch): - fs-mistrust * crates where APIs were broken (bump minor): - hashx - fslock-guard The bumps from this commit were created using this script: ``` PATCH_NF=( equix ) PATCH=" fs-mistrust " MINOR=" hashx fslock-guard " ./maint/bump-nodep "${PATCH_NF[@]}" for crate in $PATCH; do cargo set-version --bump patch -p $crate; done for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* config: Simplify ConfigurationTree::merge_from to take &mut self.Nick Mathewson2026-05-272-8/+9
|
* Apply 3 suggestion(s) to 2 file(s)Nick Mathewson2026-05-271-2/+2
| | | Co-authored-by: gabi-250 <[email protected]>
* config: Update doctests to use Deftly, and to passNick Mathewson2026-05-273-16/+24
| | | | | | | | Some of the tests used derive(Builder), which is not current practice for our configuration. Additionally, they didn't implement the requisite ConfigBuilder logic to pass with the other changes in this branch.
* Give resolve_return_results options to control output_tree.Nick Mathewson2026-05-272-13/+49
| | | | | | | I've left the options here as booleans, but moved them into a struct. (IMO, booleans are at their riskiest when they are passed as function arguments, and much less risky when they are used as struct fields.)
* config: Add an `output_tree` to our resolver methods.Nick Mathewson2026-05-271-5/+33
| | | | | | This functionality exposes the part of the configuration tree that was actually used, along with any defaulted values. RPC will want this.
* config: Add a dd(TorConfig) attribute to override apply_defaults().Nick Mathewson2026-05-271-1/+36
|
* config: Add a method to fill in a builder with unset defaultsNick Mathewson2026-05-276-1/+123
| | | | | | | | | | | | | | | This new method modifies a builder by replacing any unset values that have a default with that default. We're using this method so that we can re-serialize a builder into a `ConfigurationTree` with all of its default values included. In all cases, `b.apply_defaults()?; b.build()` should produce the same output as `b.build()`. The interesting parts of this commit are in tor_config::load and tor_config::derive. The rest of this commit just adds `apply_defaults` to other builders that _aren't_ made with `derive_deftly(TorConfig)`.
* config: Implement Builder for ListBuilders and MapBuilders.Nick Mathewson2026-05-272-0/+15
| | | | This isn't strictly necessary, but it helps for consistency.
* dd(TorConfig): change the order of default vs magicNick Mathewson2026-05-271-21/+28
| | | | | | | | | | | | | | | | | | This affects the automatic builder code made by our derive_deftly macro. It is only relevant (for now) in the case of the `NonZero<>` types and their special handling. Previously, when a builder contained Option<U>, and we wanted to generate a configuration holding T, we would _first_ apply a transformation from Option<U> to Option<T> and _second_ unwrap the result or apply a default. Now, we _first_ convert from Option<U> to U by applying a default, and only _then_ perform any necessary conversion from U and T. This is only relevant in the case where U and T are different. It simplifies writing the defaults for `NonZero` options, and will significantly simplify the logic for setting builder defaults.
* config: Fix documentation of ResolutionResultsNick Mathewson2026-05-271-1/+1
| | | | It previously referred to a function that didn't exist.
* Move metrics config types to tor-config.Wesley Aptekar-Cassels2026-05-262-0/+35
| | | | | | | | | | | | | | This will allow these types to be shared by arti and arti-relay. This does change these types from being behind the experimental-api flag. I think this is okay, as tor-config is not a stable crate anyways, but it's worth keeping in mind. There is also an argument to be made for having two separate types, one in arti and one in arti-relay, as we do for LoggingConfig. I think that using a single type has benefits, and we should strive to eventually merge the LoggingConfigs, for instance, and perhaps other types, but it doesn't seem critical in either direction at the moment.
* config: Convert some load.rs tests to use dd(TorConfig).Nick Mathewson2026-05-181-18/+11
|
* config: Use derive(TorConfig) for map builder tests.Nick Mathewson2026-05-181-14/+8
|
* config: Implement Default for ConfigurationTree.Nick Mathewson2026-05-181-1/+1
|
* tor-config: remove a needless clone.Nick Mathewson2026-05-181-1/+1
|
* config: Add a merge_from method to ConfigurationTreeNick Mathewson2026-05-182-1/+23
| | | | We'll use this in RPC to implement configuration changing.
* tor-config: Allow inspecting parts of a ConfigurationTree.Nick Mathewson2026-05-122-3/+65
| | | | | | This will be used by RPC. Probably. It might actually be a better to re-serialize the configuration after parsing it, so that our inspection functions can see default values.
* tor-config::derive: use cfg(true) and cfg(false)Nick Mathewson2026-05-071-7/+4
| | | | | Rust 1.88 added these, so we no longer have to use `any()` for false and `all()` for true.
* release: Bump tor- and arti- crate versions.Wesley Aptekar-Cassels2026-05-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cargo set-version -p arti-client 0.42.0 cargo set-version -p arti-config 0.42.0 cargo set-version -p arti-relay 0.42.0 cargo set-version -p arti-rpc-client-core 0.42.0 cargo set-version -p arti-rpcserver 0.42.0 cargo set-version -p arti-testing 0.42.0 cargo set-version -p arti-ureq 0.42.0 cargo set-version -p tor-async-utils 0.42.0 cargo set-version -p tor-basic-utils 0.42.0 cargo set-version -p tor-bytes 0.42.0 cargo set-version -p tor-cell 0.42.0 cargo set-version -p tor-cert 0.42.0 cargo set-version -p tor-cert-x509 0.42.0 cargo set-version -p tor-chanmgr 0.42.0 cargo set-version -p tor-checkable 0.42.0 cargo set-version -p tor-circmgr 0.42.0 cargo set-version -p tor-config 0.42.0 cargo set-version -p tor-config-path 0.42.0 cargo set-version -p tor-consdiff 0.42.0 cargo set-version -p tor-dirclient 0.42.0 cargo set-version -p tor-dircommon 0.42.0 cargo set-version -p tor-dirmgr 0.42.0 cargo set-version -p tor-dirserver 0.42.0 cargo set-version -p tor-error 0.42.0 cargo set-version -p tor-events 0.42.0 cargo set-version -p tor-general-addr 0.42.0 cargo set-version -p tor-geoip 0.42.0 cargo set-version -p tor-guardmgr 0.42.0 cargo set-version -p tor-hsclient 0.42.0 cargo set-version -p tor-hscrypto 0.42.0 cargo set-version -p tor-hsrproxy 0.42.0 cargo set-version -p tor-hsservice 0.42.0 cargo set-version -p tor-key-forge 0.42.0 cargo set-version -p tor-keymgr 0.42.0 cargo set-version -p tor-linkspec 0.42.0 cargo set-version -p tor-llcrypto 0.42.0 cargo set-version -p tor-log-ratelim 0.42.0 cargo set-version -p tor-memquota 0.42.0 cargo set-version -p tor-memquota-cost 0.42.0 cargo set-version -p tor-netdir 0.42.0 cargo set-version -p tor-netdoc 0.42.0 cargo set-version -p tor-persist 0.42.0 cargo set-version -p tor-proto 0.42.0 cargo set-version -p tor-protover 0.42.0 cargo set-version -p tor-ptmgr 0.42.0 cargo set-version -p tor-relay-crypto 0.42.0 cargo set-version -p tor-relay-selection 0.42.0 cargo set-version -p tor-rpcbase 0.42.0 cargo set-version -p tor-rpc-connect 0.42.0 cargo set-version -p tor-rtcompat 0.42.0 cargo set-version -p tor-rtmock 0.42.0 cargo set-version -p tor-socksproto 0.42.0 cargo set-version -p tor-units 0.42.0