ademidovx/tf-mirror

By ademidovx

Updated 10 months ago

Self-hosted mirror for the Terraform Provider Registry and HashiCorp tool binaries

Helm
Image
0

813

ademidovx/tf-mirror repository overview

Terraform Registry Mirror

A fast, robust, and flexible self-hosted mirror for the Terraform Provider Registry and HashiCorp tool binaries. Designed for air-gapped, enterprise, and CI/CD environments, it supports advanced filtering, Prometheus metrics, and multiple deployment options.


Features

  • Provider & Binary Mirroring: Downloads and serves Terraform providers and HashiCorp CLI tools.
  • Advanced Filtering: Filter by provider, version, platform, and tool.
  • Prometheus Metrics: Built-in /metrics endpoint for monitoring.
  • Flexible Deployment: Run as a binary, Docker container, or via Helm in Kubernetes.
  • Atomic Metadata: Generates index.json and .tf-mirror-metadata.json compatible with Terraform.
  • TLS Support: Optional HTTPS for secure serving.
  • Health & Version Endpoints: For easy monitoring and automation.
  • Single-Pod Mode: Downloader and server can run together with a shared data volume.
  • Multi-Stage Docker Build: Optimized for smaller image size.
  • Proxy support: HTTP/HTTPS/SOCKS5 proxy support.
Manual Docker Run
docker run --rm -v $(pwd)/data:/data docker.io/ademidovx/tf-mirror:latest \
  --mode downloader --download-path /data --provider-filter=hashicorp/aws
docker run --rm -p 8080:8080 -v $(pwd)/data:/data docker.io/ademidovx/tf-mirror:latest \
  --mode server --data-path /data --listen-port 8080

Command Line Options

OptionDescription
--modedownloader or server
--download-pathDirectory for downloads (downloader mode)
--data-pathDirectory to serve (server mode)
--provider-filterComma-separated providers (e.g. hashicorp/aws)
--platform-filterComma-separated platforms (e.g. linux_amd64)
--download-binariesComma-separated tools (e.g. terraform>1.6.0,consul>1.21.3)
--check-periodCheck interval in hours (downloader)
--max-attemptsMax download attempts
--download-timeoutTimeout per download (seconds)
--listen-hostServer listen address
--listen-portServer port (default: 80)
--hostnameServer hostname (optional)
--enable-tlsEnable HTTPS
--tls-crtTLS certificate path
--tls-keyTLS key path
--debugEnable debug logging
--helpShow help
--versionShow version

Environment Variables

VariableDescription (same as CLI unless noted)
TF_MIRROR_MODEMode: downloader/server
PROXYProxy URL
CHECK_PERIODCheck period
DOWNLOAD_PATHDownload path
PROVIDER_FILTERProvider filter
PLATFORM_FILTERPlatform filter
MAX_ATTEMPTSMax attempts
DOWNLOAD_TIMEOUTDownload timeout
DOWNLOAD_BINARIESBinaries filter
DATA_PATHData path (server)
LISTEN_HOSTListen host
LISTEN_PORTListen port
HOSTNAMEHostname
ENABLE_TLSEnable TLS
TLS_CRTTLS cert path
TLS_KEYTLS key path
DEBUGDebug logging

Repo: https://github.com/kashtan404/tf-mirror

Tag summary

Content type

Helm

Digest

sha256:e2e1b3036

Size

4.5 kB

Last updated

10 months ago

helm pull oci://registry-1.docker.io/ademidovx/tf-mirror --version 0.1.0