[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2788: add connection-policy configuration
Tahoe-LAFS
trac at tahoe-lafs.org
Wed May 18 08:26:06 UTC 2016
#2788: add connection-policy configuration
------------------------------+-----------------------
Reporter: warner | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: undecided
Component: code-network | Version: 1.11.0
Resolution: | Keywords:
Launchpad Bug: |
------------------------------+-----------------------
Comment (by warner):
I'm reading through the [https://github.com/toml-lang/toml TOML spec]. If
we make "servers" into a list, with the pubkey as a dictionary item
(instead of a key), then I our example would look like this:
{{{
[[servers]]
id = "v0-c2ng2pbrmxmlwpijn3mr72ckk5fmzk6uxf6nhowyosaubrt6y5mq"
nickname = "foo" # comments ok!
anonymous-storage-FURL =
"pb://u33m4y7klhz3bypswqkozwetvabelhxt@tcp:10.1.2.3:51298/eiu2i7p6d6mm4ihmss7ieou5hac3wn6b"
permutation-seed-base32 = "w2hqnbaa25yw4qgcvghl5psa3srpfgw3"
[[servers.connections]]
tcp = { handler = "tcp" }
[[servers]]
# second server definition
[[introducers]]
nickname = "nick1"
furl =
"pb://u33m4y7klhz3bypswqkozwetvabelhxt@tor:abcdef.onion:80/eiu2i7p6d6mm4ihmss7ieou5hac3wn6b"
[[introducers]]
nickname = "nick2"
furl =
"pb://u33m4y7klhz3bypswqkozwetvabelhxt@tcp:example.org:12345/eiu2i7p6d6mm4ihmss7ieou5hac3wn6b"
[global.connection_types]
tcp = {handler = "tor", control_endpoint = "tcp:localhost:9051"}
tor = {handler = "tor", control_endpoint = "tcp:localhost:9051"}
}}}
Some notes:
* all value strings (as opposed to keys) must be quoted. There are python-
style triple quotes for multiline strings, and perl-style single quotes
for raw strings (no escape processing)
* key strings don't need quotes if they stick to a-z A-Z hyphen underscore
* lists of dicts use the repeated-double-square-bracket syntax
demonstrated in the `servers` and `introducers` sections
* nested dicts can either be done with `[foo.bar.baz]` indicators, or with
the inline `{key = { subkey = "value"} }` syntax (which can be spread over
multiple lines, like in python)
* trailing commas in lists and inline dicts are ok
* comments are ok
* TOML provides strings, integers, floats, booleans (lowercase),
datetimes, and arrays (square brackets). Since all strings require
quoting, it's easy to tell the different between `"1.4"` (string) and
`1.4` (float).
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2788#comment:8>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list