From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cFt2Itul6GACCwEAgWs5BA (envelope-from ) for ; Fri, 09 Jul 2021 21:39:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6PoIHtul6GDVIQAA1q6Kng (envelope-from ) for ; Fri, 09 Jul 2021 19:39:07 +0000 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 29B6FED4D for ; Fri, 9 Jul 2021 21:39:07 +0200 (CEST) Received: from localhost ([::1]:58764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1wL4-0005VY-7Y for larch@yhetil.org; Fri, 09 Jul 2021 15:39:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1wL0-0005VQ-KO for guix-patches@gnu.org; Fri, 09 Jul 2021 15:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1wL0-00013Q-DG for guix-patches@gnu.org; Fri, 09 Jul 2021 15:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1wL0-00013v-Bh for guix-patches@gnu.org; Fri, 09 Jul 2021 15:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49431] [PATCH maintenance.git] nginx: berlin: Redirect old video URLs for each language. Resent-From: "pelzflorian (Florian Pelz)" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Jul 2021 19:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49431 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 49431@debbugs.gnu.org, Luis Felipe Received: via spool by 49431-submit@debbugs.gnu.org id=B49431.16258595384073 (code B ref 49431); Fri, 09 Jul 2021 19:39:02 +0000 Received: (at 49431) by debbugs.gnu.org; 9 Jul 2021 19:38:58 +0000 Received: from localhost ([127.0.0.1]:59819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1wKv-00013d-Jc for submit@debbugs.gnu.org; Fri, 09 Jul 2021 15:38:57 -0400 Received: from pelzflorian.de ([5.45.111.108]:58134 helo=mail.pelzflorian.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1wKt-00013T-7D for 49431@debbugs.gnu.org; Fri, 09 Jul 2021 15:38:56 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id DE54A360672; Fri, 9 Jul 2021 21:38:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1625859534; bh=rZyAO0k4HL6cAaGPlrkqMvFty9dNH7PpouuQlKJAySE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=rA/F3mWzJUL/FgyidJTGskZXzB9c9fTpJ32Acb8APwcfnDycCIuW5IovX2NzSuRzB 70sqv4gT/js+RtBkOegCSCuzuunVygDgISi373lF8zKv30NDqqF2dlD3oBQ5V0CeyP WDYanmTaVBQgdfDd3cev9VQzMry6ldrhxJdehDg8= Date: Fri, 9 Jul 2021 21:38:44 +0200 From: "pelzflorian (Florian Pelz)" Message-ID: <20210709193844.dk4e7q5nanqe7iz7@pelzflorian.localdomain> References: <20210706065304.6kqbwqlcf6calkh7@pelzflorian.localdomain> <87a6mwlxo3.fsf@gnu.org> <20210709070715.235m7qs3gicmms4w@pelzflorian.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210709070715.235m7qs3gicmms4w@pelzflorian.localdomain> 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625859547; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=85hzdkuYtX8uQgL/rSsFnHChKSe31cNaOFnszWjDD14=; b=Or6jhdRu3O5sZ+NHvZVTpet4hfqz/PLCITbOEa8atTPU2IDuE9g/ZqrKN3pD5EyhYlfCc3 szEjZTtp8sELHel2LEV+EH3ZTmz1vmAqAFNAS4kBl1tzir4YFkkkx8BfXtebU3ixtKrl7K lsLRtvKy19HIWzIgeWda4evPXIXAPDrBEouqm6ca3pp+Vj7DQHliBoI7Wg/fGhFbH9aJZR UyodTWIchBCkg7R5K5NJkz6832s9oON9FSsDLoI2POaaMlKqqbLdOYGlDq28wG1ujgtZ+8 /nThYIpdbFxA8bX/kwSYKo4keixXgy5K/1MnQJSNvR1r0WXb/8JJ3nCi9Bpvlg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625859547; a=rsa-sha256; cv=none; b=L0PqLHOurlk4gUgT/+i0w8H4WmT/sTa8Ym++HSiyg9TJKba56XfX6z89YOgiasg6McQTp+ E8kUW6Ivc21w6q0J4rJg5i1Br/0u9ThT9b8aFIbXiDeRxZQxHN8FswCFooaVQbnbb9k6vp xlti5wXsmGcKmDcpHPlsKwNOZuBWU3pAxpg7lDsdQ2nVw8kIQltuiTVEsMbGBQkaiDYtHF 0eixDMzuouUwHkgq8M9FBUnHK6c74beC29kK7nmPYohlOZyJDUMxADBtDuCPw7FE8ENWh3 R/cLcsbZf4sOwuiEQt1QAQ+YxCyff4SwMujbPSei0v+7ErzBCQb4yTAIwBSXIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=pelzflorian.de header.s=mail header.b="rA/F3mWz"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=pelzflorian.de header.s=mail header.b="rA/F3mWz"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 29B6FED4D X-Spam-Score: -1.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: BgP3SvBrYRsU On Fri, Jul 09, 2021 at 09:15:04AM +0200, pelzflorian (Florian Pelz) wrote: > From: Florian Pelz > > (guix.gnu.org-redirects-for-each-language): New procedure. Add > > new video redirections. […] > > +(define (guix.gnu.org-redirects-for-each-language) > > + ;; These old URL request paths existed in many forms; without /LANG > > + ;; in front and with /LANG in front for each language. Redirect > > + ;; each of them. > > + (define redirections > > + (list > > + (cons "/videos/everyday-use-of-gnu-guix,-part-one" "/videos/2020/everyday-use-of-gnu-guix-part-one/") > > + (cons "/videos/everyday-use-of-gnu-guix,-part-two" "/videos/2020/everyday-use-of-gnu-guix-part-two/") > > + (cons "/videos/system-graphical-installer" "/videos/2020/system-graphical-installer/") > > + (cons "/videos/asking-for-help" "/videos/2020/asking-for-help/") > > + (cons "/videos/installation-from-script" "/videos/2020/installation-from-script/") > > + (cons "/videos/packaging,-part-one" "/videos/2020/packaging-part-one/") > > + (cons "/videos/packaging,-part-two" "/videos/2020/packaging-part-two/") > > + (cons "/videos/packaging,-part-three" "/videos/2020/packaging-part-three/"))) > > + > > + (define (redirect-directory old new) > > + ;; Match nginx' behavior that request URLs with suffix "", "/" > > + ;; "/index.html" lead to the same file. The suffix "/" is not taken > > + ;; care of here because it already gets normalized by nginx location > > + ;; handling. The URLs in 'guix.gnu.org-redirect-locations' do not > > + ;; need this treatment, because they get an /index.html suffix > > + ;; through rewriting. > > + (let ((old-with-slashes-trimmed (string-trim-right old #\/))) > > + (list > > + (redirect old-with-slashes-trimmed new) > > + (redirect (string-append old-with-slashes-trimmed "/index.html") new)))) > > + > > + (define (guix.gnu.org-redirect-locations-for-lang lang) > > + (define (redirect-lang old new) > > + (redirect-directory (string-append "/" lang old) > > + (string-append "/" lang new))) > > + (append-map redirect-lang (map car redirections) (map cdr redirections))) > > + > > + (append > > + ;; Now all needed redirections are: > > + ;; > > + ;; 1) those without /LANG/ in front get redirected to /$lang/ > > + (append-map redirect-directory > > + (map car redirections) ;old URLs without /LANG > > + ;; new URLs with /$lang prepended: > > + (map (compose (lambda (new-without-lang) > > + (string-append "/$lang" new-without-lang)) > > + cdr) > > + redirections)) > > + ;; 2) those with /LANG/ in front get redirected to the same /LANG/ > > + (append-map guix.gnu.org-redirect-locations-for-lang > > + (map car languages-to-accept)))) > Do I need to add a copyright header? I hereby license/declare my > patch CC0 . > […] > Shall I push and then wait until someone guix system reconfigures > berlin? Sorry for again asking such general questions. A better question might be, should 'guix.gnu.org-redirects-for-each-language' go to a separate Guile module with a copyright header (if yes, what could it be named?), or remain in hydra/nginx/berlin.scm despite more complex code, without licensing information? Regards, Florian