[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: hydra/goggles: Simplify controller.
From: |
Ricardo Wurmus |
Subject: |
02/02: hydra/goggles: Simplify controller. |
Date: |
Thu, 23 Apr 2020 12:57:28 -0400 (EDT) |
rekado pushed a commit to branch master
in repository maintenance.
commit 4309affabd50dbb87b9224b4828c03c2e518bb67
Author: Ricardo Wurmus <address@hidden>
AuthorDate: Thu Apr 23 18:55:48 2020 +0200
hydra/goggles: Simplify controller.
* hydra/goggles.scm (%config): Add "channels" key.
(%controller): Use it.
---
hydra/goggles.scm | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/hydra/goggles.scm b/hydra/goggles.scm
index f00c368..d0e10ed 100755
--- a/hydra/goggles.scm
+++ b/hydra/goggles.scm
@@ -17,7 +17,8 @@
(define %log-root "/var/www/.well-known/all-logs/")
(define %config
'((host . "0.0.0.0")
- (port . 3333)))
+ (port . 3333)
+ (channels . ("guix" "guile" "bootstrappable"))))
(define file-mime-types
'(("css" . (text/css))
@@ -190,18 +191,10 @@ freenode." channel))
(match-lambda
(('GET)
(render-html (index "guix")))
- (('GET "guix")
- (render-html (index "guix")))
- (('GET "guile")
- (render-html (index "guile")))
- (('GET "bootstrappable")
- (render-html (index "bootstrappable")))
- (('GET "guix" path ...)
- (render-log (string-append %log-root "/#guix/") path))
- (('GET "guile" path ...)
- (render-log (string-append %log-root "/#guile/") path))
- (('GET "bootstrappable" path ...)
- (render-log (string-append %log-root "/#bootstrappable/") path))
+ (('GET (? (cut member <> (assoc-ref %config 'channels)) channel))
+ (render-html (index channel)))
+ (('GET (? (cut member <> (assoc-ref %config 'channels)) channel) path ...)
+ (render-log (string-append %log-root "/#" channel "/") path))
(('GET path ...)
(render-log (string-append %log-root "/#guix/") path))))