MPDクライアントの制限

MPDクライアントの制限

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 と顧客が提供する他のすべての操作を行うには、パスワードを使用します。

おすすめ記事