Commit Briefs

e93ed5cc1c Thomas Adam

fix empty notification messages with multiple gotd notification targets

When multiple notification targets are configured only the first target received notification message content. The subsequent targets would read EOF when trying to read the content. Fix this issue and add regression test coverage for it, exercising existing test code with a gotd.conf file which contains two notification targets.


bdf7ef6f88 Thomas Adam

expose authenticated gotd user account in HTTP notifications

ok op@


c02f62d5c9 Thomas Adam

fix an fd leak in gotd's notify process

This leak resulted in the gotd notify process spinning on CPU in an imsg_read() -> EAGAIN loop once it ran out of file descriptors.


6d3ee6a573 Thomas Adam

revert part of previous commit; the parent process is not ephemeral

pointed out by op@


7ede118f9c Thomas Adam

prevent gotd notification process from exiting due to EPIPE

Ephermeral processes on the other end of a pipe might decide to exit which results in EPIPE when writing. This is not a fatal error but is somewhat expected during normal operation (at least until we improve the inter-process communication about notifications).


c50aaf5dd0 Thomas Adam

got-notify-http: use a UNIX timestamp for the date

Was suggested by Lucas some time ago. ok stsp@ with a tweak in the manual.


f0b0cfba3e Thomas Adam

got-notify-http: implement basic authentication

ok stsp


23022bc04f Thomas Adam

got-notify-http: add the repository name in the json

ok stsp


94a3f4e929 Thomas Adam

add got-notify-http

ok stsp@


af4fddcd55 Thomas Adam

fmt



b2ce1dae74 Thomas Adam

portable: enable got-notify-email

Now that gotd has the start of helpers, got-notify-email is the first. This is still behind the --enable-gotd flag.


ce1bfad9f1 Thomas Adam

add initial support for commit notifications to gotd(8)

At present only email notifications are implemented. Code for HTTP notifications is not yet finished, hence HTTP-related documentation remains hidden for now. This adds a new 'notify' process which has an "exec" pledge. It runs helper programs which implement the notification transport layer, such as got-notify-email which speaks SMTP. This design avoids having to link all of gotd with network libraries and related crypto libraries. Notification content is generated by the 'repo_write' process. Commit log messages and diffstats are written to a file which the 'notify' process will pass on to its helpers on stdin. The default output looks similar to 'got log -d'. If too many new commits are present the output looks similar to 'got log -s' instead. Tags always look like 'got tag -l'. The session process coordinates generation of notifications. It maintains a notification queue which holds one notification per updated reference, and passes notification requests from this queue to the 'repo_write' process for notification content creation and then to the 'notify' process for notification delivery. Only one notification can be in flight at a time to avoid file descriptor starvation if many references get updated in a single client session. ok op@