mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-25 20:19:18 -05:00
services: rsync: support binding rsync to a specific IP address
* gnu/services/rsync.scm (<rsync-configuration>)[address]: New field. (rsync-config-file): Honor it. * doc/guix.texi (Networking Services): Document new address rsync configuration option. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
69b249ecae
commit
1ea032fb5f
2 changed files with 8 additions and 1 deletions
|
@ -17158,6 +17158,10 @@ Data type representing the configuration for @code{rsync-service}.
|
||||||
@item @code{package} (default: @var{rsync})
|
@item @code{package} (default: @var{rsync})
|
||||||
@code{rsync} package to use.
|
@code{rsync} package to use.
|
||||||
|
|
||||||
|
@item @code{address} (default: @code{#f})
|
||||||
|
IP address on which @command{rsync} listens for incoming connections.
|
||||||
|
If unspecified, it defaults to listening on all available addresses.
|
||||||
|
|
||||||
@item @code{port-number} (default: @code{873})
|
@item @code{port-number} (default: @code{873})
|
||||||
TCP port on which @command{rsync} listens for incoming connections. If port
|
TCP port on which @command{rsync} listens for incoming connections. If port
|
||||||
is less than @code{1024} @command{rsync} needs to be started as the
|
is less than @code{1024} @command{rsync} needs to be started as the
|
||||||
|
|
|
@ -45,6 +45,8 @@ (define-record-type* <rsync-configuration>
|
||||||
rsync-configuration?
|
rsync-configuration?
|
||||||
(package rsync-configuration-package ; package
|
(package rsync-configuration-package ; package
|
||||||
(default rsync))
|
(default rsync))
|
||||||
|
(address rsync-configuration-address ; string | #f
|
||||||
|
(default #f))
|
||||||
(port-number rsync-configuration-port-number ; integer
|
(port-number rsync-configuration-port-number ; integer
|
||||||
(default 873))
|
(default 873))
|
||||||
(pid-file rsync-configuration-pid-file ; string
|
(pid-file rsync-configuration-pid-file ; string
|
||||||
|
@ -110,7 +112,7 @@ (define (rsync-activation config)
|
||||||
(define rsync-config-file
|
(define rsync-config-file
|
||||||
;; Return the rsync configuration file corresponding to CONFIG.
|
;; Return the rsync configuration file corresponding to CONFIG.
|
||||||
(match-lambda
|
(match-lambda
|
||||||
(($ <rsync-configuration> package port-number pid-file lock-file log-file
|
(($ <rsync-configuration> package address port-number pid-file lock-file log-file
|
||||||
use-chroot? share-path share-comment read-only?
|
use-chroot? share-path share-comment read-only?
|
||||||
timeout user group uid gid)
|
timeout user group uid gid)
|
||||||
(if (not (string=? user "root"))
|
(if (not (string=? user "root"))
|
||||||
|
@ -132,6 +134,7 @@ (define rsync-config-file
|
||||||
"pid file = " pid-file "\n"
|
"pid file = " pid-file "\n"
|
||||||
"lock file = " lock-file "\n"
|
"lock file = " lock-file "\n"
|
||||||
"log file = " log-file "\n"
|
"log file = " log-file "\n"
|
||||||
|
(if address (string-append "address = " address "\n") "")
|
||||||
"port = " (number->string port-number) "\n"
|
"port = " (number->string port-number) "\n"
|
||||||
"use chroot = " (if use-chroot? "true" "false") "\n"
|
"use chroot = " (if use-chroot? "true" "false") "\n"
|
||||||
(if uid (string-append "uid = " uid "\n") "")
|
(if uid (string-append "uid = " uid "\n") "")
|
||||||
|
|
Loading…
Reference in a new issue