i2p options, tub.port = listen:i2p
#2889
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2889
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR 415 adds a
--i2p-i2cp-options=
flag to thetahoe create-node
CLI command, and stores these options in the tahoe.cfg file underi2p i2cp.options=
, and arranges to use these options when creating the SAM socket.It must also store these options in the
node tub.port=
field, since the SAM socket might be created by the Tub listener or the outbound connection handler, and the I2P server will stick with the options requested by whichever one arrives first. So to avoid a race, we must use exactly the same options in both places.This is complicated by the fact that
tub.port
is first parsed as a comma-joined list of listener descriptors, then each element is parsed as an Endpoint descriptor (which means splitting on colons). Since the I2CP options are a dictionary, encoded with colons and commas, there's a lot of escaping and de-escaping going on.In yesterday's devchat, we decided that it would be cleaner to put these options solely in the
i2p i2cp.options=
field (where they don't need escaping), and not try to put them intub.port
. This DRY (Don't Repeat Yourself) approach avoids the question of what happens if the two option-setting keys disagree, and removes the quoting/escaping concern.To accomplish this, we decided to change the
tub.port
semantics slightly. It normally contains a comma-separated list of Endpoint descriptors, each of which starts with aTYPE:
prefix and then a list of colon-separated arguments for that type of endpoint. We're comandeering thelisten:
"type" to mean "ask the tahoe 'provider' for that type to contribute some Server Endpoints". The provider will also be asked for one or more Foolscap connection hints, to add totub.location
.So
tub.port = listen:i2p
means "ask the i2p_provider for an endpoint".tub.port = tcp:12345,listen:i2p,listen:tor
will get one static TCP endpoint, plus whatever I2P wants to use, plus whatever Tor wants to use.The code in
Node.create_main_tub()
that handlestub.port
will look for thelisten:
prefix and call out to the provider, rather than passing the raw string intotub.listenOn()
. Once the provider returns a list of Endpoints, they'll be passed one-at-a-time intotub.listenOn()
.If Twisted (or any active plugins) add an endpoint type named "listen", this will prevent them from being used, but that doesn't seem too likely. We could pick a tahoe-specific name to avoid this, but I think that would be harder to read (e.g.
tub.port = tahoe-listen:i2p
). I'm not sure, though.The
i2p_provider
will then have a method to return a fully-formed Endpoint, with the I2CP options baked in, instead of trying to shoehorn these options into a string that's then passed toendpoints.serverFromString
.We'll close PR415 in favor of a different one that adds these changes.
In 097abb4/trunk:
done