Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for I2CP options #415

Closed
wants to merge 1 commit into from

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Apr 21, 2017

See https://geti2p.net/en/docs/protocol/i2cp for supported options.

@codecov-io
Copy link

Codecov Report

Merging #415 into master will decrease coverage by 0.01%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #415      +/-   ##
=========================================
- Coverage   88.01%     88%   -0.02%     
=========================================
  Files         146     146              
  Lines       27578   27592      +14     
  Branches     3921    3924       +3     
=========================================
+ Hits        24274   24282       +8     
- Misses       2599    2604       +5     
- Partials      705     706       +1
Impacted Files Coverage Δ
src/allmydata/scripts/create_node.py 98.4% <ø> (ø) ⬆️
src/allmydata/util/i2p_provider.py 95.23% <93.75%> (-0.3%) ⬇️
src/allmydata/stats.py 85.34% <0%> (-0.87%) ⬇️
src/allmydata/web/status.py 82.5% <0%> (-0.67%) ⬇️
src/allmydata/immutable/upload.py 96.34% <0%> (+0.09%) ⬆️
src/allmydata/mutable/servermap.py 94.04% <0%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7376e56...9731877. Read the comment docs.


def unescape(val):
return val.replace('\ESCAPED-COMMA', ',').replace('\ESCAPED-COLON', ':')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all probably deserves a comment, like why is this needed? It was also surprising to me to learn that '\,' is the very same as r'\,' in this case -- but it might be better to use the r (raw) prefixed strings anyway, so the reader knows you meant that to be "backslash comma" not just "comma".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, especially because the existing i2p_provider puts backslashes into escaped_sam_port. Maybe we could have a few examples of what the original values of sam_port and i2cp.options are, and what gets written into the config file? And some clear rules about what is legal in each kind of string and what is not.

@meejah
Copy link
Contributor

meejah commented Apr 25, 2017

Besides the "surprising string things", this looks good to me; @warner?

Is it worth trying to choose an options separator that the Twisted endpoint-strings didn't already 'steal' (namely, "something besides colon and comma")?

i2cp_options = cli_config["i2p-i2cp-options"]
if i2cp_options:
tahoe_config_i2p["i2cp.options"] = i2cp_options
escaped_options = i2cp_options.replace(':', '\:')
Copy link
Member

@warner warner May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this missing a line to replace(',', '\,') ? The inverse is done below.

@warner
Copy link
Member

warner commented May 2, 2017

other than the missing \, transform and the comments, this looks fine to me

@warner
Copy link
Member

warner commented Jun 6, 2017

@str4d , I think this is in your court now

@warner
Copy link
Member

warner commented Jul 13, 2017

In yesterday's devchat, with @str4d 's help, we decided on a different approach for this, so we're WONTFIXing this in favor of the scheme documented in https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2889

@warner warner closed this Jul 13, 2017
@warner
Copy link
Member

warner commented Nov 3, 2017

The ticket-2889 config changes have landed, so this PR can now be rewritten in terms of the i2p_provider directly creating the Endpoint object, when tahoe.cfg uses tub.port = listen:i2p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants