Authenticated GitHub Releases proxy with intelligent caching, device verification, and cryptographic signing for secure software distribution in managed environments.
GitGate acts as a gatekeeper between your managed devices and GitHub Releases, providing enterprise-grade authentication, caching, and audit logging. It reduces GitHub API consumption through intelligent caching while ensuring only verified devices can access software artifacts. Designed for organizations using MDM solutions or zero-trust networks who need controlled access to GitHub-hosted binaries.
- Multi-Method Authentication: Jamf Pro, Tailscale, mTLS, or open access modes
- Intelligent Caching: Configurable TTL-based caching for releases and assets with SHA256 checksums
- Cryptographic Signing: Optional RSA signature generation for downloaded assets
- Rate Limiting: Per-device request throttling to prevent abuse
- Comprehensive Auditing: Structured JSON logging of all access attempts and downloads
- GitHub API Efficiency: Reduces upstream API calls through aggressive caching
- High Performance: Built on Bun runtime with Hono framework for minimal latency
# From source
git clone https://github.com/yourusername/gitgate.git
cd gitgate
bun install
bun run build
# Run directly
bun run dev
# Production deployment
bun run startRequires Bun 1.0.0 or later.
# List all releases for a repository
curl https://your-gitgate-instance/releases/owner/repo
# Download a specific asset
curl https://your-gitgate-instance/release/owner/repo/v1.0.0/binary.tar.gz \
-H "X-Device-ID: your-device-id" \
-o binary.tar.gz
# Verify signature (when signing is enabled)
openssl dgst -sha256 -verify public.pem -signature asset.sig binary.tar.gzAssets include SHA256 checksums in X-Checksum-SHA256 headers. When signing is enabled, RSA signatures are provided in X-Signature-RSA-SHA256 headers.
GitGate supports two configuration methods:
- Environment variables (recommended for containerized deployments like Dokploy)
- JSON configuration file (
config.json)
Environment variables take precedence over the config file.
Set these environment variables for configuration:
GITHUB_TOKEN=ghp_your_fine_grained_pat_here
AUTH_METHOD=tailscale
GITGATE_PORT=3000
GITGATE_HOST=0.0.0.0
GITHUB_CACHE_DIR=./cache
GITHUB_CACHE_TTL_SECONDS=3600
TAILSCALE_API_KEY=tskey_your_tailscale_api_key
JAMF_API_URL=https://your-instance.jamfcloud.com
JAMF_API_KEY=your_api_key
JAMF_API_SECRET=your_api_secret
MTLS_CA_CERT_PATH=/path/to/ca.crt
MTLS_REQUIRE_CLIENT_CERT=true
SIGNING_ENABLED=false
SIGNING_PRIVATE_KEY_PATH=/path/to/private.key
AUDIT_ENABLED=true
AUDIT_LOG_FILE=./logs/audit.logRequired variables:
GITHUB_TOKEN: GitHub personal access tokenAUTH_METHOD: One ofjamf,tailscale,mtls, ornone
Auth-method-specific variables:
- For
jamf:JAMF_API_URL,JAMF_API_KEY,JAMF_API_SECRET - For
tailscale:TAILSCALE_API_KEY - For
mtls:MTLS_CA_CERT_PATH,MTLS_REQUIRE_CLIENT_CERT
Alternatively, create config.json based on config.example.json:
{
"port": 3000,
"host": "0.0.0.0",
"github": {
"token": "ghp_your_fine_grained_pat_here",
"cache_dir": "./cache",
"cache_ttl_seconds": 3600
},
"auth": {
"method": "jamf",
"jamf": {
"api_url": "https://your-instance.jamfcloud.com",
"api_key": "your_api_key",
"api_secret": "your_api_secret"
}
},
"signing": {
"enabled": false,
"private_key_path": "/path/to/private.key"
},
"audit": {
"enabled": true,
"log_file": "./logs/audit.log"
}
}- jamf: Validates devices against Jamf Pro inventory via API
- tailscale: Authenticates using Tailscale network identity
- mtls: Mutual TLS with client certificate verification
- none: Open access for development or internal networks
Generate a fine-grained personal access token with:
- Read access to repository contents
- Read access to releases
Public repositories require no special permissions.
config.ts: Configuration loading and validationserver.ts: Hono application setup and route handlersauth/: Authentication adapters for each methodjamf.ts: Jamf Pro API integrationtailscale.ts: Tailscale identity verificationmtls.ts: Client certificate validation
github/: GitHub API interaction layerclient.ts: Octokit wrapper for releases and assetscache.ts: File-based caching with checksumssigning.ts: RSA signature generation
audit/logger.ts: Structured audit log writermiddleware/ratelimit.ts: Per-device rate limiter
Request flow: Authentication → Rate Limit → Cache Check → GitHub Fetch → Cache Store → Sign → Audit → Response
bun install
bun run dev
bun run lint
bun run type-checkThe dev server watches for changes and automatically restarts. All code is TypeScript with strict type checking.
Key dependencies: Hono (web framework), Octokit (GitHub API client), native Bun APIs for crypto and filesystem operations.
- Store GitHub tokens securely with minimal required permissions
- Use authentication methods appropriate for your threat model
- Enable signing for cryptographic verification of downloaded assets
- Review audit logs regularly for anomalous access patterns
- Run behind TLS termination in production
- Rotate API keys and certificates periodically
MIT License