Skip to content

Conversation

fabian-z
Copy link

@fabian-z fabian-z commented Nov 8, 2016

Requested in #1322

This PR implements Git LFS support for Gogs, 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.

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)
  • Settings transparently integrated into installation process
  • Removes LFS objects when repositories are deleted. Works with forks (e.g. when parent repository is deleted)

Notes:

Looking forward to your review!

@fabian-z fabian-z mentioned this pull request Nov 8, 2016
@lunny
Copy link
Contributor

lunny commented Nov 8, 2016

@fabian-z hi, could you please send it to github.com/go-gitea/gitea master.

@fabian-z
Copy link
Author

fabian-z commented Nov 8, 2016

For the record:
Travis CI fails during go get for Go 1.4 because of missing base64.RawURLEncoding, which is used to store the generated JWT secret in the configuration.
The *.ini parser doesn't play nice with padded base64 encodings and the unpadded encodings were introduced with Go 1.5.
Could a contributor clarify on whether Go 1.4 must still be supported?

@lunny: PR as requested

Fabian added 2 commits November 8, 2016 16:06
Only removes objects from content store when deleted repo is the only
referencing repository
Fixes bug where LFS would not work after installation without
restarting Gogs
@fabian-z
Copy link
Author

This PR received significant review and further development in go-gitea/gitea#122. If there is any interest in merging this, the commits made to that PR branch would need to be rebased for gogs.

@unknwon unknwon added the status: review later The pull request is not confident to be review at the moment label Dec 22, 2016
@fabian-z
Copy link
Author

Since this feature now got merged with Gitea, I'll be keeping around my repository with the changes in this PR as https://github.com/fabian-z/gogs-legacy for some time. It contains the develop branch with my original changeset for Gogs and the gitea_lfs branch with the polished changeset rebased for Gitea.

If this feature should be brought to Gogs, it will need someone to rebase my original branch and apply the rest of the changeset from my gitea_lfs branch, adapting the changes.

@fabian-z fabian-z closed this Dec 26, 2016
Martchus pushed a commit to Martchus/gogs that referenced this pull request Jun 7, 2018
Martchus pushed a commit to Martchus/gogs that referenced this pull request Aug 27, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: review later The pull request is not confident to be review at the moment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants