summarylogtreecommitdiffstats
path: root/joplin-server.service
blob: 00a9464fa4ca1f0e1f4a8118c90ac70ec5c5d307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[Service]
Restart=on-failure
User=joplin-server
Type=Simple

EnvironmentFile=/etc/joplin-server.env
Environment="HOME=/opt/joplin-server/server"
Enviroment="NODE_ENV=production"
WorkingDirectory=/opt/joplin-server/server
ExecStart=/usr/bin/pm2 start --no-daemon --exp-backoff-restart-delay=1000 dist/app.js
ExecStop=/usr/bin/pm2 stop dist/app.js

; Some security directives.
; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.
PrivateTmp=true
; The /home, /root, and /run/user folders can not be accessed by this service anymore. If your Akkoma 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.
ProtectHome=true
; Mount /usr, /boot, and /etc as read-only for processes invoked by this service.
ProtectSystem=full
; 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.
PrivateDevices=false
; Ensures that the service process and all its children can never gain new privileges through execve().
NoNewPrivileges=true
; Drops the sysadmin capability from the daemon.
CapabilityBoundingSet=~CAP_SYS_ADMIN

[Install]
WantedBy=multi-user.target