summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorArun Isaac2022-07-01 01:25:58 +0530
committerArun Isaac2022-07-01 01:25:58 +0530
commitb15edb1e6910a8a2b4994d8225f2ec5097e648ab (patch)
tree4c026539c65cbd2940e1e84a73e89bb54948afd9 /bin
parent33ddc67e439a697907566b07f63be19b0d304f7b (diff)
downloadtissue-b15edb1e6910a8a2b4994d8225f2ec5097e648ab.tar.gz
tissue-b15edb1e6910a8a2b4994d8225f2ec5097e648ab.tar.lz
tissue-b15edb1e6910a8a2b4994d8225f2ec5097e648ab.zip
web: server: Make CSS a host-specific parameter.
* bin/tissue (tissue-run-web): Pass CSS as a host-specific parameter.
* tissue/web/server.scm (handler): Remove css argument. Accept CSS as
a host-specific parameter.
(start-web-server): Remove css argument.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tissue20
1 files changed, 14 insertions, 6 deletions
diff --git a/bin/tissue b/bin/tissue
index 2237652..2c739b3 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -251,12 +251,20 @@ Run a web search service reading configuration from CONFIG-FILE.
                                    listen-repl)
                            (make-unix-domain-server-socket #:path listen-repl))))))
        (start-web-server (listen->socket-address (assq-ref args 'listen))
-                         (or (assq-ref args 'hosts)
-                             ;; Assume current directory as default.
-                             `(("localhost"
-                                (indexed-repository . ,(getcwd)))))
-                         %xapian-index
-                         (tissue-configuration-web-css (load-config)))))))
+                         (map (match-lambda
+                                ((name parameters ...)
+                                 ;; Set CSS for each host.
+                                 (call-with-current-directory (assq-ref parameters 'indexed-repository)
+                                   (lambda ()
+                                     (cons name
+                                           (acons 'css
+                                                  (tissue-configuration-web-css (load-config))
+                                                  parameters))))))
+                              (or (assq-ref args 'hosts)
+                                  ;; Assume current directory as default.
+                                  `(("localhost"
+                                     (indexed-repository . ,(getcwd))))))
+                         %xapian-index)))))
 
 ;; This is a noop, since the index is built on any tissue command. It
 ;; exists just for the --help usage summary.