Commit Graph

411 Commits

Author SHA1 Message Date
trinity-1686a 2b8b775dfc feature-gate some functions requiring PreferredRuntime 2022-10-05 12:54:04 +02:00
Nick Mathewson 0d985b0def Merge branch 'hostname-validation' into 'main'
Use hostname-validator crate for hostname validation

See merge request tpo/core/arti!739
2022-10-03 19:01:56 +00:00
Reylaba 6a6931e2c3 Use hostname-validator crate for hostname validation 2022-10-03 16:47:03 +02:00
Nick Mathewson 102e3c221d Bump minor version of tor-rtcompat and most of its dependents
(Since the APIs for the `Schedule::sleep*` functions changed, this
is a breaking change in tor-rtcompat.  Therefore, the Runtime trait
in tor-rtcompat is now a different trait.  Therefore, anything that
uses the Runtime trait in its APIs has also broken.)
2022-10-03 10:01:46 -04:00
Nick Mathewson 388e0cbab5 Bump crates that have had backward compatible API changes. 2022-10-03 09:52:34 -04:00
Ian Jackson a773a753b3 Merge branch 'fix-nightly-clippy' into 'main'
Fix nightly clippy

See merge request tpo/core/arti!729
2022-09-22 16:45:52 +00:00
Ian Jackson 10d3fd9e9f Apply 1 suggestion(s) to 1 file(s) 2022-09-22 16:25:08 +00:00
trinity-1686a 8e7a904260 fix clippy::needless_borrow 2022-09-10 14:39:47 +02:00
trinity-1686a edfd416ba4 enumerate platform with getresuid support 2022-09-10 14:13:26 +02:00
Nick Mathewson a5f704f443 Remove semver.md from arti-1.0.0 2022-09-07 09:17:00 -04:00
Ian Jackson f62e2f48d4 READMEs: Drop stability warning re config
The referenced ticket is closed and I think the top-level caveats
remaining after !717 are sufficient.
2022-09-02 17:29:11 +01:00
Ian Jackson 52d9b8103a READMEs: Run maint/readmes (to update READMEs from lib.rs) 2022-09-02 17:08:08 +01:00
Ian Jackson 6ae54b4623 arti-client README: Say we intend to provide FFI 2022-09-02 17:07:37 +01:00
Ian Jackson c0189e02b7 READMEs: arti-client: Remove caveats and add some xrefs 2022-09-02 14:51:31 +01:00
Nick Mathewson 96875ea208 Bump crate versions in preparation for Arti 1.0.0 release.
Because we want to work more on ensuring that our semver stability
story is solid, we are _not_ bumping arti-client to 1.0.0 right now.

Here are the bumps we _are_ doing.  Crates with "minor" bumps have
had API breaks; crates with "patch" bumps have had new APIs added.

Note that `tor-congestion` is not bumped here: it's a new crate, and
hasn't been published before.

```
tor-basic-utils         minor
fs-mistrust             minor
tor-config              minor
tor-rtcompat            minor
tor-rtmock              minor
tor-llcrypto            patch
tor-bytes               patch
tor-linkspec            minor
tor-cell                minor
tor-proto               minor
tor-netdoc              patch
tor-netdir              minor
tor-persist             patch
tor-chanmgr             minor
tor-guardmgr            minor
tor-circmgr             minor
tor-dirmgr              minor
arti-client             minor
arti-hyper              minor
arti                    major
arti-bench              minor
arti-testing            minor
```
2022-09-01 08:59:49 -04:00
Nick Mathewson 8b6f4cc69d Update README.md files with "readmes" tool. 2022-08-31 11:08:03 -04:00
Ian Jackson 56fd5ac779 Merge branch 'safelog_more' into 'main'
Apply safelog to more of the things that we log

See merge request tpo/core/arti!693
2022-08-26 13:20:00 +00:00
Ian Jackson 72bc20c99b arti: running_as_setuid: fix MacOs build
libc::getuid and geteuid are marked unsafe, even though I think they
could be safe.  So the previous code didn't build.
2022-08-26 11:44:05 +01:00
Nick Mathewson f9a9921bed arti-client: Treat list of exit ports as sensitive. 2022-08-25 12:03:38 -04:00
Nick Mathewson e8fcf2b038 arti-client: Downgrade "got a circuit for" message.
This is not interesting to the user, and violates some of our
safe-logging rules (like "Don't log at info for each user request"
and "don't log ports").
2022-08-25 11:05:42 -04:00
Ian Jackson 9c00ec7da4 tor-config: Replace dir detection with ConfigurationSource enum
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/682#note_2830860

And subsequent IRC discussion.

Having done the work as per review comments, I don't much like the
result.  It's quite un-ergonomiuc.  If we can't have fs autodetection,
I think syntactic autodetection within sources.rs would be nearly as
nice.

However, I seem to be outvoted.  At least the externally visible
functionality (of an arti binary, say) is reasonably ergonomic.
2022-08-25 15:58:29 +01:00
Ian Jackson 7c0637ad44 config watch: Fix and reduce debounce interval
The parameter to FileWatcher::new is not a polling time fallback; it
is a "debounce time".  Events are always delayed by at least this
much.

10s is much too long for this.  1s is more appropriate.
2022-08-25 15:58:29 +01:00
Ian Jackson 7d8b3e2f2f config sources: Read arti.d as well as arti.toml
Fixes #474 aka #271
2022-08-25 15:58:29 +01:00
Ian Jackson 504bba2191 Fix setuid testing for MacOS 2022-08-25 12:21:33 +01:00
Nick Mathewson 679c1c9b6a Merge branch 'no_setuid' into 'main'
arti_client: Refuse to build a client if we are setuid.

See merge request tpo/core/arti!689
2022-08-24 19:47:15 +00:00
Nick Mathewson a8b3e147fe arti_client: Refuse to build a client if we are setuid.
Arti is not designed to be a setuid-safe program.

Part of #523.
2022-08-24 15:23:24 -04:00
trinity-1686a 426a59b2ba add feature annotation not added by doc_auto_cfg 2022-08-24 18:22:41 +02:00
trinity-1686a 7f939fa480 enable doc_auto_cfg feature on every crate when documenting for docs.rs 2022-08-24 18:22:41 +02:00
Ian Jackson 074d08bee8 arti: Fix a minimal-versions failure 2022-08-17 10:54:41 +01:00
Ian Jackson d9338293c8 Add semver notes 2022-08-17 10:54:41 +01:00
Ian Jackson 48fc5d3c39 chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>
This gets rid of many Result().  Many parameters are renamed.
Test cases of the now-impossible branch are removed.

Deleting the match from padding_parameters will come in a moment.
I've split off that commit since it has much whitespace noise.
for now, change the error type to Void.
2022-08-17 10:54:41 +01:00
Ian Jackson 76a1c45202 Introduce ChannelConfig
This commit is just the necessary plumbing.  The config is currently
empty.  We'll add something to it, for padding control, later.
2022-08-16 18:39:57 +01:00
Ian Jackson 4f44ef755a dormancy: Plumb through to chanmgr reconfigure_general
The chanmgr remembers the last dormancy state it was told.

We invent a chanmgr-specific Dormancy which the arti-client code knows
how to convert from the richer top-level dormant status.  This avoids
having to have everyone know all the variants of the top-level state.

To call reconfigure_general, we must also obtain and plumb through a
netdir.  Right now we must return an internal error if there is in
fact no netdir, because reconfigure_general does not yet cope with a
missing netdir.

Nothing actually *uses* the dormancy yet.
2022-08-16 18:37:06 +01:00
Ian Jackson 7387474be2 dormancy: tor-client: Break initial dormancy out into a variable
We're going to need to reuse this, so we can plumb the dormancy to
more places.  Breaking it out avoids having repeat the initial
dormancy value in two places.
2022-08-16 18:37:06 +01:00
Ian Jackson 69629e0ab0 arti-client: TorClient constructor: add a blank line
The rustfmt-mandated different formatting of these two very similar
blocks is bad enough, without them being smooshed together.
2022-08-16 18:37:06 +01:00
Nick Mathewson 32a78651d2 Document more explicitly what "voiding a semver warranty" entails
Closes #522.
2022-08-11 15:35:32 -04:00
Nick Mathewson b16c042004 Now that versions have bumped, remove semver.md files. 2022-08-01 10:07:12 -04:00
Nick Mathewson 859ae4acd0 Bump patch versions on crates that have new APIs.
Do _not_ bump the dependency versions on crates that have had no
changes since arti 0.0.5, since those crates do not depend on the
new APIs.

```
cargo set-version -p tor-basic-utils   --bump patch
cargo set-version -p tor-llcrypto      --bump patch
git restore crates/tor-checkable
git restore crates/tor-consdiff
git restore crates/tor-rtmock
```
2022-08-01 09:56:29 -04:00
Nick Mathewson 511cb46997 Bump minor version on crates with deps with breaking changes.
This performs the transitive closure of the last operation:
everything that depends on a crate with a breaking change gets the
version which it depends on bumped.

```
cargo set-version -p tor-proto         --bump minor
cargo set-version -p tor-netdoc        --bump minor
cargo set-version -p arti-hyper        --bump minor
cargo set-version -p arti-bench        --bump minor
cargo set-version -p arti-testing      --bump minor
cargo set-version -p tor-config        --bump minor
```
2022-08-01 09:49:13 -04:00
Nick Mathewson f5dcb98f06 Bump minor versions on all crates that have had breaking changes.
Done with these commands:

```
cargo set-version -p fs-mistrust       --bump minor
cargo set-version -p tor-bytes         --bump minor
cargo set-version -p tor-socksproto    --bump minor
cargo set-version -p tor-cert          --bump minor
cargo set-version -p tor-linkspec      --bump minor
cargo set-version -p tor-cell          --bump minor
cargo set-version -p tor-netdir        --bump minor
cargo set-version -p tor-persist       --bump minor
cargo set-version -p tor-chanmgr       --bump minor
cargo set-version -p tor-guardmgr      --bump minor
cargo set-version -p tor-circmgr       --bump minor
cargo set-version -p tor-dirclient     --bump minor
cargo set-version -p tor-dirmgr        --bump minor
cargo set-version -p arti-client       --bump minor
cargo set-version -p arti              --bump minor
```
2022-08-01 09:43:09 -04:00
Nick Mathewson dfdcc97858 Several typo fixes from `typos`. 2022-07-27 10:12:32 -04:00
Nick Mathewson 1f79e1c49b Update arti-client to new NetDirProvider API.
This allows us to give better errors in the case where bootstrapping
succeeds at first, but fails thereafter for long enough to make our
directory expire.
2022-07-26 10:41:38 +01:00
Nick Mathewson 3066aeff18 Rename download_tolerance to directory_tolerance
Closes #503.
2022-07-22 10:14:36 -04:00
Nick Mathewson 41104137b1 Rename DirSkewTolerance to DirTolerance
This name is more accurate because we aren't only dealing with
clock skew here: we're also trying to tolerate the case where the
authorities fail to reach consensus for a while.
2022-07-22 10:04:25 -04:00
Nick Mathewson 6039461a8a arti-client: Split "Persist" into setup and access variants. 2022-07-21 09:08:33 -04:00
Nick Mathewson fb558fdfb5 arti_client: turn "Proto" error into StreamFailed. 2022-07-21 09:08:33 -04:00
Nick Mathewson 4a97ad4632 arti_client: Split DirMgr error into useful types. 2022-07-21 09:08:33 -04:00
Nick Mathewson fd56ec9698 arti-client: minor edits in error messages and comments 2022-07-21 09:08:33 -04:00
Ian Jackson d89758ace2 Semver tweaks from review.
These aren't user facing comments, but getting them
right will help us write better changelogs.
2022-07-19 15:29:24 -04:00
Nick Mathewson 222d1fea5e arti-client: Remove code related to overriding fs-mistrust.
This logic can now be adjusted via the config object so that it does
its own overriding by looking at the environment as appropriate.
Removing these methods helps simplify the code a bit.

Enabled by #483.
2022-07-19 15:29:24 -04:00