Commits
- Commit:
00b3e9ae14f04a45f1ca7445bade6b41a6e8a1c5
- From:
- Omar Polo <op@omarpolo.com>
- Date:
replace malloc+memcpy with strndup. no functional change intended
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:
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:
8f137979fc5e284a136cf8950e8b3895d7ea208b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
get rid of unneeded recv_imsg_error calls
got_privsep_recv_imsg users don't need to bother to look whether the
imsg type is GOT_IMSG_ERROR because got_privsep_recv_imsg already
takes care of that and turns GOT_IMSG_ERROR into `struct got_error's
automatically.
ok stsp@
- Commit:
80985c16b7649d82b559b180b486ac017c864e5a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
rework got_privesp_recv_tree to use got_privsep_recv_imsg
ok stsp@
- Commit:
d68f2c0e20f502d7bea2f0136527683f830b3d6c
- From:
- Josh Rickmar <jrick@zettaport.com>
- Date:
add signer_id option to got.conf(5)
Setting this option will cause 'got tag' to sign all created tags using
the SSH key, unless overridden by the -s flag.
ok stsp@
- Commit:
4d5ee9564a9e46a1f634f619833c62f636cfbdc1
- From:
- Josh Rickmar <jrick@zettaport.com>
- Date:
create and verify tags signed by SSH keys
This adds a new -s flag to 'got tag' that specifies the signer
identity (for example, a key file) of the tagger. The tag object will
include a signature that validates each of the tag object headers and
the tag message.
Verifying these signed tags requires maintaining an allowed signers
file which maps signer identities (i.e. the email address of the
tagger) to SSH public keys. See ssh-keygen(1) for more details of the
allowed signers file. After creating this file and providing the path
to it in got.conf(5) using the allowed_signers option, tags may be
verified using with 'got tag -V tag_name'. The return code will be
non-zero if a signature fails to verify.
ok stsp@
- Commit:
6c77e0337609d941281f017b3e0229ae45a35b7a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix imsg_add TREE_ENTRY: Result too large on i386
There's a math error when computing the size of one entries in the
batching code. Reported by semarie, ok semarie stsp
- Commit:
61af9b215c06bece11deb27d941b390b81e0f8c6
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement support for commit coloring in got-read-pack for speed
ok op, tracey
- Commit:
336075a42a5ae0fa322db734c481d21998e82bb8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
build with -Wmissing-prototypes
ok stsp@
- Commit:
80f51a9eb717ad2fcb3df8870e03767bcf82d845
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix unexpected imsg error after incomplete enumeration in got-read-pack
reported by jrick and op@
ok op@
- Commit:
031611fc2bfa569627e4bc9f8f6092e6d47c2503
- From:
- Omar Polo <op@omarpolo.com>
- Date:
memset all stack-allocated structs used to send messages; ok stsp@
- Commit:
1a69d37faef36a64fd4252e75b9149b2b453752d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
zero the whole struct got_imsg_object before sending it
otherwise some fields may be unitialized and fail the validation done on
the receiving side.
ok stsp@
- Commit:
afd3149814241c83780b6f8df65ea0cfa39fbcb8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a harmless off-by-one from previous commit
- Commit:
a5e587e014cba0e9dc62ab1817983c89851cbe93
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a bug in got_privsep_send_object_idlist() exposed by recent changes
The old code did not work correctly if only a single object Id was to
be sent to got-read-pack. Make got-read-pack error out if the list
of commits for object enumeration is empty to catch this problem if
it occurs again.
Found by the send_basic test, which was failing with GOT_TEST_PACK=1
ok tracey
- 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:
b4b1b9c0333d1aedca89dd35c4e60ac8684cddac
- From:
- Omar Polo <op@omarpolo.com>
- Date:
remove trailing whitespaces
- Commit:
0fca100c2fe2bfd8e88b22246068addedecd343d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
compute object size, not pointer size
in this case they're luckily the same; got_imsg_object_idlist and
got_imsg_reused_delta only have one size_t long field.
ok stsp@
- Commit:
c98b0f0b57cce101941efd993eac8b9e3be2a70a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
strictier validation for data received from libexec helpers
use correct error code and ok stsp@
- Commit:
3e6054c427d642654d5abed63965eead037a7b2f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
drop unused variable
- Commit:
bf31a716e240db9b58ddd53f468b3b23e49237c2
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use strndup instead of malloc+memcpy
Simplifies the reading of the author/committer string and makes also the
code shorter.
ok stsp@
- Commit:
71fee5a34a12ea7a545b3c4dfbe91023c8f7c69a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
don't check datalen when calling recv_imsg_error
recv_imsg_error already checks the size of the message, and it does so
more precisely than the removed code.
ok stsp@
- 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:
f09728336c4d35bfa49210e640b1ceb8989fe3d5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix wrong line wrap; pointed out by op@