GithubHelp home page GithubHelp logo

samliddicott / git-cache-http-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonasmalacofilho/git-cache-http-server

0.0 0.0 0.0 142 KB

A caching Git HTTP server

License: Other

Haxe 100.00%

git-cache-http-server's Introduction

A caching Git HTTP server

Mirror remote repositories and serve them over HTTP, automatically updating them as needed.

Currently supported client operations are fetch and clone. Authentication to the upstream repository is always enforced (for now, only HTTP Basic is supported), but public repositories can be used as well.

Usage

Usage:
  git-cache-http-server.js [options]

Options:
  -c,--cache-dir <path>   Location of the git cache [default: /var/cache/git]
  -p,--port <port>        Bind to port [default: 8080]
  -h,--help               Print this message
  --version               Print the current version

The upstream remote is extracted from the URL, taking the first component as the remote hostname.

Example:

git-cache-http-server --port 1234 --cache-dir /tmp/cache/git &
git clone http://localhost:1234/github.com/jonasmalacofilho/git-cache-http-server

If you run your git-cache on a dedicated server or container (i.e. named gitcache), you can then also configure git to always use your cache like in the following example (don't use this configuration on the git-cache machine itself):.

git config --global url."http://gitcache:1234/".insteadOf https://

Installing

Requirements: nodejs and git.

npm install --global git-cache-http-server

To install a cache service on Linux systems, check the example doc/git-cache-http-server.service unit file.

For Systemd init users that file should not require major tweaks, other than specifying a different than default port number or cache directory. After installed in the proper Systemd unit path for your distribution:

systemctl daemon-reload
systemctl start git-cache-http-server
systemctl enable git-cache-http-server

Working with the Haxe sources

To modify the code or use the latest features and fixes, it is necessary to build the Haxe sources in src/.

The process of installing Haxe, any additional dependencies, and building the project has been automated with the use of a prepare script, and should work transparently with the usual npm commands. The resulting JS script will be placed in bin/.

# clone the repository (adjust the protocol)
git clone https://github.com/jonasmalacofilho/git-cache-http-server

# install development dependencies and build the sources
npm install

# install the built code globally (might require sudo)
npm install --global

Additionally, the following scripts are available should there be a need to update the Haxe dependencies or quickly rebuild the Haxe code alone:

npm run installHaxelibs
npm run build

Note: after upgrading it might be necessary to purge old .haxelib and node_modules directories, as well any remaining of old installations.

Implementation

The current implementation is somewhat oversimplified; any help in improving it is greatly appreciated!

References:

git-cache-http-server's People

Contributors

jonasmalacofilho avatar laeti-tia avatar rassie avatar fllinxi avatar bcardiff avatar gurjeet avatar samliddicott avatar tomzo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.