Resolve any GitHub repository's version tags to exact, reproducible commit SHAs.
TagSha is a self-hosted web service that looks up a GitHub repositoryβs tags and resolves each to its exact commit SHA. This makes it trivially safe to pin any dependency, infrastructure component, or CI action to a specific, immutable commit rather than a floating tag.
Use cases:
- Pinning GitHub Actions to SHA instead of tag
- Auditing infrastructure-as-code dependency versions
- Generating reproducible dependency manifests
- Investigating what commit a release tag actually points to
Browser
β
βββΊ Caddy (TLS termination, static files, reverse proxy)
β
βββΊ API (Go β chi router, zerolog, prometheus)
β βββΊ Redis (tag cache, rate limit counters)
β βββΊ GitHub API (github.com/api.github.com)
β
βββΊ Frontend (React + TypeScript, served as static files)
β
βββΊ Grafana (dashboards, served at /grafana)
βββΊ Prometheus (metrics scraper)
See docs/architecture.md for full detail.
- Docker 24+ with Compose v2
- Node.js 20+ (for frontend build)
- A GitHub Personal Access Token (optional but recommended)
git clone https://github.com/infamousrusty/tagsha.git
cd tagshamake secrets-init
# Then edit secrets/github_token with a real tokencp .env.example .env
# Edit .env β set TAGSHA_DOMAIN at minimummake docker-upThe stack will be available at your configured domain (or http://localhost in dev mode).
| Variable | Default | Description |
|---|---|---|
TAGSHA_PORT |
8080 |
API listen port |
TAGSHA_ENV |
development |
production or development |
TAGSHA_LOG_LEVEL |
info |
debug, info, warn, error |
TAGSHA_REDIS_URL |
redis://redis:6379/0 |
Redis connection URL |
TAGSHA_CACHE_TTL_SECONDS |
300 |
Tag cache TTL (seconds) |
TAGSHA_RATE_LIMIT_RPM |
50 |
Requests per minute per IP |
TAGSHA_MAX_PAGES |
10 |
Maximum tag pages to fetch (100 tags/page) |
TAGSHA_DOMAIN |
localhost |
Domain for Caddy TLS and Grafana URLs |
TAGSHA_GITHUB_TOKEN |
(empty) | GitHub PAT (or use Docker secret github_token) |
Security note: Never set
TAGSHA_GITHUB_TOKENin.envfor production. Use the Docker secret file atsecrets/github_tokeninstead.
Returns application and dependency health status.
{
"status": "healthy",
"version": "v1.2.3",
"checks": { "redis": "ok" },
"uptime_seconds": 3600.5
}Prometheus-compatible metrics endpoint.
Parse any GitHub repository identifier into a canonical owner/repo pair.
Request:
{ "query": "https://github.com/golang/go" }Response:
{ "owner": "golang", "repo": "go", "redirect_url": "/api/v1/tags/golang/go" }Returns all tags for a repository with resolved commit SHAs.
Response:
{
"owner": "golang",
"repo": "go",
"total_count": 42,
"truncated": false,
"tags": [
{
"name": "go1.22.2",
"sha": "a9a4c73c3e5a87e1f6e3e9f89c4b2d8d6a9f1234",
"message": "go1.22.2",
"author_name": "Gopher Bot",
"date": "2024-03-05T17:00:00Z",
"commit_url": "https://github.com/golang/go/commit/a9a4c73"
}
],
"cached_at": "2026-03-15T12:00:00Z",
"github_rate_limit_remaining": 4987
}Response headers:
X-Cache: HIT | MISS | STALEβ cache statusX-Request-IDβ unique request identifier for tracingX-RateLimit-Limit/X-RateLimit-Remainingβ rate limit status
# Run backend tests
make test-backend
# Run frontend tests
make test-frontend
# Start dev stack (hot-reloadable frontend + dockerised backend)
make docker-dev
# Then: cd frontend && npm run dev
# Run integration tests (requires running stack)
TAGSHA_API_URL=http://localhost:8080 go test -tags integration ./tests/integration/...- All user input is validated against strict regex patterns before use
- SSRF is mitigated at the URL parsing layer and at the HTTP client layer (redirect restriction)
- Rate limiting is enforced per IP via Redis sliding window counters
- Secrets are never logged or embedded in binaries
- Docker containers run as non-root with no Linux capabilities
- Container images are scanned by Trivy on every CI run
- Dependency audits run on every pull request
See docs/security.md for the full security model.
/healthβ dependency health checks/metricsβ Prometheus metrics (requests, latency, cache, GitHub rate limit)- Structured JSON logs with request IDs
- Grafana dashboard provisioned automatically
- Prometheus alert rules included
See docs/deployment.md for Grafana access details.