Commits
- Commit:
310a8ea5d9d2eca34e7cdd0484fc2a1ce40dba1e
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use got_object_id_hex instead of got_sha1_digest_to_str
(where possible)
The latter assumes that we only have sha1 digests to pretty-print,
while the former could, in the future, automatically switch to
sha256.
At the moment though, this is a no-op.
- Commit:
0fb910a41f7587983405793e780968c72b3f4197
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make new pkt read timeout apply only to gotsh, not the client-side helpers
- Commit:
bbca1adf04e40d91b98c326953a147a37b94c817
- From:
- Omar Polo <op@omarpolo.com>
- Date:
remove unneded wbuf->fd = -1
There's no need to set the fd to -1 on ibufs created with imsg_create(3),
and it was probably never needed.
- Commit:
2c52c623be04b56400a5c94cc8d86b6fda214d16
- From:
- Omar Polo <op@omarpolo.com>
- Date:
convert to use imsg_get_fd()
While here also fix a fd leak in got-read-pack. We were dup'ing
imsg.fd without closing imsg.fd later; instead just use imsg_get_fd()
to extract the file descriptor.
Tested by falsifian and Kyle Ackerman, thanks!
'go ahead' stsp@
- Commit:
87a3ab84d3eb87b790e3d34aeec2c344a8d7375b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
provide functions to parse/serialize different hashes
it abstracts over the hash type and ensures that object ids are zero'ed
before their sha1 digest is written. Needed by the incoming sha256
support.
ok stsp@
- Commit:
53bf0b541977b66862040d4b633fb6b5d3a3c6c8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
rename lib/sha1.c to lib/hash.c
It will soon grow functions to deal with sha256 too. stsp@ agrees.
- Commit:
5822e79e39a8777984e08b5d89a8c55d6aa0356d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
include sha2.h too where sha1.h is included
In preparation for wide sha256 support; stsp@ agrees. Change done
mechanically with
find . -iname \*.[cy] -exec sam {} +
X ,x/<sha1\.h>/i/\n#include <sha2.h>
- Commit:
427f294cd8765e673b3d562140ee3c5b895249fc
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_send_remote_ref: use struct instead of buffer for id
ok stsp@
- Commit:
5eb14fb9cee55bc3df623de8761d1e719ae697d4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_send_ref: use struct instead of buffer for id
ok stsp@
- Commit:
d8bacb933720b8819f0c4e76b004775aa1885b9b
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: minor refactor of got_pathlist_free() API
Accept flag parameter to optionally specify which pointers to free. This saves
callers looping through the list to free pointers.
ok + fix stsp@
- Commit:
9114dd430297e408815019c3bc1df29ba10a9fb8
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
fix uninitialised fildes variables in libexec helpers
Reviewed and uncovered as part of the diff in the forthcoming commit
(pathlist API refactor).
ok stsp@
- Commit:
99fd9ff4bf6d3bee4a29f13ef4ae81aa36fdd4d5
- From:
- Omar Polo <op@omarpolo.com>
- Date:
always cast ctype' is*() arguments to unsigned char
ok stsp@
- Commit:
6242c45bf7571868b35d644cd0655d3b007d60c9
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got send: show server error
Print the error message reported by the remote server when failing to
update a branch (for e.g. because of a server-side check.) Reported by
gonzalo@, with help and ok stsp@.
- Commit:
110104b65c5b511d6e99058e536c132ab962d863
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix crash in got-send-pack when server does not announce any capabilities
- Commit:
15f404b1ceddb96797adc6a015786806435fc153
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
avoid incomplete writes of pack file data in got-send-pack
- 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.
- Commit:
5e91dae4dd43b8024731223110ab18f505f453ac
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove trailing whitespace; patch by Josiah Frentsos
- Commit:
438d0cc30baf8e97fd870f5e620833e0a45401aa
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix snprintf error handling
follow the "proper secure idiom" described in the CAVEATS section of
printf(3). reminded by tb@ and millert@
- Commit:
eff568509962015d1495b29d30e8375b7ee427e4
- From:
- Florian Obser <florian@narrans.de>
- Date:
Do not ignore error from got_pathlist_append.
Found by llvm's scan-build (dead store).
OK stsp
- Commit:
1453347d2463ce1b2700dd9fa810f30f2a443e5e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
imsg_add() frees its msg argument on error; avoid double-free in error paths
- Commit:
d58ddaf3fc10239711ae7a88664e3a100567ba3c
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
const-ify tables
ok thomas_adam millert
- Commit:
bed0038563e7b63afa004a00b5c3d1c41a9a733b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
apply time-based rate-limiting to got-send-pack upload progress output
- Commit:
e99d9267c8cc287a60f768d4282c01b9f5f6c975
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
plug memory leaks in got-fetch-pack and got-send-pack
ok naddy
- Commit:
474b498221b19828b2bcb8e5c5b2ced63acbd1a6
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
whitespace fix from Omar Polo
- Commit:
030daac821622c8495676bc5210fb7784c7ae78f
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix some integers that had a slightly wrong type; patch by Omar Polo