Commit Graph

467 Commits

Author SHA1 Message Date
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
Ian Jackson 58fc19dc8d Merge branch 'store3' into 'main'
dirmgr: Expopse DirMgrStore

See merge request tpo/core/arti!851
2022-11-14 17:01:10 +00:00
Ian Jackson ed4006c87c Move GuardMgr::new call to arti_client::TorClient (fmt)
rustfmt only, broken out to ease review.
2022-11-14 15:52:30 +00:00
Ian Jackson 525c452e77 Move GuardMgr::new call to arti_client::TorClient
Having this done within circmgr was irregular - most of our other key
buildup functions are done in TorClient::create_inner.

It is also inconvenient, as it buries the guardmgr within the circmgr.
2022-11-14 15:50:07 +00:00
Ian Jackson 92939439a6 dirmgr Store: Have constructors take DirMgrStore
Now the Store is constructed by arti_client, solving the problem
described here
  https://gitlab.torproject.org/tpo/core/arti/-/issues/631#note_2853665
but in a different way.
2022-11-14 15:48:17 +00:00
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
trinity-1686a 614cf34284 Check more targets 2022-11-10 13:34:17 +00:00
Nick Mathewson b295518a42 Spelling fixes and normalizations on some high-level crates 2022-11-07 10:21:58 -05:00
Ian Jackson 7d6f5d5eab guardmgr config: Provide bridge information to new and reconfigure 2022-11-03 15:48:07 +00:00
Ian Jackson 3dde9f8a05 bridges config: Check that bridges aren't enabled with no bridges
This is the validation which is called for by the documentation.
2022-11-03 15:43:41 +00:00
Ian Jackson 6c64be06a6 guardmgr config: Introduce and require new GuardMgrConfig trait
It doesn't seem to me like it makes sense to provide the backward
compatibility here.
2022-11-03 15:43:41 +00:00
Nick Mathewson 932fe48eaf Run add_warnings. 2022-11-03 11:06:02 -04:00
Ian Jackson 48f48841e1 Require derive_more 0.99.3
0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114
which makes the Deref derive for bridgedesc::StateGuard not work
and therefore breaks minimal-versions CI.

It seems simpler to require the newer version everywhere.
2022-11-03 11:37:23 +00:00
Nick Mathewson b4cc98b21b Merge branch 'readmes' into 'main'
Abolish maint/readme and use doc include

Closes #603

See merge request tpo/core/arti!768
2022-10-12 15:16:18 +00:00
Ian Jackson f84d8777db cargo fmt to remove blank lines
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.

This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00