Commit 78f98d1
authored
fix: revert non-root runner bootstrap, keep the rest of Phase 4 (#19)
Phase 4 (#18) landed three independent hardenings in one PR:
- New configurable runner-version input (no runtime impact)
- Ephemeral + checksum + set -euo pipefail (additive safety)
- Root to non-root runner user via sudo-heredoc (behavioral change)
The dogfood rotation on terraform-provider-namecheap#182 failed —
'Start self-hosted EC2 runner' timed out at 6m15s waiting for runner
registration. EC2 instance booted fine, but whatever the user-data
did inside the instance, it didn't end at './run.sh' polling GitHub.
We can't post-mortem directly because the instance is ephemeral and
already terminated. Fix-forward strategy: revert ONLY the non-root
transition (highest-probability culprit among the three axes), keep
everything else from Phase 4.
If the Phase 4 dogfood rotation passes after this revert, the
root-to-runner sudo-heredoc is the breaker and can be investigated
as an isolated follow-up (likely candidates: sudoers config on the
hardened AMI, SELinux context, config.sh writing outside its own
directory, or my heredoc quoting). Landing the safer pieces now
unblocks Phases 5/6/7.
Kept:
- runner-version input (Phase 4's main feature)
- set -euo pipefail
- --ephemeral + --unattended + --disableupdate on config.sh
- SHA-256 verification of the runner tarball
- Clearer bash syntax ('case "$(uname -m)"', double-quoted vars)
Reverted:
- useradd + sudo -u runner -H bash <<'RUNNER_BOOTSTRAP' heredoc
- RUNNER_ALLOW_RUNASROOT=1 restored (runner executes as root again)
The non-root goal isn't lost — a follow-up issue will propose it
again, this time with better instrumentation so we can see what
failed inside the instance.
Signed-off-by: yuriyryabikov <22548029+kurok@users.noreply.github.com>1 parent 7b949a3 commit 78f98d1
2 files changed
Lines changed: 36 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87903 | 87903 | | |
87904 | 87904 | | |
87905 | 87905 | | |
87906 | | - | |
87907 | | - | |
87908 | | - | |
87909 | | - | |
| 87906 | + | |
| 87907 | + | |
| 87908 | + | |
| 87909 | + | |
| 87910 | + | |
| 87911 | + | |
87910 | 87912 | | |
87911 | | - | |
87912 | | - | |
87913 | | - | |
87914 | | - | |
87915 | | - | |
87916 | | - | |
87917 | | - | |
87918 | | - | |
87919 | | - | |
87920 | | - | |
| 87913 | + | |
| 87914 | + | |
| 87915 | + | |
| 87916 | + | |
| 87917 | + | |
| 87918 | + | |
| 87919 | + | |
| 87920 | + | |
87921 | 87921 | | |
87922 | 87922 | | |
87923 | 87923 | | |
87924 | | - | |
| 87924 | + | |
87925 | 87925 | | |
87926 | 87926 | | |
87927 | 87927 | | |
87928 | | - | |
87929 | 87928 | | |
87930 | | - | |
| 87929 | + | |
87931 | 87930 | | |
87932 | | - | |
87933 | | - | |
87934 | | - | |
87935 | | - | |
87936 | | - | |
87937 | | - | |
87938 | | - | |
87939 | | - | |
87940 | | - | |
87941 | | - | |
| 87931 | + | |
87942 | 87932 | | |
87943 | 87933 | | |
87944 | 87934 | | |
| |||
87956 | 87946 | | |
87957 | 87947 | | |
87958 | 87948 | | |
| 87949 | + | |
87959 | 87950 | | |
87960 | 87951 | | |
87961 | 87952 | | |
87962 | | - | |
87963 | | - | |
87964 | 87953 | | |
87965 | | - | |
87966 | 87954 | | |
87967 | 87955 | | |
87968 | 87956 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | | - | |
| 83 | + | |
85 | 84 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 85 | + | |
96 | 86 | | |
97 | 87 | | |
98 | 88 | | |
| |||
110 | 100 | | |
111 | 101 | | |
112 | 102 | | |
| 103 | + | |
113 | 104 | | |
114 | 105 | | |
115 | 106 | | |
116 | | - | |
117 | | - | |
118 | 107 | | |
119 | | - | |
120 | 108 | | |
121 | 109 | | |
122 | 110 | | |
| |||
0 commit comments