Monorepo for Tangled tangled.org

UI : Displayed SSH clone URL doesn't account for uppercase characters #771

Closed daroche.me
Closed opened by daroche.me

Creating a repository with uppercase characters will cause the tangled ui (both current HTMX & next's svelte) to show the same name in the clone repository dropdown.

Image

This makes the webui's SSH clone url unusable unless lowercased by the user, as knot2 refers to repositories by their record id rather than their Name.

Reproducer :

$ git ls-remote git@tangled.org:daroche.me/UppercaseTest-tangled
knot: repository not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

$ git ls-remote git@tangled.org:daroche.me/uppercasetest-tangled
04e11257596fe699e6fdae15361f22364770fe99        HEAD
04e11257596fe699e6fdae15361f22364770fe99        refs/heads/main

I don't have a working dev env to submit patches but I suppose something like this should do :

diff --git a/appview/pages/templates/repo/fragments/cloneDropdown.html b/appview/pages/templates/repo/fragments/cloneDropdown.html
index 3a9233773..f3132031b 100644
--- a/appview/pages/templates/repo/fragments/cloneDropdown.html
+++ b/appview/pages/templates/repo/fragments/cloneDropdown.html
@@ -49,14 +49,14 @@
     {{ template "cloneUrlItem" (
         dict
           "Label" "HTTPS"
-          "HandleUrl" (printf "https://tangled.org/%s/%s" $repoOwnerHandle .RepoInfo.Slug)
+          "HandleUrl" (printf "https://tangled.org/%s/%s" $repoOwnerHandle .RepoInfo.Rkey)
           "PermaUrl" (printf "https://tangled.org/%s" .RepoInfo.RepoDid)
           ) }}
 
     {{ template "cloneUrlItem" (
       dict
         "Label" "SSH"
-        "HandleUrl" (printf "git@%s:%s/%s" (stripPort $knot) $repoOwnerHandle .RepoInfo.Slug)
+        "HandleUrl" (printf "git@%s:%s/%s" (stripPort $knot) $repoOwnerHandle .RepoInfo.Rkey)
         "PermaUrl" (printf "git@%s:%s" (stripPort $knot) .RepoInfo.RepoDid)
         ) }}

Fixed since the UI revamp dropped !

Sign up or Sign in to add to the discussion.