From 46f58390cb5a01d6cb59070e8e76e9a78e9b933e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 22 Mar 2017 11:26:05 +0100 Subject: publish: Add '--public-key' and '--private-key'. * guix/scripts/publish.scm (show-help, %options): Add --public-key and --private-key. * doc/guix.texi (Invoking guix publish): Document it. --- doc/guix.texi | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 8d27dd2031..6c4e1800c1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6523,6 +6523,18 @@ This allows the user's Guix to keep substitute information in cache for guarantee that the store items it provides will indeed remain available for as long as @var{ttl}. +@item --public-key=@var{file} +@itemx --private-key=@var{file} +Use the specific @var{file}s as the public/private key pair used to sign +the store items being published. + +The files must correspond to the same key pair (the private key is used +for signing and the public key is merely advertised in the signature +metadata). They must contain keys in the canonical s-expression format +as produced by @command{guix archive --generate-key} (@pxref{Invoking +guix archive}). By default, @file{/etc/guix/signing-key.pub} and +@file{/etc/guix/signing-key.sec} are used. + @item --repl[=@var{port}] @itemx -r [@var{port}] Spawn a Guile REPL server (@pxref{REPL Servers,,, guile, GNU Guile -- cgit v1.2.3 From 4bb5e0aeb3b7f5396dff1fcd2b85b65af5e07038 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 22 Mar 2017 14:00:06 +0100 Subject: publish: Add '--nar-path'. * guix/scripts/publish.scm (show-help, %options): Add '--nar-path'. (%default-options): Add 'nar-path'. (guix-publish): Honor it. --- doc/guix.texi | 8 ++++++++ guix/scripts/publish.scm | 10 ++++++++++ 2 files changed, 18 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 6c4e1800c1..b57e219562 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6523,6 +6523,14 @@ This allows the user's Guix to keep substitute information in cache for guarantee that the store items it provides will indeed remain available for as long as @var{ttl}. +@item --nar-path=@var{path} +Use @var{path} as the prefix for the URLs of ``nar'' files +(@pxref{Invoking guix archive, normalized archives}). + +By default, nars are served at a URL such as +@code{/nar/gzip/@dots{}-coreutils-8.25}. This option allows you to +change the @code{/nar} part to @var{path}. + @item --public-key=@var{file} @itemx --private-key=@var{file} Use the specific @var{file}s as the public/private key pair used to sign diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index ba5be04818..d8ac72f4ef 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm @@ -71,6 +71,8 @@ Publish ~a over HTTP.\n") %store-directory) compress archives at LEVEL")) (display (_ " --ttl=TTL announce narinfos can be cached for TTL seconds")) + (display (_ " + --nar-path=PATH use PATH as the prefix for nar URLs")) (display (_ " --public-key=FILE use FILE as the public key for signatures")) (display (_ " @@ -152,6 +154,9 @@ compression disabled~%")) (leave (_ "~a: invalid duration~%") arg)) (alist-cons 'narinfo-ttl (time-second duration) result)))) + (option '("nar-path") #t #f + (lambda (opt name arg result) + (alist-cons 'nar-path arg result))) (option '("public-key") #t #f (lambda (opt name arg result) (alist-cons 'public-key-file arg result))) @@ -167,6 +172,9 @@ compression disabled~%")) (define %default-options `((port . 8080) + ;; By default, serve nars under "/nar". + (nar-path . "nar") + (public-key-file . ,%public-key-file) (private-key-file . ,%private-key-file) @@ -589,6 +597,7 @@ blocking." (sockaddr:addr addr) port))) (socket (open-server-socket address)) + (nar-path (assoc-ref opts 'nar-path)) (repl-port (assoc-ref opts 'repl)) ;; Read the key right away so that (1) we fail early on if we can't @@ -615,5 +624,6 @@ consider using the '--user' option!~%"))) (repl:spawn-server (repl:make-tcp-server-socket #:port repl-port))) (with-store store (run-publish-server socket store + #:nar-path nar-path #:compression compression #:narinfo-ttl ttl)))))) -- cgit v1.2.3