![限制 MPD 客户端](https://linux22.com/image/46602/%E9%99%90%E5%88%B6%20MPD%20%E5%AE%A2%E6%88%B7%E7%AB%AF.png)
有没有办法限制 MPD 客户端的有限操作,例如仅将歌曲添加到播放列表?
背景:我想使用 MPD 作为聚会的“自动点唱机”,但应阻止客人清除播放列表、跳过歌曲等。客户端将是 Android/iOS 应用程序。
答案1
MPD 可以限制通过密码识别的客户端的特定操作(并允许使用多个密码以及不同的允许操作集):
password <password@permissions>
This specifies a password for access to mpd. The format is "password@permissions" where permissions is a comma delimited list composed of
"read", "add", "control", and/or "admin". "read" allows for reading of the database, displaying the current playlist, and current status of
mpd. "add" allows for adding songs and loading playlists. "control" allows for all other player and playlist manipulations. "admin" allows
the db to be updated and for the client to kill mpd. An example value is "somePassword@read,add". Multiple password parameters may be spec‐
ified.
(来自 mpd.conf(5)),所以添加
password "<your_guest_password>@read,add"
password "<your_admin_password>@read,add,control,admin"
到你的配置文件将允许你
- 使用密码连接MPD,只能添加歌曲、读取数据库和播放列表
- 使用密码连接到 MPD 并执行 MPD 及其客户提供的所有其他操作