chiark / gitweb /
Merge latest Disobedience changes
[disorder] / doc / disorder_protocol.5.in
index aa6b65e5f901bf689e7d9f75f6d7d16cde7b75e0..f2efe2520ef8e941d0edf9e176320814cb845fea 100644 (file)
@@ -69,7 +69,7 @@ Confirm user registration.
 This command can be used without logging in.
 .TP
 .B cookie \fICOOKIE
 This command can be used without logging in.
 .TP
 .B cookie \fICOOKIE
-Log a user back in using a cookie created with \fBmake-cookie\fR.
+Log a user back in using a cookie created with \fBmake\-cookie\fR.
 The response contains the username.
 .TP
 .B deluser \fIUSERNAME
 The response contains the username.
 .TP
 .B deluser \fIUSERNAME
@@ -91,6 +91,10 @@ Set a user property.
 With the \fBadmin\fR right any username and property may be specified.
 Otherwise the \fBuserinfo\fR right is required and only the
 \fBemail\fR and \fBpassword\fR properties may be set.
 With the \fBadmin\fR right any username and property may be specified.
 Otherwise the \fBuserinfo\fR right is required and only the
 \fBemail\fR and \fBpassword\fR properties may be set.
+.IP
+User properties are syntax-checked before setting.  For instance \fBemail\fR
+must contain an "@" sign or you will get an error.  (Setting an empty value for
+\fBemail\fR is allowed and removes the property.)
 .TP
 .B enable
 Re-enable further playing, and is the opposite of \fBdisable\fR.
 .TP
 .B enable
 Re-enable further playing, and is the opposite of \fBdisable\fR.
@@ -114,7 +118,7 @@ On success the second field of the response line will have the value.
 .IP
 If the track or preference do not exist then the response code is 555.
 .TP
 .IP
 If the track or preference do not exist then the response code is 555.
 .TP
-.B get-global \fIKEY\fR
+.B get\-global \fIKEY\fR
 Get a global preference.
 .IP
 If the preference does not exist then the response code is 555.
 Get a global preference.
 .IP
 If the preference does not exist then the response code is 555.
@@ -131,7 +135,7 @@ i.e. it will not accumulate in a buffer somewhere).
 .IP
 See \fBEVENT LOG\fR below for more details.
 .TP
 .IP
 See \fBEVENT LOG\fR below for more details.
 .TP
-.B make-cookie
+.B make\-cookie
 Returns an opaque string that can be used by the \fBcookie\fR command to log
 this user back in on another connection (until the cookie expires).
 .TP
 Returns an opaque string that can be used by the \fBcookie\fR command to log
 this user back in on another connection (until the cookie expires).
 .TP
@@ -212,15 +216,15 @@ Send back the current queue in a response body, one track to a line, the track
 at the head of the queue (i.e. next to be be played) first.
 See below for the track information syntax.
 .TP
 at the head of the queue (i.e. next to be be played) first.
 See below for the track information syntax.
 .TP
-.B random-disable
+.B random\-disable
 Disable random play (but don't stop the current track).
 Requires the \fBglobal prefs\fR right.
 .TP
 Disable random play (but don't stop the current track).
 Requires the \fBglobal prefs\fR right.
 .TP
-.B random-enable
+.B random\-enable
 Enable random play.
 Requires the \fBglobal prefs\fR right.
 .TP
 Enable random play.
 Requires the \fBglobal prefs\fR right.
 .TP
-.B random-enabled
+.B random\-enabled
 Report whether random play is enabled.
 The second field of the response line will be \fByes\fR or \fBno\fR.
 .TP
 Report whether random play is enabled.
 The second field of the response line will be \fByes\fR or \fBno\fR.
 .TP
@@ -233,15 +237,15 @@ See below for the track information syntax.
 Request that DisOrder reconfigure itself.
 Requires the \fBadmin\fR right.
 .TP
 Request that DisOrder reconfigure itself.
 Requires the \fBadmin\fR right.
 .TP
-.B register \fIUSER PASSWORD EMAIL
+.B register \fIUSERNAME PASSWORD EMAIL
 Register a new user.
 Requires the \fBregister\fR right.
 The result contains a confirmation string; the user will be be able
 to log in until this has been presented back to the server via the
 \fBconfirm\fR command.
 .TP
 Register a new user.
 Requires the \fBregister\fR right.
 The result contains a confirmation string; the user will be be able
 to log in until this has been presented back to the server via the
 \fBconfirm\fR command.
 .TP
-.B reminder \fIUSER\fR
-Send a password reminder to \fIUSER\fR.
+.B reminder \fIUSERNAME\fR
+Send a password reminder to user \fIUSERNAME\fR.
 If the user has no valid email address, or no password, or a
 reminder has been sent too recently, then no reminder will be sent.
 .TP
 If the user has no valid email address, or no password, or a
 reminder has been sent too recently, then no reminder will be sent.
 .TP
@@ -251,9 +255,21 @@ Requires one of the \fBremove mine\fR, \fBremove random\fR or
 \fBremove any\fR rights depending on how the
 track came to be added to the queue.
 .TP
 \fBremove any\fR rights depending on how the
 track came to be added to the queue.
 .TP
-.B rescan
+.B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR]
 Rescan all roots for new or obsolete tracks.
 Requires the \fBrescan\fR right.
 Rescan all roots for new or obsolete tracks.
 Requires the \fBrescan\fR right.
+.IP
+If the \fBwait\fR flag is present then the response is delayed until the rescan
+completes.
+Otherwise the response arrives immediately.
+This is primarily intended for testing.
+.IP
+If the \fBfresh\fR flag is present a rescan is already underway then a second
+rescan will be started when it completes.
+The default behavior is to piggyback on the existing rescan.
+.IP
+NB that \fBfresh\fR is currently disabled in the server source, so using this
+flag will just provoke an error.
 .TP
 .B resolve \fITRACK\fR
 Resolve a track name, i.e. if this is an alias then return the real track name.
 .TP
 .B resolve \fITRACK\fR
 Resolve a track name, i.e. if this is an alias then return the real track name.
@@ -263,10 +279,10 @@ Resume the current track after a \fBpause\fR command.
 Requires the \fBpause\fR right.
 .TP
 .B revoke \fBcookie\fR
 Requires the \fBpause\fR right.
 .TP
 .B revoke \fBcookie\fR
-Revoke a cookie previously created with \fBmake-cookie\fR.
+Revoke a cookie previously created with \fBmake\-cookie\fR.
 It will not be possible to use this cookie in the future.
 .TP
 It will not be possible to use this cookie in the future.
 .TP
-.B rtp-address
+.B rtp\-address
 Report the RTP broadcast (or multicast) address, in the form \fIADDRESS
 PORT\fR.
 This command does not require authentication.
 Report the RTP broadcast (or multicast) address, in the form \fIADDRESS
 PORT\fR.
 This command does not require authentication.
@@ -278,6 +294,61 @@ Requires one of the \fBscratch mine\fR, \fBscratch random\fR or
 \fBscratch any\fR rights depending on how the track came to be
 added to the queue.
 .TP
 \fBscratch any\fR rights depending on how the track came to be
 added to the queue.
 .TP
+.B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ...
+Schedule an event for the future.
+.IP
+.I WHEN
+is the time when it should happen, as \fBtime_t\fR value.
+It must refer to a time in the future.
+.IP
+.I PRIORITY
+is the event priority.
+This can be \fBnormal\fR, in which case the event will be run at startup if its
+time has past, or \fBjunk\fR in which case it will be discarded if it is found
+to be in the past at startup.
+The meaning of other values is not defined.
+.IP
+.I ACTION
+is the action to perform.
+The choice of action determines the meaning of the remaining arguments.
+Possible actions are:
+.RS
+.TP
+.B play
+Play a track.
+The next argument is the track name.
+Requires the \fBplay\fR right.
+.TP
+.B set-global
+Set a global preference.
+The next argument is the preference name and the final argument is the value to
+set it to (omit it to unset it).
+Requires the \fBglobal prefs\fR right.
+.RE
+.IP
+You need the right at the point you create the event.
+It is not possible to create scheduled events in expectation of a future change
+in rights.
+.TP
+.B schedule-del \fIEVENT\fR
+Deletes a scheduled event.
+Users can always delete their own scheduled events; with the \fBadmin\fR
+right you can delete any event.
+.TP
+.B schedule-get \fIEVENT\fR
+Sends the details of scheduled event \fIEVENT\fR in a response body.
+Each line is a pair of strings quoted in the usual way, the first being the key
+ane the second the value.
+No particular order is used.
+.IP
+Scheduled events are considered public information.
+Right \fBread\fR is sufficient to see details of all events.
+.TP
+.B schedule-list
+Sends the event IDs of all scheduled events in a response body, in no
+particular order.
+Use \fBschedule-get\fR to get the details of each event.
+.TP
 .B search \fITERMS\fR
 Search for tracks matching the search terms.
 The results are put in a response body, one to a line.
 .B search \fITERMS\fR
 Search for tracks matching the search terms.
 The results are put in a response body, one to a line.
@@ -299,7 +370,7 @@ allow searching for phrases.
 Set a preference.
 Requires the \fBprefs\fR right.
 .TP
 Set a preference.
 Requires the \fBprefs\fR right.
 .TP
-.B set-global \fIKEY\fR \fIVALUE\fR
+.B set\-global \fIKEY\fR \fIVALUE\fR
 Set a global preference.
 Requires the \fBglobal prefs\fR right.
 .TP
 Set a global preference.
 Requires the \fBglobal prefs\fR right.
 .TP
@@ -313,16 +384,19 @@ Send the list of currently known tags in a response body.
 Unset a preference.
 Requires the \fBprefs\fR right.
 .TP
 Unset a preference.
 Requires the \fBprefs\fR right.
 .TP
-.B \fBunset-global\fR \fIKEY\fR
+.B \fBunset\-global\fR \fIKEY\fR
 Unset a global preference.
 Requires the \fBglobal prefs\fR right.
 .TP
 Unset a global preference.
 Requires the \fBglobal prefs\fR right.
 .TP
-.B user \fIUSER\fR \fIRESPONSE\fR
-Authenticate as \fIUSER\fR.
+.B user \fIUSERNAME\fR \fIRESPONSE\fR
+Authenticate as user \fIUSERNAME\fR.
 See
 .B AUTHENTICATION
 below.
 .TP
 See
 .B AUTHENTICATION
 below.
 .TP
+.B userinfo \fIUSERNAME PROPERTY
+Get a user property.
+.TP
 .B users
 Send the list of currently known users in a response body.
 .TP
 .B users
 Send the list of currently known users in a response body.
 .TP
@@ -487,11 +561,11 @@ Completed playing \fITRACK\fR
 .B failed \fITRACK\fR \fIERROR\fR
 Completed playing \fITRACK\fR with an error status
 .TP
 .B failed \fITRACK\fR \fIERROR\fR
 Completed playing \fITRACK\fR with an error status
 .TP
-.B moved \fIUSER\fR
-User \fIUSER\fR moved some track(s).
+.B moved \fIUSERNAME\fR
+User \fIUSERNAME\fR moved some track(s).
 Further details aren't included any more.
 .TP
 Further details aren't included any more.
 .TP
-.B playing \fITRACK\fR [\fIUSER\fR]
+.B playing \fITRACK\fR [\fIUSERNAME\fR]
 Started playing \fITRACK\fR.
 .TP
 .B queue \fIQUEUE-ENTRY\fR...
 Started playing \fITRACK\fR.
 .TP
 .B queue \fIQUEUE-ENTRY\fR...
@@ -503,16 +577,16 @@ Added \fIID\fR to the recently played list.
 .B recent_removed \fIID\fR
 Removed \fIID\fR from the recently played list.
 .TP
 .B recent_removed \fIID\fR
 Removed \fIID\fR from the recently played list.
 .TP
-.B removed \fIID\fR [\fIUSER\fR]
+.B removed \fIID\fR [\fIUSERNAME\fR]
 Queue entry \fIID\fR was removed.
 Queue entry \fIID\fR was removed.
-This is used both for explicit removal (when \fIUSER\fR is present)
+This is used both for explicit removal (when \fIUSERNAME\fR is present)
 and when playing a track (when it is absent).
 .TP
 .B rescanned
 A rescan completed.
 .TP
 and when playing a track (when it is absent).
 .TP
 .B rescanned
 A rescan completed.
 .TP
-.B scratched \fITRACK\fR \fIUSER\fR
-\fITRACK\fR was scratched by \fIUSER\fR.
+.B scratched \fITRACK\fR \fIUSERNAME\fR
+\fITRACK\fR was scratched by \fIUSERNAME\fR.
 .TP
 .B state \fIKEYWORD\fR
 Some state change occurred.
 .TP
 .B state \fIKEYWORD\fR
 Some state change occurred.
@@ -546,12 +620,27 @@ A track started playing.
 .B resume
 The current track was resumed.
 .TP
 .B resume
 The current track was resumed.
 .TP
+.B rights_changed \fIRIGHTS\fR
+User's rights were changed.
+.TP
 .B scratched
 The current track was scratched.
 .PP
 To simplify client implementation, \fBstate\fR commands reflecting the current
 state are sent at the start of the log.
 .RE
 .B scratched
 The current track was scratched.
 .PP
 To simplify client implementation, \fBstate\fR commands reflecting the current
 state are sent at the start of the log.
 .RE
+.TB
+.B user_add \fIUSERNAME\fR
+A user was created.
+.TP
+.B user_delete \fIUSERNAME\fR
+A user was deleted.
+.TP
+.B user_edit \fIUSERNAME\fR \fIPROPERTY\fR
+Some property of a user was edited.
+.TP
+.B user_confirm \fIUSERNAME\fR
+A user's login was confirmed (via the web interface).
 .TP
 .B volume \fILEFT\fR \fIRIGHT\fR
 The volume changed.
 .TP
 .B volume \fILEFT\fR \fIRIGHT\fR
 The volume changed.
@@ -560,6 +649,9 @@ The volume changed.
 is as defined in
 .B "TRACK INFORMATION"
 above.
 is as defined in
 .B "TRACK INFORMATION"
 above.
+.PP
+The \fBuser-*\fR messages are only sent to admin users, and are not sent over
+non-local connections unless \fBremote_userman\fR is enabled.
 .SH "CHARACTER ENCODING"
 All data sent by both server and client is encoded using UTF-8.
 Moreover it must be valid UTF-8, i.e. non-minimal sequences are not
 .SH "CHARACTER ENCODING"
 All data sent by both server and client is encoded using UTF-8.
 Moreover it must be valid UTF-8, i.e. non-minimal sequences are not