roles/pleroma/templates/pleroma.service.j2
author Luke Hoersten <luke@hoersten.org>
Sun, 19 Jan 2020 13:41:08 -0600
changeset 84 d0c40727e6ff
parent 78 18b6a82be777
permissions -rw-r--r--
Added WIP pleroma OTP role.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
67
bd34ae082697 Split out nginx sites.
Luke Hoersten <luke@hoersten.org>
parents: 64
diff changeset
     1
# {{ansible_managed}}
bd34ae082697 Split out nginx sites.
Luke Hoersten <luke@hoersten.org>
parents: 64
diff changeset
     2
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
[Unit]
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
Description=Pleroma social network
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
After=network.target postgresql.service
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
[Service]
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
User={{pleroma_user}}
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
WorkingDirectory=/home/{{pleroma_user}}/pleroma
78
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    10
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
Environment="HOME=/home/{{pleroma_user}}"
64
2b0d305daa43 Moved to prod config.
Luke Hoersten <luke@hoersten.org>
parents: 60
diff changeset
    12
Environment="MIX_ENV=prod"
69
be979818d483 Lots of updates.
Luke Hoersten <luke@hoersten.org>
parents: 67
diff changeset
    13
Environment="PLUG_TMPDIR=/tmp/{{pleroma_user}}"
78
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    14
74
dc20ec78acdd Location of mix changed.
Luke Hoersten <luke@hoersten.org>
parents: 69
diff changeset
    15
ExecStart=/usr/bin/mix phx.server
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
ExecReload=/bin/kill $MAINPID
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
KillMode=process
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
Restart=on-failure
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
78
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    20
; Some security directives.
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    21
; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    22
PrivateTmp=true
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    23
; The /home, /root, and /run/user folders can not be accessed by this service anymore. If your Pleroma user has its home folder in one of the restricted places, or use one of these folders as its working directory, you have to set this to false.
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    24
ProtectHome=false
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    25
; Mount /usr, /boot, and /etc as read-only for processes invoked by this service.
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    26
ProtectSystem=full
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    27
; Sets up a new /dev mount for the process and only adds API pseudo devices like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled by default because it may not work on devices like the Raspberry Pi.
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    28
PrivateDevices=false
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    29
; Ensures that the service process and all its children can never gain new privileges through execve().
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    30
NoNewPrivileges=true
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    31
; Drops the sysadmin capability from the daemon.
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    32
CapabilityBoundingSet=~CAP_SYS_ADMIN
18b6a82be777 Added hardening settings.
Luke Hoersten <luke@hoersten.org>
parents: 74
diff changeset
    33
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
[Install]
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
WantedBy=multi-user.target