From unknown Mon Aug 11 11:39:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#47741 <47741@debbugs.gnu.org> To: bug#47741 <47741@debbugs.gnu.org> Subject: Status: [PATCH 0/3] Add a service for OpenDHT Reply-To: bug#47741 <47741@debbugs.gnu.org> Date: Mon, 11 Aug 2025 18:39:17 +0000 retitle 47741 [PATCH 0/3] Add a service for OpenDHT reassign 47741 guix-patches submitter 47741 Maxim Cournoyer severity 47741 normal tag 47741 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 13 00:15:20 2021 Received: (at submit) by debbugs.gnu.org; 13 Apr 2021 04:15:20 +0000 Received: from localhost ([127.0.0.1]:58700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWASN-0004eN-Na for submit@debbugs.gnu.org; Tue, 13 Apr 2021 00:15:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:41710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWASL-0004eF-Mh for submit@debbugs.gnu.org; Tue, 13 Apr 2021 00:15:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWASL-0007Ez-H7 for guix-patches@gnu.org; Tue, 13 Apr 2021 00:15:17 -0400 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:36596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWASJ-0004Np-SE for guix-patches@gnu.org; Tue, 13 Apr 2021 00:15:17 -0400 Received: by mail-qv1-xf2e.google.com with SMTP id i9so7296643qvo.3 for ; Mon, 12 Apr 2021 21:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hoI+OnFf2yPX9HWEPIBst02bwbu1m+OS4ULNhKD/YD8=; b=d7a92Wu8VHae2FpbEt/y5DQYWBtNFRYwP1NTOyYTC53nuTJmkbUbF9rRFfh7TDXb6r snhKRQv7cKXdgXqS7kO8Bh3wIjcG6yvQ1cD9k5NbJDi+obOYXothDozXrW73v2rKSMh7 IaZ4B55E4eH5Nvc4UDulZZlm8An/q34zHfhaxIEBbiTuOvYCc3XHfPs4QurU38edLAob xsQWDzdxg9GeGlMvZQBHKZWH+71INiospj7K7rq+mA2mZFtz8+afrmEGFiX7xiXs3WY4 /KCo+zlD80DbU2Zs80pu/z5rgNtjW3PfqSA1cIjj0lNC3KhiLTx7MUUZKLeokB9WxtdY xwjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hoI+OnFf2yPX9HWEPIBst02bwbu1m+OS4ULNhKD/YD8=; b=dd8EhipTNK0Hlo2+74s2nAcS5Hr86JYerpV9uXTIdY4mlvnDdWfDx2AkLV1lbpJ7Ym z30xC+oACxKdEa0W4VEQrVNYsr2+FJBQx05EcBdzuOPH/CgKw50FOsctr2xF0+9DCCUK YLRpsxD64vgZg+BTU5XS2nWR6BVI6WMAQ7Q3qLcgY03bSe73iPvbWBQloOl4gFIyEvYj SOX4j1vICDQfMGRSYkOnjfVStLKeSMKYKqbyvXRfvfqu5tGsVO/zQj3KOmhVDRizK2MQ v+/EzxnDBJodRFKlNpDGJHSbt346GUv1rKTHpkgVkpwIjpJD91J0dPmFgv7e46+tEBlF 3H1w== X-Gm-Message-State: AOAM533Z2NQqEJICuUB4LozL+FWMB3wiyEqHwGUDjPhrwclXSF3LUwRB NiBT9y1p2CQtgVeCHUVg2IgD+FasFRo= X-Google-Smtp-Source: ABdhPJyTipglBEwut7KahccnUEOCRsyLI0a7j3lYOsWjYSrZTEHRH3UwOAiYewh9YlVtIlxbJrXr5A== X-Received: by 2002:a05:6214:1484:: with SMTP id bn4mr968480qvb.33.1618287314478; Mon, 12 Apr 2021 21:15:14 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-209.b2b2c.ca. [72.10.128.209]) by smtp.gmail.com with ESMTPSA id v66sm9448646qkd.113.2021.04.12.21.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 21:15:13 -0700 (PDT) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH 0/3] Add a service for OpenDHT Date: Tue, 13 Apr 2021 00:14:59 -0400 Message-Id: <20210413041500.1223-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This series overhaul our opendht package a bit and adds a service for it. You can now for example set up your own Jami proxy server easily to use with Jami on your phone. Or simply to strengthen the distributed network by participating in it and adding new stable bootstrap nodes. Thanks, Maxim Cournoyer (3): gnu: opendht: Add Python bindings, tools. services: configuration: Add syntactic sugar to easily generate documentation. services: Add opendht. doc/guix.texi | 84 ++++++++++++++++++++ gnu/packages/networking.scm | 75 +++++++++++++++--- gnu/services/configuration.scm | 13 ++++ gnu/services/networking.scm | 135 ++++++++++++++++++++++++++++++++- 4 files changed, 297 insertions(+), 10 deletions(-) -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 13 00:17:30 2021 Received: (at 47741) by debbugs.gnu.org; 13 Apr 2021 04:17:30 +0000 Received: from localhost ([127.0.0.1]:58705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUT-0004i7-Sq for submit@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:30 -0400 Received: from mail-qt1-f171.google.com ([209.85.160.171]:47000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUR-0004hs-GM for 47741@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:28 -0400 Received: by mail-qt1-f171.google.com with SMTP id y2so11761077qtw.13 for <47741@debbugs.gnu.org>; Mon, 12 Apr 2021 21:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tjcgDKaysCTsqq2UEVGi8TFD248kZSPkD9pieNvR94M=; b=GKntYoj7gaQr/KYaE9N4Mi0TfA/uyte06STo/jtNdkaI0uzlOQEtGg9nIicXq7+MJq LIvMzFPG8RKstonkeV1tuDzS4K1/GbvWkI2uD3IU1XLVOkUA3FAZE1BYmp9nqcN91gAi jjiVLAyg4i184RjT3CvEjDKB5ftAx3/69HOTSB3A7kpS6pLIQuJDeiIHIeYhu9f+65yT YOIN5kSGlJpnrghaz/CNDE8To+a5XgA1CT5E2RpSNy6AP2vhs+LN5JcGC9UqMQF088oK JExxpioBFESqgbFtusN4Rtg35V3qVwjiyDaCGoKBeAn9pxdDpTWLDwtPmBCEO2IaovHd Roow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tjcgDKaysCTsqq2UEVGi8TFD248kZSPkD9pieNvR94M=; b=bgqyOm1rJdsCaWd6pumhJDOjeoolfSKKD1YsBKgeSOWfNReLMmAsvALI5GosDCquwl VteYm+3WnS2gXb/PeItB0DhWZMPYrKi3x0i3aMmzlPVqQGYTu3oifzwIbMV8pppTuDTx dLZmsshfp1yxwcKafbMq6Crmrx1f7ssn4Mul5oou04Rl5uMnmM0at2tPDz+bdcHxDkfi bFASC/nY1vwV3R0q6x+Mxy+mvRJZ0yc3BQgpzR9I4GmiqGnRZgdz21SFYsTBskdRjGVt a3oQy+PalluHqbh5J0JDQi0g1tRg/RCciN8fUgzG0S5ThMh/HKahH77qzU+Om5gSB9by A0tA== X-Gm-Message-State: AOAM530cjFF4kcAONbNHXFtmhoMY/8+hTW90vn1CSiSc9/aQdwsaxUQ0 drdtZW7NDVbmeff0yf6P860V9KcV0mc= X-Google-Smtp-Source: ABdhPJwnZHqR9VzhEaXrUe1VcrsrTrq0XfqlYQm3z99tn6DjTK2lquZWo/m97NsJ29UVERx9Au6H3Q== X-Received: by 2002:ac8:7dce:: with SMTP id c14mr28401005qte.82.1618287441822; Mon, 12 Apr 2021 21:17:21 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-209.b2b2c.ca. [72.10.128.209]) by smtp.gmail.com with ESMTPSA id w1sm7414074qto.85.2021.04.12.21.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 21:17:21 -0700 (PDT) From: Maxim Cournoyer To: 47741@debbugs.gnu.org Subject: [PATCH 1/3] gnu: opendht: Add Python bindings, tools. Date: Tue, 13 Apr 2021 00:17:08 -0400 Message-Id: <20210413041710.1708-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 47741 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/networking.scm (opendht) [outputs]: Add tools and debug outputs. [native-inputs]: Add python and python-cython. [imported-modules, modules, phases]: New arguments. [configure-flags]: Disable static compilation. Enable Python support and the tools. [synopsis]: Update synopsis. [description]: Expound description. --- gnu/packages/networking.scm | 75 ++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index baaa9c5707..b3a51c4b82 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -3436,6 +3436,7 @@ and targeted primarily for asynchronous processing of HTTP-requests.") (base32 "1wc0f6cnvnlmhxnx64nxqgsx93k4g7ljdaqjl40ml74jg3nqrzcl")))) ;; Since 2.0, the gnu-build-system does not seem to work anymore, upstream bug? + (outputs '("out" "tools" "debug")) (build-system cmake-build-system) (inputs `(("argon2" ,argon2) @@ -3452,23 +3453,79 @@ and targeted primarily for asynchronous processing of HTTP-requests.") `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-cython" ,python-cython) ("libtool" ,libtool) ("cppunit" ,cppunit))) (arguments - `(#:tests? #f ; Tests require network connection. + `(#:imported-modules ((guix build python-build-system) ;for site-packages + ,@%cmake-build-system-modules) + #:modules (((guix build python-build-system) #:prefix python:) + (guix build cmake-build-system) + (guix build utils)) + #:tests? #f ; Tests require network connection. #:configure-flags - '(;;"-DOPENDHT_TESTS=on" - "-DOPENDHT_TOOLS=off" - "-DOPENDHT_PYTHON=off" + '( ;;"-DOPENDHT_TESTS=on" + "-DOPENDHT_STATIC=off" + "-DOPENDHT_TOOLS=on" + "-DOPENDHT_PYTHON=on" "-DOPENDHT_PROXY_SERVER=on" "-DOPENDHT_PUSH_NOTIFICATIONS=on" "-DOPENDHT_PROXY_SERVER_IDENTITY=on" - "-DOPENDHT_PROXY_CLIENT=on"))) + "-DOPENDHT_PROXY_CLIENT=on") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-python-installation-prefix + ;; Specify the installation prefix for the compiled Python module + ;; that would otherwise attempt to installs itself to Python's own + ;; site-packages directory. + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "python/CMakeLists.txt" + (("--root=\\\\\\$ENV\\{DESTDIR\\}") + (string-append "--root=/ --single-version-externally-managed " + "--prefix=${CMAKE_INSTALL_PREFIX}"))))) + (add-after 'unpack 'specify-runpath-for-python-module + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "python/setup.py.in" + (("extra_link_args=\\[(.*)\\]" _ args) + (string-append "extra_link_args=[" args + ", '-Wl,-rpath=" out "/lib']")))))) + (add-after 'install 'move-and-wrap-tools + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (tools (assoc-ref outputs "tools")) + (site-packages (python:site-packages inputs outputs))) + (mkdir tools) + (rename-file (string-append out "/bin") + (string-append tools "/bin")) + (wrap-program (string-append tools "/bin/dhtcluster") + `("PYTHONPATH" prefix (,site-packages))))))))) (home-page "https://github.com/savoirfairelinux/opendht/") - (synopsis "Distributed Hash Table (DHT) library") - (description "OpenDHT is a Distributed Hash Table (DHT) library. It may -be used to manage peer-to-peer network connections as needed for real time -communication.") + (synopsis "Lightweight Distributed Hash Table (DHT) library") + (description "OpenDHT provides an easy to use distributed in-memory data +store. Every node in the network can read and write values to the store. +Values are distributed over the network, with redundancy. It includes the +following features: +@itemize +@item Lightweight and scalable, designed for large networks and small devices; +@item High resilience to network disruption; +@item Public key cryptography layer providing optional data signature and +encryption (using GnuTLS); +@item IPv4 and IPv6 support; +@item Clean and powerful C++14 map API; +@item Bindings for C, Rust & Python 3; +@item REST API with an optional HTTP client and server with push notification +support. +@end itemize +The following tools are also included: +@table @command +@item dhtnode +A command line tool to run a DHT node and perform operations supported by the +library (get, put, etc.) with text values. +@item dhtchat +A very simple IM client working over the DHT. +@end table") (license license:gpl3+))) (define-public frrouting -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 13 00:17:34 2021 Received: (at 47741) by debbugs.gnu.org; 13 Apr 2021 04:17:34 +0000 Received: from localhost ([127.0.0.1]:58708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUY-0004iP-Bo for submit@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:34 -0400 Received: from mail-qv1-f45.google.com ([209.85.219.45]:44968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUW-0004hy-Jh for 47741@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:32 -0400 Received: by mail-qv1-f45.google.com with SMTP id o11so7461181qvh.11 for <47741@debbugs.gnu.org>; Mon, 12 Apr 2021 21:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r+Sv/DBQPtvyc/dovVnUzGhBkeik2XUD0qdDsN65sEs=; b=auQdg2PFYsZiIIUGFSJRVjXdunzHva7FS/Pa13CYP8CFxf40qwFD5mlVS2MVO9uMTt yl1BaDscqqSYktHuyzqZuU9tCTd1Lk0W/hy1diba4rvXA5XyOHElRec/5/fZDN20o264 ztKqdi8JcZvyjtQnU0i7OPc3f3AihhHKaUmwbXj9Hk/potr0bmgkNEgnCDzYrzbkbKD9 oBvGoJaa1QwPXjQdEhN/hunfRpOhmd3dmrwxz7AMCWGIqwQAdla5ictfBZMs0WYLc7gc LbiYzBJ5oaMIw1G/8+Kw0K7qSR0n9md9oGseQgxeN0Ocnjgn9UjyGeCx+iXUJ9eSHxlS 6B6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r+Sv/DBQPtvyc/dovVnUzGhBkeik2XUD0qdDsN65sEs=; b=EVNpTfNm2yLUk6dt1h+LyIny2Hj/VKhtrK6nxJTbnJeGVlOVN2gFblYJK05FE2X3bV teKvvXsOopxXyrIVJQTTD6H2x7XDoUxZkww58fYT04EC579hgY2zjtTLphH9ziM56qce NsRLvCypZfhDAOaCjBGA0VNp18DxHO1Y0YORYA1oHl1Xk37y8Z+x5TO0otyzGcGIU83A NqIzo6MYLHVTFowXyJxDYW/6f7KZw4d2dH++06lrExFIsZ/FJN+jl5aIM710vL335m1F P5RWpz72CrC88kQHqUPYJvBEbdgc/DbFHRXqEOTpXbdr6dN+CpKryIOzhCChnsqoZOKe K7mg== X-Gm-Message-State: AOAM531vfqPWxDbU3Z8owETVAOez7tP83nFu66RvS/4IvDhX5EXsINkp ylnM0l8JOjvJ8zbKg9M3HUu4SM/yTX0= X-Google-Smtp-Source: ABdhPJzWHxwgznPCs113VnL+lLDm0xaXAzbWKV8/Ur1LCb9ln7S1wIz1NmNRO/O/majCZpaLsPopog== X-Received: by 2002:ad4:4a6f:: with SMTP id cn15mr30513242qvb.56.1618287447095; Mon, 12 Apr 2021 21:17:27 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-209.b2b2c.ca. [72.10.128.209]) by smtp.gmail.com with ESMTPSA id w1sm7414074qto.85.2021.04.12.21.17.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 21:17:26 -0700 (PDT) From: Maxim Cournoyer To: 47741@debbugs.gnu.org Subject: [PATCH 2/3] services: configuration: Add syntactic sugar to easily generate documentation. Date: Tue, 13 Apr 2021 00:17:09 -0400 Message-Id: <20210413041710.1708-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210413041710.1708-1-maxim.cournoyer@gmail.com> References: <20210413041710.1708-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 47741 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I found the original (undocumented) interface difficult to understand, which was the rationale for adding a simpler one on top of it. * gnu/services/configuration.scm (configuration->documentation): New procedure. --- gnu/services/configuration.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 90f12a8d39..750535342d 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -43,6 +43,7 @@ define-configuration validate-configuration generate-documentation + configuration->documentation serialize-package)) ;;; Commentary: @@ -188,3 +189,15 @@ (or (assq-ref sub-documentation field-name) '()))))) fields))))) (stexi->texi `(*fragment* . ,(generate documentation-name)))) + +(define (configuration->documentation configuration-symbol) + "Takes CONFIGURATION-SYMBOL, the symbol used when defining a configuration +record with DEFINE-CONFIGURATION, and outputs the Texinfo documentation of its +fields." + ;; This is syntax sugar for a simple, straight-forward application of + ;; GENERATE-DOCUMENTATION. + (let ((fields-getter (module-ref (current-module) + (symbol-append configuration-symbol + '-fields)))) + (format #t (generate-documentation `((,configuration-symbol ,fields-getter)) + configuration-symbol)))) -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 13 00:17:56 2021 Received: (at 47741) by debbugs.gnu.org; 13 Apr 2021 04:17:56 +0000 Received: from localhost ([127.0.0.1]:58711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUn-0004iu-Jr for submit@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:56 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:46767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWAUl-0004id-1W for 47741@debbugs.gnu.org; Tue, 13 Apr 2021 00:17:47 -0400 Received: by mail-qk1-f176.google.com with SMTP id o17so8192748qkl.13 for <47741@debbugs.gnu.org>; Mon, 12 Apr 2021 21:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kEILGjC2wulZFHqmBs6nn0qcsPZswtpeNU3ZDu1lsg0=; b=IO6TjZO69pChoJW9BQcYzdN7Q1Y5R4bvCKUgPOq7W6MTnywqIy6vtD94EEdo9O7Not lk5DThjIGHxXNGwhPaXCKSywLKPdoB0Rk7j0eYsDgH3EBPxUInvLoZt4BN62jc4Rr58y nbwFeq8k/x5jeIgBfGC3Fs5yWUr7cBsm7Bk9Ju7nKvoFDQLvgxYLjvNAN9VG53tE1Bje CfTppXkNLuaFcQ8uYR6O9p6VWpBuO1LbaL7dfaKyPY+eBaUXtglW6gPmxuhqoGS2ZwzR EihgkI96N0Akn0GdZS7c6ad3pYQWUxNjLG6g8TCgQetMbfegC2q+qCNspOAtOTcddYzh A11Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kEILGjC2wulZFHqmBs6nn0qcsPZswtpeNU3ZDu1lsg0=; b=b+U/30+6UDid+SkySzwRm0XAWM8E4hRZIoI4tpLGVgR+qdi0b2ho6nUN/HRRsEGUr6 1iQeDoCz423ImlvsMvoIPd9KAr5Qcu/4inAaa5gvXW3p3967ZiEWTKH4Qodp4d+g2Vq3 A9vrbHYTy4fjY2LEZ3YH18o5L4O6umobkpawJ74ggJ+TiHxnCtHWeLi7HZnwJIWikL+t QHCOjgYAOpI3rKgro2i3iJNzj2g71HikHai0zx83I/vL0EK82n0x5fB/GgZ13rBp1/gz Izi3ZeQlavfMmwX7mV+WuwFf5LqiZOLYICNICpkw7MTY1GtT9rV/FpFIQ8kTPOIOrabl VZVg== X-Gm-Message-State: AOAM531yIapAZcBP6jVew7tnxS2guKQFusTTLjQV4MRTL5R0bU0zhWEz AL1ZhwhzLs4cdxzqu40MZ7Ri0BLeqJE= X-Google-Smtp-Source: ABdhPJwzJp7D0HKoby+WkKIut5I5mpUf/H1+8UHIm81cVCKeqxZDwbtuBz112fpCjukHVN6DtpX6og== X-Received: by 2002:ae9:f719:: with SMTP id s25mr30596226qkg.42.1618287461051; Mon, 12 Apr 2021 21:17:41 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-209.b2b2c.ca. [72.10.128.209]) by smtp.gmail.com with ESMTPSA id w1sm7414074qto.85.2021.04.12.21.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 21:17:40 -0700 (PDT) From: Maxim Cournoyer To: 47741@debbugs.gnu.org Subject: [PATCH 3/3] services: Add opendht. Date: Tue, 13 Apr 2021 00:17:10 -0400 Message-Id: <20210413041710.1708-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210413041710.1708-1-maxim.cournoyer@gmail.com> References: <20210413041710.1708-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 47741 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/networking.scm (serialize-boolean) (serialize-number, serialize-string): New dummy procedures. (maybe-number, opendht-configuration): New syntaxes. (%opendht-accounts): New variable. (opendht-configuration->command-line-arguments): Likewise. (opendht-shepherd-service, opendht-service-type): New variables. * doc/guix.texi: Document it. --- doc/guix.texi | 84 ++++++++++++++++++++++ gnu/services/networking.scm | 135 +++++++++++++++++++++++++++++++++++- 2 files changed, 218 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 84d8bf50be..d2593b2180 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16653,6 +16653,90 @@ must be @code{'()} or @code{'("internal")}. detailed discussion of each configuration field. @end deftp +@cindex opendht, distributed hash table network service +@cindex dhtproxy, for use with jami +@defvr {Scheme Variable} opendht-service-type +This is the type of the service running a @uref{https://opendht.net, +OpenDHT} node, @command{dhtnode}. The daemon can be used to host your +own proxy service to the DHT, for example to connect to with Jami, among +other applications. + +The value of this service is a @code{opendht-configuration} object, as +described below. +@end defvr + +@deftp {Data Type} opendht-configuration +This is the data type for the OpenDHT service configuration. + +@c The fields documentation has been auto-generated using the +@c configuration->documentation procedure from (gnu services +@c configuration). +@c TODO: Tweak the tool so that it generates doc that matches our +@c current standard. +Available @code{opendht-configuration} fields are: + +@deftypevr {@code{opendht-configuration} parameter} package opendht +The @code{opendht} package to use. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} boolean peer-discovery? +Whether to enable the multicast local peer discovery mechanism. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} boolean enable-logging? +Whether to enable logging messages to syslog. It is disabled by default +as it is rather verbose. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} boolean debug? +Whether to enable debug-level logging messages. This has no effect if +logging is disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} maybe-string bootstrap-host +The node host name that is used to make the first connection to the +network. A specific port value can be provided by appending the +@code{:PORT} suffix. By default, it uses the Jami bootstrap nodes, but +any host can be specified here. It's also possible to disable +bootsrapping by setting this to the @code{'disabled} symbol. + +Defaults to @samp{"bootstrap.jami.net:4222"}. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} maybe-number port +The UDP port to bind to. When set to @code{'disabled}, an available +port is automatically selected. + +Defaults to @samp{4222}. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} maybe-number proxy-server-port +Spawn a proxy server listening on the specified port. + +Defaults to @samp{disabled}. + +@end deftypevr + +@deftypevr {@code{opendht-configuration} parameter} maybe-number proxy-server-port-tls +Spawn a proxy server listening to TLS connections on the specified port. + +Defaults to @samp{disabled}. + +@end deftypevr +@end deftp + @cindex Tor @defvr {Scheme Variable} tor-service-type This is the type for a service that runs the @uref{https://torproject.org, diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 231a9f66c7..8c22f0eec3 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -10,7 +10,7 @@ ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018 Arun Isaac ;;; Copyright © 2019 Florian Pelz -;;; Copyright © 2019 Maxim Cournoyer +;;; Copyright © 2019, 2021 Maxim Cournoyer ;;; Copyright © 2019 Sou Bunnbu ;;; Copyright © 2019 Alex Griffin ;;; Copyright © 2020 Brice Waegeneire @@ -108,6 +108,18 @@ inetd-entry inetd-service-type + opendht-configuration + opendht-configuration-peer-discovery? + opendht-configuration-verbose? + opendht-configuration-bootstrap-host + opendht-configuration-port + opendht-configuration-proxy-server-port + opendht-configuration-proxy-server-port-tls + opendht-configuration->command-line-arguments + + opendht-shepherd-service + opendht-service-type + tor-configuration tor-configuration? tor-hidden-service @@ -730,6 +742,127 @@ daemon will keep the system clock synchronized with that of the given servers.") for listening on Internet sockets and spawning the corresponding services on demand."))) + +;;; +;;; OpenDHT, the distributed hash table network used by Jami +;;; + +;;; XXX: These dummy definitions is because there's no way to disable the +;;; serialization code from define-configuration. +(define (serialize-boolean option value) "") +(define (serialize-number option value) "") +(define (serialize-string option value) "") + +(define-maybe number) +(define-maybe string) + +;;; To generate the documentation of the following configuration record, you +;;; can evaluate: (configuration->documentation 'opendht-configuration) +(define-configuration opendht-configuration + (opendht + (package opendht) + "The @code{opendht} package to use.") + (peer-discovery? + (boolean #false) + "Whether to enable the multicast local peer discovery mechanism.") + (enable-logging? + (boolean #false) + "Whether to enable logging messages to syslog. It is disabled by default +as it is rather verbose.") + (debug? + (boolean #false) + "Whether to enable debug-level logging messages. This has no effect if +logging is disabled.") + (bootstrap-host + (maybe-string "bootstrap.jami.net:4222") + "The node host name that is used to make the first connection to the +network. A specific port value can be provided by appending the @code{:PORT} +suffix. By default, it uses the Jami bootstrap nodes, but any host can be +specified here. It's also possible to disable bootstrapping by setting this +to the @code{'disabled} symbol.") + (port + (maybe-number 4222) + "The UDP port to bind to. When set to @code{'disabled}, an available port +is automatically selected.") + (proxy-server-port + (maybe-number 'disabled) + "Spawn a proxy server listening on the specified port.") + (proxy-server-port-tls + (maybe-number 'disabled) + "Spawn a proxy server listening to TLS connections on the specified +port.")) + +(define %opendht-accounts + ;; User account and groups for Tor. + (list (user-group (name "opendht") (system? #t)) + (user-account + (name "opendht") + (group "opendht") + (system? #t) + (comment "OpenDHT daemon user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define (opendht-configuration->command-line-arguments config) + "Derive the command line arguments to used from CONFIG, an + object." + (match-record config + (opendht bootstrap-host enable-logging? port debug? peer-discovery? + proxy-server-port proxy-server-port-tls) + (let ((dhtnode #~(string-append #$opendht:tools "/bin/dhtnode"))) + `(,dhtnode + "--service" ;non-forking mode + ,@(if (string? bootstrap-host) + (list "--bootstrap" bootstrap-host)) + ,@(if enable-logging? + (list "--syslog") + '()) + ,@(if (number? port) + (list "--port" (number->string port)) + '()) + ,@(if debug? + (list "--verbose") + '()) + ,@(if peer-discovery? + (list "--peer-discovery") + '()) + ,@(if (number? proxy-server-port) + (list "--proxyserver" (number->string proxy-server-port)) + '()) + ,@(if (number? proxy-server-port-tls) + (list "--proxyserverssl" (number->string proxy-server-port-tls)) + '()))))) + +(define (opendht-shepherd-service config) + "Return a running OpenDHT." + (shepherd-service + (documentation "Run an OpenDHT node.") + (provision '(opendht dhtnode dhtproxy)) + (requirement '(user-processes syslogd)) + (start #~(make-forkexec-constructor/container + (list #$@(opendht-configuration->command-line-arguments config)) + #:mappings (list (file-system-mapping + (source "/dev/log") ;for syslog + (target source))) + #:user "opendht")) + (stop #~(make-kill-destructor)))) + +(define opendht-service-type + (service-type + (name 'opendht) + (default-value (opendht-configuration)) + (extensions + (list (service-extension shepherd-root-service-type + (compose list opendht-shepherd-service)) + (service-extension account-service-type + (const %opendht-accounts)))) + (description "Run the OpenDHT @command{dhtnode} command that allows +participating in the distributed hash table based OpenDHT network. The +service can be configured to act as a proxy to the distributed network, which +can be useful for portable devices where minimizing energy consumption is +paramount. OpenDHT was originally based on Kademlia and adapted for +applications in communication. It is used by Jami, for example."))) + ;;; ;;; Tor. -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Mon May 17 23:59:52 2021 Received: (at 47741-done) by debbugs.gnu.org; 18 May 2021 03:59:52 +0000 Received: from localhost ([127.0.0.1]:54242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1liqtc-0005MO-BZ for submit@debbugs.gnu.org; Mon, 17 May 2021 23:59:52 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:43002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1liqta-0005MA-WD for 47741-done@debbugs.gnu.org; Mon, 17 May 2021 23:59:51 -0400 Received: by mail-qt1-f178.google.com with SMTP id i19so34421qtw.9 for <47741-done@debbugs.gnu.org>; Mon, 17 May 2021 20:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=12FYuHOWpFTQP8xE1JIflmAV/JmTkTqlmDb6NSEZPXs=; b=EZ8jukPH2bFe2FUwpsPIsPB7YV+bYDut53Geerw/i9dMV0x1pRX2MMWwpV57+h9kXe UWYggbNLfEL4qPIhJ/dj1SUuXOLyNx+5tBPRgl0OqH5VPzqQguBOHKejvuksKtm8rBzF uNFZzG9dyUrJxo9xfMnChFDUHHIUSKR2E4rP9pxyvWpl5tC4NTbRvyZewT3V3Tp5eUIV q5nFtjtDrRf/R9U43uDf8bK+uenPUzWyymzeS5/JBhoZpkqHU3DcWYjNo6xcEwF9SMYr a9GkxheWKnO33+uGVuBiGPYURZvWwZK746ZNUb9FkfuIlaYWPZjtH6RYR+ZPhqTCnJjH 7Xkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=12FYuHOWpFTQP8xE1JIflmAV/JmTkTqlmDb6NSEZPXs=; b=HyzViIfhpYiswd4qO8PFh4BzOhRDSRix/zuklcW7y0F9AXGcp8bBZBR9iTkMCZnkO9 XnGilG7xDzpJnmw2u7t/3tK7JyKpKLb9Ztq2e1JZKWVdNoiNFH5ep7TnoUVRtnNQn+nX IrXuRc8mjL9ciDmY4Uaxrj+Sdb9vVBjlIKYK49PbY8sdfHHbiEMOSQRIiqBQXTJPLI1V 2MjLPKM8yFn4J05jTIpk/yGUBm4MgfgmsyPHBxFT/42rlqXYVUrSMTUpzJ2l0+C4rdFf BAdOxYStV8xcDkv/prROns9u0ZLM5N0XT7PaXSDyUDfODioCS0oMnhD1qmv9QAW68Txi sCxw== X-Gm-Message-State: AOAM533FqRC9IhRUhjOMPM86V0+tAnn7bh54Fmzkk2T61PcMIoTKQ705 r4DvBGHdQJ067l3J9LwOTJBdB1kGfYE= X-Google-Smtp-Source: ABdhPJzunFsGyVA1lzqBEaaRA0uc/2x6GMlqsf/l8W4x2iH0JNlNNH5iy9T5XFNR5/XUQ0OJKhrWjQ== X-Received: by 2002:ac8:5c44:: with SMTP id j4mr1901178qtj.58.1621310385216; Mon, 17 May 2021 20:59:45 -0700 (PDT) Received: from hurd (dsl-236-124-184.b2b2c.ca. [207.236.124.184]) by smtp.gmail.com with ESMTPSA id o12sm12109736qtg.14.2021.05.17.20.59.44 for <47741-done@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 20:59:44 -0700 (PDT) From: Maxim Cournoyer To: 47741-done@debbugs.gnu.org Subject: Re: bug#47741: [PATCH 0/3] Add a service for OpenDHT References: <20210413041710.1708-1-maxim.cournoyer@gmail.com> <20210413041710.1708-3-maxim.cournoyer@gmail.com> Date: Mon, 17 May 2021 23:59:44 -0400 In-Reply-To: <20210413041710.1708-3-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Tue, 13 Apr 2021 00:17:10 -0400") Message-ID: <87wnrwn13j.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 47741-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pushed as commit fd449608eb9016fb705eebbea784901b0242cbf2 along some improvements for (gnu services configuration). Closing. Maxim From unknown Mon Aug 11 11:39:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Jun 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator