[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