Wednesday, January 28, 2009

SVN commit hook

If you need to enforce certain patterns in commit messages for svn (eg. ticket nos etc) create a script in ~repos/hooks/pre-commit :

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text of form Feedback nnnnn:

SVNLOOK=/usr/local/bin/svnlook
match=`$SVNLOOK log -t "$TXN" "$REPOS" | grep -i 'feedback.*[0-9]:'| wc -c`
if [ $match -eq 0 ]
then
echo "COMMIT HAS FAILED:Log message does not contain feedback number eg. feedback nnnn: commit message" 2>&1
exit 1
else
exit 0
fi

exit 0

Thursday, January 15, 2009

Apache SSL config on Solaris 10 for 443

After installing most recent Apache on our Solaris 10 box we got a lot of errors with the default config for listening on SSL. Many many lines like :

(128)Network is unreachable: connect to listener on [::]:443



Basically on Solaris Listen 443 doesn't hack it anymore. If you want to listen on all interfaces use :

Listen 0.0.0.0:443

IE 7 behaviour when passed pdf via https

We have had a very odd issue with IE7 being sent pdf files over https.

Standard headers that look like this :

Cache-Control: no-cache, must-revalidate
Content-Disposition: attachment;filename=mysecretpdffile.pdf
Content-Type: application/pdf
Content-Length: 19180
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

Work fine under IE 5/5.5/6, Opera, Safari et al, but IE 7 reports that the content is not available.

After a bit of searching I found an excellent post at :

http://in2.php.net/manual/en/function.header.php#74736

For us adding the following headers in Java have resolved the issue :

response.setHeader( "Pragma", "public" );
response.setHeader( "Content-Transfer-Encoding", "binary" );
response.setHeader( "Expires", "0" );
response.setHeader( "Cache-Control", "must-revalidate, post-check=0, pre-check=0" );