[PR #122] [MERGED] Git LFS support v2 #15164

Closed
opened 2025-11-02 11:40:20 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/122
Author: @fabian-z
Created: 11/8/2016
Status: Merged
Merged: 12/26/2016
Merged by: @lunny

Base: masterHead: gitea_lfs


📝 Commits (10+)

  • 74f1ff6 Import github.com/git-lfs/lfs-test-server as lfs module base
  • f034682 Import github.com/dgrijalva/jwt-go into vendor/
  • 3d8fd95 Remove config, add JWT support from github.com/mgit-at/lfs-test-server
  • 7b3bfe8 Add LFS settings
  • 3727c21 Add LFS meta object model
  • 2e433b9 Add LFS routes and initialization
  • 9e8f91d Adapt LFS module: handlers, routing, meta store
  • f111811 Move LFS routes to /user/repo/info/lfs/*
  • c190661 Add request header checks to LFS BatchHandler / PostHandler
  • 73c52ed Implement LFS basic authentication

📊 Changes

37 files changed (+2632 additions, -11 deletions)

View changed files

📝 cmd/serve.go (+63 -1)
📝 cmd/web.go (+12 -0)
📝 models/git_diff.go (+25 -0)
models/lfs.go (+122 -0)
📝 models/models.go (+1 -1)
📝 models/repo.go (+57 -0)
📝 modules/auth/user_form.go (+1 -0)
📝 modules/base/tool.go (+13 -0)
modules/lfs/LICENSE (+20 -0)
modules/lfs/content_store.go (+94 -0)
modules/lfs/server.go (+549 -0)
📝 modules/setting/setting.go (+90 -0)
📝 options/locale/locale_en-US.ini (+4 -0)
📝 routers/install.go (+19 -0)
📝 routers/repo/view.go (+27 -0)
📝 templates/install.tmpl (+5 -0)
📝 templates/repo/diff/box.tmpl (+1 -1)
📝 templates/repo/view_file.tmpl (+2 -2)
vendor/github.com/dgrijalva/jwt-go/LICENSE (+8 -0)
vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md (+97 -0)

...and 17 more files

📄 Description

Requested in #80

This PR implements Git LFS support for Gitea, supporting the legacy v1 API as well as the current batch v1 API.

Originally imported LFS server code base from https://github.com/git-lfs/lfs-test-server.
Rebased from original PR gogits/gogs#3868 for Gitea, considering inital review in #120.

Features:

  • Uses recommended paths with HTTP and SSH remotes, no custom user settings necessary
  • Supports basic authentication with user credentials
  • Supports authentication with SSH (passing JWT under the hood)
  • Supports no authentication when pulling public repositories (however git-lfs still asks for credentials, where the prompt can be skipped - likely a bug in git-lfs) (Workaround for git-lfs bug applied in d1a2dca05b)
  • Settings transparently integrated into installation process
  • Removes LFS objects when repositories are deleted. Works with forks (e.g. when parent repository is deleted)

Notes:

  • LFS installation setting does not show added locale strings because bindata is not regenerated in this PR (as requested by @strk in #120)

Sorry for my misunderstanding regarding this projects state. Looking forward to working together with you! 😄


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/122 **Author:** [@fabian-z](https://github.com/fabian-z) **Created:** 11/8/2016 **Status:** ✅ Merged **Merged:** 12/26/2016 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `gitea_lfs` --- ### 📝 Commits (10+) - [`74f1ff6`](https://github.com/go-gitea/gitea/commit/74f1ff6bd0b4402c55dd1a6309343e3ff00c68b9) Import github.com/git-lfs/lfs-test-server as lfs module base - [`f034682`](https://github.com/go-gitea/gitea/commit/f03468288e4a23594302cbfe6c73e57146e1f83d) Import github.com/dgrijalva/jwt-go into vendor/ - [`3d8fd95`](https://github.com/go-gitea/gitea/commit/3d8fd95ac30fee045b05f2708197df866015ae71) Remove config, add JWT support from github.com/mgit-at/lfs-test-server - [`7b3bfe8`](https://github.com/go-gitea/gitea/commit/7b3bfe80adc6b5982ea939accc6c70d658b7230a) Add LFS settings - [`3727c21`](https://github.com/go-gitea/gitea/commit/3727c212ff02cb24c8ba866ca130953d4eba0015) Add LFS meta object model - [`2e433b9`](https://github.com/go-gitea/gitea/commit/2e433b92ee852937f6e99d5cb4490ab7fb37b4a9) Add LFS routes and initialization - [`9e8f91d`](https://github.com/go-gitea/gitea/commit/9e8f91dcf433fd58a55ec431ea5bf05f451b1297) Adapt LFS module: handlers, routing, meta store - [`f111811`](https://github.com/go-gitea/gitea/commit/f1118113fe7fc6cb878409026f2e74b6b27c8e47) Move LFS routes to /user/repo/info/lfs/* - [`c190661`](https://github.com/go-gitea/gitea/commit/c190661ab3b7dbccf40acbb8097f25a23a15e58d) Add request header checks to LFS BatchHandler / PostHandler - [`73c52ed`](https://github.com/go-gitea/gitea/commit/73c52edde55774c96301026a651384001c6a6ce0) Implement LFS basic authentication ### 📊 Changes **37 files changed** (+2632 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `cmd/serve.go` (+63 -1) 📝 `cmd/web.go` (+12 -0) 📝 `models/git_diff.go` (+25 -0) ➕ `models/lfs.go` (+122 -0) 📝 `models/models.go` (+1 -1) 📝 `models/repo.go` (+57 -0) 📝 `modules/auth/user_form.go` (+1 -0) 📝 `modules/base/tool.go` (+13 -0) ➕ `modules/lfs/LICENSE` (+20 -0) ➕ `modules/lfs/content_store.go` (+94 -0) ➕ `modules/lfs/server.go` (+549 -0) 📝 `modules/setting/setting.go` (+90 -0) 📝 `options/locale/locale_en-US.ini` (+4 -0) 📝 `routers/install.go` (+19 -0) 📝 `routers/repo/view.go` (+27 -0) 📝 `templates/install.tmpl` (+5 -0) 📝 `templates/repo/diff/box.tmpl` (+1 -1) 📝 `templates/repo/view_file.tmpl` (+2 -2) ➕ `vendor/github.com/dgrijalva/jwt-go/LICENSE` (+8 -0) ➕ `vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md` (+97 -0) _...and 17 more files_ </details> ### 📄 Description Requested in #80 This PR implements Git LFS support for Gitea, supporting the [legacy v1 API](https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-legacy.md) as well as the current [batch v1 API](https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md). Originally imported LFS server code base from https://github.com/git-lfs/lfs-test-server. Rebased from original PR gogits/gogs#3868 for Gitea, considering inital review in #120. Features: * Uses [recommended paths](https://github.com/github/git-lfs/tree/master/docs/api) with HTTP and SSH remotes, no custom user settings necessary * Supports basic authentication with user credentials * Supports [authentication with SSH](https://github.com/github/git-lfs/tree/master/docs/api) (passing JWT under the hood) * Supports no authentication when pulling public repositories ~~(however git-lfs still asks for credentials, where the prompt can be skipped - likely a bug in git-lfs)~~ (Workaround for git-lfs bug applied in https://github.com/go-gitea/gitea/pull/122/commits/d1a2dca05b49b0f9ae8f43e7e8e116f8c42a4a62) * Settings transparently integrated into installation process * Removes LFS objects when repositories are deleted. Works with forks (e.g. when parent repository is deleted) Notes: * LFS installation setting does not show added locale strings because bindata is not regenerated in this PR (as requested by @strk in #120) Sorry for my misunderstanding regarding this projects state. Looking forward to working together with you! :smile: --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:40:20 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15164