summaryrefslogtreecommitdiff
path: root/crates/tor-persist/src
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* tor-persist: state_dir: Add a note about the instance modification timeIan Jackson2024-02-081-0/+3
|
* tor-persist: state_dir: Test that junk is ignoredIan Jackson2024-02-081-0/+27
|
* tor-persist: state_dir: Fix typoNick Mathewson2024-02-081-1/+1
|
* tor-persist: state_dir: Improve an error messageNick Mathewson2024-02-081-1/+1
|
* tor-persist: state_dir: Add a clippy allowIan Jackson2024-02-081-0/+1
|
* tor-persist: state_dir: (Re)move unused imports and allow (fmt)Ian Jackson2024-02-081-1/+1
|
* tor-persist: state_dir: (Re)move unused imports and allowIan Jackson2024-02-081-15/+10
|
* tor-persist: state_dir terminology: Use "INSTANCE_ID" in docsIan Jackson2024-02-081-5/+5
| | | | | | Now ee consistently use "instance id" or "instance identity" (or, where unambiguous, "id"), to mean the identity of an instance within a kind, and "instance" to refer to the whole thing including the kind.
* tor-persist: state_dir tests: Test mtime resetIan Jackson2024-02-081-1/+184
|
* tor-persist: state_dir tests: Test iteration and purgeIan Jackson2024-02-081-0/+256
|
* tor-persist: state_dir tests: Break out mk_state_dirIan Jackson2024-02-081-5/+9
| | | | We're going to get more call sites.
* tor-persist: state_dir terminology: Use "key", not "slug" (fmt)Ian Jackson2024-02-081-9/+4
|
* tor-persist: state_dir terminology: Use "key", not "slug"Ian Jackson2024-02-081-29/+30
| | | | | | | | Slug is the general type. Instance kinds are slugs too. We need a word for the slug-within-an-instance which identifies a storage location for StorageHandle, or a raw subdirectory. Let's use "key". Change the terminology (and variable names) everywhere.
* tor-persist: state_dir: expiry: Implement purge_instancesIan Jackson2024-02-081-2/+133
|
* tor-persist: state_dir: expiry: Ensure that instance dir mtime is updatedIan Jackson2024-02-081-3/+18
| | | | | | Add comments where it's done automatically. (There will be tests of the claims I'm making, in a later commit.)
* tor-persist: state_dir: purge API: Clarify callback edge casesIan Jackson2024-02-081-1/+26
|
* tor-persist: state_dir: purge API: Add notes about instance mtimeIan Jackson2024-02-081-0/+9
|
* tor-persist: state_dir: purge API: Discuss deletion non-atomicityIan Jackson2024-02-081-0/+31
|
* tor-persist: state_dir: purge API: Replace retain_unused_for with age_filterIan Jackson2024-02-081-14/+14
| | | | | This will be slightly less ergonomic at call sites but it is a more orthogonal and logical API.
* tor-persist: state_dir: purge API: Have purge_instances take SystemTimeIan Jackson2024-02-081-3/+10
| | | | | | | Purging depends on the current time. We will want this to be able to come from Runtime but we don't want to have those types in this API.
* tor-persist: state_dir: purge API: PurgeHandler must provide the kindIan Jackson2024-02-081-0/+6
| | | | We purge per-kind.
* tor-persist: state_dir: docs: Remove a duplicated paragraphIan Jackson2024-02-081-5/+0
| | | | This was probably the result of rebase conflicts during develoopment.
* tor-persist: state_dir: docs: Linkify a ref to StorageHandleIan Jackson2024-02-081-1/+1
|
* tor-persist: state_dir: Implement list_instancesIan Jackson2024-02-082-5/+71
|
* tor-persist: state_dir: Add some missing Clone and Debug implsIan Jackson2024-02-011-5/+5
|
* tor-persist: state_dir: Introduce way to get at underlying lock guardIan Jackson2024-02-011-3/+38
| | | | | | And export the type, so callers don't need to depend directly on fslock_guard; many callers will need to own the returned value, not do anything else with it.