Skip to content

Hosting a public file server which doubles as a Git LFS server? #5331

@QuantumToasted

Description

@QuantumToasted

Hello. I have just currently started on a project on GitHub, with the goal of avoiding storing any large files on GitHub's servers, and instead using my public file server host to hold its files, which happen to be mirrored identically to the repo's structure (as a simple file list displayed via nginx).

My intent, at least right now, is to have ONE physical file represent the file on the public file server, as well as the LFS file on the repo. GitHub's issues and PR system is extremely useful for a community-contributed public file server in my opinion, as a user can submit an issue or PR requesting or implementing custom content for a game which supports "FastDL", and then I (or another org manager) can vet, upload, and track the file in the repo so future contributions are made aware that "this content has already been added".

Is this something that can be accomplished at all?

I was, admittedly, doing some very not-to-git-LFS-spec stuff with a custom server implementation, where an LFS file's oid was actually representing its actual file location. (The one file on the file host at this moment, http://openfast.download/tf/maps/koth_wubwubwub_remix_vip.bsp.bz2, would have its oid as tf/maps/koth_wubwubwub_remix_vip.bsp.bz2). This would have allowed me to have the file host pull double duty, where LFS would ask for a file with an oid of "tf/maps/koth_wubwubwub_remix_vip.bsp.bz2", and the server would go "oh ok, here you go, it's located at "http://openfast.download/tf/maps/koth_wubwubwub_remix_vip.bsp.bz2".

I realized this is a dumb idea, so for the time being that has been scrapped because I'm sure there's some way I can create a mapping of oid to the actual file's location on the web host, but I am too unfamiliar with git-lfs (and git as a whole) to do so.
I think my confusions stem from not understanding how to map oid -> file location in a way that is usable by both my file server and git-lfs. So, to wrap this up with simple questions after all this preface nonsense:

Is it possible to utilize a custom Git LFS server in such a way that it could double as a public file directory on a web host? (And if so, how would one go about accomplishing this?)

Also, this might be a stupid question, but I see in the API spec that an upload batch request returns an upload action with the URL to...upload to? How does git-lfs attempt to actually upload the file when committing/pushing? Does it simply do as the API says, where it will try to POST to the URL with the specified headers and append the file data? That's something that was confusing to me when trying to spec up my own server/API implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions