aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-config/src
Commit message (Collapse)AuthorAgeFilesLines
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-8/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* lints: Make lint blocks consistentIan Jackson2022-05-311-1/+3
| | | | The remaining consequences of running add_warning
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* lints: arti-config: Re-add standard lint listIan Jackson2022-05-311-0/+30
| | | | We are going to make lints the same for every crate.
* Abolish arti-config, replacing with tombstone crateIan Jackson2022-05-131-46/+4
|
* arti-config abolition: Move functionality to tor-configIan Jackson2022-05-131-233/+1
| | | | | | | | | | | | | | | | | This crate no longer has any reason to exist. All its remaining functionality is generic enough to go into tor-config. In this commit, we move the contents of lib.rs into a new file in tor-config. It contains: * Code motion * The minimal "mod" and "use" changes * The minimal doc comment * A new a compat alias for ConfigurationSources. The compat alias is there because various crates currently speak of arti_config::ConfigurationSources and it is most convenient to fix them up after the type is available in tor_config.
* arti-config: Move default config file test to arti-clientIan Jackson2022-05-131-10/+0
| | | | | | That's where this definitions is now. This test ought to have been moved in Move default_config_file() into arti-client
* Fix comment locationIan Jackson2022-05-131-2/+2
|
* config load: Move mistrust checking to load()Ian Jackson2022-05-131-15/+34
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/472 Experimentation convinced me the Mistrust should be within the ConfigurationSources.
* ARTI_DEFAULTS: Move to arti crateIan Jackson2022-05-123-192/+0
|
* config defaults: No longer apply ARTI_DEFAULTS in load()Ian Jackson2022-05-121-4/+0
| | | | | | | | This is redundant, because the defaults have to be supplied by the config builders (usually via builder default attributes). That this is actually done and correct is tested by the `default_config()` test case in arti/src/cfg.rs.
* arti-config: Move cmdline to tor-configIan Jackson2022-05-112-207/+1
| | | | | | This does not know anything about arti, only about TOML and Config. Code motion, plus necessary import adjustments.
* Move default_config_file() into arti-clientIan Jackson2022-05-111-6/+1
| | | | This will let other embedders use it.
* ConfigurationSources: Have the generics take Into<owned>Ian Jackson2022-05-111-12/+12
| | | | | | | | | | These generic arguments weren't consistent. It doesn't make sense ot insist on getting a borrowed type and then cloning it. So tidy things up in the direction of taking owned values, which is what ConfigurationSources actually needs. (My personal preference would be &dyn to avoid monomorphisation code bloat but that was controversial last time I proposed it somewhere.)
* ConfigurationSource: Move "usual" logic for constructionIan Jackson2022-05-111-0/+46
|
* default_config_file(): Have it return Result, not OptionIan Jackson2022-05-111-3/+3
| | | | Discarding this error is not right.
* ConfigurationSource: Rename new to new_emptyIan Jackson2022-05-111-1/+1
| | | | | This emphasises its nature. We're going to provide a more cooked constructor in a moment.
* Fix grammar and typosSamanta Navarro2022-04-271-1/+1
|
* DownloadSchedule: Rename field to "attempts"Ian Jackson2022-04-261-4/+4
| | | | | | | This is actually a number of *attempts* not a number of *retries*. The setter method was already called "attempts". This chnages the deserialisation of the config.
* Use a lower default for max_retries.Nick Mathewson2022-03-301-1/+1
| | | | | | | | | | The older default seems (experimentally) to be ridiculously high. Generally, if we can't build a circuit within a handful attempts, that circuit has already timed out... unless there is a fast-failure condition, in which case we're just hammering the network (or our view of it.) Found with `arti-testing` for #329.
* Run rustfmt to tidy up importsIan Jackson2022-03-211-1/+1
|
* Move ApplicationConfig to arti crateIan Jackson2022-03-212-30/+1
| | | | Code motion and import fixups.
* Move ProxyConfig to arti crateIan Jackson2022-03-212-51/+1
| | | | | | | We put this in cfg.rs, rather than (say) socks.rs, because it has config relating to both socks.rs and dns.rs. Code motion and import fixups.
* Move logging configuration from arti_config::options to arti::loggingIan Jackson2022-03-212-127/+2
| | | | Code motion and import fixups.
* Move ArtiConfig to new arti::cfg moduleIan Jackson2022-03-212-261/+5
| | | | Code motion and import fixups.
* add udp to runtimetrinity-1686a2022-03-141-0/+10
|
* rustfmtIan Jackson2022-03-111-10/+15
|
* Make ArtiConfigBuilder contain a TorClientConfigBuilderIan Jackson2022-03-111-135/+19
| | | | | | | This is an API break: now one must use `.tor()` to access the Tor configuration parts. But it is not a config file format break, because `#[serde(flatten)]`.
* Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-29/+0
|
* Have ArtiConfig contain a TorClientConfig, and drop builder retconIan Jackson2022-03-071-134/+13
| | | | | | | | | | | | | | | | | | | Replace the recapitulation of TorClientConfig fields in ArtiConfig and instead just have it contain one. This is part of #374. The conversions from ArtiConfig back to ArtiConfigBuilder and TorClientConfigBuilder would need to change, but, since we don't want them anyway, No longer impl Deserialize for ArtiConfig. (As per #371 this will want to become a private type.) No longer impl From<ArtiConfig> for ArtiConfigBuilder and TorClientConfigBuilder. And abolish tests of that code. (This all has to be in one commit, because previously ArtiConfig::tor_client_config used the validated-to-builder config retcon.)
* Provide way to get TorConfigBuilder from ArtiConfigBuilderIan Jackson2022-03-071-0/+27
| | | | | | This is needed according to #372, where we observe that builders ought not to be generated from validated structs. So we need this conversion.
* Derive Deserialize for handwritten ArtiConfigBuilderIan Jackson2022-03-071-1/+16
|
* Derive Deserialize for derive-builder-generated config buildersIan Jackson2022-03-071-0/+3
| | | | | | | | | | | | | I used git-grep -P '\#\[serde\((?!default|deny_unknown)' to find places where I needed to add additional attributes on the builder method fields. This is currently a bit duplicative, but when #371 is completely done, the validated (non-builder) configs won't need to be Deserialize any more. This is part of #371 and #372.
* Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | Add warnings about configuration stability.Nick Mathewson2022-02-281-0/+8
| |
* | Upgrade to newer version of config crate.Nick Mathewson2022-02-252-31/+55
|/
* Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | Closes #338.
* Fix a doc link.Nick Mathewson2022-02-041-1/+2
|
* Merge branch 'ticket270' into 'main'Nick Mathewson2022-02-033-4/+76
|\ | | | | | | | | | | | | Watch configuration files and reload them when they change Closes #270 See merge request tpo/core/arti!280