Commits
- Commit:
aa75acde9c5f406b658c54827bc596cf96d7c64e
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
check size before calling mmap(2)
It's only a preparatory step, as checking whether a size_t is less than
SIZE_MAX is moot. In a follow-up commit, however, the `filesize' field
of the struct got_pack will become off_t and these checks will kick in.
This also makes consistent how we guard mmap(2) against empty files.
ok and improvements stsp@
- Commit:
3efd8e3122b7d03a046d23fd5eed22c1b78f8ceb
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
4e5e98e8510dc01d4848f809792357a7ea446baf
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: remove sha1.h include
This is searched for portably.
- Commit:
405ceee385e4537e9878f8e24a6c3be0640bcd5b
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove unnecessary includes of got_lib_privsep.h
- Commit:
b61ceafcc71b10ab2295bf09b9ddb34a07666f73
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
move functions which open objects into new file object_open_privsep.c
For the future, this will make it possible to provide alternative
implementations of functions now stored in object_open_privsep.c.
This will probably be needed by future gotd(8) which runs inside
a chroot(2) environment and without the "exec" pledge(2) promise,
making it impossible to run libexec helpers on the fly.
Details of this design are not yet settled, but moving functions
into a separate compilation unit won't hurt in any case.
- Commit:
6f6c25d65e82e60c44877d2aa05bcbdbc48e65b3
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
drop unconventional got_object_commit_dup() routine
Replace with got_object_commit_retain() to increment commit object
reference counter.
suggested by and ok stsp@
- Commit:
7e8004bac7c582235903e2d61b6e7b59f96244ea
- From:
- Mikhail <mp39590@gmail.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
tog: add new log view limit feature to filter commits
Use the & key map to enter a pattern with which to limit the displayed commits
to those matching the provided pattern; similar to less(1) and mutt's limit
feature. Includes various tweaks from op.
ok plus fixes from op@
- Commit:
35eabca99227d5245619972d35e5229c63c248db
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
plug leak in resolve_symlink
ok stsp@
- Commit:
b6b86fd1b9828e38d59915e62fddce62952b8b75
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove trailing whitespace; patch by Josiah Frentsos
- Commit:
8b925c6ccd3968917253ea191906a1710c40ed2d
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: add back sys/queue.h
Now that the handling of including sys/queue.h is better, there's no
need to remove those lines from the source. Copy the location of those
original sys/queue.h lines from upstream at the same line number, so as
to avoid any conflicts in the future.
- Commit:
19a6a6b5eea7ed2df9eaaba2364d18ee05678ddd
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
move got_opentempfd() out of lib/diff.c again
ok tracey
- Commit:
acb9e3ea2ed831226f75eb7606ecd06a0711b131
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
pass the correct file to fdopen(); ok tracey
- Commit:
f9bba04a89d0b706fe1b4d95cfe16b75b70097e1
- From:
- Tracey Emery <tracey@traceyemery.net>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix missed dup in open_blob per stsp@
- Commit:
f4ae6ddb59a1edbd016ad7f0e27c2599f8966e19
- From:
- Tracey Emery <tracey@traceyemery.net>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
move got_opentempfd out of open_blob. ok stsp@
- Commit:
68036464ea72a92fd21d72135814faed6abad71a
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
allow start_pack_privsep_child() to be called from outside lib/object.c
- Commit:
ef20f542049f5928fa256eb470801089d0b1048b
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
build with -Wmissing-prototypes
ok stsp@
- Commit:
e71f1e62ddab990a047fe827d13b25003a9b8014
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
let got-read-pack be explicit about whether it could enumerate all objects
This allows the main process to avoid looping over all object IDs again
in case the pack file used for enumeration is complete.
ok op@
- Commit:
63915ee56b87d0499239ed129420c15d499e356f
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
Bring back object enumeration inside got-read-pack as a fast path.
The problem that was found in the earlier version has been fixed.
ok op@
- Commit:
3dfecf3ec1705f859b837950a7ec01c15200e428
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
revert object enumeration in got-read-pack for now; needs more work
This implementation marked commits and trees as enumerated before all trees
which they depend on were enumerated. This behaviour leads to incomplete
pack files when a tree is only partially packed and got-read-pack hits
a missing tree entry as a result. The algorithm must be reworked such
that packed leave nodes are marked enumerated first, then bubble-up.
Found by op@
- Commit:
132807502fb70f1d13642b327d151710a47f01e1
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
implement object enumeration support in got-read-pack
ok op@
- Commit:
bfb5ee0b7372ae375143b9dee5552b8bec26cf05
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
open temporary files needed for delta application in got_repo_open()
This prepares for callers of got_repo_open() that cannot afford to
open files in /tmp, such as gotwebd. In a follow-up change, we could
ask such callers to pass in the required amount of open temporary files.
One consequence is that got_repo_open() now requires the "cpath" pledge
promise. Add the "cpath" promise to affected callers and remove it once
the repository has been opened.
ok tracey
- Commit:
7d0d49208626da2cfa2ffe4001e2f6123ede40be
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
run the search for deltas to reuse in got-read-pack
This significantly speeds up the deltification step of packing by
avoiding imsg traffic. gotadmin no longer requests individual raw
deltas from got-read-pack to check whether it can reuse them.
Instead, got-read-pack obtains a list of objects we want to pack,
and hands back the list of all deltas in its pack file which can be
reused. Messages are now batched such that imsg buffers are filled
as much as possible.
Another advantage is that deltas we are not going to reuse will
no longer be written to the delta cache file, saving disk space.
Before this patch, any raw delta candidate was written to the
delta cache file by got-read-pack, and the decision whether to
reuse the delta happened afterwards in the gotadmin process.
Code for reading individual raw deltas is now unused and could be
removed at some point.
ok op@
- Commit:
9249e7e337edcfd344dc416d11ad4274c90a02f5
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
store deltas in compressed form while packing, both in memory and cache file
This reduces memory and disk space consumption during packing.
with tweaks + memleak on error fix from op@
ok op@
- Commit:
ec242592d329728975bf10a1196907167de7fed0
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
inline struct got_object_id in struct got_object_qid
Saves us from doing a malloc/free call for every item on the list.
ok op@
- Commit:
945f922947fbf90d4ae30e870a0d0262cf12bea8
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
stop relying on commit cache for good performance of got_object_id_by_path()
Instead of internally opening and closing the same commit object over and
over again, require callers to pass an open commit object in. Avoids an
inherent dependency on the commit object cache for reasonable performance.
ok op@