GITv
master
gitv-web.service47 lines, 1.2 KB
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
[Unit]
Description=GITv repository browser
After=network.target

[Service]
User=gitv-web
Group=gitv-web
SupplementaryGroups=git
ExecStart=/usr/local/bin/gitv-web serve --port 8080
Restart=on-failure
StateDirectory=gitv-web
StateDirectoryMode=0700
UMask=0077
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictSUIDSGID=yes
CapabilityBoundingSet=
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
ProtectProc=invisible
ProtectClock=yes
ProtectKernelLogs=yes
ProtectHostname=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
# No chown, setuid or the like: the browser and the git it runs only read.
SystemCallFilter=~@privileged
# Renders, transfers and the git commands they run share these. Sized for the 1 GB droplet,
# leaving room for sshd, Caddy and pushes: past MemoryMax the kernel ends a runaway clone
# (git pack-objects works inside this limit) rather than the whole machine thrashing. Raise
# both on a bigger droplet.
MemoryHigh=512M
MemoryMax=640M
TasksMax=512

[Install]
WantedBy=multi-user.target