From: Simon South <simon@simonsouth.net>
To: 44435@debbugs.gnu.org
Cc: Simon South <simon@simonsouth.net>
Subject: [bug#44435] [PATCH v3 0/1] services: Add Transmission Daemon
Date: Sat, 5 Dec 2020 10:27:54 -0500 [thread overview]
Message-ID: <cover.1607175147.git.simon@simonsouth.net> (raw)
In-Reply-To: <cover.1604429058.git.simon@simonsouth.net>
Here's a new version of this patch that incorporates feedback[0] from Ludovic:
- transmission-password-hash now signals an error in a more conventional
manner, by raise'ing a &formatted-message condition, and uses Guile-GCrypt's
"sha1" shorthand procedure along with string->utf8 for a more compact
implementation.
- A missing pair of parentheses in transmission-daemon-shepherd-service has
been restored.
- User-facing strings have been wrapped with "G_" and the file added to
po/packages/POTFILES.in to permit internationalization. (I've done this for
every string, not just the one in transmission-password-hash.)
I've also added a small test suite that exercises the password-related
procedures exported by the service module, using values captured from
transmission-daemon itself. I've placed the file in tests/services, though
it's not clear this is the right location; tests/networking.scm also pertains
to a service, for instance. I can re-submit with the file relocated if need
be.
Finally, despite my earlier bravado[1] I've held off adding any system tests,
only because I now realize getting the system test suite running on the
machines I have available is going to be a project in and of itself. I do
intend to add these at a later date.
[0] https://lists.gnu.org/archive/html/guix-patches/2020-11/msg00551.html
[1] https://lists.gnu.org/archive/html/guix-patches/2020-11/msg00557.html
For convenience, here's my original cover letter:
This patch adds a service type for Transmission Daemon, the headless variant
of the Transmission BitTorrent client (https://transmissionbt.com/). Running
the client as a service this way makes it possible to share files over
BitTorrent continuously without requiring a user be logged in.
I've tried to make this as complete as possible but am especially interested
in geting feedback as this is my first attempt at creating a service
definition. A few things to point out:
- I've placed the code in a new "(gnu services file-sharing)" module and the
documentation in a new "File-Sharing Services" section of the manual, only
because these names seemed the most natural to me. ("Peer-to-peer" would be
too broad a categorization, I think, while "BitTorrent" too narrow.)
- The module exports two procedures, "transmission-password-hash" and
"transmission-random-salt", that together are my solution to the problem of
assigning a value to the daemon's "rpc-password" configuration setting.
Transmission clients seem to expect the user to supply a password in
plaintext in their "settings.json" file. At startup, the client generates a
random, eight-character salt value; hashes it and the password together; and
writes the result back to the settings file, after which the password
remains obscured. This obviously violates the functional nature of Guix, as
we don't expect services to be rewriting their own configuration files and
the use of a random salt value makes the process non-repeatable anyway.
I've documented in the manual how a user can use these two procedures to
create a suitable value for "rpc-password" that remains stable across system
reconfigurations, but perhaps you know of a better (or more conventional)
approach.
- I've added a custom "stop" procedure to the Shepherd service that gives the
daemon time to shut down before eventually killing its process. This is
necessary since the daemon performs some housekeeping and sends a final
update to BitTorrent trackers before it exits, which can take several
seconds or more; without this code, restarting the service usually fails as
the new daemon process finds the old one is still running and attached to
the port used for peer connections.
Again, the approach I've used to handle this seems reasonable to me but
perhaps you know of something better.
--
Simon South
simon@simonsouth.net
Simon South (1):
services: Add transmission-daemon service.
Makefile.am | 1 +
doc/guix.texi | 799 +++++++++++++++++++++++++++++++
gnu/local.mk | 1 +
gnu/services/file-sharing.scm | 804 ++++++++++++++++++++++++++++++++
po/packages/POTFILES.in | 1 +
tests/services/file-sharing.scm | 59 +++
6 files changed, 1665 insertions(+)
create mode 100644 gnu/services/file-sharing.scm
create mode 100644 tests/services/file-sharing.scm
--
2.29.2
next prev parent reply other threads:[~2020-12-05 15:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 12:37 [bug#44435] [PATCH 0/1] services: Add Transmission Daemon Simon South
2020-11-04 12:40 ` [bug#44435] [PATCH 1/1] services: Add transmission-daemon service Simon South
2020-11-07 14:12 ` Simon South
2020-11-08 18:06 ` [bug#44435] [PATCH v2 0/1] services: Add Transmission Daemon Simon South
2020-11-08 18:06 ` [bug#44435] [PATCH v2 1/1] services: Add transmission-daemon service Simon South
2020-11-18 22:39 ` [bug#44435] [PATCH v2 0/1] services: Add Transmission Daemon Ludovic Courtès
2020-11-19 0:35 ` Simon South
2020-12-05 15:27 ` Simon South [this message]
2020-12-05 15:27 ` [bug#44435] [PATCH v3 1/1] services: Add transmission-daemon service Simon South
2021-02-12 7:15 ` bug#44435: [PATCH v3 0/1] services: Add Transmission Daemon 宋文武
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1607175147.git.simon@simonsouth.net \
--to=simon@simonsouth.net \
--cc=44435@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.