| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This is a little tricky (beyond the usual macro fun) because we
needed to use ExtendBuilder to get reasonable behavior for our
default trees.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We're about to need this to define some of the configuration
for RPC listeners.
The provided map-builder type is much less voluminous in terms of
APIs added than the list-builder type: It just uses Deref* and sub_builder.
I think this simplicity may be a win.
I'll need to rethink how this type handles defaults in order to
implement connect points properly; I've left XXXXs for that issue.
|
| |
|
|
| |
We'll use this to implement defaults for maps in our configuration.
|
| | |
|
| |
|
|
|
|
|
|
| |
In 1.83, this warning triggers on many of our crates.
We're thinking of fixing them all, but for now,
we're going to disable the warning.
This is part of #1765.
|
| |
|
|
|
| |
Also updated other packages to get `CfgPath` directly from
`tor-config-path' instead of 'tor-config'.
|
| |
|
|
| |
This is a direct move of the `path` module from tor-config.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
When testing, compare the contents of the files too, not just their
mtime Otherwise, because the polling backend detects changes based on
mtime, if the test creates/writes files too fast, it will fail to notice
changes (this can happen, for example, on a tmpfs).
|
| |
|
|
|
|
|
|
|
| |
The default is 30s, which feels a bit too long.
Also, when testing, we use a much shorter interval.
This is meant to be a temporary solution, so we hard-code the interval
rather than make it configurable.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inotify.
On windows and platforms that support inotify (i.e. linux and android),
we continue using the recommended watcher. On platforms that use kqueue,
we switch to a polling watcher to work around a [notify bug] that
manifests when using a non-recursive watcher to watch a directory.
This commit is best reviewed with `git diff --ignore-all-space`.
Closes #1644
[notify bug]: https://github.com/notify-rs/notify/issues/644
|
| | |
|
| |
|
|
|
| |
This type will soon become platform-dependent, so I am preemptively
adding a type alias.
|
| |
|
|
|
|
| |
This moves the `assert_config_error` helper from the restricted
discovery config tests to a `testing` module in `tor-config` (I am about
to reuse it for the C Tor keystore config tests too).
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
`FileWatcher::watch_file` can be used with arbitrary paths.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Sometimes it's useful to know what files/directories are being watched.
For example, the descriptor publisher needs to know in order to figure
out if it needs to update the watcher in response to changes in the
config.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
| |
This will soon grow more complex, so I am preemptively moving it out of
`start_watching`.
|
| |
|
|
|
| |
We don't need this variant anymore, because sighup is now handled
separately from `FileWatcher` events.
|
| |
|
|
| |
The `FileWatcher` now uses a `postage::watch` channel under the hood.
|
| |
|
|
|
| |
The event handler will soon be made async, so we need a handle to the
runtime.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
`BuilderExt` will soon be used in tor-hsservice too (for configuring the
mistrust settings of the client "restricted mode" authorization keys).
|
| | |
|
| |
|
|
| |
Part of #1473
|
| |
|
|
|
|
|
|
|
|
|
| |
* Change `pub` to `export`
* Change the `=` in define to `:`
* Change `pub_template_semver_check` to `template_export_semver_check`
Right now, 0.12.1 supports both syntaxes. I have verified this branch
also compiles with
https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402
ee171ffaf56d7dcb7d75584054921153fe19b222
|
| |
|
|
|
|
| |
* Bump in Cargo.toml
* Deal with `${Xmeta as ...}` incompatible change, by
always specifying an `as`, and changing `as tokens`.
|
| |
|
|
|
|
|
| |
The macro needs to be defined before `ExplicitOrAuto`, otherwise we
can't reference it in its docs.
Fixes the broken doc links.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
We are about to need this in other crates (for generating the tests for
the `NotAutoValue` implementations).
|