Fix Termux curl bootstrap recovery and safe download flow#19
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR improves the Termux bootstrap installation process for OpenClaw-On-Android by replacing unsafe piped curl commands with file-based execution, adding wget as a fallback downloader, and expanding documentation with robust setup steps and troubleshooting guidance for common SSL/TLS failures on Android. ChangesTermux Bootstrap Robustness
🎯 2 (Simple) | ⏱️ ~12 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review Summary by QodoFix Termux curl bootstrap recovery and safe download flow
WalkthroughsDescription• Add curl health check and recovery hint for Termux package sync issues • Replace unsafe curl | bash pattern with download-to-file flow • Support wget as fallback downloader when curl unavailable • Add comprehensive documentation for curl/SSL troubleshooting Diagramflowchart LR
A["Old: curl | bash"] -->|Unsafe| B["Empty input risk"]
C["New: Download to file"] -->|Safe| D["Verify before execute"]
E["curl health check"] -->|Detects broken curl| F["Print repair hint"]
G["DOWNLOADER array"] -->|curl or wget| H["Resilient fallback"]
File Changes1. bootstrap.sh
|
Code Review by Qodo
1. wget fallback still needs curl
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Termux install guidance and bootstrap behavior to prevent failures caused by broken/out-of-sync curl/OpenSSL packages, and to avoid the “curl | bash then missing .bashrc” trap.
Changes:
- Added a new common issue entry for the
SSL_set_quic_tls_transport_paramsTermuxcurllinker error and provided repair steps. - Replaced
curl | bashinstallation instructions across docs/README with a “download then execute” bootstrap flow. - Improved
bootstrap.shto validatecurlstartup and allow usingwgetas an alternative downloader.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/support/common-issues.mdx | Documents the Termux curl/OpenSSL mismatch error and a safer bootstrap command; renumbers sections. |
| docs/quickstart.mdx | Adds Termux package refresh/repair steps and switches to download-then-run bootstrap. |
| docs/installation.mdx | Updates full reinstall instructions to use download-then-run bootstrap. |
| bootstrap.sh | Adds curl startup check, a repair hint, and wget fallback via a unified downloader. |
| README.md | Updates Termux prerequisites and install commands; explains why download-then-run is safer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if command -v curl &>/dev/null; then | ||
| if ! curl --version &>/dev/null; then | ||
| echo -e "${RED}[FAIL]${NC} curl is installed but cannot start." | ||
| print_curl_repair_hint | ||
| exit 1 | ||
| fi | ||
| DOWNLOADER=(curl -sfL "$REPO_TARBALL") | ||
| elif command -v wget &>/dev/null; then | ||
| DOWNLOADER=(wget -qO- "$REPO_TARBALL") | ||
| else | ||
| echo -e "${RED}[FAIL]${NC} curl/wget not found. Install one with: pkg install curl" | ||
| exit 1 | ||
| fi |
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" \ | ||
| && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" |
| oca --uninstall | ||
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" |
There was a problem hiding this comment.
Code Review
This pull request updates the installation instructions and the bootstrap script to handle out-of-sync Termux SSL/HTTP packages and to avoid piping curl directly into bash. The feedback highlights that using /tmp as a fallback when TMPDIR is unset will fail on Android/Termux because /tmp is not writable, suggesting a fallback to $HOME instead. Additionally, it is recommended to use curl -fsSL instead of curl -sfL in the bootstrap script to ensure error messages are printed if the download fails.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| # Usage: | ||
| # curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o /tmp/oca-bootstrap.sh \ | ||
| # && bash /tmp/oca-bootstrap.sh |
There was a problem hiding this comment.
The usage comment suggests downloading the bootstrap script to /tmp/oca-bootstrap.sh. However, in Termux/Android, /tmp is not a writable directory and does not exist by default. Copying and running this command directly will fail with a 'No such file or directory' or 'Permission denied' error. It is safer to use a path relative to $HOME or use the ${TMPDIR:-$HOME} pattern to ensure compatibility with Termux.
| # Usage: | |
| # curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o /tmp/oca-bootstrap.sh \ | |
| # && bash /tmp/oca-bootstrap.sh | |
| # Usage: | |
| # BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh" | |
| # curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\ | |
| # && bash "$BOOTSTRAP" |
| print_curl_repair_hint | ||
| exit 1 | ||
| fi | ||
| DOWNLOADER=(curl -sfL "$REPO_TARBALL") |
There was a problem hiding this comment.
Using curl -sfL silences all output, including error messages when the download fails (due to -s without -S). If the download fails due to network or DNS issues, the script will exit silently without providing any helpful error message. Changing this to curl -fsSL (which includes -S / --show-error) will ensure that error messages are printed to stderr if the download fails, while keeping the progress bar silent.
| DOWNLOADER=(curl -sfL "$REPO_TARBALL") | |
| DOWNLOADER=(curl -fsSL "$REPO_TARBALL") |
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" \ | ||
| && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" |
There was a problem hiding this comment.
Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | |
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | |
| && bash "$BOOTSTRAP" \ | |
| && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" | |
| BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh" | |
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\ | |
| && bash "$BOOTSTRAP" \\ | |
| && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" |
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" |
There was a problem hiding this comment.
Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | |
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | |
| && bash "$BOOTSTRAP" | |
| BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh" | |
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\ | |
| && bash "$BOOTSTRAP" |
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" |
There was a problem hiding this comment.
Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.
BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
&& bash "$BOOTSTRAP"
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" \ | ||
| && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" |
There was a problem hiding this comment.
Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.
BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
&& bash "$BOOTSTRAP" \\
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
| BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh" | ||
| curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \ | ||
| && bash "$BOOTSTRAP" \ | ||
| && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" |
There was a problem hiding this comment.
Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.
BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
&& bash "$BOOTSTRAP" \\
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Motivation
CANNOT LINK EXECUTABLE "curl"orSSL_set_quic_tls_transport_paramswhencurl/OpenSSL/libngtcp2 packages are out of sync, and the oldcurl | bash && source ~/.bashrcpattern can cause a missing.bashrcsymptom if the downloader fails.curl, providing a recovery hint, and avoiding piping untrusted/empty input directly intobash.Description
curlhealth check and repair hint via a newprint_curl_repair_hint()helper inbootstrap.sh, and prefer a download-to-file flow with aDOWNLOADERarray that supportscurland awgetfallback while feeding the tarball intotar(bootstrap.sh).curl | tarcall with the resilient `Codex Task
Summary by CodeRabbit
Documentation
Bug Fixes