8356
Wx
www-xonecas-io / files
www-xonecas-io / tickets / 1015-remotes-show-github-should-show-correctly-from.md
3.6 KB
1--- 2id: 1015 3title: Remotes show github, should show correctly, from the site's repos remotes. 4type: bug 5status: done 6priority: p2 7created: 2026-11-08T03:48:13Z 8updated: 2026-11-08T20:16:29Z 9source: devnote 10area: site 11moves: 2026-11-08T04:02:21Z inbox doing drag; 2026-11-08T04:04:19Z doing blocked agent; 2026-11-08T04:07:25Z blocked doing agent; 2026-11-08T04:09:42Z doing review agent; 2026-11-08T20:16:29Z review done drag 12--- 13 14## Context 15 16Filed from `http://192.168.122.10:8080/projects/dotfiles/`, on `pre.bg-pre.text-pre-fg.rounded-[2px]`. 17 18> git clone https://github.com/sacenox/dotfiles.git 19 20## Notes 21 22- 2026-11-08 03:48Z (agent): Triage: type bug, priority p2, area site. No typos to fix. 23 24 Where it comes from: internal/site/templates/project.html:40 prints 'git clone {{(index .P.Sources 0).URL}}', the first upstream source (GitHub/GitLab), so every project page shows a GitHub/GitLab clone URL. 25 26 Question: which URL should Clone show? The site does not host git remotes yet: repos/ holds bare mirrors in the VM, and hosting them was closed as wontfix in 1011. Options I see: (a) a site URL such as https://xonecas.io/<project>.git, shown now even though nothing serves it yet; (b) wait until the site serves the repos; (c) something else you have in mind. Related: 1011. 27 28- 2026-11-08 04:04Z (agent): Blocked: the triage question is still open, and it decides what Clone shows. Nothing changed yet. 29 30 Options: 31 (a) Show https://xonecas.io/<name>.git and nothing more. Text only: the clone fails until something serves it. 32 (b) Show it AND make it work on a static host. 'site build' writes each project's bare repo to public/<name>.git with 'git update-server-info', so 'git clone https://xonecas.io/<name>.git' works over git's dumb HTTP protocol, from Caddy or any static server. The dev server would serve it too, so it can be tested here. Cost: public/ grows by the size of the repos. 33 (c) Keep the upstream URL until hosting is decided. 34 35 I recommend (b): it is the only one where the URL on the page is real. Also tell me the URL shape you want, e.g. https://xonecas.io/<name>.git or https://xonecas.io/projects/<name>.git. 36 37- 2026-11-08 04:09Z (agent): Done, with option (b) as recommended, since you asked me to decide. Clone now shows 'git clone https://xonecas.io/<name>.git', and that URL works from any static server. 38 39 - internal/site/clone.go (new): writeClone puts a bare copy of each shown project's repo at public/<name>.git ('git clone --bare' from the store, then 'git update-server-info'), so git's dumb HTTP protocol can clone it with no git server. 40 - build.go calls it per project; project.html prints the site URL; the Sources list still links the upstreams. 41 - clone_test.go: builds a repo, serves it with a plain http.FileServer, and runs a real 'git clone' against it. 42 43 CHECKED: go vet, go test pass. Full build: 82 public/<name>.git. From the dev server: 'git clone http://192.168.122.10:8080/irvc.git' and dotfiles.git both clone (dotfiles: 99 commits). The local clone hard-links objects (pack link count 2), and disk use did not change. A rebuild with no changes takes 5.4s. 44 45 NOT CHECKED / WATCH OUT: (1) Off this disk, e.g. rsync to the VPS, public/ carries the full repos, about 351 MB today. (2) A project that becomes hidden keeps its old public/<name>.git until public/ is wiped. The build does not prune; I did not check whether old HTML pages behave the same. (3) Nothing serves xonecas.io yet (1011), so the printed URL works only once public/ is hosted there. 46 47- 2026-11-08 04:09Z (agent): Filed the leftover-output issue from point (2) as a separate bug, since it predates this ticket: hidden or renamed projects stay in public/.