Skip to content

Commit

Permalink
Revert "Support SSH urls for the registry (#362)" (#363)
Browse files Browse the repository at this point in the history
This reverts commit 44dc265.
  • Loading branch information
nkottary authored Jan 21, 2022
1 parent 44dc265 commit 892638e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/webui/WebUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ function init_registry()
repo = @gf get_repo(forge, owner, name)
repo === nothing && error("Registry lookup failed")

clone = remove_ssh_prefix(get(CONFIG, "registry_clone_url", url))
fork_url = remove_ssh_prefix(get(CONFIG, "registry_fork_url", clone))
clone = get(CONFIG, "registry_clone_url", url)
fork_url = get(CONFIG, "registry_fork_url", clone)
fork_owner, fork_name = splitrepo(fork_url)
fork_repo = @gf get_repo(forge, fork_owner, fork_name)
fork_repo === nothing && error("Registry fork lookup failed")
Expand Down
7 changes: 1 addition & 6 deletions src/webui/gitutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ end

# Split a repo path into its owner and name.
function splitrepo(url::AbstractString)
if startswith(url, "https://") || startswith(url, "http://")
pieces = split(HTTP.URI(url).path, "/"; keepempty=false)
else
pieces = split(split(url, ":")[end], "/")
end

pieces = split(HTTP.URI(url).path, "/"; keepempty=false)
owner = join(pieces[1:end-1], "/")
name = pieces[end]
return owner, name
Expand Down
2 changes: 0 additions & 2 deletions src/webui/webutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ function parseform(s::AbstractString)
pairs = split(replace(s, "+" => " "), "&")
return Dict(map(p -> map(strip HTTP.unescapeuri, split(p, "=")), pairs))
end

remove_ssh_prefix(s::AbstractString) = startswith(s, "ssh://") ? s[length("ssh://")+1:end] : s

0 comments on commit 892638e

Please sign in to comment.