From 4f884107431b3bac6b3b288fb13d024945dd36f9 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 27 Jul 2019 13:24:09 +0200 Subject: [PATCH] Add README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6642af5 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Gitache + +Gitache is a web service that serves raw files from GitHub, GitLab and Bitbucket +with the proper `Content-Type` headers. Requests to a branch will be redirected +to the branches `HEAD`. Requests to a specific commit will also set long time +cache headers, so the service can be put behind a CDN like Cloudflare. + +The endpoints follow the pattern `/////` +where `` is one of `github`, `gitlab` or `bitbucket`, `` is the +name of the branch or a commit hash. + +## Building and Running + +The code can be built natively using `cargo build --release` or as a Docker +image using `docker build .` + +The easiest way to run the service is by using `docker-compose up -d` and +exposing port `8080`. + + +## API Limits + +To get the `HEAD` of a requested branch, Gitache sends a request to the +requested service's API. To prevent running into rate limiting issues with the +GitHub API, an OAuth2 App should be created and the client ID and secret can be +set via the `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` environment variables.