-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Why is it a hardlink: tl;dr: hotplug support.
If you don't want to run screen-server with --privileged (you shouldn't), and you don't want to bind the entire /dev/input (violates principle of least privilege), you're left with having to map a directory that contains the sole event device. It has to be directory, because device nodes come and go (hotplug). i.e. plug creates inode 1 -> disconnect -> plug creates inode 2. If you'd naively map --device /dev/input/logitech and start a container, during the whole lifecycle of the container it'd refer to inode 1.
Here's my /etc/udev/rules.d/80-screen-server.rules:
# Logitech should be visible for screen-server
ACTION=="add", KERNEL=="event[0-9]*", ATTRS{name}=="Logitech K400", RUN+="/bin/sh -c 'mkdir -p /dev/input/screen-server && ln $devnode /dev/input/screen-server/logitech'"
ACTION=="remove", KERNEL=="event[0-9]*", ATTRS{name}=="Logitech K400", RUN+="/bin/sh -c 'rm /dev/input/screen-server/logitech'"
And docker-compose file:
version: "3.5"
services:
screens:
labels:
traefik.frontend.rule: Host:screens.mydomain.com
environment:
SCREEN_1: "5900,800,1280,Galaxy Tab 2,/dev/input/screen-server/logitech"
image: fn61/screen-server:20201218_1758_3beeef8d
shm_size: 512M # Firefox and Chrome crash on default (64 M) if website is heavy in any way
ports:
- "5900:5900"
devices:
- "/dev/input/screen-server"
networks:
default: null
networks:
default:
external:
name: mynetworkReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation