Commit 7c3993c
committed
Move config & keygen to a dedicated binary
This moves the config generation from the main session-router binary
into a dedicated session-router-config binary, which can now:
- `-c` generate a full client config
- `-r` generate a router config
- `-e` generate an embedded config
- `-H` generate a hidden service config (= client config, but with DNS
disabled, more inbound paths, and a persistent key)
- `-k` generates a keypair file
- `-s` show the pubkey from a keypair file
along with some other flags that let you tweak the generated file.
Along the way this reworks several related things:
- config "overrides" that could be set via RPC are now gone. They
seemed like a privelege escalation (because a user could make
permanent changes overriding the settings in the admin-protected
config file). Also they were quite broken because if you tried to
actually "override" a setting it just errored with an error about
specifying a value more than once, bricking lokinet; and for
multi-options it could only append but not replace. (These issues
could be fixed, but don't seem worth it given the first issue).
- removed a bunch of related override saving code.
- Untangled a weird relationship between
Config/ConfigDefinitions/Parser.
- Drop `ConfigGenParameters` which was really just two values, one of
which was wrong (the data-dir, as it referred to the default rather
than actual) and the other of which was already in the
ConfigDefinitions.
- Made all paths the config (e.g. unbound hosts, key file) properly
resolve relative to the config file dir. Previously they were all
wrong in different ways: some relative to cwd, some relative to
data-dir, some relative to the *default* data_dir fallback if you
don't specify a datadir.
- Make the config file a required argument when launching
session-router, and never auto-vivify it.
- Make the keyfile no longer auto-vivify: if a keyfile is specified that
doesn't exist it is now an error.
- Remove many deprecated config options as we no longer are aiming to be
a seamless upgrade from Lokinet.
- Rename "Deprecated" in the config to "Obsolete" to better reflect what
it does (i.e. warn and ignore).
- Remove "undeclared" ini handlers. They were gross, and the last use
of it (for unbound options) is now gone.1 parent 7d5e77c commit 7c3993c
File tree
21 files changed
+463
-949
lines changed- src
- config
- constants
- crypto
- daemon
- router
- rpc
- util
- thread
21 files changed
+463
-949
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
| 193 | + | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| |||
0 commit comments