From patchwork Sat Jun 22 19:33:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodion Goritskov X-Patchwork-Id: 65581 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 DA84427BBEA; Sat, 22 Jun 2024 20:37:16 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS 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 96E6727BBE2 for ; Sat, 22 Jun 2024 20:37:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL6Xo-0001Pq-Iz; Sat, 22 Jun 2024 15:37:04 -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 1sL6Xn-0001PZ-C5 for guix-patches@gnu.org; Sat, 22 Jun 2024 15:37:03 -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 1sL6Xn-0000PG-2M for guix-patches@gnu.org; Sat, 22 Jun 2024 15:37:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sL6Xm-0001Q1-Hf for guix-patches@gnu.org; Sat, 22 Jun 2024 15:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71722] [PATCH 1/2] services: agate: Update options for compatibility with the current Agate version. Resent-From: Rodion Goritskov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Jun 2024 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71722 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71722@debbugs.gnu.org Cc: Rodion Goritskov Received: via spool by 71722-submit@debbugs.gnu.org id=B71722.17190849885384 (code B ref 71722); Sat, 22 Jun 2024 19:37:02 +0000 Received: (at 71722) by debbugs.gnu.org; 22 Jun 2024 19:36:28 +0000 Received: from localhost ([127.0.0.1]:57781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL6XE-0001Om-4q for submit@debbugs.gnu.org; Sat, 22 Jun 2024 15:36:28 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:55418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL6XC-0001OX-74 for 71722@debbugs.gnu.org; Sat, 22 Jun 2024 15:36:26 -0400 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4217136a74dso25295795e9.2 for <71722@debbugs.gnu.org>; Sat, 22 Jun 2024 12:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719084920; x=1719689720; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DEZXbW9enrhmkK05bukDIGTMvHGu0wGW1/6B+pOS7Jo=; b=l1SmSi/HVtufRsa11SMwQXGVPFGdf1/s6+abIpA5ZN8U/YJrSSeQPyoSU94rtpZLWc J+GgevysznJoVcpaXsR7ATmNCeXJnT030xnQ50KdAZkNakO9gxxxRnTp6ZleyA+pPu3K 5DuY7VbAZxKI7Es97YSMAL8n0nmXbsF50Ha7ZhKH3UOvhNVjYbth+Wy3bnI+ScnEkItm 4uTFI/gK+WL7VE9Ohgb1441582QIHT6XREg8YxPLnQ5iyeLSMinwjbD8ADS9Mmc2VVKt CFO06vGkEYtQeCm5gIXPchIRYQU9HZJxMwwLQ9CO2m3A+rkqePDBlY5V3aK9xn5BSwE4 DI5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719084920; x=1719689720; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DEZXbW9enrhmkK05bukDIGTMvHGu0wGW1/6B+pOS7Jo=; b=pWtF0dhtRgPbWznqryAmZXRBl8CVYvzzvg5ZKJL3o6Xpc0/TvKkBOqMPJ9+gDrey1I KrFwCgBFlBShIL07rJUzH6utakONFcpReBkLdO9pnfH3u8iUzGcDlKpm8a/8GOM+A7XD LdR3PQ/py/C+1He/88w+uENyvkO/o4Zf2VlILDd2phRGMYqY7619wrXppQy74zC5b6v9 VwjbQoS+hC07Bcp5YdtDYmtQWL+U+H0y5fhKarshbyxvAjSHFI9cabDOsBKUVpsVDVXp IUOsoUMk7pVlU3RgHYox9Bw6e3s5XXQypSS6C+nXnCNQgPgBRmydG26Vmr5uMQdrZIOp +GPg== X-Gm-Message-State: AOJu0YyCkHGf2YVPV4a3elWUsd9vp7tg0vPkb/KPU6VZIUGH18/oiy9u a6xdTMsytEUaGM9bOxHw8gZgZMvVJLOd6nemKw3tj8Tr/LJ0oedKLU4lVA== X-Google-Smtp-Source: AGHT+IELER+RrEr/4D5Nty3aT/dYtBFQ8CJyc6y0G2QX40PA3OtNJBrTZBa9Ik8efgXShcxyeROy+g== X-Received: by 2002:a5d:59a8:0:b0:365:aad:2f5f with SMTP id ffacd0b85a97d-366e9569f3fmr450734f8f.29.1719084918857; Sat, 22 Jun 2024 12:35:18 -0700 (PDT) Received: from bumblebee-mighty.lan ([92.51.75.166]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366389b8ab0sm5433576f8f.27.2024.06.22.12.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 12:35:18 -0700 (PDT) From: Rodion Goritskov Date: Sat, 22 Jun 2024 23:33:54 +0400 Message-ID: <258b03236418dc733802f4834f02565755063e76.1719082137.git.rodion.goritskov@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: References: MIME-Version: 1.0 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 ()[certs]: Add. * gnu/services/web.scm ()[cert]: Remove. * gnu/services/web.scm ()[key]: Remove. * gnu/services/web.scm ()[hostname]: Change from string to list. * gnu/services/web.scm ()[silent?]: Remove. * gnu/services/web.scm ()[only-tls13?]: Add. * gnu/services/web.scm ()[central-conf?]: Add. * gnu/services/web.scm ()[ed25519?]: Add. * gnu/services/web.scm ()[skip-port-check?]: Add. * gnu/services/web.scm (agate-shepherd-service): Change handling of addr and hostname, add new options handling. Change-Id: Ibc83a7254d1e425604d4aa0b95cbaa74fc9c72eb --- gnu/services/web.scm | 50 +++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 406117c457..1ee1fff9ed 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -302,13 +302,15 @@ (define-module (gnu services web) agate-configuration? agate-configuration-package agate-configuration-content - agate-configuration-cert - agate-configuration-key + agate-configuration-certs agate-configuration-addr agate-configuration-hostname agate-configuration-lang - agate-configuration-silent + agate-configuration-only-tls13 agate-configuration-serve-secret + agate-configuration-central-conf + agate-configuration-ed25519 + agate-configuration-skip-port-check agate-configuration-log-ip agate-configuration-user agate-configuration-group @@ -2177,20 +2179,24 @@ (define-record-type* (default agate)) (content agate-configuration-content (default "/srv/gemini")) - (cert agate-configuration-cert - (default #f)) - (key agate-configuration-key - (default #f)) + (certs agate-configuration-certs + (default "/srv/gemini-certs")) (addr agate-configuration-addr (default '("0.0.0.0:1965" "[::]:1965"))) (hostname agate-configuration-hostname - (default #f)) + (default '())) (lang agate-configuration-lang (default #f)) - (silent? agate-configuration-silent - (default #f)) + (only-tls13? agate-configuration-only-tls13 + (default #f)) (serve-secret? agate-configuration-serve-secret (default #f)) + (central-conf? agate-configuration-central-conf + (default #f)) + (ed25519? agate-configuration-ed25519 + (default #f)) + (skip-port-check? agate-configuration-skip-port-check + (default #f)) (log-ip? agate-configuration-log-ip (default #t)) (user agate-configuration-user @@ -2202,8 +2208,10 @@ (define-record-type* (define agate-shepherd-service (match-lambda - (($ package content cert key addr - hostname lang silent? serve-secret? + (($ package content certs addr + hostname lang only-tls13? + serve-secret? central-conf? + ed25519? skip-port-check? log-ip? user group log-file) (list (shepherd-service (provision '(agate)) @@ -2213,17 +2221,21 @@ (define agate-shepherd-service #~(make-forkexec-constructor (list #$agate "--content" #$content - "--cert" #$cert - "--key" #$key - "--addr" #$@addr + "--certs" #$certs + #$@(append-map + (lambda x (append '("--addr") x)) + addr) + #$@(append-map + (lambda x (append '("--hostname") x)) + hostname) #$@(if lang (list "--lang" lang) '()) - #$@(if hostname - (list "--hostname" hostname) - '()) - #$@(if silent? '("--silent") '()) #$@(if serve-secret? '("--serve-secret") '()) + #$@(if only-tls13? '("--only-tls13") '()) + #$@(if central-conf? '("--central-conf") '()) + #$@(if ed25519? '("--ed25519") '()) + #$@(if skip-port-check? '("--skip-port-check") '()) #$@(if log-ip? '("--log-ip") '())) #:user #$user #:group #$group #:log-file #$log-file))) From patchwork Sat Jun 22 19:33:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodion Goritskov X-Patchwork-Id: 65582 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 2ABA827BBE9; Sat, 22 Jun 2024 20:37:29 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS 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 7758227BBE2 for ; Sat, 22 Jun 2024 20:37:28 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL6Xp-0001QP-N6; Sat, 22 Jun 2024 15:37:05 -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 1sL6Xn-0001Pa-DJ for guix-patches@gnu.org; Sat, 22 Jun 2024 15:37:03 -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 1sL6Xn-0000PK-4V for guix-patches@gnu.org; Sat, 22 Jun 2024 15:37:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sL6Xn-0001Q9-0L for guix-patches@gnu.org; Sat, 22 Jun 2024 15:37:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71722] [PATCH 2/2] services: agate-service-type: Update documentation. Resent-From: Rodion Goritskov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Jun 2024 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71722 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71722@debbugs.gnu.org Cc: Rodion Goritskov Received: via spool by 71722-submit@debbugs.gnu.org id=B71722.17190849995413 (code B ref 71722); Sat, 22 Jun 2024 19:37:02 +0000 Received: (at 71722) by debbugs.gnu.org; 22 Jun 2024 19:36:39 +0000 Received: from localhost ([127.0.0.1]:57788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL6XO-0001PE-MB for submit@debbugs.gnu.org; Sat, 22 Jun 2024 15:36:39 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:61682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL6XN-0001Oy-3j for 71722@debbugs.gnu.org; Sat, 22 Jun 2024 15:36:37 -0400 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-364b2f92388so2044583f8f.2 for <71722@debbugs.gnu.org>; Sat, 22 Jun 2024 12:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719084931; x=1719689731; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N1aXpfejDC0OoBW0DuXaBkhE9Tl2WF+PbORDgm0v8lI=; b=foqA3VrJdFO9ga0IAFeMEWbVLMCxjLb9Hs5jrb9KiHoEuicYuxw9rK+uKSeDiirjqj smW6AFqzUWFN1WCurnAci1dpUJ5P/CmydZoKyH4UJz2TVWllHOWfiAQJSFm6psYGoEGT /EHSRd7cg6aEq/A+TObToxZJXuKqrP0ZyZJdPTm7KMLG6oXuqrdnLhfeh6Si7MIeVRth D4OCeyC0R8U1cdwGqkW/w6KVbKM0GvAf5/cZORV9G3DUGdH3vUACFGiWAQRyHCqGuTch TgncfLtq78rYQdqDDgKzOrc9BSMyKZH28ZufSOhnQrfWfVPVjS3KBdr2wslqVNxPtyaM KuMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719084931; x=1719689731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N1aXpfejDC0OoBW0DuXaBkhE9Tl2WF+PbORDgm0v8lI=; b=eoMh/iv9eeh9LBdLDDWO8MW2dR0N6eiMZpA2sMuSpLoPt3XHJ+u/WqRJOS4nu5NTLN /0jfKx+MtoVS9Cvw+Ff5pvSzmnNhU+GvojYmzz/QyoYG7/QfrOL72XxzpxpDXKxxRpYo nqQx/cmlYcP5kmrZojw+qrHDdtBSv+xsNiCRHg3kSZymSDy0+uklFyegMCcUeqMGLfjh Wtm5aNqllmmF/UKBTRHWsuDihWsXhRZOXNBHkgUM/jKbRvKHeQ/vvqhsrQulUwfU/NOs 2mrt3AGGmfZ6y6KGKIrMvdUaI6d00YxnTDg25j4YZRFM4MS+fwSkB4OVhusFLqPGHCic LZbw== X-Gm-Message-State: AOJu0YzkJ5t9yZ1XSQuiNP46nx1Jkf05dPDS1AozBhzofkgMfanE9BrY Tm/NydGC5WkwDbgvdR5SZzRFtlg6R0WZpKkElGiJrDJafN00HIR5gWF1sQ== X-Google-Smtp-Source: AGHT+IEd05W2V78xhC4stBg3Ai+cQqzrI2PBHcbCFRkmSSHNjOkvX9wT5U/zodG8lfQahfMQnKT7fg== X-Received: by 2002:a5d:4a47:0:b0:35f:22e4:fb58 with SMTP id ffacd0b85a97d-366e9463f42mr319110f8f.8.1719084930568; Sat, 22 Jun 2024 12:35:30 -0700 (PDT) Received: from bumblebee-mighty.lan ([92.51.75.166]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366389b8ab0sm5433576f8f.27.2024.06.22.12.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 12:35:30 -0700 (PDT) From: Rodion Goritskov Date: Sat, 22 Jun 2024 23:33:55 +0400 Message-ID: <60dbc3caee3fc6038fceeeb5ca677cf1d626c8a7.1719082137.git.rodion.goritskov@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: References: MIME-Version: 1.0 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 * doc/guix.texi: Document (agate-service-type) updated options. Change-Id: Ifb4968d704627344913bb69f20636d710a4fe738 --- doc/guix.texi | 51 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0102fd0fad..c75de94486 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -32734,25 +32734,30 @@ Web Services (service agate-service-type (agate-configuration (content "/srv/gemini") - (cert "/srv/cert.pem") - (key "/srv/key.rsa"))) + (certs "/srv/gemini-certs"))) @end lisp The example above represents the minimal tweaking necessary to get Agate -up and running. Specifying the path to the certificate and key is +up and running. Specifying the path to the certificate and key directory is always necessary, as the Gemini protocol requires TLS by default. -To obtain a certificate and a key, you could, for example, use OpenSSL, -running a command similar to the following example: +If specified path is writable by Agate, and contains no valid key +and certificate, the Agate will try to generate them on the first start. +If specified directory is read-only - key and certificate should be pre-generated by user. + +To obtain a certificate and a key in a DER format, you could, for example, +use OpenSSL, running a commands similar to the following example: @example -openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem \ - -days 3650 -nodes -subj "/CN=example.com" +openssl genpkey -out key.der -outform DER -algorithm RSA \ + -pkeyopt rsa_keygen_bits:4096 +openssl req -x509 -key key.der -outform DER -days 3650 -out cert.der \ + -subj "/CN=example.com" @end example Of course, you'll have to replace @i{example.com} with your own domain name, and then point the Agate configuration towards the path of the -generated key and certificate. +directory with the generated key and certificate using the @code{certs} option. @end defvar @@ -32766,30 +32771,38 @@ Web Services @item @code{content} (default: @file{"/srv/gemini"}) The directory from which Agate will serve files. -@item @code{cert} (default: @code{#f}) -The path to the TLS certificate PEM file to be used for encrypted -connections. Must be filled in with a value from the user. - -@item @code{key} (default: @code{#f}) -The path to the PKCS8 private key file to be used for encrypted -connections. Must be filled in with a value from the user. +@item @code{certs} (default: @file{"/srv/gemini-certs"}) +Root of the certificate directory. Must be filled in with a value from the user. @item @code{addr} (default: @code{'("0.0.0.0:1965" "[::]:1965")}) A list of the addresses to listen on. -@item @code{hostname} (default: @code{#f}) -The domain name of this Gemini server. Optional. +@item @code{hostnames} (default: @code{'()}) +Virtual hosts for the Gemini server. If multiple values are +specified, corresponding directory names should be present in the @code{content} +directory. Optional. @item @code{lang} (default: @code{#f}) RFC 4646 language code(s) for text/gemini documents. Optional. -@item @code{silent?} (default: @code{#f}) -Set to @code{#t} to disable logging output. +@item @code{only-tls13?} (default: @code{#f}) +Set to @code{#t} to disable support for TLSv1.2. @item @code{serve-secret?} (default: @code{#f}) Set to @code{#t} to serve secret files (files/directories starting with a dot). +@item @code{central-conf?} (default: @code{#f}) +Set to @code{#t} to look for the .meta configuration file in the @code{content} +root directory and will ignore @code{.meta} files in other directories + +@item @code{ed25519?} (default: @code{#f}) +Set to @code{#t} to generate keys using the Ed25519 signature algorithm +instead of the default ECDSA. + +@item @code{skip-port-check?} (default: @code{#f}) +Set to @code{#t} to skip URL port check even when a @code{hostname} is specified. + @item @code{log-ip?} (default: @code{#t}) Whether or not to output IP addresses when logging.