Skip to content

Commit bb621ad

Browse files
committed
doc: correct the <user>/<group> privilege-dropping documentation
The manual claimed the server drops privileges when launched as root. It no longer does: <user>/<group> are deprecated and ignored. Document this, advise against running as root, and list the supported ways to serve ports 80/443 as an unprivileged user. Remove the misleading <user>/<group> lines from the sample configurations.
1 parent 356d1ec commit bb621ad

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

doc/config.mld

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ Here is a simple example:
101101
<datadir>/var/lib/ocsigenserver</datadir>
102102
<commandpipe>/var/run/ocsigenserver/command</commandpipe>
103103

104-
<user>www-data</user>
105-
<group>www-data</group>
106-
107104
<charset>utf-8</charset>
108105

109106
<extension findlib-package="ocsigenserver.ext.staticmod"/>
@@ -147,9 +144,6 @@ exist. To create it run [psql] and execute [CREATE TABLE ocsipersist;].
147144
<datadir>/home/toto/var/lib/ocsigenserver</datadir>
148145
<commandpipe>/home/toto/var/run/ocsigenserver_command</commandpipe>
149146

150-
<user>toto</user>
151-
<group>toto</group>
152-
153147
<charset>utf-8</charset>
154148

155149
<extension findlib-package="ocsigenserver.ext.staticmod"/>
@@ -333,16 +327,20 @@ v}
333327
{3 [<user>] and [<group>] : user who runs the server}
334328

335329

336-
If the server is launched by root, it will change itself the user and group for the process, for security reasons. Create a group and a user for Ocsigenserver or use an existing user of your system (e.g. [www-data]).
337-
338-
Example :
330+
{b Deprecated and ignored.} Ocsigenserver no longer drops privileges: these
331+
tags are accepted for backward compatibility but have {b no effect}, and the
332+
server logs a warning if they are present.
339333

334+
{b Do not launch the server as root.} Run it directly as a dedicated
335+
unprivileged user (e.g. [www-data]). To serve a privileged port (80 or 443)
336+
as a non-root user, use one of:
337+
- a reverse proxy (nginx, HAProxy, Caddy, ...) terminating ports 80/443 and
338+
forwarding to Ocsigenserver on a high port (recommended, see the [<timeout>]
339+
note above);
340+
- the Linux capability [cap_net_bind_service] on the executable
341+
([setcap 'cap_net_bind_service=+ep' ...]);
342+
- a firewall/port redirection from 80/443 to a high port.
340343

341-
342-
{v
343-
<user>www-data</user>
344-
<group>www-data</group>
345-
v}
346344
{3 [<charset>] : default charset for pages}
347345

348346

0 commit comments

Comments
 (0)