Files
MyIP/.env.example
T
jason5ng32andClaude Opus 5.5 287c50fe1a Feat(datasets): one updater engine for every offline dataset
MaxMind and CAIDA each had their own updater with its own lock, state file,
publish step, boot download and timer. One engine (common/dataset-updater.js)
now owns all of that, and each dataset is a row in common/datasets.js that
holds only its own logic: find the newest remote version, fetch or distill
it, validate, reload.

- Locks: proper-lockfile, a heartbeat lock shared by every process, so a
  crashed holder's lock goes stale on its own; a booting server waits for a
  live holder and loads what it published.
- State: one file per dataset, written with write-file-atomic; the old
  .maxmind-update-state.json / .caida-update-state.json are read once, so an
  upgrade doesn't re-download.
- Schedule: croner at a fixed time (DATASET_UPDATE_CRON, default 04:30 local)
  instead of 24 h from process start, plus a catch-up run at boot for a check
  a downtime skipped. DATASET_AUTO_UPDATE (default on) replaces
  MAXMIND_AUTO_UPDATE / CAIDA_AUTO_UPDATE, which still apply when it is unset.
- Reload: the engine watches every dataset's files, so a publish by another
  process or a hand-placed .mmdb is picked up; MaxMind's own watcher goes.

MaxMind's City and ASN editions now publish together under one version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 02:21:58 +08:00

72 lines
2.9 KiB
Bash

# Server
BACKEND_PORT="11966"
FRONTEND_PORT="18966"
ALLOWED_DOMAINS=""
# THIRD-PARTY APIs
GOOGLE_MAP_API_KEY=""
IPINFO_API_KEY=""
CLOUDFLARE_API_KEY=""
IPAPIIS_API_KEY=""
IP2LOCATION_API_KEY=""
MAC_LOOKUP_API_KEY=""
RIPESTAT_SOURCE_APP=""
# Shareable diagnostic reports — stored in Cloudflare Workers KV. Both values
# below must be set (together with CLOUDFLARE_API_KEY, which additionally
# needs the "Workers KV Storage: Edit" permission) or the share-link feature
# stays hidden. CLOUDFLARE_KV_NAMESPACE_ID is the namespace's hex ID from the
# dashboard, not its name.
CLOUDFLARE_ACCOUNT_ID=""
CLOUDFLARE_KV_NAMESPACE_ID=""
# MaxMind — GeoLite2 is downloaded only when both are set
MAXMIND_ACCOUNT_ID=""
MAXMIND_LICENSE_KEY=""
# Offline datasets (MaxMind, CAIDA, PeeringDB): missing ones download at boot;
# all are re-checked daily at DATASET_UPDATE_CRON (server-local time) unless
# DATASET_AUTO_UPDATE is "false"
DATASET_AUTO_UPDATE="true"
DATASET_UPDATE_CRON="30 4 * * *"
# SITE
VITE_SITE_URL="https://ipcheck.ing"
# DOCS SITE — origin of the GitBook docs site powering the in-app
# assistant and the Help Center link. Empty disables both.
VITE_DOCS_URL=""
# EARTH ONLINE — full URL of the pulse backend (trailing slashes stripped).
# Empty hides the social parts (status feed / visitor map / visit beacon) at
# build time, like Sentry. The outage feed is independent — it only needs
# CLOUDFLARE_API_KEY above.
VITE_PULSE_BEACON_URL=""
# CURL API
VITE_CURL_IPV4_DOMAIN=""
VITE_CURL_IPV6_DOMAIN=""
VITE_CURL_IPV64_DOMAIN=""
# Google Analytics
VITE_GOOGLE_ANALYTICS_ID=""
# Security related
# SECURITY_BLACKLIST_LOG_FILE_PATH: opt-in on-disk ledger of rate-limited IPs
# (e.g. "logs/blacklist-ip.log"). Empty = no file; the event is always logged
# via the shared logger either way (and mirrored to Sentry when configured).
SECURITY_BLACKLIST_LOG_FILE_PATH=""
SECURITY_RATE_LIMIT=""
SECURITY_DELAY_AFTER=""
# Sentry — all optional; leave empty and no Sentry code ships or runs at all.
# VITE_SENTRY_DSN_FRONTEND: frontend DSN (build-time; baked into the bundle;
# also read by the backend at runtime as the allowlist for /api/monitoring,
# the first-party tunnel that relays envelopes past ad blockers)
# SENTRY_DSN_BACKEND: backend DSN (runtime; read by sentry-instrument.js)
# SENTRY_ENVIRONMENT: backend environment tag — unset means "production",
# set "development" on dev machines (frontend tags itself automatically)
# SENTRY_ORG / SENTRY_PROJECT_FRONTEND / SENTRY_AUTH_TOKEN: source-map upload
# at build time only — the token is a secret, never exposed to the browser
VITE_SENTRY_DSN_FRONTEND=""
SENTRY_DSN_BACKEND=""
SENTRY_ENVIRONMENT=""
SENTRY_ORG=""
SENTRY_PROJECT_FRONTEND=""
SENTRY_AUTH_TOKEN=""
# Logging — LOG_LEVEL: debug/info/warn/error (default info)
# LOG_FORMAT: "json" for log shippers, anything else = pretty
# LOG_HTTP: "true" to enable per-request /api logging (off by default)
LOG_LEVEL=""
LOG_FORMAT=""
LOG_HTTP=""