Commit Graph

17 Commits

Author SHA1 Message Date
Ian Jackson 6af1485a90 tor-config: Add ConfigurationSources::try_from_cmdline
We'll use this in crates/arti in a moment.
2023-08-07 18:03:03 +01:00
Nick Mathewson 1e96d1b95a Remove semver.md files now that 1.1.7 is out. 2023-08-01 12:55:52 -04:00
Gabriela Moldovan 5b97b0b2ce
tor-config: Remove unused ItemOrBool helper.
`ItemOrBool` is currently not used anywhere (it was previously used by
the keymgr config).
2023-07-13 12:30:07 +01:00
Nick Mathewson 2ab5348ab2 Remove semver.md files. 2023-03-31 09:24:41 -04:00
Ian Jackson c18f5c35dc tor-config: Do minimal $ and ~ handling even without expand-paths
Fixes #790
2023-03-21 16:37:50 +00:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Ian Jackson 112e28d88e tor-config: Rename to ReconfigureError::UnsupportedSituation
From Unsupported.  Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873
This was added in this MR.

Also add the missing semver note.
2022-11-24 14:31:03 +00:00
Ian Jackson fa918446ac tor-config: Rename to ConfigBuildError::NoCompileTimeSupport
From Unsupported.  Following one of the suggestions here
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873

This was added in 2c37116149 which was
not yet in a release so this isn't a semver break.  I have added
the semver note that was omitted in that MR.
2022-11-24 14:30:58 +00:00
Nick Mathewson a5f704f443 Remove semver.md from arti-1.0.0 2022-09-07 09:17:00 -04:00
Nick Mathewson 88fa24d029 Improve error from bad escapes in a toml config.
Whereas previously we would say:

```
target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml
```
we now say:
```
target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml   (If you wanted to include a literal \ character, you need to escape it by writing two in a row: \\)
```

The implementation is a bit of a hack, I'm afraid, but I don't think
it's all that bad.

Closes #549.
2022-08-25 15:04:52 -04:00
Ian Jackson 3af1f3e712 tor-config: Support tracking deprecated config keys 2022-08-25 18:41:28 +01:00
Ian Jackson 33358379f4 tor-config: Introduce ResolutionResults
This will allow us to handle new kinds of warnigns etc.
2022-08-25 18:41:03 +01:00
Ian Jackson ae5ca43779 tor-config: semver.md: Document change to ConfigurationSource enum 2022-08-25 15:58:29 +01:00
Ian Jackson 7c0637ad44 config watch: Fix and reduce debounce interval
The parameter to FileWatcher::new is not a polling time fallback; it
is a "debounce time".  Events are always delayed by at least this
much.

10s is much too long for this.  1s is more appropriate.
2022-08-25 15:58:29 +01:00
Ian Jackson 7d088cf8df config sources: Introduce scan() and FoundConfigFiles
We're going to need to do config file reading in two phases.

Right now this isn't actually necessary, because the set of files
is fixed since we don't support dynamically scanning directories.
But the new API will be needed in a moment.

Code motion and API changes, but no overall functional change.
Review with `git show -b` may be helpful.

The new API also provides for dealing with directories, but right now
that doesn't happen.
2022-08-25 15:58:29 +01:00
Ian Jackson ee2580face tor-config: resolve_option_general: Add semver note 2022-08-23 14:21:13 +01:00
Ian Jackson d9338293c8 Add semver notes 2022-08-17 10:54:41 +01:00