summaryrefslogtreecommitdiff
path: root/crates/tor-config/src/path.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove dbg!()s in tor-configNick Mathewson2022-05-201-5/+0
| | | | This should satisfy our CI and turn it green again.
* CfgPath: Test serialisation round-trip with a binary formatIan Jackson2022-05-031-0/+8
| | | | | | Use MessagePack. Signed-off-by: Ian Jackson <[email protected]>
* CfgPath: Make it SerializeIan Jackson2022-05-031-5/+69
| | | | | | And provide round-trip tests. As per https://gitlab.torproject.org/tpo/core/arti/-/issues/371
* CfgPath: Overhaul APIIan Jackson2022-05-031-6/+86
| | | | | | | | | | | | | | | | | | | | | | Document that this can contain either a string for expansion, or a literal PathBuf not for expansion. Rename the `from_path` method to `new_literal`: a very important difference is whether it gets expanded - less important than the Rust type. Also, now it takes `Into<PathBuf>`, which avoids a needless clone. (We don't change the API in `arti-client` because `&tempfile::Tempdir()` doesn't implement `Into<PathBuf>`, so `arti-client` has to have some new `as_ref` calls.) Provide accessors `as_unexpanded_str` and `as_literal_path`. The deserialisation already makes this part of the stable API,l so not pvoding accessors seems just obstructive. They are useful for tests, too. Add tests for the new entrypoints, and for deserialisation of both variants from TOML (via config, or directly) and JSON.
* CfgPath: Change deserialisaation of Literal variantIan Jackson2022-05-031-5/+17
| | | | | | | | We introduce LiteralPath struct, so that a literal path deserialises from some_path = { literal: "actual path string" } This makes the deserialisation unambiguous.
* Test shell variable expansion on windowsMichael2022-03-051-2/+24
|
* tor-config: Add HasKind support.Nick Mathewson2022-02-091-0/+22
| | | | This required a few new ErrorKinds.
* Fix invalid path character on windowsMichael2022-01-311-0/+4
|
* Explain that CfgPath can look at the environment.Nick Mathewson2022-01-121-1/+2
| | | | Closes #246.
* Change sane_defaults() and with_directories()Nick Mathewson2021-11-291-3/+1
| | | | | | | | The sane_defaults() call is now the same as you get from a default builder: by convention, we just call that method Default::default(). The with_directories() constructor makes more sense as a constructor for the TorClientConfigBuilder than for TorClientConfig.
* More tests for tor-config.Nick Mathewson2021-11-241-2/+17
|
* Make every Config type implement Eq.Nick Mathewson2021-11-211-2/+2
| | | | | Doing this is necessary for reconfiguration support, and will help a lot with testing, too.
* Rename .gitignore APP_FOO to ARTI_FOO.Nick Mathewson2021-11-211-12/+12
| | | | | | | | Since these shell-variables are hardwired to use org.torproject.Arti as the program name, it isn't appropriate to call them "app-specific". If we someday reinstate APP_FOO, it should be based on a user-provided application name.
* Give CfgPath an alternative inner representation.Nick Mathewson2021-11-211-24/+41
| | | | | | | | In order to handle explicitly specified path buffers directly, we now let CfgPath be either a string (that gets expanded) or a PathBuf (that doesn't). This simplifies TorClientConfig::with_directories()
* Make arti-client config object match arti config better.Nick Mathewson2021-11-211-0/+13
| | | | | | | | Now every section that the two configuration objects share has the same type and name. This should help us in documenting our configuration in a way that doesn't confuse people. There is still lots of API work to go.
* Move top-level configuration downwards from `arti` to `arti-config`.Nick Mathewson2021-11-181-16/+29
| | | | | | | | To do this at all neatly, I had to split out `tor-config` from `arti-config` again, and putting the lower level stuff (paths, builder errors) into tor-config. I also changed our use of derive_builder to always use a common error type, to avoid error type proliferation.
* Remove dependency from arti-client to tor-config.Nick Mathewson2021-11-161-0/+2
| | | | | I'm about to make tor-config a higher-level module, so it can't be a dependency for tor-config.
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+159
This will cause some pain for now, but now is really the best time to do this kind of thing.