summarylogtreecommitdiffstats
path: root/microbin.service
blob: b0a961ea415647e20646e67cfb83fdcc0d74d027 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[Unit]
Description=A tiny, self-contained, configurable paste bin and URL shortener
Documentation=https://github.com/szabodanika/microbin
After=network.target

[Service]
# hardening
ReadWritePaths="/var/lib/microbin/"
NoNewPrivileges=true
ProtectSystem=strict
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
PrivateDevices=true
DevicePolicy=closed
ProtectControlGroups=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
ProtectHostname=true
PrivateTmp=true
ProtectClock=true
LockPersonality=true
RestrictNamespaces=true
RestrictRealtime=true
MemoryDenyWriteExecute=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged
ProtectHome=true
RemoveIPC=true
RestrictSUIDSGID=true
CapabilityBoundingSet=CAP_NET_BIND_SERVICE

# enable for 1-1024 port listening
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# enable to specify a higher limit for open files/connections
#LimitNOFILE=1000000

User=http
Group=http
StateDirectory=microbin
WorkingDirectory=/var/lib/microbin
EnvironmentFile=/etc/microbin.conf
ExecStart=microbin
Restart=on-failure
KillSignal=SIGINT

[Install]
WantedBy=default.target