From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31389 invoked from network); 6 Mar 2023 14:31:48 -0000 Received: from lists.zx2c4.com (165.227.139.114) by inbox.vuxu.org with ESMTPUTF8; 6 Mar 2023 14:31:48 -0000 Received: by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTP id fce0e493; Mon, 6 Mar 2023 14:31:35 +0000 (UTC) Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [2607:f8b0:4864:20::533]) by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id caeac906 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 6 Mar 2023 14:31:32 +0000 (UTC) Received: by mail-pg1-x533.google.com with SMTP id 16so5625397pge.11 for ; Mon, 06 Mar 2023 06:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; t=1678113091; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nG6PB12bMUOxtK/DsrJ14BbV1JCsFtZ2l0vMwVkYpt8=; b=NRmTqpghMnHysWak50Hnwd5BS+6ejW5DbryW63nm9kwbbGPXuJpONc0t4PgLrwoh22 L1S8YkvckzcyZ0wEWxuyQehvOmiQ6Tk/EfvVTeOmyYuEjyXSD3E2XwwDCozKBDNdpI47 lXb1NaajuoaRGhp/3iLEO5cgNZgqzk42ysj9bCaZuptmFzq5l/bdycSM3MyGGlFY854x LvoxeCy4vTIFqhzDvTWCILixq13oKPGTdBpZVVBs9Ia3wmqXIwX27LF3WOthfW1wmD59 sQOpLhtbv+4KonA6CGuyjwe6oOjx+At7kGwTPFCGiG3PQ7OjC8cfB495UZjq36I4XVcR Wtqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678113091; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nG6PB12bMUOxtK/DsrJ14BbV1JCsFtZ2l0vMwVkYpt8=; b=Uha6nPdFvRDttq+VSIvAurVZtaVGwJVs/xp0IRCr+Q5Y3OlbRX+i5eSs8x3ERbwdWg 4tZ+Ta43HMC3XOndQP3G0j8EozdpSVZURWHNusmPqmbq6t1XBiinrH4TDgeDSFMbnJeI 9Qe+dS9/8eds4bzolIZP1uZ4O/C028N3/s4tsCjRmQMgwLlbOPk9s6JSdwmfrSOOfR+I 4FG92GrOWCUleGDDh8P9gtKfQA7qS0NsnV59Ht0fBdXNZVpp3ZqUSgiUq4s0qH3CZ60a YTz4bq8yDJM9ZLPHCmuf1+SpEwjG9fAB85nG6nJnrBX5ZHwUVhDZy6vJQHZLeKFsyNv6 9FlQ== X-Gm-Message-State: AO0yUKUEvTRr7L5HUkoIPSJLv85S2kH2KFTB5AAU8CeKcwJP+3nr6kwn AMxIlGgq/lusACoi9uRSYUF96Q6w/WxZzqAqHA0Fa2VbmSQ= X-Google-Smtp-Source: AK7set9AMwnxR+mDJUHq3VEMaPU+IORZzpw7xRSGoCrD34xS6dYxYJh58Yiuyxb5mnns6sZtJ8I2mjl4CAN+sT36wcI= X-Received: by 2002:a62:868b:0:b0:5d6:4f73:97a with SMTP id x133-20020a62868b000000b005d64f73097amr4756099pfd.1.1678113090982; Mon, 06 Mar 2023 06:31:30 -0800 (PST) MIME-Version: 1.0 From: Andreas Mahling Date: Mon, 6 Mar 2023 15:31:19 +0100 Message-ID: Subject: cgit with busybox httpd To: cgit@lists.zx2c4.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" sorry, I've missed sending to the list address I wrote a script test.sh which prints the environment. When called as http://git/cgi-bin/test.sh/xyz PATH_INFO ist set to '/xyz' When called as http://git/cgi-bin/test.sh/xyz/ 404 is thrown. So the problem seems to be caused by httpd hello John, It seems the 404 is generated by httpd, I think because the url ends with a slash httpd treats the part after cgit.cgi not as PATH_INFO (as it should) but as a directory. So this seems more a fault of httpd to me. Sorry, but I don't understand how to put into QUERY_STRING what now goes into PATH_INFO. Do you mean the virtual-root option in cgitrc? It is already commented out in my setup, but cgit builds the url with PATH_INFO part anyway. best regards Andreas Am Mo., 6. M=C3=A4rz 2023 um 12:41 Uhr schrieb John Keeping : > > On Mon, Mar 06, 2023 at 11:13:10AM +0100, Andreas Mahling wrote: > > I'm in the process to configure a cgit instance for my private network = at home. > > Because my internet router will be the host for git and cgit, I'm > > looking for a ligthweight setup. > > I would like to use busybox httpd as webserver, which has a very low > > footprint and supports cgi, but no other fancy bells and whistles, > > especially no url rewrite. > > > > It works in principle, but there is a problem with the URLs generated > > by cgit: they seem always containing a trailing slash. This leads to a > > 404 error thrown by httpd. If I manually remove the slash, everyting > > is OK. > > > > Example given: > > http://git/cgi-bin/cgit.cgi/linuxadmin.git/ -> 404 > > http://git/cgi-bin/cgit.cgi/linuxadmin.git -> Page ist shown > > > > Is there a way to tell cgit to give up the trailing slash? I'm running > > cgit-1.2.3-r3 on Alpine 3.17.2 > > I don't think it's possible to change that behaviour without patching > CGit. Given how URLs are constructed, it looks a bit complicated to fix > in all cases, but you could remove the setting of "virtual_root" in > cmd_main() to force using query parameters instead of virtual paths in > URLs. > > Can you tell where the 404 is generated? Is this a case of httpd > returning an error when it shouldn't, or is it a behaviour difference > that CGit isn't handling correctly - maybe other CGI hosts strip > trailing slashes before passing a path to CGit but httpd doesn't? >