-
Notifications
You must be signed in to change notification settings - Fork 17
Make netifaces dependency optional #19
Comments
Thanks for sending this in!
Are you running into issues when dealing with an architecture where
That's generally the case, but I don't know what environments people are going to use advocate in, or how embedders are going to expose configuration of advocate's filter behaviour, so it seemed prudent to go with stricter defaults to accommodate the slightly-less-than-sane environments advocate may need to operate in. Additionally, I was concerned that if I made what was basically a "my network is weird, so please do some otherwise pointless checks to make me secure" option, nobody who should have that option on would turn it on.
I'd like to keep this functionality by default when someone does If you were just thinking along the lines of making those paths conditional on the Alternatively, if you're mainly having problems on Linux, I could look at making |
In this case it's just build chain complexity in particular areas that make it more difficult than it ought to be.
Oh, interesting. Are there systems/platforms that configure the local interfaces with the public IP addresses? The EC2 instances I've looked at that have public IPs directly assigned to their ENIs don't report the IP address with
Yeah, this totally makes sense to me.
Yeah this would be an improvement for some of my use-cases, and was roughly what I was thinking.
It is on Linux, yeah - I'd be quite happy with this change as well! |
I checked, and you're right, of course. I probably should have used an example I'd actually tested 😛. It's at least the case on Digital Ocean's Ubuntu droplets, it's not the case on EC2 VPC instances.
Alright, in that case I'll do one of those two soon. I'm in the middle of dropping Python 2.x support which should get rid of all of the direct deps other than requests and netifaces. If working with the ioctl call won't be too hairy I'll do that, otherwise I'll just add the disable on ImportError logic. |
Does 5aafc5f work for what you were thinking? It defers |
Ah yes, that's fantastic! Thanks, @JordanMilne :) |
Great! I'll publish a release containing it this week. |
How are we looking for a new release? Anything I can do to help? |
Can we reopen this issue, since this hasn't technically been fixed until it's been shipped? |
For platforms where using Python modules implemented in C is particularly difficult, it would be useful to be able to use Advocate without those features included.
In particular, it looks like
netifaces
exists solely to support detection of local addresses; in the vast majority of cases, I would expect all addresses reported bynetifaces
to be private addresses, and thus not pass the filter anyway. I'm not sure that it's worth a breaking change, but I'm curious why this functionality is enabled by default, given that (I assume) most hosts don't have direct public IP addresses.Would you be open to a PR that disables this functionality if
netifaces
is not available?The text was updated successfully, but these errors were encountered: