From patchwork Sun Aug 13 10:37:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Miguel_=C3=81ngel_Moreno?= X-Patchwork-Id: 15844 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 95D7227BBE9; Sun, 13 Aug 2023 12:45:50 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 34D8F27BBEB for ; Sun, 13 Aug 2023 12:45:46 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qV9XB-0000CB-Di; Sun, 13 Aug 2023 07:45:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qV9Wq-0000AS-20 for guix-patches@gnu.org; Sun, 13 Aug 2023 07:45:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qV9Wo-0004d3-VX for guix-patches@gnu.org; Sun, 13 Aug 2023 07:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qV9Wo-0003Tq-LD for guix-patches@gnu.org; Sun, 13 Aug 2023 07:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62102] [PATCH v2] services: Add whoogle-service-type. References: <86zg8k8iy8.fsf@conses.eu> In-Reply-To: <86zg8k8iy8.fsf@conses.eu> Resent-From: Miguel =?utf-8?b?w4FuZ2Vs?= Moreno Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Aug 2023 11:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62102 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62102@debbugs.gnu.org Received: via spool by 62102-submit@debbugs.gnu.org id=B62102.169192708713327 (code B ref 62102); Sun, 13 Aug 2023 11:45:02 +0000 Received: (at 62102) by debbugs.gnu.org; 13 Aug 2023 11:44:47 +0000 Received: from localhost ([127.0.0.1]:58344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qV9WX-0003Sm-IC for submit@debbugs.gnu.org; Sun, 13 Aug 2023 07:44:46 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:40355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qV8TC-0007Q6-Hk for 62102@debbugs.gnu.org; Sun, 13 Aug 2023 06:37:15 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5FF58E0002 for <62102@debbugs.gnu.org>; Sun, 13 Aug 2023 10:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=migalmoreno.com; s=gm1; t=1691923026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptCspev06zk0xL6knm/y5hCTX12CEq8VBXJtSZLm2EU=; b=oVmvPvql5mTFyQCW1qKTlo5ltdzihSbxrAcb4t/T0fTco1K5O301CDTQcuA62BVgHcFODJ WCqj3y6JL+CQU3UNX0N4LlbsdfxEM7+eOwY3x20Zf14YyK/PGJR7anSqvqkhOwspUaXB4p xk3l1te30EtWtD24+cv9FRmCESxKSfncq+oU/EZTMc51GdGZH6W2X1WSNOWFaiINNNbm68 /lIGWducr+uQKAvpjcg485qlWHWd8yoLdbMocU7eKZ1RGkdACRiDzntyTRMMV41VaMVh+3 05Qm77L/OSNcJez0SDeaYFKXb1cF2N8nCB6gtBUBn/MH1asz+LV5GBv5MATqXg== From: Miguel =?utf-8?b?w4FuZ2Vs?= Moreno Date: Sun, 13 Aug 2023 12:37:04 +0200 Message-ID: <864jl344a7.fsf@migalmoreno.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-GND-Sasl: mail@migalmoreno.com X-Mailman-Approved-At: Sun, 13 Aug 2023 07:44:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/web.scm (whoogle-service-type): New variable. * doc/guix.texi (Web Services): Document it. --- doc/guix.texi | 32 +++++++++++++++++++++++++ gnu/services/web.scm | 56 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 409ca2ad62..35746ec21e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31031,6 +31031,38 @@ Web Services @end table @end deftp +@subheading Whoogle Search +@cindex Whoogle Search +@uref{https://github.com/benbusby/whoogle-search, Whoogle Search} is a +self-hosted, ad-free, privacy-respecting metasearch engine that collects +and displays Google search results. + +@defvar whoogle-service-type +Service type for Whoogle Search. +@end defvar + +@deftp {Data Type} whoogle-configuration +Data type representing Whoogle Search service configuration. + +@table @asis +@item @code{package} (default: @code{whoogle-search}) +The Whoogle Search package to use. + +@item @code{host} (default: @code{"127.0.0.1"}) +The host address to run Whoogle on. + +@item @code{port} (default: @code{5000}) +The port where Whoogle will be exposed. + +@item @code{environment-variables} (default: @code{'()}) +A list of strings with the environment variables to configure Whoogle. +You can consult +@uref{https://github.com/benbusby/whoogle-search/blob/main/whoogle.template.env, +its environment variables template} for the list of available options. + +@end table +@end deftp + @subsubheading Patchwork @cindex Patchwork Patchwork is a patch tracking system. It can collect patches sent to a diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 818226a4f7..ed53572eec 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2020, 2021 Alexandru-Sergiu Marton ;;; Copyright © 2022 Simen Endsjø ;;; Copyright © 2023 Bruno Victal +;;; Copyright © 2023 Miguel Ángel Moreno ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,6 +37,7 @@ (define-module (gnu services web) #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu services admin) + #:use-module (gnu services configuration) #:use-module (gnu services getmail) #:use-module (gnu services mail) #:use-module (gnu system pam) @@ -47,6 +49,7 @@ (define-module (gnu services web) #:use-module (gnu packages patchutils) #:use-module (gnu packages php) #:use-module (gnu packages python) + #:use-module (gnu packages python-web) #:use-module (gnu packages gnupg) #:use-module (gnu packages guile) #:use-module (gnu packages logging) @@ -240,6 +243,13 @@ (define-module (gnu services web) varnish-service-type + whoogle-service-type + whoogle-configuration + whoogle-configuration-package + whoogle-configuration-host + whoogle-configuration-port + whoogle-configuration-environment-variables + patchwork-database-configuration patchwork-database-configuration? patchwork-database-configuration-engine @@ -1604,6 +1614,52 @@ (define varnish-service-type (default-value (varnish-configuration)))) + +;;; +;;; Whoogle +;;; + +(define-configuration/no-serialization whoogle-configuration + (package + (package whoogle-search) + "The @code{whoogle-search} package to use.") + (host + (string "127.0.0.1") + "The host address to run Whoogle on.") + (port + (integer 5000) + "The port to run Whoogle on.") + (environment-variables + (list-of-strings '()) + "A list of strings specifying environment variables used to configure +Whoogle.")) + +(define (whoogle-shepherd-service config) + (match-record config + (package host port environment-variables) + (list + (shepherd-service + (provision '(whoogle-search)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/bin/whoogle-search") + "--host" #$host "--port" #$(number->string port)) + #:environment-variables + (append (list "CONFIG_VOLUME=/var/cache/whoogle-search") + '#$environment-variables))) + (stop #~(make-kill-destructor)) + (documentation "Run a @code{whoogle-search} instance."))))) + +(define whoogle-service-type + (service-type + (name 'whoogle-search) + (extensions + (list (service-extension shepherd-root-service-type + whoogle-shepherd-service) + (service-extension profile-service-type + (compose list whoogle-configuration-package)))) + (default-value (whoogle-configuration)) + (description "Set up the @code{whoogle-search} metasearch engine."))) + ;;; ;;; Patchwork