~ salmonella-environment-setup (master) /awful/awful-salmonella-tar.conf


 1;; -*- scheme -*-
 2(import scheme)
 3(cond-expand
 4  (chicken-4
 5   (import chicken)
 6   (use awful awful-salmonella-tar intarweb spiffy spiffy-sexpr-log))
 7  (chicken-5
 8   (import (chicken pathname))
 9   (import awful awful-salmonella-tar intarweb spiffy spiffy-sexpr-log))
10  (else
11   (error "Unsupported CHICKEN version.")))
12
13(root-path "/home/chicken/salmonella/reports")
14(split-log? #t)
15
16(access-log "/var/log/awful")
17(error-log "/var/log/awful/error.log")
18
19;;; For run-salmonella.logz
20(define (send-gzipped-file file)
21  (if (memq 'gzip (header-values 'accept-encoding
22                                 (request-headers (current-request))))
23      (with-headers '((content-encoding gzip))
24        (lambda ()
25          (send-static-file file)))
26      (send-response
27       code: 406
28       body: "<h1>406 - Only gzip-compressed content is available</h1>")))
29
30(mime-type-map
31 (append
32  (mime-type-map)
33  '(("logz"  . text/plain))))
34
35(file-extension-handlers
36 `(("logz"  . ,send-gzipped-file)))
37
38
39;;; Redirect .htmlz->.html and .svgz->.svg
40(define (compressed->uncompressed path)
41  (and (member (pathname-extension path) '("htmlz" "svgz"))
42       (list path)))
43
44(define-page compressed->uncompressed
45  (lambda (path)
46    (redirect-to (string-chomp path "z"))))
47
48
49;;; awful-salmonella-tar
50(cache-dir "/var/cache/awful-salmonella-tar")
51
52(awful-salmonella-tar "/")
Trap