# Example configuration for compare.sr.ht.
#
# compare.sr.ht is a stateless service: it owns no database and no object
# storage. Apart from its own [compare.sr.ht] section it only *reads* keys that
# already exist in the shared sourcehut config.ini of the instance. On a
# deployed instance you normally append the [compare.sr.ht] section below to the
# instance's existing /etc/sr.ht/config.ini rather than shipping a standalone
# file. core-go's LoadConfig() searches: ./config.ini, ../config.ini,
# /etc/sr.ht/config.ini, /etc/sr.ht/*.ini.

[compare.sr.ht]
#
# Public origin of this service. Used to build self URLs and the logout
# return_to. Cookie auth requires this to be a subdomain of the shared cookie
# domain (*.srht.bigb.es).
origin=https://compare.srht.bigb.es
#
# Directory the built static assets (bundle.<hash>.js, main.min.<hash>.css,
# logo.svg) are installed to; globbed at startup to resolve the hashed filenames.
static-dir=/usr/share/sourcehut/compare.sr.ht/static
#
# Address the HTTP server binds to. Optional; defaults to 127.0.0.1:5090.
#bind-address=127.0.0.1:5090

# --------------------------------------------------------------------------
# Shared keys read in place (NOT owned by this service). These already exist in
# the instance config; they are documented here so a standalone dev config.ini
# is self-contained. Do not duplicate/override them on a real instance.
# --------------------------------------------------------------------------

[sr.ht]
# network-key: Fernet key shared across services. Used to (a) decrypt the
# unified-login cookie (sr.ht.unified-login.v1) to learn the viewer's username
# and (b) mint the Internal auth token for git.sr.ht GraphQL. REQUIRED by
# crypto.InitCrypto.
network-key=
# site-name: shown as the nav brand ("<site-name> compare").
site-name=sourcehut
# environment: "production" hides the dev banner; anything else shows it.
environment=production
# internal-ipnet: CIDR the git.sr.ht API trusts for Internal auth. This host
# must fall inside it for anonymous/internal GraphQL calls to be accepted.
internal-ipnet=10.0.0.0/8,127.0.0.0/8

[webhooks]
# private-key: base64 Ed25519 seed. compare.sr.ht emits no webhooks, but
# crypto.InitCrypto fatally requires this key to be present.
private-key=

[meta.sr.ht]
# origin: used to build the login/logout links in the nav
# ({meta}/login?return_to=..., {meta}/logout?return_to=...).
origin=https://meta.srht.bigb.es

[git.sr.ht]
# origin: public origin of git.sr.ht (link targets, switcher).
origin=https://git.srht.bigb.es
# api-origin: base for the internal GraphQL endpoint (<api-origin>/query).
# GetAPI falls back through api-internal-origin/internal-origin/api-origin/
# origin; at least one must be set or startup fails.
api-origin=https://git.srht.bigb.es
# repos: on-disk root of bare repositories. compare.sr.ht reads
# {repos}/~{owner}/{name} directly (read-only) after authorization passes.
repos=/var/lib/git
