This is a server which will act as a proxy to a GIT server and will provide GIT Large File System (LFS) caching support.
The application is written in Microsoft MVC Asp.Net Core 2.2, and is configured to be hosted inside a Docker container.
It is configured to use ASP.Net Identities for basic authentication purposes only.
If the request is not related to LFS it will pass through the commands to the specified GIT server.
If the command is a LFS based it will check the local server first for the cached file, if it exists will serve that file instead of the file on the remote GIT server.
This is useful in the cases where you have limited bandwidth or you want to reduce the amount of used GIT LFS data on GIT providers such as GitHub where GIT LFS has a quota.
The server itself has some basic settings protected by ASP.Net Identities. This is meant only as token protection and not meant for robust server environments. This tool is meant for a local development team use only where you trust each other.
The GIT authentication is the same as the server. The code just does a forwarding proxy where all the headers are passed through to the server, so users should use their credentials as they are on the remote server.
- Install Docker
- Open Visual Studio 2017
- Build
- Go and debug
The application will debug through the docker automatically.
You can then debug and set breakpoints.
Follow the Docker Deploy Guide
- When you go to the main webpage, create a account.
- Go to GIT Hosts up the top menu bar.
- Click "Create New"
- For the host URL put the host without the repository name in it. Eg for GitHub use https://github.com/
- For the Host Authentication Token we use Personal Access Token based login, in GitHub to create a Token go to:
- Click your profile picture at the top right of the page.
- Click "Settings"
- Click "Developer settings"
- Click "Personal Access Tokens"
- Click "Generate New Token"
- Give a name to your token such as "GIT LFS Cache"
- Give the application "Repo" rights.
- For the Host Name give a user friendly name. (This is not used to access the server)
- For the Host User Name give your user name. (This is not used to access the server)
- Take note of the Git Host ID (numeric number) after you created. This will be used in your GIT url in the next section.
- Find your deployed docker's HTTP port.
- Set the remote for your GIT repository to http://{docker ip}:{docker port}/api/{Git Host ID}/{Repository Name}
- Eg
git clone http://localhost:8080/api/1/MyTestRepository