commit 92e059d

uint  ·  2026-01-31 12:20:35 +0000 UTC
parent 5583766
update docs to reflect current program
3 files changed,  +67, -33
+15, -2
 1@@ -1,4 +1,4 @@
 2-.Dd January 28, 2026
 3+.Dd January 31, 2026
 4 .Dt PARADOS 1
 5 .Os
 6 .Sh NAME
 7@@ -33,6 +33,8 @@ performs the following steps:
 8 .Bl -enum -compact
 9 .It
10 Load configuration from
11+.Ev PARADOS_CONFIG
12+if set, otherwise
13 .Pa /etc/parados.conf
14 or, if not present,
15 .Pa ./parados.conf .
16@@ -46,7 +48,11 @@ Bind to the configured address and port.
17 Accept and handle HTTP requests.
18 .El
19 .Pp
20-Each incoming connection is handled independently.
21+Each incoming connection is handled independently in its own thread.
22+The maximum number of concurrent clients is limited by the
23+.Ic max_clients
24+configuration option.
25+.Pp
26 Connections are closed after each request.
27 .Sh LOGGING
28 .Nm
29@@ -70,6 +76,13 @@ for all endpoints except
30 .Pp
31 Access to media files is restricted per user based on configured
32 allow-lists.
33+.Sh LIBRARY MANAGEMENT
34+The media library is scanned at startup.
35+.Pp
36+If authentication is enabled, the library may be rescanned at runtime
37+by issuing a request to the
38+.Pa /rescan
39+endpoint.
40 .Sh EXIT STATUS
41 .Ex -std
42 .Sh SEE ALSO
+22, -12
 1@@ -1,4 +1,4 @@
 2-.Dd January 28, 2026
 3+.Dd January 31, 2026
 4 .Dt PARADOS 7
 5 .Os
 6 .Sh NAME
 7@@ -51,9 +51,15 @@ Response format:
 8 { "proto": 1, "items": [ { "id": "...", "path": "..." } ] }
 9 .Ed
10 .It Pa /meta/{id}
11-Return metadata for a single item.
12-The response includes the item identifier, path, size in bytes, and MIME
13-type.
14+Return metadata for a single item as JSON.
15+The response includes the item identifier, path, basename, size in bytes,
16+modification time (epoch seconds), MIME type, and kind.
17+.Pp
18+Response format:
19+.Bd -literal -offset indent
20+{ "proto": 1, "id": "...", "path": "...", "name": "...",
21+  "size": N, "mtime": N, "type": "...", "kind": "..." }
22+.Ed
23 .It Pa /stream/{id}
24 Stream the contents of a media item.
25 Supports byte range requests using the
26@@ -62,12 +68,11 @@ header.
27 .Pp
28 Valid ranges return HTTP 206.
29 Invalid ranges return HTTP 400 or HTTP 416.
30-.It Pa /queue
31-Return an M3U playlist containing stream URLs for all permitted items.
32+.It Pa /rescan
33+Rescan the media directory and rebuild the library.
34+If authentication is disabled, the endpoint returns HTTP 403.
35 .Pp
36-If the request includes a
37-.Cm Host
38-header, it is used to construct playlist URLs.
39+During a rescan, requests that access the library may get block until the rescan completes.
40 .El
41 .Sh RESPONSES
42 The server sets
43@@ -76,9 +81,12 @@ based on file extension.
44 Unknown types default to
45 .Cm application/octet-stream .
46 .Pp
47-Most responses include
48-.Cm Content-Length .
49-Streaming responses may omit it.
50+Responses include
51+.Cm Content-Length
52+and close the connection after each request.
53+.Pp
54+If a user is authenticated, items outside the configured allow-list are
55+treated as not found.
56 .Sh STATUS CODES
57 .Bl -tag -width Ds
58 .It Cm 200
59@@ -91,6 +99,8 @@ Partial content.
60 Bad request.
61 .It Cm 401
62 Authentication required or failed.
63+.It Cm 403
64+Forbidden.
65 .It Cm 404
66 Resource not found or not permitted.
67 .It Cm 405
+30, -19
  1@@ -1,4 +1,4 @@
  2-.Dd January 28, 2026
  3+.Dd January 31, 2026
  4 .Dt PARADOS.CONF 5
  5 .Os
  6 .Sh NAME
  7@@ -16,11 +16,11 @@ Each non-empty, non-comment line is a key/value pair int he form:
  8 key=value
  9 .Ed
 10 .Pp
 11-Whitespace around keys and values are ignored.
 12+Whitespace around keys and values ignored.
 13 Lines beginning with
 14 .Sq #
 15 are comments and are ignored.
 16-Invalid keys are ignored.
 17+Unknown keys are ignored but logged.
 18 .Sh FILES
 19 .Bl -tag -width Ds
 20 .It Pa /etc/parados.conf
 21@@ -43,9 +43,8 @@ Address to bind the HTTP server to.
 22 Use
 23 .Cm 127.0.0.1
 24 to listen on the local host only.
 25-This is also recommended if you are soley using a WebUI interface
 26-hosted from the same device as exposing the server to the whole
 27-network may uncessesarily open your server to danger.
 28+This is recommended if a web interface is being hosted on the same machine;
 29+exposing the server to the network may unnecessarily increase risk.
 30 Use
 31 .Cm 0.0.0.0
 32 to listen on all IPv4 interfaces.
 33@@ -80,10 +79,11 @@ verbose_log=true
 34 .It Ic cors_origin
 35 Configure Cross-Origin Resource Sharing (CORS) for web clients.
 36 .Pp
 37-If empty, CORS header is sent.
 38+If empty, no CORS headers are sent.
 39 If set to
 40 .Cm * ,
 41-all origins are allowed, otherwise, the value is interpreted as a
 42+all origins are allowed.
 43+Otherwise, the value is interpreted as a
 44 comma-separated list of allowed origins (clients that can interact
 45 over the web).
 46 .Pp
 47@@ -91,17 +91,16 @@ Example:
 48 .Bd -literal -offset indent
 49 cors_origin=http://127.0.0.1:8000
 50 .Ed
 51-
 52 .It Ic http_io_timeout
 53 Maximum number of seconds the server will block on a single socket
 54 read/write operation.
 55 .Pp
 56 This limits how long a client may stall for while sending a request or
 57-while receiving a response.
 58+receiving a response.
 59 If the timeout is exceeded, the connection is closed.
 60 .Pp
 61-This option used for protecting against stalled or bad-acting clients.
 62-This does not limit the duration of a request or stream, only I/O operations.
 63+This option is used to protect against stalled or misbehaving clients.
 64+It does not limit the total duration of a request or stream.
 65 .Pp
 66 Valid values are integers in the range 1 to 300.
 67 .Pp
 68@@ -109,7 +108,18 @@ Example:
 69 .Bd -literal -offset indent
 70 http_io_timeout=5
 71 .Ed
 72-
 73+.It Ic max_clients
 74+Maximum number of concurrent client connections.
 75+If the limit is reached, new connections receive a
 76+.Dv 503
 77+response.
 78+.Pp
 79+Valid values are integers in the range 1 to 1024.
 80+.Pp
 81+Example:
 82+.Bd -literal -offset indent
 83+max_clients=64
 84+.Ed
 85 .El
 86 .Sh AUTHENTICATION
 87 Authentication entries are specified using repeated groups of the keys
 88@@ -123,12 +133,12 @@ If no
 89 entries are present, authentication is disabled and all files are
 90 accessible.
 91 If one or more users are present, HTTP Basic authentication is required
 92-for all requests (except
 93-.Pa /ping ).
 94+for all requests except
 95+.Pa /ping .
 96 .Pp
 97 Each
 98 .Ic user
 99-starts a new entry.
100+starts a new authentication entry.
101 The following
102 .Ic pass
103 and
104@@ -162,7 +172,7 @@ A value of
105 .Cm *
106 allows all paths.
107 Otherwise, the value must match the beginning of a file's relative path.
108-The match allows directory boundaries.
109+Directory boundaries are respected.
110 .Pp
111 Example:
112 .Bd -literal -offset indent
113@@ -192,14 +202,15 @@ pass=
114 allow=TV/NBA/
115 .Ed
116 .Pp
117-Single passwordless admin user with full access:
118+Single passwordless administrative user with full access:
119 .Bd -literal -offset indent
120 user=admin
121 pass=
122 allow=*
123 .Ed
124 .Sh SEE ALSO
125-.Xr parados 1
126+.Xr parados 1 ,
127+.Xr parados 7
128 .Sh AUTHORS
129 .An Abhinav Prasai
130