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

Example Config is IPv4-only, yet tornado supports IPv6 #779

Open
cvmiller opened this issue Jan 29, 2018 · 3 comments

Comments

@cvmiller
Copy link

commented Jan 29, 2018

Given this day in age where IPv4 addresses are exhausted, and 20% of the traffic on the internet is IPv6, it would be great to see MotionEye support IPv6 as well.

Looking into the code a bit, it appears that a small change to the settings.py will enable MotionEye to support IPv6 (at least for the control webserver). The current settings.py has:

# the IP address to listen on
# (0.0.0.0 for all interfaces, 127.0.0.1 for localhost)
LISTEN = '0.0.0.0'

Yet, setting LISTEN to an empty string will enable the tornado webserver to listen on both IPv4 AND IPv6

# the IP address to listen on
# (0.0.0.0 or :: for all interfaces, 127.0.0.1 or ::1 for localhost, blank for both IPv4 & IPv6)
LISTEN = ''

At a minimum it would be nice if the comments reflected support for IPv6, and perhaps the default settings.py could be a blank string, enabling both IPv4 AND IPv6 support for your fine software.

@ccrisan

This comment has been minimized.

Copy link
Owner

commented Jan 30, 2018

Makes sense, as long as this is strictly motionEye-related and has nothing to do with motionEyeOS, where IPv6 is currently disabled.

@cvmiller

This comment has been minimized.

Copy link
Author

commented Jan 30, 2018

Great. IPv6 is the future of the internet (all growth will be using IPv6). MotionEye is a great piece of software, and it will be even better with IPv6 support.

@ttimasdf

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2018

besides the hack @cvmiller suggests,
meyectl won't accept a line with empty value, because the config parser inside is a simple strip and split . It does not recognize quotes as well. Use standard library configparser is easier and better IMHO, but at the time being we could just add another hack to the whole giant hacks meyectl.py:

# ...
             elif value.lower() == 'true':
                 value = True

             elif value.lower() == 'false':
                 value = False

             # here's the hack
             elif value in ['""', "''"]:
                 value = ""

             elif isinstance(curr_value, int):
                 value = int(value)

             elif isinstance(curr_value, float):
# ...

And add the listen directive back to /etc/motioneye/motioneye.conf. If you choose not to patch meyectl.py, you MUST comment out the listen line in config file for it will override the one specified in settings.py

 # the IP address to listen on
 # (0.0.0.0 for all interfaces, 127.0.0.1 for localhost)
 listen ''

Then, tornado listens dual stack as expected 😏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.