diff --git a/Makefile.am b/Makefile.am index 5f89871..ba541ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -105,6 +105,7 @@ SOURCES = \ guix-data-service/web/jobs/controller.scm \ guix-data-service/web/jobs/html.scm \ guix-data-service/web/nar/controller.scm \ + guix-data-service/web/nar/html.scm \ guix-data-service/web/query-parameters.scm \ guix-data-service/web/render.scm \ guix-data-service/web/repository/controller.scm \ diff --git a/guix-data-service/web/nar/controller.scm b/guix-data-service/web/nar/controller.scm index 755bdfb..53419e0 100644 --- a/guix-data-service/web/nar/controller.scm +++ b/guix-data-service/web/nar/controller.scm @@ -32,6 +32,7 @@ #:use-module (guix base64) #:use-module (guix serialization) #:use-module (guix-data-service web render) + #:use-module (guix-data-service web nar html) #:use-module (guix-data-service model derivation) #:export (nar-controller @@ -66,6 +67,9 @@ ((key . value) (format #f "~a: ~a~%" key value))) %nix-cache-info)))) + (('GET "substitutes") + (render-html + #:sxml (view-substitutes (%narinfo-signing-public-key)))) (('GET "nar" derivation) (render-nar request mime-types diff --git a/guix-data-service/web/nar/html.scm b/guix-data-service/web/nar/html.scm new file mode 100644 index 0000000..596d16b --- /dev/null +++ b/guix-data-service/web/nar/html.scm @@ -0,0 +1,39 @@ +;;; Guix Data Service -- Information about Guix over time +;;; Copyright © 2019 Christopher Baines +;;; +;;; This program is free software: you can redistribute it and/or +;;; modify it under the terms of the GNU Affero General Public License +;;; as published by the Free Software Foundation, either version 3 of +;;; the License, or (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; Affero General Public License for more details. +;;; +;;; You should have received a copy of the GNU Affero General Public +;;; License along with this program. If not, see +;;; . + +(define-module (guix-data-service web nar html) + #:use-module (ice-9 match) + #:use-module (gcrypt pk-crypto) + #:use-module (guix-data-service web view html) + #:export (view-substitutes)) + +(define (view-substitutes narinfo-signing-public-key) + (layout + #:body + `(,(header) + (div + (@ (class "container")) + (div + (@ (class "row")) + (div + (@ (class "col-sm-12")) + (h1 "Substitutes") + ,@(if (canonical-sexp? narinfo-signing-public-key) + `((h3 "Public key") + (pre + ,(canonical-sexp->string narinfo-signing-public-key))) + `((p "No signing key available.")))))))))