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

WebGUI bind IPv6 #150

Closed
imp1sh opened this issue Feb 16, 2022 · 5 comments
Closed

WebGUI bind IPv6 #150

imp1sh opened this issue Feb 16, 2022 · 5 comments
Milestone

Comments

@imp1sh
Copy link

imp1sh commented Feb 16, 2022

I just started to tinker around with vaping but I cannot seem to find relevant information about the IPv6 status of this project.

I would like to be able to bind the WebGUI onto an IPv6 address but the program crashes when I try to configure something like this:

    plugins:

      - name: http
        type: flask
        bind: [::]:7021
        debug: true
        static_url_path: /static
        server: self
        async: thread
        routes:
          /targets : graphsrv->targets
          /graph_data :
            methods:
              - POST
              - GET
            target: graphsrv->graph_data
          /graph : graphsrv->graph_view
          /overview_read_file : graphsrv->overview_read_file
          /: graphsrv->overview_view

Output:

root@graphrx1:~/vaping # vaping start --home=examples/standalone_dns/ --debug
Traceback (most recent call last):
  File "/usr/local/bin/vaping", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/vaping/cli.py", line 72, in start
    update_context(ctx, kwargs)
  File "/usr/local/lib/python3.8/site-packages/vaping/cli.py", line 21, in update_context
    ctx.update_options(kwargs)
  File "/usr/local/lib/python3.8/site-packages/munge/click.py", line 119, in update_options
    self.config = self.config_class(read=self.home)
  File "/usr/local/lib/python3.8/site-packages/munge/config.py", line 54, in __init__
    self.read(kwargs["read"])
  File "/usr/local/lib/python3.8/site-packages/munge/config.py", line 130, in read
    config = munge.load_datafile(config_name, conf_path, default=None)
  File "/usr/local/lib/python3.8/site-packages/munge/codec/__init__.py", line 81, in load_datafile
    return codec().load(open(datafile))
  File "/usr/local/lib/python3.8/site-packages/munge/codec/yaml.py", line 15, in load
    return yaml.safe_load(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "/usr/local/lib/python3.8/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/local/lib/python3.8/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/usr/local/lib/python3.8/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python3.8/site-packages/yaml/parser.py", line 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/usr/local/lib/python3.8/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/usr/local/lib/python3.8/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
  File "/usr/local/lib/python3.8/site-packages/yaml/parser.py", line 369, in parse_node
    raise ParserError("while parsing a %s node" % node, start_mark,
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
@vegu
Copy link
Contributor

vegu commented Feb 16, 2022

Don't think we've tested - thanks for bringing it up

@vegu vegu added this to the Next release milestone Feb 21, 2022
@vegu
Copy link
Contributor

vegu commented Mar 11, 2022

The initial error is a yaml parse error because the value needs to be wrapped in quotes.

However once that is addressed, vodka still fails to parse it properly, ticket for the latter issue is created here: 20c/vodka#18

@vegu
Copy link
Contributor

vegu commented Mar 11, 2022

@imp1sh fix for this has been merged to vodka master branch, ill do a pypi release for vodka in tandem with the next vaping release, which should hopefully happen next week the latest.

If you want to test beforehand you can install the current vodka master branch directly:

pip install https://github.com/20c/vodka/archive/refs/heads/master.zip

@vegu
Copy link
Contributor

vegu commented Mar 16, 2022

released 3.2.0 for vodka which should fix this issue, please re-open this ticket if it does not.

To install the update:

pip install vodka==3.2.0

@vegu vegu closed this as completed Mar 16, 2022
@imp1sh
Copy link
Author

imp1sh commented Mar 25, 2022

This fix seems to work. Thank you.

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

No branches or pull requests

2 participants