From 7e82daa7d191c5cbfe551bc02191a2fc4366da98 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 16 Jul 2023 21:30:14 -0400 Subject: [PATCH 1/4] gitea: 1.19.4 -> 1.20.0 --- pkgs/applications/version-management/gitea/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/gitea/default.nix b/pkgs/applications/version-management/gitea/default.nix index 0b9e1a9d93ab1..29059d74b7c7e 100644 --- a/pkgs/applications/version-management/gitea/default.nix +++ b/pkgs/applications/version-management/gitea/default.nix @@ -20,12 +20,12 @@ buildGoModule rec { pname = "gitea"; - version = "1.19.4"; + version = "1.20.0"; # not fetching directly from the git repo, because that lacks several vendor files for the web UI src = fetchurl { url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz"; - hash = "sha256-vNMNEKMpUoVLUGwPPVhLKfElFmjCWgZHY5i1liNs+xk="; + hash = "sha256-ME2ZYSeaHru/7wBFBmXLpf9dKpl0WrtrmAqmzw37tq4="; }; vendorHash = null; From 42105b2ba37a5f98b0996c34aa5dc3979975c6a4 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 17 Jul 2023 11:49:34 +0200 Subject: [PATCH 2/4] nixos/gitea: explicitly set CHUNKED_UPLOAD_PATH to writable location Fix for Gitea 1.20.0. Without this being set, e.g. a `git push` (or `ssh` to `git@` in general) fails like this: 2023/07/17 09:27:05 ...s/setting/setting.go:109:LoadCommonSettings() [F] Unable to load settings from config: unable to create chunked upload directory: /nix/store/yna9nf66wl2n9hlnhxi2g7fdgawk2kxl-gitea-1.20.0/bin/data/tmp/package-upload (mkdir /nix/store/yna9nf66wl2n9hlnhxi2g7fdgawk2kxl-gitea-1.20.0/bin/data: read-only file system) Connection to git.mbosch.me closed. --- nixos/modules/services/misc/gitea.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 945009f005801..3cc0e54723d96 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -439,6 +439,8 @@ in lfs = mkIf cfg.lfs.enable { PATH = cfg.lfs.contentDir; }; + + packages.CHUNKED_UPLOAD_PATH = "${cfg.stateDir}/tmp/package-upload"; }; services.postgresql = optionalAttrs (usePostgresql && cfg.database.createDatabase) { From b8a8e973b079978d1af22ba043516e7985fd3809 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 17 Jul 2023 11:59:35 +0200 Subject: [PATCH 3/4] nixos/tests/gitea: fix * Since Gitea 1.20 the request to `/commits` requires at least one retry because it appears to take a moment until Gitea actually knows that this repo isn't empty anymore (previously on 1.20 this failed with HTTP 409 which occurs when the requested repo is empty). * Remove `*.shutdown()`, for some reason they hang regularly for unknown reasons. --- nixos/tests/gitea.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nixos/tests/gitea.nix b/nixos/tests/gitea.nix index 2285bb5a42529..b8926cfa35465 100644 --- a/nixos/tests/gitea.nix +++ b/nixos/tests/gitea.nix @@ -121,14 +121,10 @@ let client2.succeed(f"GIT_SSH_COMMAND='{GIT_SSH_COMMAND}' git clone {REPO}") client2.succeed('test "$(cat repo/testfile | xargs echo -n)" = "hello world"') - server.succeed( + server.wait_until_succeeds( 'test "$(curl http://localhost:3000/api/v1/repos/test/repo/commits ' + '-H "Accept: application/json" | jq length)" = "1"' ) - - client1.shutdown() - client2.shutdown() - server.shutdown() ''; }); in From b61919e5e0b4a6ad12eededfee4af703a9182c4e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 20 Jul 2023 22:20:43 +0200 Subject: [PATCH 4/4] nixos/gitea: set service type to `notify` --- nixos/modules/services/misc/gitea.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 3cc0e54723d96..89a6d01516206 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -577,7 +577,7 @@ in ''; serviceConfig = { - Type = "simple"; + Type = "notify"; User = cfg.user; Group = cfg.group; WorkingDirectory = cfg.stateDir;