rkvm
rkvm copied to clipboard
feat(server): Add device allowlist
This PR is meant as a spiritual continuation of #55, implemented by using the evdev attributes instead of file paths. I'm doing the comparison inside Inspector to ensure we stop processing a device as soon as possible (i.e. before we create a writer for the device)
The default behaviour with device-allowlist unset is the same as before: All inputs found will be forwarded
If you configure the device-allowlist, only the devices matching at least 1 of the config options will be forwarded
Example configs
# Only forward Logitech devices
[[device-allowlist]]
vendor-id = 1133
# Forward Logitech & UHK V1 devices
[[device-allowlist]]
name = "Ultimate Gadget Laboratories UHK 60 v1"
[[device-allowlist]]
vendor-id = 1133
I currently support name, vendor-id, and product-id for filtering, and they're all either exact matches if they're set, or no check at all if they're unset.
Happy to change things as you see fit!
Cool, thank you for this. I'll review soon.
nice to see some improvements in this project. I tried your branch/pr and it works just great For my part, this could easily be merged into main