From 42f23754c11ac72c367742407769e09d71815954 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 23 Jun 2022 19:20:40 -0700 Subject: fix(modules/cgit): correct alias configuration for robots.txt As noted in https://github.com/yandex/gixy/blob/master/docs/en/plugins/aliastraversal.md > if you want to map a single file make sure the location starts with a > =, e.g =/i.gif instead of /i.gif Without a leading `=`, the configuration refuses to build. Change-Id: Ib49f68fbe26441ff6c3ee91efa1d12c3778a0248 Reviewed-on: https://cl.fcuny.net/c/world/+/489 Reviewed-by: Franck Cuny Tested-by: CI --- modules/services/cgit/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/services') diff --git a/modules/services/cgit/default.nix b/modules/services/cgit/default.nix index 39e1633..704d0dc 100644 --- a/modules/services/cgit/default.nix +++ b/modules/services/cgit/default.nix @@ -109,7 +109,9 @@ in enableACME = true; locations = { "~* ^.+.(css|png|ico)$" = { root = "${pkgs.cgit}/cgit"; }; - "/robots.txt".alias = robots-deny; + # as per https://github.com/yandex/gixy/blob/master/docs/en/plugins/aliastraversal.md + # if you want to map a single file make sure the location starts with a =, e.g =/i.gif instead of /i.gif. + "=/robots.txt".alias = robots-deny; "/".extraConfig = '' include ${pkgs.nginx}/conf/fastcgi_params; fastcgi_param CGIT_CONFIG ${pkgs.writeText "cgitrc" cgitrc}; -- cgit 1.4.1