Commit 5b79ca6
deploy: harden cloud-init with archon user, swap, and fixes (#981)
* deploy: harden cloud-init with archon user, swap, and fixes
- Create dedicated 'archon' user (sudo + docker groups, passwordless
sudo, locked password) and copy SSH authorized_keys from default
cloud user (with root fallback) so login works immediately.
- Run docker pulls and the image build as the archon user via sudo -u.
- Add 2GB swapfile to prevent OOM during docker build on small VPS
(<2GB RAM).
- Remove package_upgrade to speed up boot and avoid surprise kernel
updates.
- Drop redundant systemctl enable/start docker (get.docker.com handles
it).
- ufw allow 443/tcp for consistency with 22/80.
- set -e before clone for fail-fast on network errors.
- Update docs link to https://archon.diy/deployment/docker/.
- SETUP_COMPLETE now instructs ssh archon@<server-ip>.
- Header lists supported providers (incl. Hostinger) and notes the
archon user + swap behavior.
* deploy: address PR review feedback on cloud-init
- Fix set -e regression: merge clone/cp/chown into single shell block
so fail-fast actually applies (CodeRabbit).
- Drop passwordless sudo from archon user — docker group only. Removes
trivial privilege escalation path (Wirasm).
- Remove non-existent 'docker' group from initial users.groups list;
it is added via usermod later (CodeRabbit).
- Restore package_upgrade: true to patch CVEs in the base image before
anything else runs (Wirasm).
- Add ufw allow 443/udp for HTTP/3 QUIC — Caddy exposes 443:443/udp in
docker-compose (CodeRabbit).
- Update SETUP_COMPLETE and header comment to note archon user has no
sudo (use default cloud user / root for maintenance).1 parent e778994 commit 5b79ca6
1 file changed
Lines changed: 72 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
| 32 | + | |
23 | 33 | | |
24 | 34 | | |
25 | 35 | | |
| |||
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
33 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
34 | 61 | | |
35 | 62 | | |
36 | | - | |
37 | | - | |
| 63 | + | |
38 | 64 | | |
39 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
40 | 83 | | |
41 | 84 | | |
42 | | - | |
| 85 | + | |
| 86 | + | |
43 | 87 | | |
44 | 88 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
49 | 96 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
53 | 100 | | |
54 | | - | |
55 | | - | |
| 101 | + | |
| 102 | + | |
56 | 103 | | |
57 | 104 | | |
58 | 105 | | |
| |||
61 | 108 | | |
62 | 109 | | |
63 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
64 | 118 | | |
65 | 119 | | |
66 | 120 | | |
| |||
85 | 139 | | |
86 | 140 | | |
87 | 141 | | |
88 | | - | |
| 142 | + | |
89 | 143 | | |
90 | 144 | | |
91 | 145 | | |
0 commit comments