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

Config for unix socket listeners #23

Closed
ioolkos opened this issue Mar 17, 2021 · 8 comments
Closed

Config for unix socket listeners #23

ioolkos opened this issue Mar 17, 2021 · 8 comments

Comments

@ioolkos
Copy link

ioolkos commented Mar 17, 2021

I'd like to use Cuttlefish configuration for unix domain sockets similar to the following config snippet:

listener.tcp.default = 127.0.0.1:1883  ##normal listener
listener.tcp.unix_socket = local:/tmp/my.sock:0  ## uds listener

This will currently be captured and disallowed by the ip datatype validation here:

from_string_to_ip(String, {IpPlusColon, PortString}) ->

Would an extension to that ip validation be the right approach? better ideas?

@michaelklishin
Copy link
Collaborator

Let's not extend the ip type and introduce a new one instead. domain_socket is what I'd use.

@ioolkos
Copy link
Author

ioolkos commented Mar 20, 2021

I understand. The thing is that this will lead to tons of duplicate boilerplate in your schema files (the domain socket will use TCP transport, can theoretically even use SSL).

I think the best approach is to go just one step further and introduce a new datatype that corresponds to the Erlang socket_address so that it can match an IP address and a local address: http://erlang.org/doc/man/inet.html#type-socket_address
This will leave the existing ip type untouched.

@michaelklishin
Copy link
Collaborator

Sounds good.

@ioolkos
Copy link
Author

ioolkos commented Mar 22, 2021

I'll provide a PR. Will take a while as I need it to be part of a working end-to-end implementation.
Thanks!

@ioolkos ioolkos closed this as completed Mar 22, 2021
@codeadict
Copy link
Contributor

@ioolkos - Should we open a PR with your implementation on https://github.com/ioolkos/cuttlefish/tree/feature_domain_socket?

@ioolkos
Copy link
Author

ioolkos commented Jan 20, 2023

@codeadict Thanks, I forgot about this. It was just a quick hack but we can open a PR. In relation to Verne itself, there's still a minor issue: vernemq/vernemq#2008
I think the ip_or_domain data type messes up the initial default listener creation... maybe I haven't added a translation or sth similar.

@codeadict
Copy link
Contributor

@ioolkos I think you can alsp have a single type, like domain_socket and specify 2 types in the schema like [ip, domain_socket] instead of having a composed type

@codeadict
Copy link
Contributor

@ioolkos Added PR #33 that fixes the VerneMQ issues we are facing with releases now

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

3 participants