summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | tor-config: Support watching dirs for files with a given extension (fmt).Gabriela Moldovan2024-08-211-2/+9
| | | | |
| * | | | tor-config: Support watching dirs for files with a given extension.Gabriela Moldovan2024-08-212-20/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes a couple of issues with the previous implementation: * it enables you to watch for more than just one file/extension per directory (each directory now has a list of filters. If any of the filters apply to the path contained in the notify::Event, the `FilterWatcher` notifies the listeners * it removes the list watched files from `FileWatcher`. This makes things a lot simpler to grok: essentially, the file watcher only ever watches directories, notifying if an "interesting" file was changed (in our case, the interesting files are files that have a relevant extension, such as `.auth`, or specific configuration files, as specified by `ConfigurationSources`).
| * | | | tor-config: Move event handling to a separate function.Gabriela Moldovan2024-08-211-20/+30
| | | | | | | | | | | | | | | | | | | | | | | | | This will soon grow more complex, so I am preemptively moving it out of `start_watching`.
| * | | | tor-config: Remove unused Event::SigHup variant.Gabriela Moldovan2024-08-211-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | We don't need this variant anymore, because sighup is now handled separately from `FileWatcher` events.
| * | | | tor-config: Make FileWatcher use an opaque channel type.Gabriela Moldovan2024-08-214-94/+178
| | | | | | | | | | | | | | | | | | | | The `FileWatcher` now uses a `postage::watch` channel under the hood.
| * | | | tor-config: Give FileWatcherBuilder a handle to the runtime.Gabriela Moldovan2024-08-214-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | The event handler will soon be made async, so we need a handle to the runtime.
| * | | | tor-config: Move FileWatcher to tor-config.Gabriela Moldovan2024-08-215-185/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the most part, this is just code motion. The only change here is that `prepare` is no longer a method on `FileWatcher`. This decouples `FileWatcher` from `ConfigurationSources`, enabling us to use it to watch files and directories that aren't configuration.
| * | | | arti: Update outdated FileWatcher docs.Gabriela Moldovan2024-08-211-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The `FileWatcher` doesn't contain the channel for receiving events anymore, and `FileWatcher::event_matched` was removed at some point.
* | | | | Merge branch 'document-data-streams' into 'main'Nick Mathewson2024-08-223-3/+22
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Circuit reactor: improve code comments See merge request tpo/core/arti!2358
| * | | | | flow-control: document idea for making more robustJim Newsome2024-08-212-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From <https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2340#note_3062531>
| * | | | | Circuit reactor: improve code commentsJim Newsome2024-08-211-3/+11
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | In particular, clarify that stream-flow-control msgs don't get blocked on circuit congestion control.
* | | | | Merge branch 'optional-managed-pts' into 'main'Nick Mathewson2024-08-226-455/+584
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | tor-ptmgr: make managed PTs optional ('managed-pts' feature flag) Closes #1334 See merge request tpo/core/arti!2354
| * | | | tor-ptmgr: added a 'managed-pts' default featureSteven Engler2024-08-215-82/+125
| | | | | | | | | | | | | | | | | | | | | | | | | This conditionally compiles most of the code related to managed transports.
| * | | | tor-ptmgr: break out `spawn_transport` into separate functionSteven Engler2024-08-201-33/+38
| | | | |
| * | | | tor-ptmgr: moved `PtClientMethod` from ipc to crate moduleSteven Engler2024-08-202-22/+24
| | | | |
| * | | | tor-ptmgr: move some code to a new 'managed' moduleSteven Engler2024-08-203-312/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code that's related to managed transports has been moved to a new 'managed' module. This includes the PT reactor since it's not needed for unmanaged transports.
| * | | | tor-ptmgr: fix warnings when 'tor-channel-factory' isn't enabledSteven Engler2024-08-202-3/+7
| | | | |
| * | | | tor-ptmgr: added the `TransportOptions` enumSteven Engler2024-08-202-43/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a little nicer and more type-safe to work with than `TransportConfig`. It would have been nice to change `TransportConfig` directly instead, but it would slightly change arti_client's public API, and would require an extra field in the `[[bridges.transports]]` toml table.
* | | | | Merge branch 'peekable-poll-set' into 'main'Jim Newsome2024-08-2111-291/+498
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | Add and use `PeekableStream` and `UnobtrusivePeekableStream` See merge request tpo/core/arti!2345
| * | | | StreamPollSet: disallow polling ready streamsJim Newsome2024-08-212-30/+46
| | | | |
| * | | | StreamMap: Use StreamUnobtrusivePeeker instead of PeekableJim Newsome2024-08-213-4/+10
| | | | |
| * | | | Expose stream_peekJim Newsome2024-08-212-6/+18
| | | | |
| * | | | PeekFuture: implement for all PeekableStreamJim Newsome2024-08-211-5/+6
| | | | |
| * | | | StreamUnobtrusivePeeker: implement PeekableStream and UnobtrusivePeekableStreamJim Newsome2024-08-214-41/+16
| | | | |
| * | | | tor-proto: Use PeekableStream to get rid of redundant bufferingJim Newsome2024-08-213-235/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update `StreamPollSet` to require that its streams implement `PeekableStream`, and to not do its own buffering of values read from the stream. This avoids an extra layer of buffering for streams that already buffer a value, and makes the interior state a little simpler and more robust. It does have a downside of making the API a little less convenient, since the caller must do its own `poll_peek` call if it wants a reference to the item. * Update `StreamMap` to implement `PeekableStream` for `OpenStreamEntStream`, as it must to satisfy the updated `StreamPollSet` API. We have to somewhat constrain the `poll_ready_streams_iter` API to no longer return both a reference to the stream and the message. I don't see a way to return both while satisfying the borrow checker. Luckily we don't really need both anymore. * Update the Circuit reactor to handle the updated `StreamMap::poll_ready_streams_iter` API.
| * | | | tor-async-utils: add traits PeekableStream and UnobtrusivePeekableStreamJim Newsome2024-08-212-0/+129
| | |/ / | |/| |
* | | | Merge branch 'shadow-obfs4' into 'main'Jim Newsome2024-08-2117-2/+83
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shadow: add obfs4 arti client + tor bridge Closes #1538 See merge request tpo/core/arti!2355
| * | | | shadow: add obfs4 arti client + tor bridgeopara2024-08-2117-2/+83
| | | | |
* | | | | Merge branch 'ticket-1504' into 'main'Nick Mathewson2024-08-213-12/+8
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | llcrypto: Make `blind_keypair` build without hsv3-client. Closes #1504 See merge request tpo/core/arti!2341
| * | | | | keymanip: Make blind_pubkey exist unconditionallyNick Mathewson2024-08-213-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it exists unconditionally so that we can have our assertion for public key consistency happen unconditionally. (Blinding secret keys is not remotely in the critical path, so I'm not concerned about the critical path.) From a suggestion from Gabi on !2341.
| * | | | | keymanip: Use doc(cfg(...)) in place of "Availability" sectionsNick Mathewson2024-08-211-8/+2
| | | | | |
| * | | | | llcrypto: Make `blind_keypair` build without hsv3-client.Nick Mathewson2024-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `blind_keypair` function should only call `blind_pubkey` when it is present. Also, fix the documentation: blind_keypair is a hsv3-service function, not a hsv3-client function. Closes #1504.
* | | | | | Merge branch 'rpclib-test-failure' into 'main'Nick Mathewson2024-08-211-0/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | rpclib: Allow ConnectionClosed in arti_socket_closed test Closes #1510 See merge request tpo/core/arti!2348
| * | | | | rpclib: Allow ConnectionClosed in arti_socket_closed testNick Mathewson2024-08-211-0/+9
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is supposed to check the case where we launch a bunch of requests but the socket is dropped before we get a response. Different operating systems handle 'drop' a bit differently, and schedule threads differently, so we shouldn't be surprised at slightly different errors here. In particular, OSX is more prone to deliver the close as a proper "close" rather than an EPIPE or such, which previously broke this test. Closes #1510.
* | | | | Merge branch 'noop-tracker-2' into 'main'Ian Jackson2024-08-219-134/+448
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Make arrangements in tor-memquota for memory tracking to be optional See merge request tpo/core/arti!2351
| * | | | | tor-memquota: IfEnabled: Complete a thought in a commentIan Jackson2024-08-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported at https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2351#note_3062292
| * | | | | tor-memquota: Pass EnabledToken to HasMemoryCost methodIan Jackson2024-08-192-17/+29
| | | | | |
| * | | | | tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-196-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will hopefully allow much caller code to be compiled out. The users (IsParticipant impls) don't generally need to bother with it - they can just ignore it.
| * | | | | tor-memquota: Put EnabledToken in various structs, including the reclaimerIan Jackson2024-08-193-4/+26
| | | | | |
| * | | | | tor-memquota: Allow memory tracking to be compiled outIan Jackson2024-08-196-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now if we run doctests without the feature enabled, we test that a no-op MemoryQuotaTracker works. Those tests aren't currently run in CI, but they will be after !2350.
| * | | | | tor-memquota: Support a no-op MemoryQuotaTrackerIan Jackson2024-08-194-51/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap up most of the structures in IfEnabled. Sadly this diff is very noisy. I experimented with macros for the little enabled check at the start of each function but they didn't really help. We don't test this yet. We'll do a smoke test of this later.
| * | | | | tor-memquota: Introduce self_ variables in mtracker.rs (fmt)Ian Jackson2024-08-191-1/+4
| | | | | |
| * | | | | tor-memquota: Introduce self_ variables in mtracker.rsIan Jackson2024-08-191-48/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to bind self_ to something more complicated, in each of these functions, and that's what all these field references etc. will need to refer to. Do this mechanical change first for clarity.
| * | | | | tor-memquota: Introduce IfEnabled and EnabledTokenIan Jackson2024-08-193-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | EnabledToken is pub because it's going to appear in public APIs.
| * | | | | tor-memquota: find_in_tracker: Allow internal use of non-unit errorsIan Jackson2024-08-191-6/+6
| | | | | |
| * | | | | tor-memquota: pre-apply rustfmt churnIan Jackson2024-08-192-4/+14
| | |/ / / | |/| | | | | | | | | | | | | This will make some later diffs easier to read.
* | | | | Merge branch 'rpc-delegate' into 'main'Nick Mathewson2024-08-213-32/+138
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | rpcbase: Implement RPC method delegation support. See merge request tpo/core/arti!2342
| * | | | rpcbase: Implement RPC method delegation support.Nick Mathewson2024-08-143-32/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Couldn't use Deref here, since we needed to get an Arc.) Only one delegation target per object is permitted for now. This will help with #1523.
* | | | | Merge branch 'ticket1534_01' into 'main'Alexander Færøy2024-08-205-4/+280
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | relay: Add basic configuration and builder Closes #1534 See merge request tpo/core/arti!2352
| * | | | relay: Add basic configuration and builderDavid Goulet2024-08-205-4/+280
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the basic TorRelayConfig object along a builder in order to create a TorRelay object. At this commit, the configuration object only holds a "StorageConfig" which is a simple starting point which will allow to expand to a KeyMgr and then a ChanMgr along more configuration. There is also no custom Error for the crate at this point. Fixes #1534 Signed-off-by: David Goulet <[email protected]>