Commits
- Commit:
3bf0e21f50b11c683f08a06c8ab362fe220adc2b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add a lock for the cleanup operation
This adds the functions got_repo_cleanup_prepare() and _complete()
to lock/unlock the repository to prevent multiple `gotadmin cleanup'
or `git gc' operations to run in parallel.
improvements and ok stsp@
- Commit:
b156a14e478c9485a080a24f237f70b6c8984182
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
reword misleading comment in struct got_repository WRT struct got_pack
- Commit:
5e187e2b4b0695966e135747400039b46a6992d1
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
gotd no longer uses chroot; remove comments suggesting otherwise
- Commit:
b54930d53597467f9112f45e9bfd192e352531ac
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add got_repo_get_object_format()
and use it to avoid hardcoding the digest type in a few places.
ok stsp@
- Commit:
27749ea2ddbc482ad434ed865e0f855313db0a27
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got-read-gitconfig: send key-value pairs for extensions
Most extension allow only for a boolean value so the current behaviour
of just sending the extension with a trueish value is fine. However,
some extensions that we could eventually support (like "objectformat")
have a string value. This is a preparatory step towards that.
ok stsp@
- Commit:
1b3e8e8674ebd24834b549a70d90487307d0f3bf
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use sub-second precision when checking for objects/pack/ modification
Convert from st.m_time (second-precision time_t) to st.m_tim (struct timespec).
To compensate for the potential case where a filesystem provides resolution
in seconds only, always read the directory if no pack files are known to exist.
Otherwise, there is a race condition when gotd repo_write creates a new pack
and a request arrives for repo_read shortly after. Caught by a regression test
for gotd on empty repositories. Test failure pointed out by Mikhail.
ok op@
- 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:
b9de8018be96c42d3421711a341c1fc8f6d7e0fb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move declaration of got_privsep_child out of got_lib_privsep.h
This declaration is the only reason why got_lib_privsep.h must be
included in order to use got_lib_repository.h. Moving this declaration
will allow for cleaning up unnecessary includes of got_lib_privsep.h.
- Commit:
6a800804535a75203abfb3708e68a661c1c89958
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move code for reading Git's config file into new file read_gitconfig_privsep.c
The end goal here is to remove the dependency of repository.c on privsep.c
during compilation.
- Commit:
b8a4401b8e46c0a32b824433c648ea749898616b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
refresh our pack-index path list if the mtime of objects/pack has changed
ok op@
- Commit:
61af9b215c06bece11deb27d941b390b81e0f8c6
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement support for commit coloring in got-read-pack for speed
ok op, tracey
- Commit:
cfcf1cbc17e0ba04db86f31e48233e0ef2e9fd6d
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
reduce GOT_PACK_CACHE_SIZE to 32, otherwise it uses too many open files
found by tracey
- Commit:
9b576444ae8786f3cc494c57cb8e7a64b74970db
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
cache a list of known pack index files when the repository is opened
Avoids overhead due to readdir calls while searching a pack index.
ok op@
- Commit:
67fd68496517d3103b130a1085efdd4591bd7416
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
reuse existing deltas when creating pack files
tested by thomas, naddy, and myself
- Commit:
d3c116bf7268bde4ceb3311eb4ed995fc4776487
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
cache raw objects in order to speed up gotadmin pack
- Commit:
f8b19efda6453501f8bc4ce868f953b703dca576
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use RB_TREE instead of STAILQ to manage packindex bloom filters; much faster
- Commit:
b343c297c60d4200da952ab5b2843eec39ed42b1
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use a bloom filter to avoid pointless pack index searches
- Commit:
abc59930d57a2d46c310e1b0c758c948554bc1af
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
indentation fixes
- Commit:
1124fe406f09a7d5d995da60e6251e3440226d40
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
handle pack index files which lack a corresponding pack file
ok millert
- Commit:
6c41426143b93f57eebf1aaac35dcee4fa3fc282
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
cap pack file cache size at 1/8 of the current open file desciptor limit
- Commit:
159a21e5a66248bba48b1b665ff4c2c3c61b2240
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
increase pack index cache size from 16 to 64 to improve performance
This can make a huge difference on repositories which contain more than
16 pack files, at the expense of additional open file handles.
My test case was a ports.git repository with > 60 pack files (these
accumulate due to 'got fetch', and 'git repack -a' would condense them).
With cache size 16 'got update' in /usr/ports took more than 60 seconds.
With cache size 64 the same command took less than 5 seconds.
The root cause is probably that mapping and unmapping large files over
and over again is expensive on OpenBSD.
- Commit:
6d5a9006ab2a400b488b9e93ec9647fb9b2a0930
- From:
- Yang Zhong <yzhong@freebsdfoundation.org>
- Date:
add fd field to got_repository, modify got_packidx_open to use fds
These changes are intended to make got more compatible with
FreeBSD's Capsicum.
ok stsp
- Commit:
20b7abb3fa8e5b46bacd07df9f85cfd7edc5a4c9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
detect unknown repository format extensions (such as sha256 format)
ok millert
- Commit:
50b0790ed9a28fced631f31e5b7ca76a9a610ea5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add per-worktree got.conf(5) file in the .got directory; ok millert
- Commit:
257add310e4b16ae43b467b91f66b773da39f470
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add got.conf(5) configuration file
ok tracey