Commits
- Commit:
77d0cae1993d80e742dbcf69ace80700ed616831
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fmt
- Commit:
7fdc3e586448ae55ae38bef76bb5a0a34538e5e6
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
gotd: nix trailing whitespace and indentation fix
ok op@, stsp@
- Commit:
44587340e4924f8f07bf02c57a9a1c2527c2d8d4
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove filesystem access via bind(2) from gotd auth process
op@ pointed out a problem in my initial patch where I forgot
to call unveil(2) with a path before unveil(NULL, NULL).
ok op, jamsek
- Commit:
365cf0f34d08316d433e730a8663283029f729b3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move "unix" pledge promise from gotd parent to auth process
The listen process now communicates the client UID/GID to the parent,
and the auth process verifies this on behalf of the parent.
This allows us to remove the "unix" pledge promise from the parent,
removing parent access to syscalls such as listen() and accept() in
the AF_UNIX domain.
ok tracey@ op@
- Commit:
ef4e2f01b0bff14f003a72321ce0165a0df72fa1
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix gotd authentication timeout
The authentication timeout was accidentally overriden by the request timeout.
Fix this and set both timeouts in the same place for clarity.
ok op@
- Commit:
5e25db14db9eb20ee11b68048b45b3e0f54d50eb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
run gotd authentication in a separate child process
ok op@
- Commit:
b50a2b4639132c68255480f1c5c8785fd7cd8094
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fork gotd repo_read/repo_write children on demand
ok op, jamsek
- Commit:
898c8f8fd003d730d0490c1a5a807e4c11e30f4b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotd: tweak error message if getpwnam fails
errno may not be set to something interesting so switch to fatalx, and
simplify the error message (knowing the failed function, which is also
wrong, doesn't buy much here.)
ok jamsek
- Commit:
eec68231a79adb345b1a6a3194e5ddb353570356
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
switch gotd from chroot(2) to unveil(2)
In the future, gotd will fork+exec new processes for each client connection.
Using unveil instead of chroot avoids having to start such processes as root.
The -portable version could use chroot(2) where no equivalent to unveil(2)
exists. A future component which starts new processes will be isolated as
a separate process, which could run as root in the -portable version.
ok op@
- Commit:
d93ecf7dc6dd75bc506128cc5666c1b76761e0a0
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add a gotd "listen" process which watches the unix socket
ok op@
- Commit:
b1142068fd26fa24285c533f10e3afcb61719759
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix gotd startup without any -v options
- Commit:
8c6fc1468a57de4851e137b55bda5cd838e2f759
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
rename GOTD_SOCK_FILENO to GOTD_FILENO_MSG_PIPE for clarity (it's not a socket)
- Commit:
a45aafaf9bf7910fed713ff35d6d051d463bae98
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
tedu Ted's copyright added to gotd.c by accident; doas-derived code is in auth.c
- Commit:
ddbe612c691511246aacb15046c1a202d0efcf75
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix group membership check in gotd auth
ok op@
- Commit:
0ccf3acb6c3004ac41b46ad931024da1f4ea0e3e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement per-repository read/write authorization rules in gotd
ok op@
- Commit:
86b188ee113cde1b53e1d3544b40ce80ab7767a7
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Omar Polo <op@omarpolo.com>
- Date:
gotd: Don't include stdlib.h twice
- Commit:
36c7cfbb2a9b646bfb1658fca4e34bc63a46ec42
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix crash in gotd if client gets disconnected on error; reported by Mikhail
- Commit:
b90054ed55f30ebe28115abf5ad9cecc2b925713
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use mkstemps(3) instead of mkstemp(3) for opening named temporary files
Allows 'got commit' to use a ".diff" suffix for temporary diff files.
ok op@
- Commit:
585362fdeffda23f6ace02652caf7c5b0ecd4759
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotd: propagate confpath to children as well
otherwise they end up running with default config which isn't ideal.
ok stsp@
- Commit:
f1752522ac2fd00af85111c530b80ef1187a07f7
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add gotctl(8); initially supported commands are 'info' and 'stop'
This will be used by an upcoming regress test suite for gotd(8).
ok tracey
- Commit:
86769de8751a920ee4288ec91157066d6f098bfc
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove sendfd pledge promise from gotd repo_read process
Have the parent process send one end of the pipe directly to gotsh(1),
such that repo_write can run without "sendfd".
Combining "sendfd" and "recvfd" in the same process is frowned upon.
ok tracey
- Commit:
7fec5f4ad5baecf5bab9d872a925055270b2cf53
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove sendfd pledge promise from gotd repo_write process
Have the parent process send one end of the pipe directly to gotsh(1),
such that repo_write can run without "sendfd".
Combining "sendfd" and "recvfd" in the same process is frowned upon.
ok tracey
- Commit:
6f3190632709528909c1dc45046a2a85921584aa
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Stefan Sperling <stsp@stsp.name>
- Date:
sort getopt() option lists and switch statements; patch by Josiah Frentsos
- Commit:
88dec1791eeb2f779795789b119d5bf675c24b6a
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix gotd(8) usage() string; patch by Josiah Frentsos
- Commit:
13b2bc374c1870ec27b2eeb40efe68fd465f64bb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
introduce gotd(8), a Git repository server reachable via ssh(1)
This is an initial barebones implementation which provides the absolute
minimum of functionality required to serve got(1) and git(1) clients.
Basic fetch/send functionality has been tested and seems to work here,
but this server is not yet expected to be stable.
More testing is welcome. See the man pages for setup instructions.
The current design uses one reader and one writer process per repository,
which will have to be extended to N readers and N writers in the future.
At startup, each process will chroot(2) into its assigned repository.
This works because gotd(8) can only be started as root, and will then
fork+exec, chroot, and privdrop.
At present the parent process runs with the following pledge(2) promises:
"stdio rpath wpath cpath proc getpw sendfd recvfd fattr flock unix unveil"
The parent is the only process able to modify the repository in a way
that becomes visible to Git clients. The parent uses unveil(2) to
restrict its view of the filesystem to /tmp and the repositories
listed in the configuration file gotd.conf(5).
Per-repository chroot(2) processes use "stdio rpath sendfd recvfd".
The writer defers to the parent for modifying references in the
repository to point at newly uploaded commits. The reader is fine
without such help, because Git repositories can be read without
having to create any lock-files.
gotd(8) requires a dedicated user ID, which should own repositories
on the filesystem, and a separate secondary group, which should not
have filesystem-level repository access, and must be allowed access
to the gotd(8) socket.
To obtain Git repository access, users must be members of this
secondary group, and must have their login shell set to gotsh(1).
gotsh(1) connects to the gotd(8) socket and speaks Git-protocol
towards the client on the other end of the SSH connection.
gotsh(1) is not an interactive command shell.
At present, authenticated clients are granted read/write access to
all repositories and all references (except for the "refs/got/" and
the "refs/remotes/" namespaces, which are already being protected
from modification).
While complicated access control mechanism are not a design goal,
making it possible to safely offer anonymous Git repository access
over ssh(1) is on the road map.