Commit Graph

481 Commits

Author SHA1 Message Date
eta 85ca3e41b9 Merge branch 'shadykaty-error-hint-v2' into 'main'
Create and use an ErrorHint type to report how to fix a problem.

Closes #579 and #578

See merge request tpo/core/arti!994
2023-02-07 16:32:10 +00:00
Nick Mathewson 8ee04ac203 Merge branch 'logs' into 'main'
Report causes of errors

Closes #680

See merge request tpo/core/arti!997
2023-02-01 18:19:33 +00:00
Nick Mathewson a2b1f20216 Bump minor version of tor-cell.
In !948 we renamed a couple of accessor functions, which is a
breaking change in `tor-cell`'s API.

In retrospect, perhaps we should have deprecated the old names and
added the new ones, so we wouldn't have to break the API.  (This is
the only API break AFAICT since 1.1.0.)
2023-02-01 10:42:58 -05:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
These changes influence behavior, but not effect compatibility.
(If I messed up, and any crate except for `arti` has non-breaking
API changes, that's still fine, since they are all version
0.x.)
2023-02-01 10:23:58 -05:00
Ian Jackson 5c0a7e0127 Use ErrorReport for errors in error! in arti-client 2023-01-30 18:52:32 +00:00
Nick Mathewson b3c963e7fa ErrorHint: Add a note about lowering the permissions hint 2023-01-27 11:56:53 -05:00
Nick Mathewson ae963e3c6b ErrorHint: use anonymize_home 2023-01-27 11:56:53 -05:00
Nick Mathewson 39ad97fdc2 ErrorHint: Implement tryfrom_torpersist 2023-01-27 11:56:53 -05:00
Nick Mathewson 3c82f794c1 ErrorHint: refactor API (part 2)
Change ErrorHint so that, internally, it just holds an enum with a
lightweight reference to whatever parts of the error it needs to
generate a hint.  Then we can move the formatting logic into a
Display function for ErrorHint, and do away with ErrorDetail entirely.
2023-01-27 11:56:53 -05:00
Nick Mathewson b8058c5d02 ErrorHint: refactor API (part 1)
Move the "hint" function into Error, and use Option rather than Result.

(I'm using Option here because it's not really an error case not to have
a hint; we just either have a hint, or we don't.)
2023-01-27 11:56:53 -05:00
Shady Katy cc4c07678a add opaque ErrorHint API, impl ErrorHint from BadPermissions 2023-01-27 11:02:42 -05:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
Michael van Straten fa93f6674d made TorClient::set_stream_prefs public 2023-01-18 18:20:59 +01:00
Nick Mathewson 56cb2d2a10 Make a top-level API for connecting to onion services.
Fortunately, it adds very little to the arti-client API surface.
2023-01-12 09:28:58 -05:00
Ian Jackson 125a455bdc test lint blocks: Add many many automatically
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Ian Jackson 4e74104e70 Merge branch 'spelling-20221206' into 'main'
A few spelling fixes for bridgedescmgr code

See merge request tpo/core/arti!925
2022-12-06 18:25:43 +00:00
Nick Mathewson f204eebf11 arti-client: spelling fix. 2022-12-06 09:08:26 -05:00
eta 16305a6415 Merge branch 'optional-deps-static' into 'main'
make use of 1.60 weak dependancy features

Closes #434

See merge request tpo/core/arti!920
2022-12-05 15:21:55 +00:00
trinity-1686a 39fffd8d03 make use of 1.60 opt dependancy features 2022-11-30 21:24:04 +01:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Ian Jackson 598f4e2e28 arti: BridgesConfig is evidently not too high up
Since apparently it was possible to write all the other code without
moving it.
2022-11-30 15:51:10 +00:00
Ian Jackson a74ee097f5 arti: pt mgr spawns the task itself in new 2022-11-30 15:48:31 +00:00
Nick Mathewson 5f0f5f81b1 arti-client: Try to take ownership of state earlier.
There's no harm in doing this, since we'll try to take ownership of
the state soon as soon as we use it: We just want to try early, so
that we'll get it before we decide that we're using bridges.

Fixes bug #669; bug introduced by !889.
2022-11-29 19:58:42 -05:00
Ian Jackson 143b331ef7 arti-client: Make ptmgr actually optional 2022-11-29 16:32:14 +00:00
Ian Jackson c92dcb5f50 arti, arti-client: Conditionalise various things on pt-client 2022-11-29 16:32:14 +00:00
eta 3a0f0a909d Spelling fix in arti_client::err 2022-11-29 12:31:50 +00:00
Nick Mathewson 1f4a385d7d Temporarily make ptmgr required for arti-client :/ 2022-11-28 17:29:32 -05:00
Nick Mathewson 820657b6bc PtMgr: Use a persistent state directory for PT state.
This makes a `pt_state` directory inside .local/share/arti (or the
local equivalent), right next to our existing `state` dir.

Ideally we would use a separate directory for each PT, but we have a
very fuzzy "what is a specific PT" notion.

Closes #667
2022-11-28 17:29:32 -05:00
Nick Mathewson 1a9c4c722b Integrate PtMgr into arti-client.
If support is available at compile-time, then we construct a PtMgr
and register it with the ChanMgr.  We keep a handle to it ourself so
that we can reconfigure it as needed.

Closes #659.
2022-11-28 17:29:32 -05:00
Ian Jackson 6a39cdfe57 Merge branch 'watch-drop-option' into 'main'
tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable

See merge request tpo/core/arti!853
2022-11-23 18:55:32 +00:00
Ian Jackson 4d502bd818 arti-client: Add comment about Option DormantMode
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854090
(ftaod, that is a different MR to this one)
2022-11-23 17:50:05 +00:00
Nick Mathewson c0a6fb3e0f Merge branch 'stability' into 'main'
arti-client, tor-config: Remove stability warning from top-level docs

See merge request tpo/core/arti!878
2022-11-23 17:50:01 +00:00
Ian Jackson b2607fd8c8 bridge non-support: De-cfg the primary bridge config fields
We now parse the `bridges.enabled` BoolOrAuto, and the
`bridges.bridges` list.

The `bridges.bridges` list is Vec<()> in the builder, and Vec<Void> in
the built config.  Ie, it is simply a count, and vanishes in the built
config.

But this count triggers us to try to call build(), to try to parse
bridges, and to try to set and honour the enablement boolean.

The result is that the type system now ensures that if bridges are
disabled, but specified (either by listing them in the config, or
writing `enabled=true`), we inevitably try to insist that we have a
non-empty Vec<Void>, which is of course impossible.

There will be a test case too for those who think this too abstract a
way to guarantee this property :-).
2022-11-21 16:46:19 +00:00
Ian Jackson 58710b9635 Make the bridge list in the builder be a list of BridgeConfigBuilder
By changing MultilineListBuilder.
2022-11-21 14:58:24 +00:00
Ian Jackson 0b14b93f76 arti-client, tor-config: Remove stability warning from top-level docs
Ticket #285 is closed and most of this is stable now we think.

(There are still a couple of stability warnings for specific types in
tor-config, which aren't exposed at the arti-client level.)
2022-11-21 12:06:27 +00:00
Ian Jackson 285a7988bb Merge branch 'fix_nightly_20221118' into 'main'
Fix warnings and breakage in nightly (2022-11-18 edition)

See merge request tpo/core/arti!872
2022-11-18 16:43:16 +00:00
Nick Mathewson d51162e55b Fix a bunch of "needless borrow" warnings on nightly
It looks like, despite a few false starts, they've got this warning
right; there weren't any false positives.
2022-11-18 10:12:05 -05:00
Nick Mathewson 2c366927cc arti-client: make bridge-client depend on dirmgr/bridge-client
This resolves some errors when building with `bridge-client` but not
with `--all-features`.
2022-11-18 08:53:47 -05:00
Nick Mathewson f1f6005474 arti-client: Mark "bridge-client" and "pt-client" as non-experimental 2022-11-18 08:53:47 -05:00
Nick Mathewson 09591bcc5a arti-client: split long lines in Cargo.toml
Doing this separately to make the next commit easier to read.
2022-11-18 08:53:47 -05:00
eta 09b918515c Merge branch 'ptmgr-config' into 'main'
tor-ptmgr: make configuration use builders, plumb into arti-client

See merge request tpo/core/arti!823
2022-11-16 12:12:35 +00:00
eta 1c9f6fb179 tor-ptmgr: make configuration use builders, plumb into arti-client
This brings the draft configuration mechanisms in tor-ptmgr in line with
the config in other crates, using builders. It also plumbs the config
type through into the main `arti-client` config, and adds some example
lines to `arti-example-config.toml`.
2022-11-16 11:39:25 +00:00
Ian Jackson fdeb2db1c2 arti-client: Retain a strong reference to the inner Arc<BridgeDescMgr>
Fixes #636.
2022-11-15 14:36:02 +00:00
Ian Jackson b7441c9804 bridges: Create and install a BridgeDescMgr when we bootstrap 2022-11-15 12:08:21 +00:00
Ian Jackson a565e3381f arti-client: Store a handle to the DirMgrStore in TorClient (fmt)
rustfmt only.
2022-11-15 12:08:21 +00:00
Ian Jackson 63c463944d arti-client: Store a handle to the DirMgrStore in TorClient
We'll need this shortly.
2022-11-15 12:08:21 +00:00
Ian Jackson 647610f2f9 arti-client: Store a handle to the guardmgr in TorClient
We'll need this shortly.
2022-11-15 12:08:20 +00:00
Ian Jackson b41becec56 Merge branch 'guardmgr' into 'main'
Move guardmgr creation to arti-client, rather than within circmgr

See merge request tpo/core/arti!850
2022-11-14 17:01:31 +00:00