Rust application that links RFID tags to scripts - tap a card to play an album, open a picture, or trigger any action.
GPLv2 | v0.3.0
jukebox [options]
Options:
-h, --help Print this usage information.
-n, --new Start new database.
-a, --add Add mode, add new action triggers to database.
-f, --database PATH Database file (default: ./jukebox.db)
-p, --port PATH Serial port (default: /dev/ttyACM0)
-s, --split START:LENGTH
Key trimming parameters (default: 3:10)
-d, --scripts PATH Script directory (default: /etc/jukebox.d)
Requires sqlite3 development libraries:
# Fedora/RHEL
sudo dnf install libsqlite3x-devel
# Debian/Ubuntu
sudo apt install libsqlite3-devBuild:
cargo build --releasesudo mkdir -p /etc/jukebox.d
sudo chown root:root /etc/jukebox.d
sudo chmod 755 /etc/jukebox.dCreate executable scripts for each action. Example:
# /etc/jukebox.d/play_jazz
#!/bin/bash
mpv /music/jazz/Make scripts executable:
sudo chmod +x /etc/jukebox.d/*jukebox -n -aThis creates a new database and enters add mode. The available scripts are listed. Tap a card, then enter the script name to associate with it. Repeat for each card. Press Ctrl+C when done.
jukebox -f /etc/jukebox.dbThis version uses a script directory approach instead of arbitrary shell commands:
- Only scripts in the designated directory (
/etc/jukebox.d) can be executed - Script names cannot contain path separators (no
../attacks) - Scripts are executed directly (no shell interpretation)
Recommendations:
- Do not run jukebox as root - spawned scripts inherit privileges
- Make scripts root-owned:
sudo chown root:root /etc/jukebox.d/* - Make database root-owned but world-readable
- Add your user to the
dialoutgroup for serial device access:sudo usermod -a -G dialout $USER
Version 0.3.0 introduces breaking changes:
- Commands are no longer stored in the database - only script names
- You must create scripts in
/etc/jukebox.d/(or custom-dpath) - Re-register your cards with
jukebox -ausing script names
See CHANGELOG.md