unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 28024@debbugs.gnu.org
Subject: [bug#28024] [PATCH 4/5] services: Update the Tailon service for Tailon 1.3.0.
Date: Wed,  9 Aug 2017 09:06:03 +0100	[thread overview]
Message-ID: <20170809080604.6236-4-mail@cbaines.net> (raw)
In-Reply-To: <20170809080604.6236-1-mail@cbaines.net>

Tailon 1.3.0 (upgraded from 1.1.1) adds support for HTTP authentication.

* gnu/services/admin.scm (<tailon-configuration-file>): Add http-auth and
  users configuration values.
  (tailon-configuration-file-http-auth, tailon-configuration-file-users): New
  procedures.
  (tailon-configuration-file-compiler): Add support for the http-auth and
  users configuration options.
* doc/guix.texi (Monitoring Services): Document authentication for Tailon.
---
 doc/guix.texi          | 18 ++++++++++++++++++
 gnu/services/admin.scm | 24 +++++++++++++++++++-----
 2 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index e4903be83..c7787e4a8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13774,6 +13774,24 @@ Initial line wrapping state in the web interface. Set to @code{#t} to
 initially wrap lines (the default), or to @code{#f} to initially not
 wrap lines.
 
+@item @code{http-auth} (default: @code{#f})
+HTTP authentication type to use. Set to @code{#f} to disable
+authentication (the default). Supported values are @code{"digest"} or
+@code{"basic"}.
+
+@item @code{users} (default: @code{#f})
+If HTTP authentication is enabled (see @code{http-auth}), access will be
+restricted to the credentials provided here. To configure users, use a
+list of pairs, where the first element of the pair is the username, and
+the 2nd element of the pair is the password.
+
+@example
+(tailon-configuration-file
+  (http-auth "basic")
+  (users     '(("user1" . "password1")
+               ("user2" . "password2"))))
+@end example
+
 @end table
 @end deftp
 
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index 19169427c..e24aebae2 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -59,8 +59,8 @@
             tailon-configuration-file-tail-lines
             tailon-configuration-file-allowed-commands
             tailon-configuration-file-debug?
-            tailon-configuration-file-wrap-lines
-
+            tailon-configuration-file-http-auth
+            tailon-configuration-file-users
 
             <tailon-configuration>
             tailon-configuration
@@ -224,7 +224,11 @@ for ROTATION."
   (debug?                  tailon-configuration-file-debug?
                            (default #f))
   (wrap-lines              tailon-configuration-file-wrap-lines
-                           (default #t)))
+                           (default #t))
+  (http-auth               tailon-configuration-file-http-auth
+                           (default #f))
+  (users                   tailon-configuration-file-users
+                           (default #f)))
 
 (define (tailon-configuration-files-string files)
   (string-append
@@ -254,7 +258,7 @@ for ROTATION."
     (($ <tailon-configuration-file> files bind relative-root
                                     allow-transfers? follow-names?
                                     tail-lines allowed-commands debug?
-                                    wrap-lines)
+                                    wrap-lines http-auth users)
      (text-file
       "tailon-config.yaml"
       (string-concatenate
@@ -273,7 +277,17 @@ for ROTATION."
                                         (string-join allowed-commands ", ")
                                         "]"))
           ,@(if debug? '(("debug" . "true")) '())
-          ("wrap-lines" . ,(if wrap-lines "true" "false")))))))))
+          ("wrap-lines" . ,(if wrap-lines "true" "false"))
+          ("http-auth" . ,http-auth)
+          ("users" . ,(if users
+                          (string-concatenate
+                           (cons "\n"
+                                 (map (match-lambda
+                                       ((user . pass)
+                                        (string-append
+                                         "  " user ":" pass)))
+                                      users)))
+                          #f)))))))))
 
 (define-record-type* <tailon-configuration>
   tailon-configuration make-tailon-configuration
-- 
2.14.0

  parent reply	other threads:[~2017-08-09  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  7:29 [bug#28024] [PATCH] Upgrade Tailon from 1.1.1 to 1.3.0 Christopher Baines
2017-08-09  8:06 ` [bug#28024] [PATCH 1/5] gnu: Add python-tornado-http-auth Christopher Baines
2017-08-09  8:06   ` [bug#28024] [PATCH 2/5] gnu: Update tailon to version 1.3.0 Christopher Baines
2017-08-09  8:06   ` [bug#28024] [PATCH 3/5] services: Add missing wrap-lines option to tailon Christopher Baines
2017-08-09  8:06   ` Christopher Baines [this message]
2017-08-09  8:06   ` [bug#28024] [PATCH 5/5] services: admin: Simplify the handling of the Tailon debug? option Christopher Baines
2017-08-09 20:51 ` [bug#28024] [PATCH] Upgrade Tailon from 1.1.1 to 1.3.0 Marius Bakke
2017-08-09 23:43   ` bug#28024: " Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809080604.6236-4-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=28024@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).