mirror-cache 0.0.3

A customizable reverse proxy with cache
port: 9000
metrics_port: 9001
# log level: error / warn / info / debug / trace, default level is info
log_level: info
hot_reload: false

redis:
  url: redis://localhost

sled:
  metadata_path: cache/sled_metadata

rules:
  # PyPI index
  - name: PyPI index
    path: "pypi/simple"
    upstream: "https://pypi.org/simple"
    rewrite:
      - from: "https://files.pythonhosted.org/"
        to: "http://localhost:9000/pypi/"
    policy: "policy_ttl_60"
    options:
      content_type: "text/html"
  # PyPI packages
  - name: PyPI packages
    path: "pypi/packages/"
    size_limit: 1 GB
    upstream: "https://files.pythonhosted.org/packages/"
    policy: "policy_lru"

  # Anaconda index [main]
  - path: 'anaconda/pkgs/main/(.*repodata.json(.bz2)?)'
    upstream: "https://repo.anaconda.com/pkgs/main/$1"
    policy: "policy_ttl_60"
  # Anaconda packages [main]
  - path: "anaconda/pkgs/main"
    upstream: "https://repo.anaconda.com/pkgs/main"
    policy: "policy_lru_anaconda"

  # Anaconda cloud index
  - path: 'anaconda/cloud/(.*repodata.json(.bz2)?)'
    upstream: "https://conda.anaconda.org/$1"
    policy: "policy_ttl_60"
  # Anaconda cloud packages
  - path: "anaconda/cloud/"
    upstream: "https://conda.anaconda.org/"
    policy: "policy_lru_anaconda"

  # Ubuntu
  - path: "ubuntu/dists/(.*)/(.*)"
    policy: "policy_ubuntu"
    upstream: "http://archive.ubuntu.com/ubuntu/dists/$1/$2"

policies:
  - name: policy_ttl_60
    type: TTL
    metadata_db: sled
    path: "cache/ttl"
    timeout: 60
    clean_interval: 10 # TTL cache cleanup interval, for sled only
  - name: policy_lru
    type: LRU
    metadata_db: sled
    size: 1 GB
    path: "cache/lru"
  - name: policy_lru_anaconda
    type: LRU
    metadata_db: sled
    size: 1073741824
    path: "cache/lru"
  - name: policy_ubuntu
    type: LRU
    metadata_db: sled
    size: 128 MB
    path: cache/ubuntu