{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote_repository.rs#L44-L80","documentation":"Remote onboarding only supports HTTPS, SSH, or file schemes. validate_origin parses any origin containing `://` and bails if the URL scheme is not one of https, ssh, or file. This keeps bootstrap limited to transports whose authentication mise can delegate to local Git.","triggerScenarios":"Calling Source::fetch or install_at with an origin whose URL scheme is e.g. `git://`, `http://`, `ftp://`, `rsync://`, or a custom scheme, while the origin is not an explicitly local path.","commonSituations":"Using an old-style `git://` GitHub URL, an internal `http://` mirror, or a company scheme like `arc://` in the source repository setting.","solutions":["Switch the origin to an https:// URL.","Use an SSH URL (ssh://user@host/path or scp-style user@host:path) if SSH auth is configured.","For local repositories, use a plain filesystem path (which bypasses the URL check via explicit_local) or a file:// URL.","If you must use git:// or http://, host a mirror over HTTPS."],"exampleFix":"// before\ninstall_at(\"git://github.com/org/repo.git\", rev, ...).await?;\n// after\ninstall_at(\"https://github.com/org/repo.git\", rev, ...).await?;","handlingStrategy":"validation","validationCode":"function isSupportedScheme(origin: string): boolean {\n  try { return [\"https\", \"ssh\", \"file\"].includes(new URL(origin).protocol.replace(\":\", \"\")); }\n  catch { return !origin.includes(\"://\"); } // local path\n}","typeGuard":"const isHttpsOrSsh = (s: string): boolean => /^https:\\/\\/|^ssh:\\/\\//.test(s);","tryCatchPattern":null,"preventionTips":["Standardize on https:// origins in CI and docs.","Lint mise.toml source URLs for scheme allowlist before deploy."],"tags":["git","url","validation","unsupported-scheme"],"backgroundTag":"invalid-url-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}