From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2AptMtEArGVxGwAAqHPOHw:P1 (envelope-from ) for ; Sat, 20 Jan 2024 18:20:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2AptMtEArGVxGwAAqHPOHw (envelope-from ) for ; Sat, 20 Jan 2024 18:20:17 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=K4w7OIDp; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705771217; 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:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=n14Wgrw5uOzA/jUzQ3ACWw3v0KUkOnNy1RrSfgaaa1Y=; b=iDRbqGrgr6bmC5ZCQFyNCCXU5F04s3tcQ8t52Q8Z581v9vAZytGOfV/hYrbQ/bYTUVyLVY y7OOevWtdl16lb7V47CxZFY0rVJTxdZrac5o4UBEoxfFmKNFvA6rYGGFY7i+M108urWftY +Ufg3+Emm7dwRxGCbZr42zBoVHfBnBnNadeWpHwHK2PVSVn+hApHs1OeiplBAIgmUllM8i xrTBxKu1eoY8ExyI5aBEpPJziEs44blrJcbiiWX9kCHW8hAfVs4+aqqnkAXVj2LS7lUnqe RpRa9b68zGBQRZFpwyx8emKNAtOFjBMJ+wL1H7gIMOePYwcRQjzmmSErjvNvsg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705771217; a=rsa-sha256; cv=none; b=quVkqPKy4po/i9GTc6sI8Akl2GztIRcuIvlAJ/qag8oShOcErzrAw+dq+p5A+y4wqFEcBg RTZDr4BediUbwuow73Bp8XPDk6eHOF86aY7Y0sHhqssv8wok6opuHRICApDAiUnoTLIb82 c1NyQEKrjNifPBAtOD8tV32Ap1p6ion1BVnCt1VJiijlz/GtpJ+x3XheBibx3U5j702xv7 pRquT5iu/wGgCod63xwhLekyHmKlv2iQoKxl2Gy4wpZ7DoGMoNcn3SHg5Byl+tnAFVmRkf 2p1vgTfHi1HSpZnye55s7vDJAj6kNIY/3Kw/kVbzOUNm+gsCZdrb8XkDWxjwRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=K4w7OIDp; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" 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 4F17D6D618 for ; Sat, 20 Jan 2024 18:20:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRF0j-0003S1-9k; Sat, 20 Jan 2024 12:20:01 -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 1rRF0h-0003Rq-VR for bug-guix@gnu.org; Sat, 20 Jan 2024 12:19:59 -0500 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 1rRF0h-0005Lf-NA for bug-guix@gnu.org; Sat, 20 Jan 2024 12:19:59 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRF0k-0006wF-B3 for bug-guix@gnu.org; Sat, 20 Jan 2024 12:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#68610: URI path in git-http-nginx-location-configuration doesn't accept / properly Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 20 Jan 2024 17:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68610 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 68610@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170577115426585 (code B ref -1); Sat, 20 Jan 2024 17:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2024 17:19:14 +0000 Received: from localhost ([127.0.0.1]:35568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rREzy-0006uj-8N for submit@debbugs.gnu.org; Sat, 20 Jan 2024 12:19:14 -0500 Received: from lists.gnu.org ([2001:470:142::17]:40412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rREzt-0006uK-92 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 12:19:13 -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 1rREzk-0003NG-Pa for bug-guix@gnu.org; Sat, 20 Jan 2024 12:19:00 -0500 Received: from mail-108-mta80.mxroute.com ([136.175.108.80]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rREzi-0005C7-Oo for bug-guix@gnu.org; Sat, 20 Jan 2024 12:19:00 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta80.mxroute.com (ZoneMTA) with ESMTPSA id 18d27e1e0a30003727.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 20 Jan 2024 17:18:51 +0000 X-Zone-Loop: a1c1c5d71789c163c1a248a4fe274fcd7c74beb6c566 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=n14Wgrw5uOzA/jUzQ3ACWw3v0KUkOnNy1RrSfgaaa1Y=; b=K4w7OIDp0C8XRHmio8Ei/IhM9T TGdWpjl09u447K5gR/CZThlu30X5u8U9izV87iP1wPk3vPnU0R4VxBrcbFsgmy3U5UiQ7kKBPg+/k YaZhdbbpbqySqM6pbbc1R+pslAKQuacqlmNskZnrn+R3I2kJA9SHKvG3NOHWOP68OJbdGS/KijdpO 9h3FWBK5gqbQuiFXG+BwTsSDWEofq6HEycqtwcEOSRNzzAqCqdUNIe7GopnK227YeUL5LpCdKfTk6 t5SC3L4bx7dcCQlWVxhPYVgcF1fqpOo3Yoix/QW8CFduDK/dcNAPPaSZExNNoF6biQAXZx9F1LvgJ yKq8VQ3Q==; From: Richard Sent Date: Sat, 20 Jan 2024 12:18:47 -0500 Message-ID: <87zfwzapoo.fsf@freakingpenguin.com> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.80; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta80.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -6.68 X-Spam-Score: -6.68 X-Migadu-Queue-Id: 4F17D6D618 X-TUID: K/5+7Iegdgrx Hi all, In the documentation for Version Control Services, there is example code for sharing Git repos through Nginx, posted below. The line (git-http-configuration (uri-path "/")) implies that git repositories can be reached at "git.my-host.org/repo.git". However, this doesn't work. --8<---------------cut here---------------start------------->8--- (service nginx-service-type (nginx-configuration (server-blocks (list (nginx-server-configuration (listen '("443 ssl")) (server-name "git.my-host.org") (ssl-certificate "/etc/letsencrypt/live/git.my-host.org/fullchain.pem") (ssl-certificate-key "/etc/letsencrypt/live/git.my-host.org/privkey.pem") (locations (list (git-http-nginx-location-configuration (git-http-configuration (uri-path "/")))))))))) --8<---------------cut here---------------end--------------->8--- Nginx's location information is generated by git-http-nginx-location-configuration, which runs --8<---------------cut here---------------start------------->8--- (uri (string-append "~ /" (string-trim-both uri-path #\/) "(/.*)")) --8<---------------cut here---------------end--------------->8--- If uri-path is "/" (or "", or "\"), this entry will be created in nginx.conf: --8<---------------cut here---------------start------------->8--- location ~ /(/.*) { .... } --8<---------------cut here---------------end--------------->8--- This location regex pattern will match git.my-host.org//, but not git.my-host.org/. However, Nginx merges slashes by default, so you cannot access the repo with 'http://git.my-host.org//repo.git' because Nginx collapses that to http://git.my-host.org/repo.git before matching the URI against the location pattern. Which, as mentioned, does not match. I did find that (uri-path "*") does work, but I've not tested it extensively. I also found that I can add `(raw-content (list "merge_slashes off;"))` to nginx-server-configuration, then use `$ git clone http://git.my-host.org//repo.git`, but that's not ideal. At minimum, the documentation should be updated to reflect this (uri-path "/" vs "\" vs "" are identical). I don't know what the future plans are for git-http-service, but I can think of two possible solutions: 1. git-http-nginx-location-configuration no longer modifies uri-path and instead pastes it literally in nginx.conf. To my understanding "/git" would work identically without the regex match currently used, exposing repos at "host.domain/git/path/to/repo.git", but I've not tested this. 2. git-http-nginx-location-configuration takes an optional Nginx-style URI pattern argument that, if passed, replaces the URI generated from git-http-configuration. -- Take it easy, Richard Sent Making my computer weirder one commit at a time.