# Extension Registry Configuration - Multi-Backend Example
# This example demonstrates the new multi-instance architecture supporting
# multiple Git-based sources (Gitea, Forgejo, GitHub) and multiple OCI registries

[server]
host = "0.0.0.0"
port = 8082
workers = 4
enable_cors = false
enable_compression = true

# Multiple Git-based source backends
# Internal Gitea instance for private extensions
[[sources.gitea]]
id = "internal-gitea"
url = "https://gitea.internal.example.com"
organization = "provisioning"
token_path = "/etc/secrets/gitea-internal-token.txt"
timeout_seconds = 30
verify_ssl = true

# Public Gitea instance for community extensions
[[sources.gitea]]
id = "public-gitea"
url = "https://gitea.public.example.com"
organization = "provisioning-extensions"
token_path = "/etc/secrets/gitea-public-token.txt"
timeout_seconds = 30
verify_ssl = true

# Forgejo sources (Git-compatible)
[[sources.forgejo]]
id = "community-forgejo"
url = "https://forgejo.community.example.com"
organization = "provisioning"
token_path = "/etc/secrets/forgejo-token.txt"
timeout_seconds = 30
verify_ssl = true

# GitHub sources
[[sources.github]]
id = "org-github"
organization = "my-organization"
token_path = "/etc/secrets/github-token.txt"
timeout_seconds = 30
verify_ssl = true

# Multiple OCI distribution registries
# Internal Zot registry
[[distributions.oci]]
id = "internal-zot"
registry = "zot.internal.example.com"
namespace = "provisioning/extensions"
timeout_seconds = 30
verify_ssl = true

# Public Harbor registry
[[distributions.oci]]
id = "public-harbor"
registry = "harbor.public.example.com"
namespace = "provisioning"
auth_token_path = "/etc/secrets/harbor-token.txt"
timeout_seconds = 30
verify_ssl = true

# Docker Hub
[[distributions.oci]]
id = "docker-hub"
registry = "docker.io"
namespace = "myorg"
auth_token_path = "/etc/secrets/docker-hub-token.txt"
timeout_seconds = 30
verify_ssl = true

# GHCR (GitHub Container Registry)
[[distributions.oci]]
id = "ghcr"
registry = "ghcr.io"
namespace = "my-organization"
auth_token_path = "/etc/secrets/ghcr-token.txt"
timeout_seconds = 30
verify_ssl = true

# Caching configuration
[cache]
capacity = 1000
ttl_seconds = 300
enable_metadata_cache = true
enable_list_cache = true
