From 1fc4577e10fec57c501d95818e3d062abcb280d2 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 1 Dec 2012 13:52:31 +0000 Subject: [PATCH] Add an `update-hook' configuration tweak. This is for publishing the archive to a web server or similar. --- bin/update | 3 +++ etc/config.tcl | 4 ++++ lib/func.tcl | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/bin/update b/bin/update index bc68410..09a4c60 100755 --- a/bin/update +++ b/bin/update @@ -53,4 +53,7 @@ exec openssl ca -config "etc/openssl.conf" -updatedb 2>@1 exec openssl ca -config "etc/openssl.conf" -gencrl | \ openssl crl -text -out "crl" 2>@1 +## Call the user hook. +update-hook + ###----- That's all, folks -------------------------------------------------- diff --git a/etc/config.tcl b/etc/config.tcl index 8192461..c471518 100644 --- a/etc/config.tcl +++ b/etc/config.tcl @@ -17,3 +17,7 @@ set P(tls-server) { start-skew 1 expire-interval 28 } + +proc update-hook {} { + exec rsync -av --delete-after crl ca.cert cert req test/publish 2>@stderr +} diff --git a/lib/func.tcl b/lib/func.tcl index ece7e5b..04bd206 100644 --- a/lib/func.tcl +++ b/lib/func.tcl @@ -86,6 +86,11 @@ array unset P set C(ca-period) 3650 set C(archive-interval) 32 +## The update hook function. +proc update-hook {} { + ## Called by `bin/update': might publish data to a web server, for example. +} + ## Read the user configuration. if {[file exists "$CERTROOT/etc/config.tcl"]} { source "$CERTROOT/etc/config.tcl" -- 2.11.0