Blob
- Date:
- Message:
- 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@
- Actions:
- History | Blame | Raw File
1 .PATH:${.CURDIR}/../lib3 SUBDIR = libexec5 .include "../got-version.mk"7 .if ${GOT_RELEASE} == "Yes"8 BINDIR ?= ${PREFIX}/sbin9 .endif11 PROG= gotd12 SRCS= gotd.c auth.c repo_read.c repo_write.c log.c privsep_stub.c \13 listen.c imsg.c parse.y pack_create.c ratelimit.c deltify.c \14 bloom.c buf.c date.c deflate.c delta.c delta_cache.c error.c \15 gitconfig.c gotconfig.c inflate.c lockfile.c murmurhash2.c \16 object.c object_cache.c object_create.c object_idset.c \17 object_open_io.c object_parse.c opentemp.c pack.c path.c \18 read_gitconfig.c read_gotconfig.c reference.c repository.c \19 hash.c sigs.c pack_create_io.c pollfd.c reference_parse.c \20 repo_imsg.c pack_index.c session.c object_qid.c notify.c \21 commit_graph.c diffreg.c diff.c \22 diff_main.c diff_atomize_text.c diff_myers.c diff_output.c \23 diff_output_plain.c diff_output_unidiff.c \24 diff_output_edscript.c diff_patience.c26 CLEANFILES = parse.h28 MAN = ${PROG}.conf.5 ${PROG}.830 CPPFLAGS = -I${.CURDIR}/../include -I${.CURDIR}/../lib -I${.CURDIR}31 YFLAGS =33 .if defined(PROFILE)34 LDADD = -lutil_p -lz_p -lm_p -lc_p -levent_p35 .else36 LDADD = -lutil -lz -lm -levent37 .endif38 DPADD = ${LIBZ} ${LIBUTIL} ${LIBM} ${LIBEVENT}40 .if ${GOT_RELEASE} != "Yes"41 NOMAN = Yes42 .endif44 realinstall:45 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \46 -m ${BINMODE} ${PROG} ${BINDIR}/${PROG}48 .include <bsd.prog.mk>