Merge pull request #210 from DarkKirb/fix-forgejo

make forgejo work with backblaze b2
This commit is contained in:
Charlotte 🦝 Delenk 2023-03-27 15:04:35 +01:00 committed by GitHub
commit dc80077caa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -61,5 +61,8 @@ in
maintainers = with maintainers; [ma27]; maintainers = with maintainers; [ma27];
}; };
}; };
forgejo = prev.forgejo.overrideAttrs (prev: {
patches = prev.patches or [] ++ [./forgejo.patch];
});
} }
// nix-packages.packages.${system} // nix-packages.packages.${system}

13
overlays/forgejo.patch Normal file
View file

@ -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)