aboutsummaryrefslogtreecommitdiffstats
path: root/debian/lacme.postinst
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@debian.org>2021-02-15 00:32:29 +0100
committerGuilhem Moulin <guilhem@debian.org>2021-02-22 03:31:12 +0100
commita321c90db4a6d323f1a9bc06c4d861cee8868664 (patch)
tree7804d619f5198b4387fb64b78f1742035d80fd78 /debian/lacme.postinst
parentf08eeeed6abaea2d6dbe8fd801eb0acd187e23d0 (diff)
Use dedicated system users for internal components.
* The internal webserver now runs as a dedicated system user _lacme-www (and group nogroup) instead of www-data:www-data. This is configurable in the [webserver] section of the lacme(8) configuration file. * The internal ACME client now runs as a dedicated system user _lacme-client (and group nogroup) instead of nobody:nogroup. This is configurable in the [client] section of the lacme(8) configuration file. * The _lacme-www and _lacme-client system users are created automatically by lacme.postinst (hence a new Depends: adduser), and deleted on purge. (So make sure not to chown any file to these internal users.)
Diffstat (limited to 'debian/lacme.postinst')
-rwxr-xr-xdebian/lacme.postinst21
1 files changed, 21 insertions, 0 deletions
diff --git a/debian/lacme.postinst b/debian/lacme.postinst
new file mode 100755
index 0000000..536e37f
--- /dev/null
+++ b/debian/lacme.postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+ if ! getent passwd _lacme-www >/dev/null; then
+ adduser --force-badname --system \
+ --home /nonexistent --no-create-home \
+ --gecos "lacme www user" \
+ --quiet _lacme-www || true
+ fi
+ if ! getent passwd _lacme-client >/dev/null; then
+ adduser --force-badname --system \
+ --home /nonexistent --no-create-home \
+ --gecos "lacme client user" \
+ --quiet _lacme-client || true
+ fi
+fi
+
+#DEBHELPER#
+exit 0