From 0170765df53e8c001b7e39dc0eb547ff4a7c76d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 17 Jan 2024 10:11:13 +0200 Subject: [PATCH] gitea: use compressed assets --- modules/services/gitea/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/services/gitea/default.nix b/modules/services/gitea/default.nix index a7766e7..de031be 100644 --- a/modules/services/gitea/default.nix +++ b/modules/services/gitea/default.nix @@ -1,6 +1,7 @@ { config, lib, + pkgs, myData, ... }: { @@ -41,6 +42,7 @@ }; security.LOGIN_REMEMBER_DAYS = 30; server = { + STATIC_URL_PREFIX = "/static"; ENABLE_GZIP = true; LANDING_PAGE = "/motiejus"; ROOT_URL = "https://git.jakstys.lt"; @@ -73,6 +75,14 @@ caddy = { virtualHosts."git.jakstys.lt".extraConfig = '' + route /static/assets/* { + uri strip_prefix /static/assets + file_server * { + root ${pkgs.gitea.passthru.data-compressed}/public + precompressed br gzip + } + } + reverse_proxy 127.0.0.1:${toString myData.ports.gitea} ''; };