From 96667b20ffcc1a4ad08632b5f4dd59f45b40bbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sun, 26 Mar 2023 09:25:26 +0100 Subject: [PATCH] make forgejo work with backblaze b2 --- overlays/default.nix | 3 +++ overlays/forgejo.patch | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 overlays/forgejo.patch diff --git a/overlays/default.nix b/overlays/default.nix index 5bd0ee84..10c6b4b3 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -61,5 +61,8 @@ in maintainers = with maintainers; [ma27]; }; }; + forgejo = prev.forgejo.overrideAttrs (prev: { + patches = prev.patches or [] ++ [./forgejo.patch]; + }); } // nix-packages.packages.${system} diff --git a/overlays/forgejo.patch b/overlays/forgejo.patch new file mode 100644 index 00000000..f068e191 --- /dev/null +++ b/overlays/forgejo.patch @@ -0,0 +1,13 @@ +diff --git a/modules/storage/minio.go b/modules/storage/minio.go +index 8cc06bc..9ad9f46 100644 +--- a/modules/storage/minio.go ++++ b/modules/storage/minio.go +@@ -142,7 +142,7 @@ func (m *MinioStorage) Save(path string, r io.Reader, size int64) (int64, error) + m.buildMinioPath(path), + r, + size, +- minio.PutObjectOptions{ContentType: "application/octet-stream"}, ++ minio.PutObjectOptions{ContentType: "application/octet-stream", SendContentMd5: true}, + ) + if err != nil { + return 0, convertMinioErr(err)