From patchwork Fri Mar 10 20:11:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Miguel_=C3=81ngel_Moreno?= X-Patchwork-Id: 47855 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 2D9C116E84; Fri, 10 Mar 2023 20:13:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 D6A0D16E7A for ; Fri, 10 Mar 2023 20:13:24 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paj6w-0004yb-Hc; Fri, 10 Mar 2023 15:13:06 -0500 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 1paj6u-0004yP-KG for guix-patches@gnu.org; Fri, 10 Mar 2023 15:13:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paj6t-0000lh-AO for guix-patches@gnu.org; Fri, 10 Mar 2023 15:13:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1paj6s-0008W0-Mz for guix-patches@gnu.org; Fri, 10 Mar 2023 15:13:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#62102] [PATCH] services: Add whoogle-service-type. Resent-From: conses Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Mar 2023 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62102 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62102@debbugs.gnu.org Cc: contact@conses.eu, Andrew Tropin X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167847913132657 (code B ref -1); Fri, 10 Mar 2023 20:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Mar 2023 20:12:11 +0000 Received: from localhost ([127.0.0.1]:55913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paj63-0008Uf-5g for submit@debbugs.gnu.org; Fri, 10 Mar 2023 15:12:11 -0500 Received: from lists.gnu.org ([209.51.188.17]:53556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paj61-0008UW-Vu for submit@debbugs.gnu.org; Fri, 10 Mar 2023 15:12:10 -0500 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 1paj60-0004TU-EZ for guix-patches@gnu.org; Fri, 10 Mar 2023 15:12:09 -0500 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paj5y-0000fp-0f for guix-patches@gnu.org; Fri, 10 Mar 2023 15:12:08 -0500 Received: (Authenticated sender: contact@conses.eu) by mail.gandi.net (Postfix) with ESMTPSA id AB5E4C0005; Fri, 10 Mar 2023 20:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conses.eu; s=gm1; t=1678479121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=IOSgEx3xwpJ/E8k//s7PQWPeXEIvJ4a79iSHL2SnnZQ=; b=oqEpZVhCnin4D2VeSLtRhR1jUAZq7wIm9Qxk+b9DyXnauHV5JikbfsGB55Ha8K6stJyCeS 15/i93S3ulFXsn2AlFqT28UXTS7b3SGEw7O7tWPLHNnazSmyPwrIkdVQ3n9FlAiP6+MELI BWbLFPQDq2YdGUk5YuY5MKFR1LyGwR2PXjH/PjMZftQx2eCyiPwyCVDfo2xQGmkuSNgqbk A3e+EBU9HrZzQ0+1e/AYWgXC2ZinKfIZkaNxeb4+Ykrj0LoEFgJy36DecfBYGQCQmYZiPS PYyXpx9fCHT2Ir4E8YqJUnRLsQg8t9o5r1s34HuS/gQsxDFJv5mYoxwlp9aaLA== From: conses Date: Fri, 10 Mar 2023 21:11:59 +0100 Message-ID: <86zg8k8iy8.fsf@conses.eu> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4b98:dc4:8::226; envelope-from=contact@conses.eu; helo=relay6-d.mail.gandi.net X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index d56e893527..66cc640a6d 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -35,6 +35,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) @@ -46,6 +47,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) @@ -235,6 +237,9 @@ (define-module (gnu services web) varnish-service-type + whoogle-service-type + whoogle-configuration + patchwork-database-configuration patchwork-database-configuration? patchwork-database-configuration-engine @@ -1575,6 +1580,47 @@ (define varnish-service-type (default-value (varnish-configuration)))) + +;;; +;;; Whoogle +;;; + +(define-configuration/no-serialization whoogle-configuration + (whoogle + (package whoogle-search) + "The @code{whoogle-search} package to use.")) + +(define (whoogle-shepherd-service config) + (list + (shepherd-service + (provision '(whoogle-search)) + (start #~(make-forkexec-constructor + (list (string-append #$(whoogle-configuration-whoogle config) + "/bin/whoogle-search")) + #:environment-variables + (append (list "CONFIG_VOLUME=/var/cache/whoogle-search") + (default-environment-variables)))) + (stop #~(make-kill-destructor)) + (documentation "Run a @code{whoogle-search} instance.")))) + +(define (whoogle-profile-service config) + (list + (whoogle-configuration-whoogle config))) + +(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 + whoogle-profile-service))) + (default-value (whoogle-configuration)) + (description "Run the @code{whoogle-search} engine."))) + ;;; ;;; Patchwork