Page MenuHomePhabricator

Implement a Git LFS server which supports no operations
ClosedPublic

Authored by epriestley on Mar 16 2016, 7:49 PM.
Tags
None
Referenced Files
F14352087: D15485.diff
Thu, Dec 19, 12:57 PM
Unknown Object (File)
Wed, Dec 18, 8:44 AM
Unknown Object (File)
Mon, Dec 16, 5:12 PM
Unknown Object (File)
Nov 10 2024, 3:14 PM
Unknown Object (File)
Oct 24 2024, 5:07 AM
Unknown Object (File)
Oct 23 2024, 10:30 AM
Unknown Object (File)
Oct 20 2024, 6:03 PM
Unknown Object (File)
Oct 17 2024, 11:35 PM
Subscribers

Details

Summary

Ref T7789. This builds on top of git-lfs-authenticate to detect LFS requests, read LFS tokens, and route them to a handler which can do useful things.

This handler promptly drops them on the floor with an error message.

Test Plan

Here's a transcript showing the parts working together so far:

  • git-lfs connects to the server with SSH, and gets told how to connect with HTTP to do uploads.
  • git-lfs uses HTTP, and authenticates with the tokens properly.
  • But the server tells it to go away, and that it doesn't support anything, so the operation ultimately fails.
$ GIT_TRACE=1 git lfs push origin master
12:45:56.153913 git.c:558               trace: exec: 'git-lfs' 'push' 'origin' 'master'
12:45:56.154376 run-command.c:335       trace: run_command: 'git-lfs' 'push' 'origin' 'master'
trace git-lfs: Upload refs origin to remote [master]
trace git-lfs: run_command: git rev-list --objects master --not --remotes=origin
trace git-lfs: run_command: git cat-file --batch-check
trace git-lfs: run_command: git cat-file --batch
trace git-lfs: run_command: 'git' config -l
trace git-lfs: tq: starting 3 transfer workers
trace git-lfs: tq: running as batched queue, batch size of 100
trace git-lfs: prepare upload: b7e0aeb82a03d627c6aa5fc1bbfd454b6789d9d9affc8607d40168fa18cf6c69 lfs/dog1.jpg 1/1
trace git-lfs: tq: sending batch of size 1
trace git-lfs: ssh: local@localvault.phacility.com git-lfs-authenticate diffusion/18/poems.git upload 
trace git-lfs: api: batch 1 files
trace git-lfs: HTTP: POST http://local.phacility.com/diffusion/POEMS/poems.git/info/lfs/objects/batch
trace git-lfs: HTTP: 404
trace git-lfs: HTTP: {"message":"Git LFS operation \"objects\/batch\" is not supported by this server."}
trace git-lfs: HTTP: 
trace git-lfs: api: batch not implemented: 404
trace git-lfs: run_command: 'git' config lfs.batch false
trace git-lfs: tq: batch api not implemented, falling back to individual
trace git-lfs: ssh: local@localvault.phacility.com git-lfs-authenticate diffusion/18/poems.git upload b7e0aeb82a03d627c6aa5fc1bbfd454b6789d9d9affc8607d40168fa18cf6c69
trace git-lfs: api: uploading (b7e0aeb82a03d627c6aa5fc1bbfd454b6789d9d9affc8607d40168fa18cf6c69)
trace git-lfs: HTTP: POST http://local.phacility.com/diffusion/POEMS/poems.git/info/lfs/objects
trace git-lfs: HTTP: 404
trace git-lfs: HTTP: {"message":"Git LFS operation \"objects\" is not supported by this server."}
trace git-lfs: HTTP: 
trace git-lfs: tq: retrying 1 failed transfers
trace git-lfs: ssh: local@localvault.phacility.com git-lfs-authenticate diffusion/18/poems.git upload b7e0aeb82a03d627c6aa5fc1bbfd454b6789d9d9affc8607d40168fa18cf6c69
trace git-lfs: api: uploading (b7e0aeb82a03d627c6aa5fc1bbfd454b6789d9d9affc8607d40168fa18cf6c69)
trace git-lfs: HTTP: POST http://local.phacility.com/diffusion/POEMS/poems.git/info/lfs/objects
trace git-lfs: HTTP: 404
trace git-lfs: HTTP: {"message":"Git LFS operation \"objects\" is not supported by this server."}
trace git-lfs: HTTP: 
Git LFS: (0 of 1 files) 0 B / 87.12 KB                                                                                                                                                                                     
Git LFS operation "objects" is not supported by this server.
Git LFS operation "objects" is not supported by this server.

Diff Detail

Repository
rP Phabricator
Branch
lfs9
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/diffusion/controller/DiffusionServeController.php:418XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 11180
Build 13870: Run Core Tests
Build 13869: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Implement a Git LFS server which supports no operations.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
epriestley edited edge metadata.
  • Add an extra sanity check to prevent tokens from one repository from being used on a different repository (this should be moot, but better safe than sorry).
chad edited edge metadata.
This revision is now accepted and ready to land.Mar 16 2016, 8:15 PM

look at all that console output tho

something with that much console output must be working well

epriestley edited edge metadata.
  • One additional sanity check.
This revision was automatically updated to reflect the committed changes.