Commit Graph

3514 Commits

Author SHA1 Message Date
Nick Mathewson de3c7baa4c Note that fs-mistrust has broken semver. 2022-05-24 10:54:02 -04:00
Nick Mathewson 25c64db575 Apply fs-mistrust to logfile directories. 2022-05-24 10:54:02 -04:00
Nick Mathewson b1fc4bd03b Make fs-mistrust configurable from the top level.
This change requires a little refactoring of TorClientBuilder: now,
instead of enabling or disabling mistrust, it enables or disables
the decision to _override_ the mistrust in the config.
2022-05-24 10:54:02 -04:00
Nick Mathewson 12f2a47fcb Write custom serde impls for Trusted{User,Group}
We support all of the following (in TOML notation):

```
user = "rose"  # by name
user = 413     # by ID
user = false   # no user
user = ":current"  # A 'special' user.

user = { name: "rose" }
user = { id: 413 }
user = { special: ":none" }
user = { special: ":current" }
```
2022-05-24 10:54:02 -04:00
Nick Mathewson 9dd7b99de1 Add serde derives for MistrustBuilder.
The Group and User (de)serialization is pretty ugly, and I can't
vouch for the correcness of MistrustBuilder.  I will seek feedback
before I proceed.
2022-05-24 10:54:02 -04:00
Nick Mathewson 330582a142 fs-mistrust: Add Group and User types.
This will help make the actual configuration more serializable,
I hope.
2022-05-24 10:54:02 -04:00
Nick Mathewson 95200383b5 fs-mistrust: make Mistrust have a corresponding Builder type.
This is an approximately minimal revision to get Builder in place;
subsequent commits will clean up the API.
2022-05-24 10:54:02 -04:00
Nick Mathewson baa58daace fs-mistrust: rename fields
This renaming will make things slightly simpler for declaring a
builder.
2022-05-24 10:54:02 -04:00
Ian Jackson 85faa1c0f6 Merge branch 'upgrades-20220523' into 'main'
Update to newer sanitize-filename and tinystr.

See merge request tpo/core/arti!523
2022-05-24 13:22:01 +00:00
Ian Jackson dae2ccd692 Merge branch 'clippy_pass' into 'main'
Make clippy +nightly pass again

See merge request tpo/core/arti!522
2022-05-24 13:21:24 +00:00
Nick Mathewson 8e15c97f56 DirMgr: Stop load-from-cache process when there is no change.
Previously in !511 I had introduced a bug where, if there was an
error more serious than "no change", that error would keep us from
noticing that we had no change, and we'd loop until the safety
counter ran out.  Then we'd panic.

This commit fixes the bug by reintroducing the `changed` boolean --
this time as an outparam for the add_from_* methods.

Fixes #482.
2022-05-24 08:50:20 -04:00
trinity-1686a b279b09b0c add example for Isolation 2022-05-23 22:40:08 +02:00
Nick Mathewson c27b3cb701 Update to newer sanitize-filename and tinystr. 2022-05-23 16:02:50 -04:00
Nick Mathewson 90b8a927a3 Merge branch 'check-pid-squashed' 2022-05-23 13:08:03 -04:00
Jim Newsome 48e1c75584 chutney/teardown: validate that pid is set 2022-05-23 13:07:59 -04:00
Nick Mathewson 546ae3000e Resolve the new `derive_partial_eq_without_eq` lint.
It's a little overzealous sometimes, but it's mostly to the good.
2022-05-23 12:55:37 -04:00
Nick Mathewson 2f1803f4c6 Suppress clippy warnings in tor-basic-utils.
These are warnings that we've decided it's okay to suppress elsewhere.
2022-05-23 12:55:37 -04:00
Nick Mathewson aaa8bfcb53 Merge branch 'remove_dbgs' into 'main'
Remove dbg!()s in tor-config, and fix nightly CI

See merge request tpo/core/arti!516
2022-05-23 16:18:46 +00:00
eta 0861827d90 Merge branch 'update-min-async-compression' into 'main'
async-compression minimum version 0.3.5 -> 0.3.14

Closes #473

See merge request tpo/core/arti!521
2022-05-23 15:43:28 +00:00
eta 55ce1fea79 Merge branch 'streamprefs-test' into 'main'
add unit tests for arti_client::StreamPrefs

See merge request tpo/core/arti!520
2022-05-23 15:41:26 +00:00
Jim Newsome e33cae6cb6
async-compression minimum version 0.3.5 -> 0.3.14
0.3.14 is the first released version to include
e724673876,
which fixes https://gitlab.torproject.org/tpo/core/arti/-/issues/473
2022-05-23 10:01:18 -05:00
michael mccune 0d8f520faf add unit tests for arti_client::StreamPrefs
this change adds unit tests for the public methods of StreamPrefs. although
these are mostly "setter" style functions, the tests confirm the basic
expectations and operation.
2022-05-23 10:55:17 -04:00
Ian Jackson 60551711b8 Merge branch 'channel' into 'main'
channel: Provide and use Sink::prepare_send_from

See merge request tpo/core/arti!514
2022-05-23 11:39:39 +00:00
Ian Jackson 2fc6c8a194 prepare_send_from: clippy: Replace some or_else with or 2022-05-23 11:28:05 +01:00
Ian Jackson 86d5768c05 prepare_send_from: clippy: Have dprintln explicitly return () 2022-05-23 11:28:05 +01:00
Ian Jackson d3f261d5ef prepare_send_from: clippy: Avoid a lint
I think this is worse code, but it's not *significantly* worse.
2022-05-23 11:28:05 +01:00
Ian Jackson 24dde5ddf1 prepare_send_from: clippy: Add missing docs
I intend to reintroduce this in its own MR.
2022-05-23 11:28:05 +01:00
Ian Jackson 739e5b52b1 prepare_send_from: clippy: Replace two unwraps 2022-05-23 11:28:05 +01:00
Ian Jackson 94038a9227 prepare_send_from: Break out get_output! macro
So we can change unwrap to expect, which makes this too long to repeat.
2022-05-23 11:28:05 +01:00
Ian Jackson 9fd0050acf prepare_send_from: docs and comments improvements
Apropos review.
2022-05-23 11:28:05 +01:00
Ian Jackson 426ff28b73 prepare_send_from: Add tests
When I added these tests, they didn't find any bugs in my own
implementation, but I did find a bug in futures::future::unfold.
See the in-code comment.
2022-05-23 11:28:05 +01:00
Ian Jackson 793782acc8 channel: Provide and use Sink::prepare_send_from
This is a general-purpose implementation of the ad-hoc approach
currently taken in (eg) crates/tor-proto/src/channel/reactor.rs,
with an API intended to defned against the more obvious mistakes.

This allows us to separate the two concerns: the channel reactor can
focus on handling channel cells and control messages and is over 2.5x
shorter.

The complexity of the manual sink implementation, and the machinery
needed to avoid having to suspend while holding an item, are dealt
with separately.  That separate implemenation now has proper
documentation.  (Tests are in the nest commit to avoid this one being
even more unwieldy.)

We use `extend` to define this as an extension trait.  A competitor is
`ext` but in my personal projects I have found `extend` slightly
better.
2022-05-23 11:28:05 +01:00
eta b137d64e18 Update Gitlab CI config for Gitlab 14.10
see https://gitlab.com/gitlab-org/gitlab/-/issues/344533
2022-05-23 10:14:09 +00:00
eta a6c7818d8e Merge branch 'update-async-compression' into 'main'
async-compression v0.3.12 -> v0.3.14

Closes #473

See merge request tpo/core/arti!517
2022-05-23 09:59:44 +00:00
Jim Newsome d54faaf500
async-compression v0.3.12 -> v0.3.14
This is to pick up
https://github.com/Nemo157/async-compression/pull/148#issuecomment-1128862482

Fixes https://gitlab.torproject.org/tpo/core/arti/-/issues/473
2022-05-20 16:33:19 -05:00
Nick Mathewson 994426d18c Add a couple of "pub use" to make nightly rustdoc pass. 2022-05-20 12:12:23 -04:00
Nick Mathewson 6a00b74b0b Clarify which releases get advisories. 2022-05-20 11:57:03 -04:00
Nick Mathewson a42a6467a1 SupportPolicy: Add tiers, clarify what "support" means. 2022-05-20 11:52:22 -04:00
Nick Mathewson 9d26a91886 Remove dbg!()s in tor-config
This should satisfy our CI and turn it green again.
2022-05-20 10:34:32 -04:00
eta b4e9e42278 Merge branch 'cert_dl_recovery_v3' into 'main'
DirMgr: Revise error handling to better tolerate reset-able failures

Closes #412 and #439

See merge request tpo/core/arti!511
2022-05-19 12:32:31 +00:00
Nick Mathewson 5b5b4bbbea Simplify advance and reset functions with mem::replace. 2022-05-19 08:09:05 -04:00
Nick Mathewson eab0046d0e Explain why we call update_status unconditionally. 2022-05-19 08:04:57 -04:00
Nick Mathewson 6aebb18e64 Remove BootstrapAction::Impossible
It does nothing that Fatal does not.  Suggested by @eta in review.
2022-05-19 08:00:41 -04:00
Nick Mathewson 8406cc3b7f Initial draft policy on supported platforms and dependencies 2022-05-18 09:24:46 -04:00
Nick Mathewson c70916c0d9 Fix compilation with Rust 1.56. 2022-05-17 14:58:36 -04:00
Nick Mathewson 5de1b93195 DirMgr: Remove blocking_error return path. 2022-05-17 12:25:32 -04:00
Nick Mathewson 53ed5f40cf DirMgr: Unify error return paths
We no longer have separate return paths for recoverable and fatal
errors; instead, they are merged, and distinguished based on
recovery actions.

Since it is now possible for download() to give an error that should
_not_ destroy the previous state, it takes `&mut Box<dyn DirState>`.
This change unfortunately means that we can no longer call `state =
state.advance()`, but instead have to do some mem::swap junk with
poisoned values.  Any better solution would be a good thing.

Additionally, the reset() and advance() methods can no longer fail.

There is still a separate return path for reset-triggering errors;
I'm about to fix that.
2022-05-17 12:25:32 -04:00
Nick Mathewson 6450a4113f Merge branch 'backtrace' into 'main'
Do backtrace string matching test only on some platforms.

See merge request tpo/core/arti!512
2022-05-17 15:10:09 +00:00
Nick Mathewson d7a3fd2c17 DirMgr: Remove special handling of "changed" boolean 2022-05-17 10:16:15 -04:00
Ian Jackson 273879cb14 Placate rustfmt
I found the previous layout *much* better.  Ah well.
2022-05-17 15:04:10 +01:00