Monorepo for Tangled tangled.org

repoguard: allow repo parameter formats like /handle/repo

closes #42 by stripping one leading slash from the repo parameter.

also fixes a minor issue with the nix develop shellhook.

this kinda hacky fix is tested with the following commands:

```
nix build .#repoguard
SSH_ORIGINAL_COMMAND="git-upload-pack '/soopy.moe/test-repo'" ./result/bin/repoguard -log-path /tmp/ASDUJBIf-repoguard.log -user git
SSH_ORIGINAL_COMMAND="git-upload-pack 'soopy.moe/test-repo'" ./result/bin/repoguard -log-path /tmp/ASDUJBIf-repoguard.log -user git
```

Tangled cfc4b6e6 f9d3d7b2

Changed files
+5 -3
cmd
repoguard
+4 -3
cmd/repoguard/main.go
··· 66 66 gitCommand := cmdParts[0] 67 67 68 68 // did:foo/repo-name or 69 - // handle/repo-name 69 + // handle/repo-name or 70 + // any of the above with a leading slash (/) 70 71 71 - components := strings.Split(strings.Trim(cmdParts[1], "'"), "/") 72 + components := strings.Split(strings.TrimPrefix(strings.Trim(cmdParts[1], "'"), "/"), "/") 72 73 logEvent("Command components", map[string]interface{}{ 73 74 "components": components, 74 75 }) 75 76 if len(components) != 2 { 76 - exitWithLog("invalid repo format, needs <user>/<repo>") 77 + exitWithLog("invalid repo format, needs <user>/<repo> or /<user>/<repo>") 77 78 } 78 79 79 80 didOrHandle := components[0]
+1
flake.nix
··· 152 152 shellHook = '' 153 153 cp -f ${htmx-src} appview/pages/static/htmx.min.js 154 154 cp -f ${lucide-src} appview/pages/static/lucide.min.js 155 + mkdir -p appview/pages/static/fonts/ 155 156 cp -f ${ia-fonts-src}/"iA Writer Quattro"/Static/*.ttf appview/pages/static/fonts/ 156 157 cp -f ${ia-fonts-src}/"iA Writer Mono"/Static/*.ttf appview/pages/static/fonts/ 157 158 '';