From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id MOybEO1RqmZvkgAAqHPOHw:P1 (envelope-from ) for ; Wed, 31 Jul 2024 15:02:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id MOybEO1RqmZvkgAAqHPOHw (envelope-from ) for ; Wed, 31 Jul 2024 17:02:05 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=T2t0goZh; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1722438125; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=eZajMDodHiseFBH/D5S+9kmNaiPWEJvWarBoHLuQ5Ns=; b=RGpfv8QIWuM4koL6bRotG9Frq5xycqqijLV1MxOXsupIdkVPEjPTAPHqrbemFY0kSMs7VW VxecFMAbDgGmHiWo5JVL9dNRdIT1ukClH6VFQC5kgDVAjHTHEzkaR9QJ3PZ/JxZ9RBO1xz Lx27GE8zVgugrAujWr+dx29yBYXsY6zvueuQPNDfNb2rqlFDh48wPCb7ybHT8Zs/GbWqu9 v1gKq23Cg6/ZQKPTVkZl1VWyCay4tVQefDnLdzlRmNqM4P/ymFEUSTHpJgTxr/mFhihTcf 2C+RlmP8fW9h14Ph5B0yNy7Sb+xmg/wnA+L6/WSx6yLQNE11Sn4/1hcm6F9Q0w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=T2t0goZh; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722438125; a=rsa-sha256; cv=none; b=A6YQE/JHaXkWJaZymlR3vtDkh3m5pPzaHthxvcEheUunNecij40ciUyVwG+NqOHdYFkMgS UttMSu6ELCnF+40O/LLoavY3hTWxoQ40wyFdiGLeJBwA/nZZNV0sP+I+9KCLwOE353uWMV bkgM2p5gOl3AvocZp4lndAzUIswkz+VHGTv/f2XQCOD1d9IYxHofxlHsFUvUM8RMi7VK/d uBlSGQ7KiihQeSNaBtY98sEXFGuOLoHSwe+l19lXMgQsMHdeH4TThYP6FFgOKXXThDJs/a WvCIQUSeELtkkICwhcMsuhwcnNZONxnxVtFZG4q7sylXSjN6fsjvUvluidfaUw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 08E7565B8A for ; Wed, 31 Jul 2024 17:02:04 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZApq-0001l1-Ts; Wed, 31 Jul 2024 11:01:51 -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 1sZApo-0001ko-1v for guix-patches@gnu.org; Wed, 31 Jul 2024 11:01:49 -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 1sZApn-0001IU-PL for guix-patches@gnu.org; Wed, 31 Jul 2024 11:01:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=eZajMDodHiseFBH/D5S+9kmNaiPWEJvWarBoHLuQ5Ns=; b=T2t0goZh1+JOBUd98eVxvubrv/DnTbh7yZAf+u7WyPCZ6kK6WR7V9i9DbwSzyB6zx7K830rdPcDWkiVftNdmCLd9zyUzwuMXAkNhFOSLr/w0oxKdcq6H/bwQTplz3hkKoL4TkX02qCgRAa2CgzsVsMVTwRmVgXGQNEiHDEdkLaUCnPaOpMHoCvimQsjcsInHBUVu0BZ1lT5G4QUY/+KsaN9cUJqwSdSTl4dpKmiDhGDZnwXQDC8THECBu7Vnvm9ngTS6kEHtXtVBhjM56i1rmLlKXEnNabPvjhYjWFLXGoaJIhseFz4VHGU+E/75oYMZERI8o3cUdf2mMeGrVA0eng==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sZAq2-0002is-AK for guix-patches@gnu.org; Wed, 31 Jul 2024 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72400] [PATCH] services: gitile: Allow to set user and group. Resent-From: Evgeny Pisemsky Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 31 Jul 2024 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72400 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72400@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172243808710414 (code B ref -1); Wed, 31 Jul 2024 15:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Jul 2024 15:01:27 +0000 Received: from localhost ([127.0.0.1]:50133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZApS-0002ht-GO for submit@debbugs.gnu.org; Wed, 31 Jul 2024 11:01:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:41364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZApP-0002hh-A5 for submit@debbugs.gnu.org; Wed, 31 Jul 2024 11:01:24 -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 1sZAp7-0007aL-2E for guix-patches@gnu.org; Wed, 31 Jul 2024 11:01:05 -0400 Received: from roxy-shared.hosting.energy ([137.74.182.160] helo=roxy.hosting.energy) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZAp3-0001D7-Is for guix-patches@gnu.org; Wed, 31 Jul 2024 11:01:04 -0400 Received: from [45.137.112.91] (helo=laptop) by roxy.hosting.energy with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1sZAp1-000000007FG-2B84 for guix-patches@gnu.org; Wed, 31 Jul 2024 18:00:59 +0300 From: Evgeny Pisemsky Date: Wed, 31 Jul 2024 18:00:55 +0300 Message-ID: <87sevpehco.fsf@pisemsky.site> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-services-gitile-Allow-to-set-user-and-group.patch Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=137.74.182.160; envelope-from=mail@pisemsky.site; helo=roxy.hosting.energy X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_FAIL=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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 08E7565B8A X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -8.37 X-Spam-Score: -8.37 X-TUID: r+xPWPaZfW9x >From 91ec60142ea1220cf4a87883915bf086e1344f69 Mon Sep 17 00:00:00 2001 Message-ID: <91ec60142ea1220cf4a87883915bf086e1344f69.1722437974.git.mail@p= isemsky.site> From: Evgeny Pisemsky Date: Wed, 31 Jul 2024 17:30:50 +0300 Subject: [PATCH] services: gitile: Allow to set user and group. Change-Id: I757d7a6c2690326272f0437eda2ba4b2fae409a0 --- doc/guix.texi | 7 +++++ gnu/services/version-control.scm | 45 ++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 41814042f5..9b04a0b0e5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -129,6 +129,7 @@ Copyright @copyright{} 2024 Richard Sent@* Copyright @copyright{} 2024 Dariqq@* Copyright @copyright{} 2024 Denis 'GNUtoo' Carikli@* +Copyright @copyright{} 2024 Evgeny Pisemsky@* =20 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -39287,6 +39288,12 @@ Version Control Services The footer content, as a list of sxml expressions. This is shown on every page served by Gitile. =20 +@item @code{user} (default: @code{"git"}) +Owner of the @code{gitile} process. + +@item @code{group} (default: @code{"git"}) +Owner's group of the @code{gitile} process. + @item @code{nginx} An nginx server block that will be extended and used as a reverse proxy by Gitile to serve its pages, and as a normal web server to serve its assets. diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 14ff0a59a6..d61675345f 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2018 Christopher Baines ;;; Copyright =C2=A9 2021 Julien Lepiller +;;; Copyright =C2=A9 2024 Evgeny Pisemsky ;;; ;;; This file is part of GNU Guix. ;;; @@ -74,6 +75,8 @@ (define-module (gnu services version-control) gitile-configuration-index-title gitile-configuration-intro gitile-configuration-footer + gitile-configuration-user + gitile-configuration-group gitile-configuration-nginx =20 gitile-service-type)) @@ -441,6 +444,10 @@ (define-record-type* (default '())) (footer gitile-configuration-footer (default '())) + (user gitile-configuration-user + (default "git")) + (group gitile-configuration-group + (default "git")) (nginx gitile-configuration-nginx)) =20 (define (gitile-config-file host port database repositories base-git-url @@ -462,7 +469,7 @@ (define (gitile-config-file host port database reposito= ries base-git-url (define gitile-nginx-server-block (match-lambda (($ package host port database repositories - base-git-url index-title intro footer nginx) + base-git-url index-title intro footer user group nginx) (list (nginx-server-configuration (inherit nginx) (locations @@ -488,7 +495,7 @@ (define gitile-nginx-server-block (define gitile-shepherd-service (match-lambda (($ package host port database repositories - base-git-url index-title intro footer nginx) + base-git-url index-title intro footer user group nginx) (list (shepherd-service (provision '(gitile)) (requirement '(loopback)) @@ -500,21 +507,27 @@ (define gitile-shepherd-service repositories base-git-url index-title intro footer)) - #:user "gitile" - #:group "git"))) + #:user #$user + #:group #$group))) (stop #~(make-kill-destructor))))))) =20 -(define %gitile-accounts - (list (user-group - (name "git") - (system? #t)) - (user-account - (name "gitile") - (group "git") - (system? #t) - (comment "Gitile user") - (home-directory "/var/empty") - (shell (file-append shadow "/sbin/nologin"))))) +(define (gitile-accounts config) + (let ((user (gitile-configuration-user config)) + (group (gitile-configuration-group config))) + (filter identity + (list + (and (equal? group "gitile") + (user-group + (name "gitile") + (system? #t))) + (and (equal? user "gitile") + (user-account + (name "gitile") + (group group) + (system? #t) + (comment "Gitile user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin")))))))) =20 (define gitile-service-type (service-type @@ -523,7 +536,7 @@ (define gitile-service-type on the web.") (extensions (list (service-extension account-service-type - (const %gitile-accounts)) + gitile-accounts) (service-extension shepherd-root-service-type gitile-shepherd-service) (service-extension nginx-service-type base-commit: 01d4363168ed10ea223047f7a7b83201f161ec0b --=20 2.45.2