-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
136 lines (123 loc) · 7.16 KB
/
Copy path.env.example
File metadata and controls
136 lines (123 loc) · 7.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
DATABASE_URL=postgresql://username:password@localhost:5432/playmatch
REDIS_URL=redis://localhost:6379
# Main HTTP listener. Also serves the MCP endpoint at /mcp.
PORT=8080
# Number of HTTP worker threads. Defaults to the CPU count when unset.
# HTTP_WORKERS=8
# Prometheus metrics are exposed on /metrics on this separate listener.
METRICS_PORT=9090
# Upper bound on the Postgres connection pool.
DATABASE_MAX_CONNECTIONS=100
# Log level filter applied to SQL query logging. Parses a log level filter and
# defaults to Debug when unset.
DATABASE_SQL_LOG_LEVEL=debug
# Worker count for parallel import and match work. Defaults to the CPU count
# when unset.
# PARALLELISM=8
# API version routing. The bare /api/* alias mirrors whichever version is
# selected here, resolved once at boot and static for the process lifetime.
# Optional, accepts v1 or v2, defaults to v1.
# PLAYMATCH_DEFAULT_API_VERSION=v1
# Reverse-proxy trust for the per-IP rate limiter. The limiter keys on the client
# IP, taken from the CF-Connecting-IP header ONLY when the request's immediate
# peer is a trusted proxy; otherwise it uses the peer address directly. This stops
# a client that reaches the origin directly from spoofing the header to mint a
# fresh rate-limit bucket. Leave both unset for the common cases: the default
# trusted set is Cloudflare's published ranges PLUS the private/loopback ranges
# (10/8, 172.16/12, 192.168/16, 127/8, IPv6 ULA/loopback), so a Cloudflare-fronted
# deployment AND an app behind a reverse proxy on a private network (Traefik/nginx
# on the same Docker/compose network, a k8s ingress) both work with no config.
#
# TRUSTED_PROXY_CIDRS: comma-separated CIDRs of the proxies allowed to set
# CF-Connecting-IP. Setting it REPLACES the defaults above; use it to lock trust
# down to a specific proxy, or set it to an empty value to trust no proxy (key on
# the peer IP only). Only needed if the app's port is exposed to an untrusted
# private network.
# TRUSTED_PROXY_CIDRS=10.0.0.0/8,192.168.0.0/16
# Master kill switch for CF-Connecting-IP trust. Set to false to never honor the
# header regardless of the peer. Defaults to true (still peer-gated as above).
# TRUST_CF_CONNECTING_IP=true
# Metadata providers. Each is optional; comment out to disable a provider.
# Disabling all providers leaves the API live but the background match cron
# becomes a no-op and the corresponding `/api/<provider>/*` routes are not
# registered.
IGDB_CLIENT_ID=YOUR_CLIENT_ID
IGDB_CLIENT_SECRET=YOUR_CLIENT_SECRET
STEAMGRIDDB_API_KEY=YOUR_STEAMGRIDDB_API_KEY
SCREENSCRAPER_DEV_ID=YOUR_SCREENSCRAPER_DEV_ID
SCREENSCRAPER_DEV_PASSWORD=YOUR_SCREENSCRAPER_DEV_PASSWORD
# Optional. Without user credentials ScreenScraper heavily throttles and
# frequently rejects requests with "API closed for non-members" during peak
# hours. Both must be set together to take effect.
# SCREENSCRAPER_USER_ID=YOUR_SCREENSCRAPER_USER_ID
# SCREENSCRAPER_USER_PASSWORD=YOUR_SCREENSCRAPER_USER_PASSWORD
# MobyGames requires a paid subscription. The cheapest tier permits one
# request every five seconds; higher tiers raise the budget. Without this
# key the MobyGames provider is disabled.
MOBYGAMES_API_KEY=YOUR_MOBYGAMES_API_KEY
# LaunchBox is a bulk metadata source. Setting LAUNCHBOX_ENABLED=true enables a
# daily download of the LaunchBox metadata zip (~70 MB) and the import of
# ~700k game records into local Postgres tables. Requires ~700 MB of scratch
# disk space under tmp/launchbox/ during import. Disable on resource-
# constrained deployments.
# LAUNCHBOX_ENABLED=true
# Optional override for the metadata zip URL. Defaults to the upstream URL
# when omitted.
# LAUNCHBOX_METADATA_URL=https://gamesdb.launchbox-app.com/metadata.zip
# EmuReady provides community-driven emulator compatibility data. Set the
# flag below to join EmuReady to the daily match cycle. The provider only
# populates signature_metadata_mapping rows; downstream consumers fetch
# listings via gameId on demand from the EmuReady API. No proxy routes are
# exposed by playmatch for this provider.
# EMUREADY_ENABLED=true
# Hasheous provides hash-based ROM matching against public signature DATs
# (No-Intros, Redump, TOSEC, MAMEArcade, etc.). Set the flag below to join
# Hasheous to the daily match cycle. The hash-lookup endpoints are open and
# require no API key.
# HASHEOUS_ENABLED=true
# OpenVGDB is a bulk metadata source distributed as a small SQLite snapshot
# (~9 MB zip). Setting OPENVGDB_ENABLED=true enables a daily download of the
# OpenVGDB release zip and the import of its ROMs and RELEASES tables into
# local Postgres tables. Matching is hash-first (CRC, MD5, SHA1) against the
# imported tables; no calls leave the box at match time. The dataset is
# updated infrequently upstream, so the md5-skip check normally short-circuits
# subsequent imports at no cost.
# OPENVGDB_ENABLED=true
# Optional override for the release zip URL. Defaults to the GitHub latest
# release asset when omitted.
# OPENVGDB_METADATA_URL=https://github.com/OpenVGDB/OpenVGDB/releases/latest/download/openvgdb.zip
# RetroAchievements requires a username + web API key (free; get one from
# https://retroachievements.org/controlpanel.php). Both must be set together.
# When enabled the provider bulk-imports every RA system, game, and MD5 hash
# once per cycle (one API call per system, ~70 calls total with a 1s courtesy
# delay between calls) and matches local ROMs by MD5 hash first then by name.
# Custom-hash consoles (PS1, GameCube/DS, Dreamcast/Saturn, PCE-CD, 3DO,
# Arcade) only match by name; plain-MD5 consoles match by hash.
# RETROACHIEVEMENTS_USERNAME=YOUR_RA_USERNAME
# RETROACHIEVEMENTS_API_KEY=YOUR_RA_WEB_API_KEY
# TheGamesDB. Match-only provider with no proxy routes. The ~120k row catalogue
# (every game id + canonical title + alternate names) is seeded once via a
# database migration from an upstream CSV export, so no daily bulk import runs.
# TGDB_API_KEY is optional: when set, games not present in the seeded local
# dataset trigger a name search against the TheGamesDB API capped at 30 calls
# per match cycle (~900/month, within the free tier's 1000/month limit). The
# remaining monthly allowance is cached in Redis and recovered via a single
# probe call if Redis loses the value. Without the API key the provider runs
# but only matches against the seeded dataset.
# TGDB_ENABLED=true
# TGDB_API_KEY=YOUR_TGDB_API_KEY
# Pepper used for HMAC-SHA256 hashing of API keys. Generate with `openssl rand -hex 32`.
# Must be at least 16 raw bytes (32 hex chars). Treat like a production secret.
API_KEY_PEPPER=REPLACE_WITH_OUTPUT_OF_openssl_rand_hex_32
INITIAL_DATA_INIT=true
# Forces the initial data init to run even when it would otherwise be skipped.
FORCE_INITIAL_DATA_INIT=false
# Model Context Protocol server. Exposes the playmatch identify and lookup tools
# over Streamable HTTP at /mcp on the main API listener (the same PORT). Set
# MCP_ENABLED=false to turn it off entirely. The endpoint shares the public API
# per-IP rate limit.
MCP_ENABLED=true
# Public origin of this deployment. Used to advertise the MCP endpoint in the
# discovery document served at /.well-known/mcp-server-card and /.well-known/mcp.json.
# Leave empty to serve a card without a remote endpoint entry.
MCP_PUBLIC_URL=https://playmatch.retrorealm.dev