{"record":{"id":"416ea8c5f61307a0","repo":"jdx/mise","slug":"remote-bootstrap-requires-https-ssh-or-a-local-p","errorCode":null,"errorMessage":"remote bootstrap requires HTTPS, SSH, or a local path","messagePattern":"remote bootstrap requires HTTPS, SSH, or a local path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote_repository.rs","lineNumber":62,"sourceCode":"pub(crate) fn validate_origin(origin: &str) -> Result<()> {\n    if origin.starts_with('-') || origin.chars().any(char::is_control) {\n        bail!(\"invalid repository origin\");\n    }\n    // Explicit local paths may contain colons; otherwise :: selects a Git helper.\n    let explicit_local = std::path::Path::new(origin).is_absolute()\n        || origin.starts_with(\"./\")\n        || origin.starts_with(\"../\");\n    if !explicit_local\n        && origin.split_once(\"::\").is_some_and(|(prefix, _)| {\n            !prefix.is_empty() && !prefix.contains(['/', '\\\\', '[', ']', '@', ':'])\n        })\n    {\n        bail!(\"Git remote helpers are not supported for remote onboarding\");\n    }\n    if !explicit_local && origin.contains(\"://\") {\n        let url = url::Url::parse(origin).wrap_err(\"invalid repository URL\")?;\n        if !matches!(url.scheme(), \"https\" | \"ssh\" | \"file\") {\n            bail!(\"remote bootstrap requires HTTPS, SSH, or a local path\");\n        }\n    }\n    if let Ok(url) = url::Url::parse(origin)\n        && (url.password().is_some()\n            || (url.scheme() != \"ssh\" && !url.username().is_empty())\n            || url.query().is_some()\n            || url.fragment().is_some())\n    {\n        bail!(\"repository origin must not contain credentials, query parameters, or fragments\");\n    }\n    Ok(())\n}\n\nimpl Source {\n    pub(crate) async fn fetch(origin: String) -> Result<Self> {\n        validate_origin(&origin)?;\n        let directory = tempfile::tempdir()?;\n        let repo = directory.path().join(\"repo\");","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/remote_repository.rs#L44-L80","documentation":"During remote-repository onboarding, mise validates the git remote origin string. If the origin has a URL scheme (contains '://') that is not https, ssh, or file, onboarding is rejected. Git remote helpers and exotic transports are not supported for bootstrap.","triggerScenarios":"Calling Source::fetch or install_at with an origin like git://host/repo, ftp://..., or a remote-helper form (e.g. git@... without a scheme is fine, but ext:: or helper schemes are not).","commonSituations":"Copying a git:// URL from old project docs, using a custom git remote-helper transport, or pasting an scp-like URL that got mangled into an unsupported scheme.","solutions":["Change the origin to an https:// URL, e.g. https://github.com/owner/repo.git","Use an SSH URL ssh://git@github.com/owner/repo.git or a local file:// path","Remove any remote-helper prefix (ext::, gitremote-helpers forms) from the origin"],"exampleFix":"// before\nlet origin = \"git://github.com/owner/repo.git\";\n// after\nlet origin = \"https://github.com/owner/repo.git\";","handlingStrategy":"validation","validationCode":"fn origin_scheme_ok(origin: &str) -> bool {\n    match origin.split_once(\"://\") {\n        Some((scheme, _)) => matches!(scheme, \"https\" | \"ssh\" | \"file\"),\n        None => true, // no scheme (e.g. git@host:path) is allowed\n    }\n}","typeGuard":"fn is_supported_origin(origin: &str) -> bool {\n    origin.contains(\"://\")\n        && matches!(origin.split('://').next(), Some(\"https\") | Some(\"ssh\") | Some(\"file\"))\n        || !origin.contains(\"://\")\n}","tryCatchPattern":null,"preventionTips":["Always use https:// or ssh:// URLs for onboarding origins","Never use git:// or remote-helper transports","Test the origin with `git ls-remote` before calling the API"],"tags":["git","validation","url"],"backgroundTag":"invalid-url-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}