vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Give a hand-run instance the file modes and socket directory Linux packaging provides
8f24ae1f8c7873da346344c2686b02aac6df781b · Keenan Nemetz · 12d ago · parent a4a6d1e9
Give a hand-run instance the file modes and socket directory Linux packaging provides Three things a Vole forge gets from its Linux package are missing when it runs on macOS, and all three are silent. The systemd unit sets UMask=0027. launchd has no equivalent, so SQLite, git, the CI spool, and the ACME client would create group- and world-readable files. The data directory is 0700, so it is contained, but the defence is the unit's today. internal/secure.Restrict sets the umask in the long-running commands instead: a packaged Linux install already has it, and setting it where the unit did is harmless. The front-door socket lives in /run/vole, which exists because tmpfiles.d and the post-install script create it. A hand-run instance has nothing to do that, so `ssh_listen = "socket"` failed with ENOENT before any clone could try. The listener now creates the directory (0750) when it is missing and warns that the sshd account still needs access to it. An existing directory is untouched: its group and setgid bit are the installer's decision. macOS puts /var behind a symlink to /private/var, so the same config file reached two ways compared unequal and `vole admin init` printed a --config hint it did not need. The comparison resolves symlinks on the directory, which also works for a file that does not exist yet. Closes: 01M7ZVF0E8YXKD6A8TNX1MW8B3
cmd/vole/init.go +15−6
| @@ -72,13 +72,22 @@ func cmdInit(args []string) error { | |||
| 72 | 72 | // print the plain commands when later invocations will discover the instance | |
| 73 | 73 | // without --config. | |
| 74 | 74 | func samePath(a, b string) bool { | |
| 75 | aa, err := filepath.Abs(a) | ||
| 75 | return resolvePath(a) == resolvePath(b) | ||
| 76 | } | ||
| 77 | |||
| 78 | // resolvePath is the identity of a config path: absolute, with the symlinks in | ||
| 79 | // its directory resolved. Resolving the directory rather than the file is what | ||
| 80 | // makes this work for a path that does not exist yet, and it is what makes macOS | ||
| 81 | // agree with itself: /var is a symlink to /private/var, so an instance named | ||
| 82 | // through one spelling and later through the other is one instance. | ||
| 83 | func resolvePath(p string) string { | ||
| 84 | abs, err := filepath.Abs(p) | ||
| 76 | 85 | if err != nil { | |
| 77 | return false | ||
| 86 | return p | ||
| 78 | 87 | } | |
| 79 | bb, err := filepath.Abs(b) | ||
| 80 | if err != nil { | ||
| 81 | return false | ||
| 88 | dir, name := filepath.Dir(abs), filepath.Base(abs) | ||
| 89 | if real, err := filepath.EvalSymlinks(dir); err == nil { | ||
| 90 | dir = real | ||
| 82 | 91 | } | |
| 83 | return filepath.Clean(aa) == filepath.Clean(bb) | ||
| 92 | return filepath.Join(dir, name) | ||
| 84 | 93 | } | |