~ salmonella-environment-setup (master) 31f050e66325989f927177728b693c5a87689349


commit 31f050e66325989f927177728b693c5a87689349
Author:     Mario Domenech Goulart <mario.goulart@gmail.com>
AuthorDate: Mon Mar 24 22:15:03 2014 -0300
Commit:     Mario Domenech Goulart <mario.goulart@gmail.com>
CommitDate: Mon Mar 24 22:15:03 2014 -0300

    salmonella/awful: add configuration file for awful-salmonella-tar

diff --git a/awful/awful-salmonella-tar.conf b/awful/awful-salmonella-tar.conf
new file mode 100644
index 0000000..c726b57
--- /dev/null
+++ b/awful/awful-salmonella-tar.conf
@@ -0,0 +1,43 @@
+;; -*- scheme -*-
+(use spiffy spiffy-sexpr-log awful awful-salmonella-tar intarweb)
+
+(root-path "/home/chicken/salmonella/reports")
+(split-log? #t)
+
+(access-log "/var/log/awful")
+(error-log "/var/log/awful/error.log")
+
+;;; For run-salmonella.logz
+(define (send-gzipped-file file)
+  (if (memq 'gzip (header-values 'accept-encoding
+                                 (request-headers (current-request))))
+      (with-headers '((content-encoding gzip))
+        (lambda ()
+          (send-static-file file)))
+      (send-response
+       code: 406
+       body: "<h1>406 - Only gzip-compressed content is available</h1>")))
+
+(mime-type-map
+ (append
+  (mime-type-map)
+  '(("logz"  . text/plain))))
+
+(file-extension-handlers
+ `(("logz"  . ,send-gzipped-file)))
+
+
+;;; Redirect .htmlz->.html and .svgz->.svg
+(define (compressed->uncompressed path)
+  (and (member (pathname-extension path) '("htmlz" "svgz"))
+       (list path)))
+
+(define-page compressed->uncompressed
+  (lambda (path)
+    (redirect-to (string-chomp path "z"))))
+
+
+;;; awful-salmonella-tar
+(cache-dir "/var/cache/awful-salmonella-tar")
+
+(awful-salmonella-tar "/")
Trap