gnu: tzdata: Update source URI.
[jackhill/guix/guix.git] / gnu / services / vpn.scm
index f577e08..cbb4a79 100644 (file)
@@ -1,5 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
       #f))
 
 (define (serialize-tls-auth role location)
-  (serialize-field 'tls-auth
-                   (string-append location " " (match role
-                                                 ('server "0")
-                                                 ('client "1")))))
+  (if location
+      (serialize-field 'tls-auth
+                       (string-append location " " (match role
+                                                     ('server "0")
+                                                     ('client "1"))))
+      #f))
 (define (tls-auth? val)
   (or (eq? val #f)
       (string? val)))
@@ -278,7 +282,7 @@ by the authority given in @code{ca}.")
 
    (key
     (string "/etc/openvpn/client.key")
-    "The key of the machine the daemon is running on. It must be the whose
+    "The key of the machine the daemon is running on. It must be the key whose
 certificate is @code{cert}.")
 
    (comp-lzo?
@@ -350,7 +354,7 @@ channel to protect against DoS attacks.")
 
    (client-to-client?
     (boolean #f)
-    "When true, clients are alowed to talk to each other inside the VPN.")
+    "When true, clients are allowed to talk to each other inside the VPN.")
 
    (keepalive
     (keepalive '(10 120))
@@ -366,7 +370,7 @@ element is the timeout before considering the other side down.")
    (status
     (string "/var/run/openvpn/status")
     "The status file. This file shows a small report on current connection. It
-is trunkated and rewritten every minute.")
+is truncated and rewritten every minute.")
 
    (client-config-dir
     (openvpn-ccd-list '())
@@ -444,7 +448,9 @@ is trunkated and rewritten every minute.")
          (shell (file-append shadow "/sbin/nologin")))))
 
 (define %openvpn-activation
-  #~(mkdir-p "/var/run/openvpn"))
+  #~(begin
+      (use-modules (guix build utils))
+      (mkdir-p "/var/run/openvpn")))
 
 (define openvpn-server-service-type
   (service-type (name 'openvpn-server)