aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-27 13:03:17 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-27 13:03:17 +0000
commit485b79a6de5b7c2f726b7b5f3ea6ee2665d8ef34 (patch)
tree5029a17a9ba655230889ff9379b331c2e9944d05
parent6f8ac2eccc1112a4ffaeaea612e5364cc0b229b5 (diff)
downloaddata-service-485b79a6de5b7c2f726b7b5f3ea6ee2665d8ef34.tar
data-service-485b79a6de5b7c2f726b7b5f3ea6ee2665d8ef34.tar.gz
Add a page to show the public key used to sign substitutes
-rw-r--r--Makefile.am1
-rw-r--r--guix-data-service/web/nar/controller.scm4
-rw-r--r--guix-data-service/web/nar/html.scm39
3 files changed, 44 insertions, 0 deletions
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 <mail@cbaines.net>
+;;;
+;;; 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
+;;; <http://www.gnu.org/licenses/>.
+
+(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.")))))))))