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

support ipv6 for api_server.listen_ip_address #10222

Closed
gmvp3 opened this issue May 19, 2024 · 2 comments
Closed

support ipv6 for api_server.listen_ip_address #10222

gmvp3 opened this issue May 19, 2024 · 2 comments
Labels
Enhancement Enhancements to the bot. Get lower priority than bugs by default. Question Questions - will be closed after some period of inactivity.

Comments

@gmvp3
Copy link

gmvp3 commented May 19, 2024

Describe your environment

  • Operating system: ____debian12
  • Python Version: _____ 3.11.2
  • CCXT version: _____ 4.3.11
  • Freqtrade Version: ____ 2024.4

Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

webui dose not support ipv6 address

Explain the problem you have encountered
vps only ipv6 address,so need freqtrade webui support ipv6

Steps to reproduce:

configure api_server.listen_ip_address in config.json

Observed Results:

  • What happened?
    cant started
  • What did you expect to happen?
    support ipv6

Relevant code exceptions or logs

Note: Please copy/paste text of the messages, no screenshots of logs please.

2024-05-19 18:29:49,223 - freqtrade.rpc.api_server.webserver - INFO - Starting HTTP Server at (ipv6 address):8080
2024-05-19 18:29:49,223 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
File "/root/freqtrade/freqtrade/main.py", line 42, in main
  return_code = args['func'](args)
                ^^^^^^^^^^^^^^^^^^
File "/root/freqtrade/freqtrade/commands/trade_commands.py", line 24, in start_trading
  worker = Worker(args)
           ^^^^^^^^^^^^
File "/root/freqtrade/freqtrade/worker.py", line 37, in __init__
  self._init(False)
File "/root/freqtrade/freqtrade/worker.py", line 53, in _init
  self.freqtrade = FreqtradeBot(self._config)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/freqtrade/freqtrade/freqtradebot.py", line 93, in __init__
  self.rpc: RPCManager = RPCManager(self)
                         ^^^^^^^^^^^^^^^^
File "/root/freqtrade/freqtrade/rpc/rpc_manager.py", line 49, in __init__
  apiserver = ApiServer(config)
              ^^^^^^^^^^^^^^^^^
File "/root/freqtrade/freqtrade/rpc/api_server/webserver.py", line 72, in __init__
  self.start_api()
File "/root/freqtrade/freqtrade/rpc/api_server/webserver.py", line 186, in start_api
  if not IPv4Address(rest_ip).is_loopback and not running_in_docker():
         ^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ipaddress.py", line 1315, in __init__
  self._ip = self._ip_int_from_string(addr_str)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ipaddress.py", line 1202, in _ip_int_from_string
  raise AddressValueError("Expected 4 octets in %r" % ip_str)
ipaddress.AddressValueError: Expected 4 octets in '(ipv6 address)'

@gmvp3 gmvp3 added the Triage Needed Issues yet to verify label May 19, 2024
@xmatthias xmatthias added Question Questions - will be closed after some period of inactivity. and removed Triage Needed Issues yet to verify labels May 19, 2024
@xmatthias
Copy link
Member

xmatthias commented May 19, 2024

That's correct - but it's not a bug or problem, it's simply functionality that's currently not supported.
nobody needed it, or had the time / will to implement and test this so far - simply because quite honestly - ipv6 is not relevant at this point in time.

Slowly, it's becomming "a bit" more relevant, but a large part of ISP's simply won't support it - so while you can probably use it in local networks - you can't connect to it on a larger scale.

Happy to see a PR adding support for ipv6 (please add some comments on how you tested that it's not introducing new security issues / problems in the PR description).

I'll anyway probably close this in a few days as "not planned" - as there's no immediate plans to add support for this - simply due to it's current irrelevance in the global market.


As an aside:
We do strongly recommend to NOT expose the api directly to the internet. neither port forwarding, nor using a private network (like wireguard / tailscale / similar things) will require the use of ipv6.

This makes me think if it's really something that we should be adding - as it's implicitly facilitating the exposure of the API externally. While that's also possible with ipv4 - there's no need for ipv6 support as long as you remain in private networks.

@gmvp3
Copy link
Author

gmvp3 commented May 19, 2024

Thanks a lot for the answer, I tried to solve this problem with wireguard.

@xmatthias xmatthias added the Enhancement Enhancements to the bot. Get lower priority than bugs by default. label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancements to the bot. Get lower priority than bugs by default. Question Questions - will be closed after some period of inactivity.
Projects
None yet
Development

No branches or pull requests

2 participants