summaryrefslogtreecommitdiff
path: root/crates/tor-persist
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-persist: Error: Provide for handling LocalResourceAlreadyInUseIan Jackson2024-01-311-0/+5
| | | | | | | | | | state_dir doesn't support a "shared read-only" mode, so it needs an error.
* | tor-persist: Error: Provide for handling BadSlugIan Jackson2024-01-311-1/+24
| | | | | | | | | | | | | | Introduce a Bug variant. Then, use it for conversions from BadSlug. See the comment for why I think this is appropriate.
* | tor-persist: state_dir: Two API fixesIan Jackson2024-01-311-2/+2
| | | | | | | | | | | | | | | | You don't need to consume a Mistrust to get a CheckedDir - you use a Verifier and then something clones it for you. So StateDirectory::new should take &Mistrust. And instance_peek_storage needs T to be deserialisable!
* | tor-persist: state_dir: Rename InstanceStateHandle::purge (from delete)Ian Jackson2024-01-311-2/+2
| | | | | | | | | | This is rather more serious than many deletions - it wipes out the whole directory. And this name goes better with purge_instances.
* | tor-persist: state_dir: Enable rustfmtIan Jackson2024-01-311-1/+0
| | | | | | | | The formatting will be normalised roughly as we go.
* | tor-persist: load_store: Add some tracingIan Jackson2024-01-311-3/+18
| | | | | | | | Now we get log messages about what we're reading/writing.
* | tor-persist: Fix a doc commentIan Jackson2024-01-311-1/+1
|/
* tor-persist: Document that slugs cannot start with '-'.Gabriela Moldovan2024-01-311-1/+1
|
* tor-persist: Make all Slugs non-empty.Gabriela Moldovan2024-01-311-10/+13
| | | | | | | | This also removes a TODO regarding adding a `Nickname` type for representing `HsClientSpecifier` and `HsNickname` (we don't need it if `Slug`s are non-empty). Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1931#note_2990227
* tor-persist: Forbid slugs from starting with a hyphen.Gabriela Moldovan2024-01-311-1/+21
|
* tor_persist::slug: Allow hyphens in Slugs.Gabriela Moldovan2024-01-311-2/+3
| | | | | | | | The internal representation of `HsNickname` will soon be `Slug`, and nicknames can contain hyphens, so let's add `-` to the allowed charset. Part of #1092
* slug: Provide BadSlug::EmptySlugNotAllowedIan Jackson2024-01-291-0/+12
|
* Merge branch 'slug2' into 'main'Ian Jackson2024-01-252-94/+62
|\ | | | | | | | | TryIntoSlug See merge request tpo/core/arti!1922
| * state_dir: Remove a now-unused allowIan Jackson2024-01-251-1/+0
| |
| * state_dir: Replace InstanceIdString with Slug and SlugRefIan Jackson2024-01-251-44/+14
| | | | | | | | And tidy up some of the docs to refer to the slug module.
| * state_dir: Abolish now-obsolete Slug trait renameIan Jackson2024-01-251-5/+3
| |
| * slugs: Provide TryIntoSlug, and replace state_dir::Slug with itIan Jackson2024-01-252-47/+48
| |
* | Merge branch 'slug4' into 'main'gabi-2502024-01-251-0/+5
|\ \ | | | | | | | | | | | | slug: Implement the AsRefs for Slug as well as for SlugRef See merge request tpo/core/arti!1929
| * | slug: Implement the AsRefs for Slug as well as for SlugRefIan Jackson2024-01-251-0/+5
| |/ | | | | | | | | Otherwise you can't use &Slug where someone wants &impl AsRef<Path>, which is rather sad.
* / slug: Fix maint/check_doc_featuresIan Jackson2024-01-251-0/+2
|/
* tor_persist::slug: Abolish ForbiddenOnWindows on non-WindowsIan Jackson2024-01-251-21/+9
| | | | | | | | | Abolish it, sprinkling cfg all over, rather than having it be uninhabited. See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1912#note_2988746 https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1912#note_2988748
* Introduce tor_persist::slug moduleIan Jackson2024-01-253-0/+398
| | | | | | | | | I need this for state_dir (#1163, !1853). I intend that this should be used for arti paths (#1092, #1193). See also #1195. Implements the spec in #1192 but doesn't connect it to anything yet.
* tor-persist: state_dir: Demote anyhow to dev depIan Jackson2024-01-241-2/+2
| | | | It's not a runtime dep, in fact.
* tor-persist: load_store: More documentationIan Jackson2024-01-241-3/+29
|
* Fix doc comments.Nick Mathewson2024-01-242-2/+2
|
* tor-persist: state_dir: Implement the StorageHandle methodsIan Jackson2024-01-241-6/+36
| | | | | You can't call these yet and there aren't any tests. But this demonstrates use of the previous refactoring.
* tor-persist: state_dir: (intend to) use tor_persist::ErrorIan Jackson2024-01-241-16/+4
|
* tor-persist: have load_store module provide deletionIan Jackson2024-01-242-0/+10
|
* tor-persist: Provide load_store module for use by state_dirIan Jackson2024-01-243-22/+58
|
* tor-persist: Use correct pathnames in errorsIan Jackson2024-01-241-5/+8
| | | | | | | | | | | | Before this, we would say the problem happened while accessing Resource::File { container: "STATE_DIR", file: "KEY.json", } which would imply that we failed to access "STATE_DIR/KEY.json". But that's not true: we *actually* access "STATE_DIR/state/KEY.json".
* state-dir: Use a real lock guardIan Jackson2024-01-242-4/+6
| | | | | Bring in the fslock-guard crate and replace the Void in the structs. (Separated out since this contains Cargo.lock churn.)
* state-dir: Move from tor-hsservice to tor-persistIan Jackson2024-01-243-1/+587
| | | | | | | | | | And, instead of being a hidden module, it's a public experimental one. I have feature-gated all the new dependencies since we probably want to feature-gate this module in perpetuity, since some builds of Arti won't need it. Closes #1205
* tor-keymgr: Use keystore_error_kind() to get the error kind.Gabriela Moldovan2024-01-151-1/+1
| | | | Closes #1215
* todos: Reference a new ticket about errorkindsIan Jackson2024-01-111-1/+1
|
* Remove pending semver entriesarti-v1.1.12Nick Mathewson2024-01-091-1/+0
|
* Patchlevel version bumps in preparation for 1.1.12.Nick Mathewson2024-01-091-1/+1
| | | | | | | | | | | | | This crate doesn't have a meaningful public API, so it just gets a patchlevel bump: arti These crates had nonbreaking changes, and get a patchlevel bump: tor-rtcompat fs-mistrust tor-llcrypto tor-cert
* Breaking version bumps in preparation for 1.1.12.Nick Mathewson2024-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have breaking changes on their own: tor-error tor-netdoc tor-dirmgr tor-keymgr Because of the breaking change in tor-error, and the fact that basically every crate publicly depends on tor-error (by implementing ErrorKind), we need to call this a breaking change on all of the following: tor-config tor-geoip tor-rtmock tor-log-ratelim tor-rpcbase tor-bytes tor-hscrypto tor-socksproto tor-cell tor-proto tor-netdoc tor-netdir tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-testing
* tor-persist: Provide FsMistrustErrorExt, and use itIan Jackson2023-12-135-5/+65
| | | | | | | | | | | | | This code needs fs_mistrust::Error and tor_error::ErrorKind. I think we probably don't want fs_mistrust to depend on tor_error or vice versa. tor_persist is approximately the place where these two threads of thought come together, and it's currently the lowest place where this is needed. Use it in tor-dirmgr too, which is currently the other place that embodies this knowledge about fs_mistrust::Error.
* Remove semver.md files.Nick Mathewson2023-12-041-1/+0
|
* Bump minor versions in preparation for releaseNick Mathewson2023-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This crate is new, and gets a bump to 0.1.0. tor-log-ratelim This crate had a breaking change: tor-persist tor-llcrypto had a breaking change. These crates _are_ tor-llcrypto, or (transitively) depend on it. I am assuming that they all re-expose something from it in a way that matters: tor-llcrypto tor-bytes tor-hscrypto tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-hyper
* Bump patchlevel versions in preparation for releaseNick Mathewson2023-12-041-2/+2
| | | | | | | | | | | | | | | These crates had backward-compatible changes, and get a patchlevel bump only: fs-mistrust tor-error tor-config tor-rtcompat tor-rtmock This crate exposes no non-CLI APIs, and gets a patchlevel bump only: arti
* In every crate, change rust-version to 1.70.Nick Mathewson2023-11-281-1/+1
|
* tor-persist: Make LockStatus #[must_use]Ian Jackson2023-11-222-0/+2
| | | | | I see other problems with this API, see #1136. but we can at least easily do this.
* Bump patchlevel (not dependents) on crates with trivial changesNick Mathewson2023-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: ``` tor-basic-utils caret fs-mistrust safelog retry-error tor-events tor-units tor-geoip tor-rtcompat tor-rpcbase tor-protover tor-socksproto tor-checkable tor-congestion tor-persist tor-circmgr arti-rpcserver arti-config arti-hyper arti-bench arti-testing tor-consdiff ```
* Update patchlevel for crates with nontrivial changes.Nick Mathewson2023-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are: ``` hashx equix tor-async-utils tor-error tor-config tor-rtmock tor-llcrypto tor-bytes tor-hscrypto tor-hspow tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-netdir tor-chanmgr tor-guardmgr tor-dirmgr tor-keymgr tor-hsclient tor-hsservice arti-client arti ```
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-233-0/+3
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Upgrade to sanitize-filename 0.5.0Nick Mathewson2023-08-011-1/+1
|
* Increment patchlevel versions of crates with minor changesNick Mathewson2023-08-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are at version 0.x.y, so we don't need to distinguish new-feature changes from other changes: ``` tor-basic-utils fs-mistrust tor-error tor-geoip tor-checkable tor-linkspec tor-netdoc tor-netdir tor-persist tor-ptmgr tor-hsservice ``` This crate has a breaking change, but only when the semver-breaking feature `experimental-api` is enabled: ``` tor-config ``` This crate is at version 1.x.y, but has no new public APIs, and therefore does not need a minor version bump: ``` arti ```
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-104-0/+4
|