Commits
- Commit:
60c140aebbd1069094e75d8358cb305bc305b7f8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use a caller-specified size limit for mapped files in got_object_raw_alloc()
Without this we end up being confused about whether a raw object has
been mapped into memory, leading to crashes.
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:
eb81bc23c735e8aa9eaee796a230c7d7c76657ba
- From:
- Tracey Emery <tracey@traceyemery.net>
- Date:
move got_opentempfd out of open_blob. ok stsp@
- Commit:
db9b9b1c2b70d98419e70b05e7283b2284bedbec
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
0ab4c95723904e176687f5edc131bdf422dd261a
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
e44d939152693c16e95d2855b539ad6b30e81b15
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
cee6a7ea556f9f3ae0f50df959c2acd8cb59bf80
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement object enumeration support in got-read-pack
ok op@
- Commit:
fae7e03842e8618973f4d4910a86a52d881ab2ab
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
2d9e6abf243a0a1895786fa9002b28d69a0f6fea
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
d7b5a0e827bb38e5c8502f0ba8d7838fedaba19b
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
67fd68496517d3103b130a1085efdd4591bd7416
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
reuse existing deltas when creating pack files
tested by thomas, naddy, and myself
- Commit:
64a8571e126da3ef8c0488551727b87e4509b50d
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
map raw object files into memory while packing if possible
- Commit:
94dac27cd14d635dc83d202ffa7ed21dad0de278
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
raw object blocksize and read buffer were unused; remove them
- Commit:
284e76635399152995c605f3dd640d4ac99488da
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove unused internal raw object API functions
- Commit:
d3c116bf7268bde4ceb3311eb4ed995fc4776487
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
cache raw objects in order to speed up gotadmin pack
- Commit:
cc7a354afc4ae05de465ac2cf97b558fec5b271f
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
reuse temporary files which were not used by got_object_raw_open()
- Commit:
d5c81d448ae4eec21053152e1c82c66eb11ca7a4
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
verify object ID checksums while loose objects are being accessed
- Commit:
b3d68e7f99c78cbcf672100fb14310e4b4f18482
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement 'gotadmin cleanup'
- Commit:
762d73f46b73795f4f1defc7cbadd0a3c3f17604
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
introduce got_object_open_loose_fd() for library-internal use
- Commit:
59d1e4a0a9c19debc27746357d97084b59a76db8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement raw object data access; this will be required for packing
- Commit:
ca6e02acaa175cf833a3424ff1c4842445c0109f
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add support for first-parent history traversal to got-read-pack
- Commit:
5aa813935b6489921083da5ed9459a1cfb8a03e3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add copyright year for files already touched in 2020
- Commit:
2c98ee284cc81440281858351f0aa94cbca9a83c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
NAME_MAX does not account for a terminating NUL
- Commit:
56e0773df7e12fc69c1f6f9d171c93fd78a13d0e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
convert tree entries from SIMPLEQ to an array
- Commit:
5f25cc858267bf6a334ed243cd4ceaa4bcb851d6
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove obj->path_packfile which is unused nowadays; saves a few free() calls