Commit Graph

1651 Commits

Author SHA1 Message Date
Trinity Pointard 1fd720a926 add ci check for deps minimal versions and msrv 2021-10-31 09:54:52 +01:00
David Goulet 45137a84b1 readme: Add crates.io badge at the top
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-29 12:15:18 -04:00
Nick Mathewson 156ffae727 Add our release instructions to version control. 2021-10-29 12:05:40 -04:00
Nick Mathewson d272afb341 Cargo.lock: v0.0.1 is now published. 2021-10-29 11:58:28 -04:00
Nick Mathewson f5d042115a tor-persist: serde usage now requires derive feature. 2021-10-29 11:41:26 -04:00
Nick Mathewson e6e740646a Bump all crate versions to 0.0.1 2021-10-29 11:05:51 -04:00
Nick Mathewson ad2b4e300a Remove alternative-name handling from exclude_contributors.txt
This doesn't actually do the right thing: it will make somebody get
ignored completely for a release if they _only_ use their
alternative name.
2021-10-29 10:39:05 -04:00
Nick Mathewson ba799d6335 thanks.sh: Remove tempdir on exit. 2021-10-29 10:38:08 -04:00
Nick Mathewson b9f23fbf98 Fix shellcheck warnings in thanks.sh 2021-10-29 10:35:37 -04:00
Nick Mathewson f399a7ecb5 Merge remote-tracking branch 'origin/mr/113' 2021-10-29 10:32:50 -04:00
Nick Mathewson a29378bf92 Add a list_crates.py script, for help with foreach scripting. 2021-10-29 10:32:16 -04:00
eta 71e87fc1ab Add an attempt at autogenerating contributor lists for releases
Disclaimer: I have no idea what I'm doing when it comes to shell
scripts.

maint/thanks.sh autogenerates a list of contributors since a revision
(that you pass it on the command line), intended to make the work of
going through the shortlog a bit less manual. It can exclude
contributors' names given in maint/exclude_contributors.txt, in order to
filter out people who work for Tor, or who commit under more than one
name.
2021-10-29 15:30:01 +01:00
Nick Mathewson e4716e71c0 Typo fix in Changelog 2021-10-29 10:27:22 -04:00
Nick Mathewson b90e83781d Add a script to enforce topological sorting in workspace Cargo.toml 2021-10-29 10:27:05 -04:00
Nick Mathewson f7a72d7f62 Update Cargo.lock in preparation for Arti 0.0.1 release. 2021-10-29 09:40:35 -04:00
Nick Mathewson 9d3256ec83 Update README.md files 2021-10-29 09:37:15 -04:00
Nick Mathewson 3dbf1eb637 Begin a CHANGELOG.md for Arti 0.0.1 2021-10-29 09:35:49 -04:00
Nick Mathewson 19a61249f8 Merge remote-tracking branch 'origin/mr/112' 2021-10-29 09:16:44 -04:00
eta a12fffc66a Improve docs of more (potentially re-exported) arti-client types
Most of the structs in `arti-client` have example code now, to give a
clearer idea of how they're used.

Annoyingly, a lot of the types exposed in `arti-client` are actually
re-exports, which makes documentation a bit harder: example code that
references other parts of `arti-client` can't actually be run as a
doctest, since the crate it's in is a dependency of `arti-client`.

We might be able to fix this in future by doing the documentation in
`arti-client` itself, but rustdoc seems to have some weird behaviours
there that need to be investigated first (for example, it seems to merge
the re-export and original documentation, and also put the re-export
documentation on the `impl` block for some reason).

For now, though, this commit just writes the docs from the point of view
of an `arti-client` consumer, removing notes specific to the crate in
which they're defined. It's not ideal, but at least the end user
experience is decent.
2021-10-29 14:06:06 +01:00
Nick Mathewson 1ee24ce653 Improve some documentation links
Instead of putting a fully qualified name in the text, in most cases
we should just use the short name of the type or function we're
referring to.

In other words, instead of saying [`crate::module::Foo`], we should
typically say [`Foo`](crate::module::Foo).
2021-10-29 08:39:04 -04:00
Nick Mathewson c11fe200d1 Try writing a bit more documentation for configuration types. 2021-10-28 20:49:17 -04:00
Nick Mathewson 2057142671 Use correct link for AsyncWriteExt::flush 2021-10-28 20:48:54 -04:00
Nick Mathewson 4107533d77 Typo fix in an expect() message. 2021-10-28 20:22:49 -04:00
Nick Mathewson 6cba1acef4 Encourage the use of TorClient::clone(). 2021-10-28 20:21:35 -04:00
Nick Mathewson c8f65e532e DataStream: document the importance of flush(). 2021-10-28 20:21:35 -04:00
Nick Mathewson bf3bfdf62d arti-client example: Try to make the comments a little more clear.
I'm not 100% sure this is better, but it might help the user
understand how Arti works a bit better.
2021-10-28 20:20:23 -04:00
Nick Mathewson 672335ccf6 Update README.md files 2021-10-28 19:59:22 -04:00
Nick Mathewson 9304d5d6b7 Add removed paragraphs to Architecture.md 2021-10-28 19:59:05 -04:00
Nick Mathewson 19d3c34729 Merge remote-tracking branch 'origin/mr/111' 2021-10-28 19:54:03 -04:00
Nick Mathewson b160177b63 Oops: add missing data files 2021-10-28 19:51:16 -04:00
Nick Mathewson 4a721da54c tor-dirmgr: tests for GetMicrodescsState 2021-10-28 14:21:21 -04:00
eta dcdd8c59df Improve top-level arti-client documentation, add example code
This overhauls the top-level `arti-client` documentation significantly:

- the "Using arti-client" section walks the user through all of the
  necessary steps to initiate a Torified TCP connection, and then
  provides a code example
  - this example is also available as `examples/readme.rs`; it's not run
    as a doctest, since it involves connecting to Tor
  - a "More advanced usage" subheading provides information about stream
    isolation (and can potentially be used for other interesting
    features once we get them).
- a new "Multiple runtime support" section was added to explain the
  purpose and usage of the `tor-rtcompat` crate
- the section on design and privacy considerations was removed; this is
  probably okay to keep in a README, but users of the crate aren't going
  to be interested in this (at least I don't think)

(also, the doc comment for `arti_client::Error` was fixed to make actual
sense)
2021-10-28 19:20:42 +01:00
Nick Mathewson 2f149621fd tor-dirmgr: tests for download schedules. 2021-10-28 13:08:46 -04:00
Nick Mathewson e6c0fbaa10 tor-chanmgr: remove PendingChanError as unnecessary. 2021-10-28 12:41:08 -04:00
Nick Mathewson dcc1acb2fc Merge branch 'test_dirmgr' 2021-10-28 11:56:41 -04:00
Nick Mathewson a730478fd0 Fix clippy warnings in tests. 2021-10-28 11:44:09 -04:00
Nick Mathewson 6dde31f328 Merge remote-tracking branch 'origin/mr/110' 2021-10-28 11:40:18 -04:00
Nick Mathewson 0979e60293 Mark request_retried test as ignored 2021-10-28 11:30:16 -04:00
Trinity Pointard 0438a3da93 move integration tests to scripts 2021-10-28 11:28:22 -04:00
Nick Mathewson 7e8891b861 tor-dirmgr: Test for GetCertsState 2021-10-28 10:21:56 -04:00
Nick Mathewson 8956e6cd8b tor-dirmgr: Tests for GetConsensusState.
This test uses a consensus that I've copied from
tor-netdoc/testdata.  I would include it directly, but I think that
will cause trouble when it comes time to run "cargo package".
2021-10-28 09:35:18 -04:00
Nick Mathewson 5e27c46d24 tor-dirmgr::state: Mock the view of current time.
This will let us test the state processing code without having to
give it up-to-date directory objects.
2021-10-28 08:41:59 -04:00
Nick Mathewson b7c7c8ba13 tor_circmgr: Refactor and re-enable build_timeout() test
The previous version of this test used the old, racy version of
wait_for (see #149).  The new version is refactored so that
simulated time is only allowed to advance after each step is done,
so that we can actually be sure that each step in the process will
happen as it should.

In order to get the time-advances to proceed properly, and avoid
polluting state between tests, I've had to introduce some machinery
to encode the proper amount for time to advance.  It isn't something
I'd want to use for a whole bunch of tests, but for just one set,
it's fine.

These tests now pass reliably for me.

I wonder if a discrete-event-simulation approach (hello, Shadow)
would let us write tests like these to our hearts' content?
2021-10-27 16:31:31 -04:00
Nick Mathewson 3c82666d39 Small FAQ update. 2021-10-27 15:07:49 -04:00
Nick Mathewson 01894dcd68 Add missing entries to Architecture.md 2021-10-27 15:05:00 -04:00
Nick Mathewson 2fae63b5ae Upgrade to fslock version 0.2
This version makes all locks per-handle rather than per-process, by
moving from lockf() to flock() on unix.
2021-10-27 14:52:09 -04:00
eta 4fa0122dde Improve and future-proof the `arti` CLI
This switches out `arti`'s argument-parsing library with `clap`, which
is a lot more featureful (and very widely used within the Rust
ecosystem). We also now use a lot of `clap`'s features to improve the
CLI experience:

- The CLI now expects a subcommand (currently, either "help", or "proxy"
  for the existing SOCKS proxy behaviour). This should let us add
  additional non-SOCKS-proxy features to arti in future.
- `clap` supports default values determined at runtime, so the way the
  default config file is loaded was changed: now, we determine the
  OS-specific path for said file before invoking `clap`, so the help
  command can show it properly.
  - The behaviour of `tor_config` was also changed; now, one simply
    specifies a list of configuration files to load, together with
    whether they're required.
  - That function also way overused generics; this has been fixed.
- Instead of using the ARTI_LOG environment variable to configure
  logging, one now uses the `-l, --log-level` CLI option.
  (The intent is for this option to be more discoverable by users.)
- The `proxy` subcommand allows the user to override the SOCKS port used
  on the CLI without editing the config file.
2021-10-27 19:11:48 +01:00
Nick Mathewson 134c04a67a Update our disclaimers and limitations sections. 2021-10-27 11:13:46 -04:00
eta 5a4db67b16 Add Futureproof<T> wrapper type, use for GuardDisabled enum
The Futureproof<T> type lets you serialize and deserialize types whose
representations might change (most useful for enums that might grow
additional variants). It uses #[serde(untagged)] to accomplish this.

This gets used in order to make the `disabled` field of `Guard` more
robust against future guard disablement reasons being added.

A test was also added to verify correct behaviour of the new type.
2021-10-27 15:10:44 +01:00
eta 7a931b4de3 Add #[serde(flatten)] HashMap fields to serializable objects
As per arti#175, we'd like to be able to handle newer Arti versions
storing additional state in the persisted state files, without dropping
this data on the floor when we write out changes to these files.

Use the #[serde(flatten)] mechanism to achieve this, by adding catch-all
HashMap<String, JsonValue> fields to all structs that are at risk of
this happening to them.
2021-10-27 13:31:52 +01:00