-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeerclawd.service
More file actions
63 lines (52 loc) · 1.35 KB
/
peerclawd.service
File metadata and controls
63 lines (52 loc) · 1.35 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
[Unit]
Description=PeerClaw Agent Gateway
Documentation=https://github.com/peerclaw/peerclaw-server
After=network-online.target
Wants=network-online.target
# Uncomment if using PostgreSQL or Redis:
# After=network-online.target postgresql.service redis.service
[Service]
Type=simple
User=peerclaw
Group=peerclaw
ExecStart=/usr/local/bin/peerclawd -config /etc/peerclaw/config.yaml
WorkingDirectory=/var/lib/peerclaw
RuntimeDirectory=peerclaw
StateDirectory=peerclaw
LogsDirectory=peerclaw
ConfigurationDirectory=peerclaw
# Environment file for secrets (JWT_SECRET, REDIS_PASSWORD, etc.)
EnvironmentFile=-/etc/peerclaw/peerclaw.env
# Restart policy
Restart=on-failure
RestartSec=5
StartLimitIntervalSec=60
StartLimitBurst=5
# Graceful shutdown
KillMode=mixed
KillSignal=SIGTERM
TimeoutStopSec=30
# Security hardening
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictSUIDSGID=yes
RestrictNamespaces=yes
RestrictRealtime=yes
MemoryDenyWriteExecute=yes
LockPersonality=yes
# Allow binding to port 8080 (non-privileged)
AmbientCapabilities=
CapabilityBoundingSet=
# File descriptor limits
LimitNOFILE=65536
LimitNPROC=4096
# Read-write paths for data and logs
ReadWritePaths=/var/lib/peerclaw /var/log/peerclaw
[Install]
WantedBy=multi-user.target