config: support Ubuntu — distro-agnostic scripts#10
Conversation
1343d30 to
d973c1f
Compare
Greptile SummaryThis PR contains two separate improvements: Ubuntu compatibility for shell scripts and environment validation via varlock. Ubuntu Compatibility:
Environment Validation (varlock):
Testing: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: d973c1f |
531bcfe to
55ab39b
Compare
55ab39b to
10af489
Compare
| if [ -d "$HOME/.pi/agent/sessions" ]; then | ||
| find "$HOME/.pi/agent/sessions" -name '*.jsonl' -not -perm 600 -exec chmod 600 {} + 2>/dev/null || true | ||
| count=$(find "$HOME/.pi/agent/sessions" -name '*.jsonl' 2>/dev/null | wc -l) | ||
| [ "$count" -gt 0 ] && echo " ✓ $count session log(s) → 600" | ||
| fi |
There was a problem hiding this comment.
Bug: The use of || true in harden-permissions.sh silences errors from the chmod command, potentially leaving sensitive session logs with incorrect permissions without any failure indication.
Severity: HIGH
Suggested Fix
Remove the || true to allow the script to fail correctly if the chmod command returns a non-zero exit code. The script should exit with an error if it cannot successfully harden the permissions on the session log files, ensuring that failures are not silent.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: bin/harden-permissions.sh#L54-L58
Potential issue: The `harden-permissions.sh` script uses `|| true` after a `find ...
-exec chmod 600 {} +` command. This masks any failure from the `chmod` operation. If
`chmod` fails to set the correct permissions on sensitive session logs (e.g., due to
ownership or permission errors), the script will not report an error and will continue
execution. This can lead to a silent security failure where session logs containing full
conversation histories remain group-readable, despite the script appearing to have
succeeded. The subsequent log message "✓ $count session log(s) → 600" can give a false
sense of security.
Support Ubuntu and add integration CI on ephemeral DigitalOcean droplets.
Changes
Ubuntu compatibility fixes
bin/hornet-safe-bash: replacegrep -P(Perl regex) withgrep -E(POSIX extended)setup.sh: fix CWD inheritance (cd /tmp), use deployed harden-permissions, run git config as admin userbin/harden-permissions.sh: guard sessions dirfindfor fresh installsAGENTS.md: add distro-agnostic coding guidelineIntegration CI
bin/ci/droplet.sh: reusable DO droplet lifecycle (create/destroy/wait-ssh/run)bin/ci/setup-ubuntu.sh: Ubuntu prereqs → setup.sh → test suite.github/workflows/integration.yml: matrix workflow (Ubuntu now, extensible to Arch etc)DO_API_TOKEN(already set)Tested
All 207 tests pass.