~ruther/guix-local

16dbd20852ff789f927c28317be014361a41b509 — Zacchaeus 10 months ago 6768e33
services: tor: add auto-start?

* gnu/services/networking.scm (tor-configuration): Add `auto-start?' field.
Fix indent.
* doc/guix.texi (tor-configuration): Document this.

Change-Id: I9339291e3329d615550f97e9cc0f0d773f0d1c51
Reviewed-by: André Batista <nandre@riseup.net>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2 files changed, 9 insertions(+), 1 deletions(-)

M doc/guix.texi
M gnu/services/networking.scm
M doc/guix.texi => doc/guix.texi +3 -0
@@ 23231,6 23231,9 @@ For any transport plugin you include in this list, appropriate
configuration line to enable transport plugin will be automatically
added to the default configuration file.

@item @code{auto-start?} (default: @code{#t})
Whether or not to start the Tor daemon on boot.

@end table
@end deftp


M gnu/services/networking.scm => gnu/services/networking.scm +6 -1
@@ 187,6 187,7 @@
            tor-configuration-socks-socket-type
            tor-configuration-control-socket-path
            tor-configuration-transport-plugins
            tor-configuration-auto-start
            tor-onion-service-configuration
            tor-onion-service-configuration?
            tor-onion-service-configuration-name


@@ 1171,7 1172,9 @@ applications in communication.  It is used by Jami, for example.")))
  (control-socket?  tor-configuration-control-socket-path
                    (default #f))
  (transport-plugins tor-configuration-transport-plugins
                    (default '())))
                     (default '()))
  (auto-start?      tor-configuration-auto-start
                    (default #t)))

(define %tor-accounts
  ;; User account and groups for Tor.


@@ 1284,6 1287,7 @@ HiddenServicePort ~a ~a~%"
  "Return a <shepherd-service> running Tor."
  (let* ((torrc (tor-configuration->torrc config))
         (transport-plugins (tor-configuration-transport-plugins config))
         (auto-start? (tor-configuration-auto-start config))
         (tor   (least-authority-wrapper
                 (file-append (tor-configuration-tor config) "/bin/tor")
                 #:name "tor"


@@ 1320,6 1324,7 @@ HiddenServicePort ~a ~a~%"
           (start #~(make-forkexec-constructor
                     (list #$tor "-f" #$torrc)
                     #:user "tor" #:group "tor"))
           (auto-start? auto-start?)
           (stop #~(make-kill-destructor))
           (actions (list (shepherd-configuration-action torrc)))
           (documentation "Run the Tor anonymous network overlay.")))))