Backend for a git CDN with proper content types https://yagcdn.tk
Go to file
dependabot-preview[bot] 5ee110b18f
Bump pretty_env_logger from 0.3.0 to 0.3.1 in /backend
Bumps [pretty_env_logger](https://github.com/seanmonstar/pretty-env-logger) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/seanmonstar/pretty-env-logger/releases)
- [Commits](https://github.com/seanmonstar/pretty-env-logger/compare/v0.3.0...v0.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 05:36:32 +00:00
backend Bump pretty_env_logger from 0.3.0 to 0.3.1 in /backend 2019-08-19 05:36:32 +00:00
frontend Mention CSS framework 2019-08-12 20:14:58 +02:00
time-cache Link dockerignore 2019-08-07 22:24:38 +02:00
.drone.yml Enable CI 2019-08-09 19:22:30 +02:00
.env Rename env vars 2019-07-28 15:03:43 +02:00
docker-compose.yml Rename project 2019-08-09 19:43:58 +02:00
Dockerfile Rename project 2019-08-09 19:43:58 +02:00
README.md Add badges 2019-08-09 20:59:31 +02:00
update.sh Move update script 2019-07-29 22:38:13 +02:00
yagcdn.conf Rename config 2019-08-13 19:55:48 +02:00

YaGCDN

Hits-of-Code Drone build dependency status

YaGCDN 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 /<service>/<user>/<repo>/<gitref>/<file> where <service> is one of github, gitlab or bitbucket, <gitref> 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, YaGCDN 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.

Variables

Environment Variable CLI Flag Description
GITHUB_CLIENT_SECRET --gh-secret GitHub OAuth2 secret (optional)
GITHUB_CLIENT_ID --gh-id GH OAuth2 Client ID (optional)
CF_ZONE_IDENT --cf-zone Cloudflare Zone identifier
CF_AUTH_USER --cf-auth-user CF API User (X-Auth-Email)
CF_AUTH_KEY --cf-auth-key CF API Key (X-Auth-Key)
YAGCDN_HOSTNAME --hostname Hostname (default: yagcdn.tk)