File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ CFLAGS += -Wall -Wextra -Werror -pedantic -std=c99
55PREFIX ?= /usr/local
66BINDIR ?= $(PREFIX ) /bin
77MANDIR ?= $(PREFIX ) /share/man
8+ UNITDIR ?= /lib/systemd/system
89
910all : thinproxy
1011
@@ -16,10 +17,13 @@ install: thinproxy
1617 install -m 755 thinproxy $(DESTDIR )$(BINDIR ) /
1718 install -d $(DESTDIR )$(MANDIR ) /man8
1819 install -m 644 thinproxy.8 $(DESTDIR )$(MANDIR ) /man8/
20+ install -d $(DESTDIR )$(UNITDIR )
21+ install -m 644 thinproxy.service $(DESTDIR )$(UNITDIR ) /
1922
2023uninstall :
2124 rm -f $(DESTDIR )$(BINDIR ) /thinproxy
2225 rm -f $(DESTDIR )$(MANDIR ) /man8/thinproxy.8
26+ rm -f $(DESTDIR )$(UNITDIR ) /thinproxy.service
2327
2428clean :
2529 rm -f thinproxy
Original file line number Diff line number Diff line change @@ -41,6 +41,13 @@ The default prefix is `/usr/local`. Override with:
4141make install PREFIX=/usr DESTDIR=/tmp/pkg
4242```
4343
44+ A systemd unit file is installed to ` /lib/systemd/system/ ` . To enable:
45+
46+ ``` sh
47+ sudo systemctl daemon-reload
48+ sudo systemctl enable --now thinproxy
49+ ```
50+
4451## Usage
4552
4653```
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =thinproxy lightweight HTTP/HTTPS proxy
3+ After =network.target
4+
5+ [Service]
6+ Type =simple
7+ ExecStart =/usr/local/bin/thinproxy -f /etc/thinproxy.conf
8+ Restart =on-failure
9+ RestartSec =5
10+
11+ # Security hardening
12+ NoNewPrivileges =yes
13+ ProtectSystem =strict
14+ ProtectHome =yes
15+ PrivateTmp =yes
16+ PrivateDevices =yes
17+ ProtectKernelTunables =yes
18+ ProtectKernelModules =yes
19+ ProtectControlGroups =yes
20+ ReadOnlyPaths =/etc/thinproxy.conf
21+ RestrictNamespaces =yes
22+ RestrictSUIDSGID =yes
23+ MemoryDenyWriteExecute =yes
24+ LockPersonality =yes
25+
26+ [Install]
27+ WantedBy =multi-user.target
You can’t perform that action at this time.
0 commit comments