mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-09-02 01:29:23 +00:00
fix(setup): check cloudflared binary and validate tunnel token (#424)
* fix(setup): check cloudflared binary and validate tunnel token (#418) The Cloudflare tunnel setup accepted tokens blindly without checking if cloudflared was installed or if the token was valid. Now: - Checks for cloudflared on PATH before accepting a token, with install instructions if missing (user can continue anyway) - Validates token format (base64-decoded JSON with account/tunnel fields) with a warning if malformed (user can override) - Replaces misleading "will start automatically at boot" with honest instructions for starting the tunnel and installing as a service - Reuses binary_exists() from skills::gating (promoted to pub(crate)) for cross-platform PATH lookup Closes #418 Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: reuse cloudflared_found instead of redundant binary_exists call Address review feedback: the binary check result was already stored in cloudflared_found from earlier in the function. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e794f39726
commit
914f3cd075
@@ -75,7 +75,7 @@ pub fn check_requirements_sync(requirements: &GatingRequirements) -> GatingResul
|
||||
}
|
||||
|
||||
/// Check if a binary exists on PATH using `std::process::Command`.
|
||||
fn binary_exists(name: &str) -> bool {
|
||||
pub(crate) fn binary_exists(name: &str) -> bool {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
std::process::Command::new("which")
|
||||
|
||||
Reference in New Issue
Block a user