summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | tor-persist: state_dir: Implement StateDirectory::newIan Jackson2024-01-311-1/+17
| | | |
| * | | tor-persist: state_dir: Implement acquire_instanceIan Jackson2024-01-312-7/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | And also instance_peek_storage, which needs to share some code, so determined the shape of this implementation. Make StateDirectory have the (one) field we need.
| * | | tor-persist: state_dir: Implement InstanceStateHandle and StorageHandleIan Jackson2024-01-311-8/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the straightforward methods which, given a CheckedDir, perform the relevant operation. Make InstanceStateHandle have the necessary fields. Constructing an InstanceStateHandle is a bit complex and will come in a moment.
| * | | tor-persist: state_dir: Have instance id throw fmt::ErrorIan Jackson2024-01-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, allowing Bug here was quite inconvenient for everyone. I think very few call sites will want to throw anything interesting. If they *do* want to cause an error, without panicking, they could write a syntactically invalid slug.
| * | | 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
|/ / /
* | | Merge branch 'arti-path-slugs' into 'main'gabi-2502024-01-3116-242/+250
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-keymgr: Replace ArtiPathComponent with Slug Closes #1193 and #1092 See merge request tpo/core/arti!1931
| * | | tor-persist: Document that slugs cannot start with '-'.Gabriela Moldovan2024-01-311-1/+1
| | | |
| * | | tor-hsclient: Rename HsClientSpecifier to HsClientNickname (fmt).Gabriela Moldovan2024-01-312-4/+4
| | | |
| * | | tor-hsclient: Rename HsClientSpecifier to HsClientNickname.Gabriela Moldovan2024-01-314-13/+12
| | | | | | | | | | | | | | | | | | | | Service nicknames are represented by `HsNickname`, so let's rename `HsClientSpecifier` to `HsClientNickname`.
| * | | tor-persist: Make all Slugs non-empty.Gabriela Moldovan2024-01-315-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-keymgr: Add roundrip test for HsId -> Slug -> HsId conversion.Gabriela Moldovan2024-01-311-1/+22
| | | | | | | | | | | | | | | | This also fixes a bug in `HsId::from_component`.
| * | | tor-keymgr: Allow empty denotators in ArtiPath (fmt).Gabriela Moldovan2024-01-311-8/+2
| | | |
| * | | tor-keymgr: Allow empty denotators in ArtiPath.Gabriela Moldovan2024-01-312-11/+7
| | | |
| * | | tor-hsservice: Fix corner case in HsNickname FromStr impl.Gabriela Moldovan2024-01-311-3/+19
| | | | | | | | | | | | | | | | | | | | It was previously possible to construct an `HsNickname` out of an empty string using the `FromStr` impl.
| * | | tor-persist: Forbid slugs from starting with a hyphen.Gabriela Moldovan2024-01-313-5/+44
| | | |
| * | | tor-keymgr: Add a TODO about removing ValidatedString.Gabriela Moldovan2024-01-311-0/+2
| | | |
| * | | tor-keymgr: Remove the Slug tests (fmt).Gabriela Moldovan2024-01-312-8/+3
| | | |
| * | | tor-keymgr: Remove the Slug tests.Gabriela Moldovan2024-01-311-34/+0
| | | | | | | | | | | | | | | | These tests belong in tor_persist now.
| * | | tor-keymgr: Abolish ArtiPathComponent.Gabriela Moldovan2024-01-317-104/+57
| | | | | | | | | | | | | | | | | | | | | | | | `ArtiPathComponent`s are really just `Slugs`. Part of #1193, #1092
| * | | tor-hsclient: Use Slug for HsClientSpecifier (fmt).Gabriela Moldovan2024-01-311-11/+3
| | | |
| * | | tor-hsclient: Use Slug for HsClientSpecifier.Gabriela Moldovan2024-01-312-4/+21
| | | |
| * | | tor-keymgr: Make ArtiPathComponent a Slug internally (fmt).Gabriela Moldovan2024-01-313-36/+57
| | | |
| * | | tor-keymgr: Make ArtiPathComponent a Slug internally.Gabriela Moldovan2024-01-313-104/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it easier to replace `ArtiPathComponent` with `Slug` later down the line. Note this changes the syntax rules of `ArtiPathComponent`: * previously `ArtiPathComponent`s could be unicode strings, (now they are lowercase ASCII alphanumerics, plus `-`, `_`) * previously `ArtiPathComponent`s couldn't start with `-` or `_`, but now they can Part of #1193, #1092
| * | | tor-keymgr: Strip .onion suffix from HsId before building Slug.Gabriela Moldovan2024-01-313-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | We are about to replace `ArtiPathComponent` with `Slug`, but `Slug`s don't support `.`, so let's strip the `.onion` suffix before encoding it in the `ArtiPath`.
| * | | tor-hsservice: Make Slug the underlying repr of HsNickname.Gabriela Moldovan2024-01-311-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We represent `HsNickname` as a `Slug` instead of an `ArtiPathComponent` (we are about to remove the latter). Part of #1092
| * | | 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
* | | Merge branch 'new-strum' into 'main'gabi-2502024-01-3011-23/+45
|\ \ \ | |/ / |/| | | | | | | | Upgrade to strum 0.26 See merge request tpo/core/arti!1937
| * | Upgrade to strum 0.26Nick Mathewson2024-01-3011-23/+45
|/ /
* | Merge branch 'empty-slug' into 'main'Ian Jackson2024-01-291-0/+12
|\ \ | | | | | | | | | | | | slug: Provide BadSlug::EmptySlugNotAllowed See merge request tpo/core/arti!1933
| * | slug: Provide BadSlug::EmptySlugNotAllowedIan Jackson2024-01-291-0/+12
| | |
* | | Merge branch 'make-secure-dir' into 'main'Ian Jackson2024-01-292-0/+19
|\ \ \ | |/ / |/| | | | | | | | fs_mistrust: Provide CheckedDir::make_secure_dir See merge request tpo/core/arti!1927
| * | fs_mistrust: Provide CheckedDir::make_secure_dirIan Jackson2024-01-292-0/+19
|/ / | | | | | | | | | | state_dir wants this, to descend into subdirectories. I think the implementation could be improved - see the TODO.
* | Merge branch 'publisher-tasks' into 'main'gabi-2502024-01-261-3/+67
|\ \ | | | | | | | | | | | | | | | | | | tor-hsservice: Abort any pending desc uploads if shutting down. Closes #1253 See merge request tpo/core/arti!1921
| * | tor-hsservice: Downgrade a debug message to trace.Gabriela Moldovan2024-01-261-1/+4
| | |
| * | tor-hsservice: Abort any pending desc uploads if shutting down.Gabriela Moldovan2024-01-261-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | `Reactor::upload_for_time_period` now exits as soon as the Reactor is dropped (its upload tasks check if `shutdown_tx` was dropped before proceeding). Closes #1253
| * | tor-hsservice: Add an UploadError type for interruption due to shutdown.Gabriela Moldovan2024-01-261-0/+12
| | | | | | | | | | | | | | | This error will be returned if an upload is aborted because the reactor shutting down.
| * | tor-hsservice: Document how the publisher tasks are shut down.Gabriela Moldovan2024-01-261-0/+7
|/ / | | | | | | Part of #1253
* | Merge branch 'set_faulty_eventually' into 'main'Nick Mathewson2024-01-262-6/+24
|\ \ | | | | | | | | | | | | | | | | | | HSS: Mark an Ipt as faulty if it fails continuously for 15 minutes. Closes #1248 See merge request tpo/core/arti!1915
| * | HSS: Mark an Ipt as faulty if it fails continuously for 15 minutes.Nick Mathewson2024-01-252-6/+24
| | | | | | | | | | | | Closes #1248.
* | | Merge branch 'verifier' into 'main'Nick Mathewson2024-01-262-2/+3
|\ \ \ | | | | | | | | | | | | | | | | fs_mistrust: Expose CheckedDir::verifier See merge request tpo/core/arti!1928
| * | | fs_mistrust: Expose CheckedDir::verifierIan Jackson2024-01-252-2/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | I'm not sure why this isn't public. It seems like an obviously reasonable transformation. If I as author of !1927 had been an external contributor, I could have worked around the lack of .make_secure_directory() if .verifier() had existed. So I think exposing it would be useful.
* | | 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.