summarylogtreecommitdiffstats
path: root/copilot-api.service
blob: 6316238fa16b557b02a970c47ac1fce82602b9ee (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
[Unit]
Description=GitHub Copilot OpenAI/Anthropic-compatible API server
Documentation=https://github.com/ericc-ch/copilot-api
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=copilot-api
Group=copilot-api

# Store all data under /var/lib/copilot-api — paths.ts uses os.homedir()
# so we redirect HOME there; the token ends up at
# /var/lib/copilot-api/.local/share/copilot-api/github_token
Environment=HOME=/var/lib/copilot-api

ExecStart=/usr/bin/copilot-api start
Restart=on-failure
RestartSec=5

# Persistent state directory managed by systemd
StateDirectory=copilot-api
StateDirectoryMode=0750

# Security hardening
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/var/lib/copilot-api
CapabilityBoundingSet=

[Install]
WantedBy=multi-user.target