aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-persist/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-persist: fix display of Target path(s).Alexander Hansen Færøy8 days1-1/+2
| | | | | | | | | | | | | | | | | | This patch changes how display works on our Target struct. Currently, log messages generated by Arti Relay looks like this: `tor_persist::load_store: storing "/path/to/arti-relay/state"/"circuit_timeouts.json"` With this patch applies it instead looks like this: `tor_persist::load_store: storing "/path/to/arti-relay/state/circuit_timeouts.json"` With this change we ensure that the correct delimiter between the directory and the filename is used (on Unix it's "/", but on Windows it's "\") and we also avoid the added "" around both the directory and filename.
* tor-persist: remove hidden backspace characterSteven Engler2026-08-041-1/+1
|
* Use "extend" for tor-netdoc FsMistrustErrorExtIan Jackson2026-07-161-7/+3
|
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-152-2/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
| |
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-151-1/+1
| | | | | | | | Removed unnecessary lint
* | tor-persist: Fix clippy warninghjrgrn2026-07-101-1/+1
|/
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-099-0/+9
| | | | | | | | | | | | 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.
* Remove users of fslock other than fslock-guard.Nick Mathewson2026-05-062-35/+26
| | | | | | There were two that relied on the the ability to have a lock in an unlocked state. Instead, we replace those with Option<LockFileGuard> or its equivalent.
* tor-persist: migrate to web-time-compat.Nick Mathewson2026-03-264-16/+18
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-2/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-069-9/+9
| | | | Run maint/add_warning
* 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.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-078-23/+26
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-072-4/+11
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* fix: remove backspace in commentTobias Stoeckmann2025-04-251-1/+1
| | | | | The backspace character leads to funny results, depending on tool or terminal used to show content of the file.
* hashx, tor-persist: fix intra-doc link backtickshashcatHitman2025-04-161-1/+1
| | | | | | | | | | - Replaced single quotes in [`hashx::rand`] documentation link to [`hashx::rand::RngBuffer`] with backticks so it actually works. - Added a missing backtick to the link to [`tor_persist::state_dir::StateDirectory::instance_peek_storage`] in the documentation of [`tor_persist::state_dir::StateDirectory::with_instance_path_pieces`].
* fix: fix typosDimitris Apostolou2025-01-301-2/+2
|
* 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
* 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-relay-crypto: Add a denotator to RelaySigningKeypairSpecifier.Gabriela Moldovan2024-10-311-1/+1
| | | | | | | This will enable us to store more than one `K_relaysign_ed` in the keystore. Closes #1692
* tor-persist: Add a slug timestamp type.Gabriela Moldovan2024-10-312-0/+134
| | | | | | | | The new `Iso8601TimeSlug` is useful for encoding a timestamp as a `Slug` (i.e. in a filename). This is needed, for example, for #1692, to encode a timestamp as key denotator.
* tor-persist: Explain why colons will never be valid slug chars.Gabriela Moldovan2024-10-231-0/+4
|
* Merge branch 'miri-1' into 'main'Ian Jackson2024-10-094-4/+10
|\ | | | | | | | | Add some more miri tests See merge request tpo/core/arti!2502
| * tor-persist: miri: disable tests that involve fs accessIan Jackson2024-10-084-4/+10
| |
* | tor-hsservice: Move HsNickname to tor-persist.Gabriela Moldovan2024-10-082-0/+139
|/ | | | | | | We are about to need this in `tor-keymgr`, where we're about to add a config for C Tor service keystores (the C Tor keystore config will have an associated `HsNickname` that specifies which of the arti hidden services it's supposed to be used with).
* tor-persist: Allow all dead code if not all features enabledIan Jackson2024-09-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes cargo check -p tor-circmgr --all-features --all-targets which otherwise prints warning: variant `InstanceState` is never constructed --> crates/tor-persist/src/err.rs:45:5 | 13 | pub(crate) enum Resource { | -------- variant in this enum ... 45 | InstanceState { | ^^^^^^^^^^^^^ | = note: `Resource` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default warning: variants `Deleting` and `Enumerating` are never constructed --> crates/tor-persist/src/err.rs:66:5 | 57 | pub(crate) enum Action { | ------ variants in this enum ... 66 | Deleting, | ^^^^^^^^ ... 78 | Enumerating, | ^^^^^^^^^^^ | = note: `Action` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis warning: method `delete` is never used --> crates/tor-persist/src/load_store.rs:83:19 | 35 | impl Target<'_> { | --------------- method in this implementation ... 83 | pub(crate) fn delete(&self) -> Result<(), ErrorSource> { | ^^^^^^
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-252-18/+18
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* implement TorClient::wait_for_stoptrinity-1686a2024-07-111-0/+20
|
* tor-persist: Deprecate ErrorSource::Permissions, use InaccessibleIan Jackson2024-07-101-1/+9
|
* tor-persist: Correct message and description for mistrust errorIan Jackson2024-07-101-2/+4
|
* Fix clippy::doc_lazy_continuationIan Jackson2024-07-081-9/+9
|
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-1/+1
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Update to derive-deftly 0.12.1Ian Jackson2024-06-171-1/+2
| | | | | | * Bump in Cargo.toml * Deal with `${Xmeta as ...}` incompatible change, by always specifying an `as`, and changing `as tokens`.
* Suppress a false positive for a new lint on Rust BetaIan Jackson2024-05-131-0/+1
|
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Switch to derive-deftlyIan Jackson2024-04-031-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* Run maint/add_warning.Nick Mathewson2024-03-136-0/+6
|
* Use tor_basic_utils::PathExt::display_lossyIan Jackson2024-03-053-6/+9
| | | | | Change Path::display to this new function, in call sites where it's being used for a diagnostic.
* Merge branch 'deny-unchecked-duration-substraction' into 'main'Ian Jackson2024-03-051-0/+1
|\ | | | | | | | | | | | | deny clippy::unchecked_duration_subtraction Closes #1304 See merge request tpo/core/arti!2008
| * deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
| |
* | tor-persist: Improve test portabilityTobias Stoeckmann2024-03-011-3/+5
|/ | | | | | | | | The test fails on Windows systems for two reasons: - File separator \ is printed in error message instead of expected / - Temporary files are located within home directory, which is anonymized Test failure can be provoked on Linux as well by setting TMPDIR to point to a directory within HOME.
* tor-persist: state_dir: Use DOT_LOCK in the final locationIan Jackson2024-02-081-1/+1
| | | | | Actually, we want to test handling of the string with whatever the extension would be, if it changed.
* tor-persist: state_dir: Introduce DOT_LOCKIan Jackson2024-02-081-2/+7
| | | | | | | And replace ".lock" with it. Now the only place that the "lock" extension this is still present as a literal is in a test.
* tor-persist: state_dir: Introduce LOCK_EXTNIan Jackson2024-02-081-4/+6
| | | | | | And replace "lock" with it. This is the first half of not open-coding this; the sites where the literal string is ".lock" are in the next commit, to help avoid the slip of using the wrong constant.