vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Merge change request 01M70WES5ZZDJ6RP226WB11BBZ: Let people rename and remove their own passkeys
keenan · 26m ago
4b8c9e1d
| 1 | //go:build unix |
| 2 | |
| 3 | package git |
| 4 | |
| 5 | import ( |
| 6 | "os" |
| 7 | "syscall" |
| 8 | ) |
| 9 | |
| 10 | // lockFile blocks until this process holds the exclusive lock on f. flock is |
| 11 | // released when the descriptor closes, including when the process is killed, which |
| 12 | // is what makes a write that dies mid-commit recoverable without a lock file |
| 13 | // anybody has to clean up. |
| 14 | func lockFile(f *os.File) (func(), error) { |
| 15 | for { |
| 16 | err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX) |
| 17 | if err == nil { |
| 18 | return func() { _ = syscall.Flock(int(f.Fd()), syscall.LOCK_UN) }, nil |
| 19 | } |
| 20 | // A signal can interrupt the wait; the lock is not held, so ask again. |
| 21 | if err != syscall.EINTR { |
| 22 | return nil, err |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 |