fix readme
This commit is contained in:
@@ -105,18 +105,118 @@ sudo cp config/config.json /opt/buttontask/config/
|
||||
# privileged helpers (root-owned) + sudoers whitelist
|
||||
sudo install -m 0755 webconfig/scripts/bt-netconfig webconfig/scripts/bt-update \
|
||||
webconfig/scripts/bt-service /opt/buttontask/scripts/
|
||||
sudo install -m 0440 webconfig/scripts/buttontask.sudoers /etc/sudoers.d/buttontask
|
||||
sudo tee /etc/sudoers.d/buttontask > /dev/null << 'EOF'
|
||||
buttontask ALL=(root) NOPASSWD: /opt/buttontask/scripts/bt-netconfig
|
||||
buttontask ALL=(root) NOPASSWD: /opt/buttontask/scripts/bt-update
|
||||
buttontask ALL=(root) NOPASSWD: /opt/buttontask/scripts/bt-service
|
||||
EOF
|
||||
sudo chmod 0440 /etc/sudoers.d/buttontask
|
||||
sudo visudo -cf /etc/sudoers.d/buttontask
|
||||
|
||||
sudo chown -R buttontask:buttontask /opt/buttontask
|
||||
sudo chown root:root /opt/buttontask/scripts/bt-* # scripts must be root-owned
|
||||
|
||||
# Qt eglfs needs a writable runtime dir for the unprivileged user
|
||||
sudo mkdir -p /tmp/runtime-buttontask
|
||||
sudo chown buttontask:buttontask /tmp/runtime-buttontask
|
||||
sudo chmod 0700 /tmp/runtime-buttontask
|
||||
|
||||
# eglfs grabs KMS/DRM directly; disable the desktop display manager
|
||||
sudo systemctl disable display-manager
|
||||
sudo systemctl stop display-manager
|
||||
|
||||
sudo cp webconfig/buttontask.service /etc/systemd/system/
|
||||
sudo cp webconfig/buttontask-web.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now buttontask buttontask-web
|
||||
|
||||
# verify sudoers (should succeed without a password prompt)
|
||||
sudo -u buttontask sudo -n /opt/buttontask/scripts/bt-netconfig eth0 dhcp
|
||||
```
|
||||
|
||||
### Touchscreen (device-specific override)
|
||||
|
||||
The base `buttontask.service` does not hardcode a touch device path because the
|
||||
`eventN` number varies between boards. Copy the example override and set the
|
||||
correct event for your touchscreen:
|
||||
|
||||
```sh
|
||||
# find the touchscreen event number
|
||||
grep -l -E 'ABS_X|ABS_MT_POSITION' /sys/class/input/event*/device/capabilities/abs 2>/dev/null \
|
||||
| sed 's|.*/input/event||;s|/device.*||'
|
||||
|
||||
sudo mkdir -p /etc/systemd/system/buttontask.service.d
|
||||
sudo cp /opt/buttontask/current/webconfig/buttontask.service.d/override.conf.example \
|
||||
/etc/systemd/system/buttontask.service.d/override.conf
|
||||
# edit override.conf — replace event1 with the number found above
|
||||
sudo systemctl daemon-reload && sudo systemctl restart buttontask
|
||||
```
|
||||
|
||||
### Migrating an already-deployed device
|
||||
|
||||
If the device was installed from an older guide, apply these fixes:
|
||||
|
||||
```sh
|
||||
# 1. sudoers (fixes "sudo: a password is required" in web network config)
|
||||
sudo tee /etc/sudoers.d/buttontask > /dev/null << 'EOF'
|
||||
buttontask ALL=(root) NOPASSWD: /opt/buttontask/scripts/bt-netconfig
|
||||
buttontask ALL=(root) NOPASSWD: /opt/buttontask/scripts/bt-update
|
||||
buttontask ALL=(root) NOPASSWD: /opt/buttontask/scripts/bt-service
|
||||
EOF
|
||||
sudo chmod 0440 /etc/sudoers.d/buttontask
|
||||
sudo visudo -cf /etc/sudoers.d/buttontask
|
||||
|
||||
# 2. runtime dir
|
||||
sudo mkdir -p /tmp/runtime-buttontask
|
||||
sudo chown buttontask:buttontask /tmp/runtime-buttontask
|
||||
sudo chmod 0700 /tmp/runtime-buttontask
|
||||
|
||||
# 3. display manager
|
||||
sudo systemctl disable --now display-manager
|
||||
|
||||
# 4. updated unit + touch override (see above)
|
||||
sudo cp /opt/buttontask/current/webconfig/buttontask.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# 5. icons — until OTA with the path-resolution fix, set absolute iconsDir:
|
||||
# "iconsDir": "/opt/buttontask/icons" in /opt/buttontask/config/config.json
|
||||
|
||||
sudo systemctl restart buttontask-web buttontask
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
**`/usr/bin/env: 'bash\r': No such file or directory`**
|
||||
|
||||
Shell scripts were saved with Windows CRLF line endings. On the device, fix in place:
|
||||
|
||||
```sh
|
||||
sudo sed -i 's/\r$//' /opt/buttontask/scripts/bt-*
|
||||
```
|
||||
|
||||
Or re-copy the scripts from a repo checkout with LF endings (see `.gitattributes`).
|
||||
|
||||
**`sudo: a password is required` (web → Сеть)**
|
||||
|
||||
- `sudo visudo -cf /etc/sudoers.d/buttontask` must pass without errors
|
||||
- web service must run as `buttontask`: `systemctl show -p User buttontask-web`
|
||||
- helper scripts must be root-owned: `ls -la /opt/buttontask/scripts/bt-*`
|
||||
- test manually: `sudo -u buttontask sudo -n /opt/buttontask/scripts/bt-netconfig eth0 dhcp`
|
||||
|
||||
**`QML Image: Cannot open: file:///./icons/...`**
|
||||
|
||||
- Icons are stored in `/opt/buttontask/icons/` (shared, outside the version dir)
|
||||
- Set `"iconsDir": "/opt/buttontask/icons"` in config, or deploy a build with
|
||||
the C++ path-resolution fix (relative `./icons` is resolved against
|
||||
`BUTTONTASK_ROOT`, same as the web configurator)
|
||||
|
||||
**Touch not working**
|
||||
|
||||
- Check the override at `/etc/systemd/system/buttontask.service.d/override.conf`
|
||||
- Re-detect the event number (see Touchscreen section above)
|
||||
- Ensure the `buttontask` user is in supplementary groups `video render input`
|
||||
(set in `buttontask.service`)
|
||||
|
||||
## Network configuration (Ethernet)
|
||||
|
||||
Open the web UI → tab **Сеть**. It reads the live state via `nmcli` and can
|
||||
@@ -173,7 +273,7 @@ live and is also readable in the app's **Обновление** page.
|
||||
"darkMode": true,
|
||||
"password": "admin", // shared with web auth
|
||||
"kioskMode": false,
|
||||
"iconsDir": "./icons", // dir for user icons & background images
|
||||
"iconsDir": "/opt/buttontask/icons", // dir for user icons & background images
|
||||
"webPort": 8080
|
||||
},
|
||||
"buttons": [
|
||||
|
||||
Reference in New Issue
Block a user