Commit cc2a749
authored
fix(packaging): make /etc/mcpproxy writable by the service user (#825)
Companion to #822. That PR added /etc/mcpproxy to ReadWritePaths=, lifting
systemd's ProtectSystem=strict namespace restriction — necessary but not
sufficient, because POSIX permissions still apply.
nfpm declares only the FILES under /etc/mcpproxy, so the directory ships
implicitly as root:root 0755 (verified against a .deb built from this tree).
The service runs as User=mcpproxy, and SaveConfig -> atomicWriteFile creates
mcp_config.json.tmp.<hex> in that directory before renaming it, so the service
needs write+search on the directory itself. os.MkdirAll(dir, 0700) is a no-op
on an existing directory, so nothing repaired it at runtime.
postinstall.sh now runs:
install -d -m 2770 -o root -g mcpproxy /etc/mcpproxy
2770: group-writable for mcpproxy, setgid so new files keep the group, no
access for others (the config holds API keys). Mirrors the existing install -d
for /var/lib/mcpproxy, and repairs permissions on hosts upgrading from an
earlier package.1 parent 8498555 commit cc2a749
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
9 | 25 | | |
10 | 26 | | |
11 | 27 | | |
| |||
0 commit comments