oxen-io / lokinet

Lokinet is an anonymous, decentralized and IP based overlay network for the internet.
https://lokinet.org/
GNU General Public License v3.0
1.72k stars 220 forks source link

IPC Socket Fixes #2111

Closed dr7ana closed 1 year ago

dr7ana commented 1 year ago

Currently, lokinet.ini (under the [api] section) defaults to bind=tcp://127.0.0.1:1190

2057 adds the ability to access an IPC socket by changing the line to bind=ipc:///some/path/my.sock

Lokinet should be able to bind to multiple listening addresses instead of one, by repeating the bind=... line such as

bind=tcp://127.0.0.1:1190 bind=ipc:///some/path/my.sock

Fixes: #2110

jagerman commented 1 year ago

Something else that would be very useful is to be able to expose an encrypted/authenticated but public listener. This needs two config additions:

  1. We need to be able to specify the address on which we listen_curve().
  2. We need to be able to specify one (or more) public keys that will be accepted.

Something like this in the config:

[api]
bind_curve = tcp://0.0.0.0:1234
curve_pubkey = abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789

This would then use listen_curve() on that address (in addition to any of the listen_plain()s that happen from the bind options currently).

listen_curve() takes an "allow" callback: the allow callback would be looking at the public key and return AuthLevel::admin if it is in the curve_pubkey list, otherwise AuthLevel::denied to refuse the connection.