-
Notifications
You must be signed in to change notification settings - Fork 18
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
Automatically configure config.connections.incoming
#53
Conversation
This replaces the old hardcode method with a new automatic configuration that iterates through `os.networkInterfaces()` and returns a valid configuration that takes advantage of all possible interfaces.
It seems like this auto stuff only applies to shs, so I don't see that big of a problem. I mean it can't be combined with noauth, as mentioned here. I guess this superseeds some of the other PRs? |
Yeah, I've defaulted to always include the shs transform because I don't understand This definitely supersedes #47 and #49, and maybe #23 (? (cc: @regular)). |
Thats was what I meant, mostly. noauth should only be used with pure scope 'device'. |
Sweet, are there any changes you'd like to see (or anyone you think should definitely see this)? |
I was just testing this and it works for me, both with existing config and without any incoming. Also for patchbay we change the incoming to allow unix + noauth so I don't see anything really bad coming out of this. So +1 for merging. |
I want to point out a great observation that @black-puppydog made here:
I'd like to avoid any mandatory config changes, I'm thinking this behavior might be better:
|
Scratch that, it looks like Dominic mentioned that @regular might have some valuable feedback here, so I'm going to wait until I get a 👍 from him until merging this. I think this change might be more elegant upstream (see ssbc/multiserver-scopes#1), but I think this is a decently robust workaround until then. |
Yeah I put a bit of thought into that fix-connections.
There should really be a test around it. The behaviour we do not want under
any circumstances is that a person sets some incoming connections
explicitly narrowly, as a then some auto smart junk adds connections. This
is how it was and it's and its a great way to add security problems
/rant
…On Sat, 11 May 2019, 04:29 Christian Bundy, ***@***.***> wrote:
Scratch that, it looks like util/fix-connections.js specifically checks
to ensure that config.host is represented in config.connections.incoming,
so we can only do this automated stuff when config.host == null.
Dominic mentioned that @regular <https://github.com/regular> might have
some valuable feedback here, so I'm going to wait until I get a 👍 from
him until merging this. I think this change *might* be more elegant
upstream (see ssbc/multiserver-scopes#1
<ssbc/multiserver-scopes#1>), but I think this
is a decently robust workaround until then.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#53 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAUK3HTSI7UINJ4YZHX7TP3PUWPGTANCNFSM4HLTPTWQ>
.
|
Yep, I'm super appreciative that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes sense! ❤️
i'm not sure what the implications are for those running inside Docker containers, but ssb-pub
should hopefully not be affected since i decided to stop using defaults: ssbc/ssb-server#638
I've actually taken this code and moved it into multiserver where I think it belongs: ssbc/multiserver#49 This means that ssb-config can still listen on |
defaults.js
Outdated
@@ -1,9 +1,9 @@ | |||
var path = require('path') | |||
var home = require('os-homedir') | |||
var merge = require('deep-extend') | |||
var nonPrivate = require('non-private-ip') | |||
var ssbKeys = require('ssb-keys') | |||
var get = require('lodash.get') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start
@christianbundy thanks for pinging me. The only thing I can add to this conversation is this: Somewhere you wrote:
https://serverfault.com/a/452279/171681 You might want to consider this when coding a special case for '::'. I'm afraid I don't have any more specific advise/opinion on this. |
@christianbundy you've done amazing work. I understand there could be a deeper solution in Because I am more familiar with this, and have tested this working on my local network, I've decided to merge this as a great interim solution. I've factored out the body of your logic into a single file to make this easy to snip out in the future if thanks so much for your love and attention ❤️ ❤️ ❤️ |
updated the tests here, and travis says everything's good : #60 |
Wrap upPublished as Closed #47 Future / TODORevisit this if ssbc/multiserver#49 is merged |
This replaces the old hardcode method with a new automatic configuration
that iterates through
os.networkInterfaces()
and returns a validconfiguration that takes advantage of all possible interfaces.
This should give multiserver more addresses to broadcast.
Before
After
One interesting side-effect here is that if you run a node in a mesh network (e.g. cjdns) then that address is now being broadcast over LAN. If two people use both Scuttlebutt and cjdns on the same LAN then when they're far away I think they'll continue to peer over cjdns because the address is saved to
gossip.json
. Someone please correct me if I'm wrong here!Also Travis CI tests by filtering IPv6 addresses on Travis. 🎉
Resolves #47
Resolves #49
Resolves #52
Hopefully takes care of ssbc/patchwork#958 and ssbc/patchwork#1024
Paves the way to merging ssbc/multiserver#42