yufan.me reads its infrastructure configuration from environment variables at process startup. These variables control how the server binds, which Postgres and Redis instances to connect to, and how the session layer signs cookies. They are intentionally separate from the database-backed site settings, which control runtime behaviour such as navigation links, SEO meta, and caching policy — settings you can change without restarting the server. CopyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/syhily/yufan.me/llms.txt
Use this file to discover all available pages before exploring further.
.env.example to .env and fill in the required variables before your first boot.
Server
The network interface the Hono HTTP server binds to. The default
0.0.0.0 listens on all interfaces, which is correct for most containerised deployments. Set to 127.0.0.1 if you put a reverse proxy (nginx, Caddy) in front and do not want the server exposed directly.The TCP port the server listens on. Defaults to
4321. Override this when the port conflicts with another service or when your hosting platform injects its own PORT variable.Controls log verbosity. Accepts standard level names:
trace, debug, info, warn, error, fatal. When left unset the server picks a sensible default for the NODE_ENV. Set to debug or trace locally to see incoming request details and query logs.Database
Postgres connection string in the standard URI format.Drizzle opens a connection pool against this URL on startup. The database must exist and be reachable before the server starts; migrations in
drizzle/ should be applied by your deployment workflow before boot.Redis connection string.Redis is used for session storage, rate-limit counters, and generated-image caches (OG images, calendar SVGs, avatar proxies, embedding search results). A single Redis instance is sufficient; the server namespaces every key with a configurable prefix set in the cache settings section.
Session security
A high-entropy secret string used to sign the
__session cookie. The Hono session middleware rejects any cookie whose signature does not match, so changing this value immediately invalidates all active sessions.Generate a suitable value with:Analytics (optional)
Filesystem path to a MaxMind GeoLite2-City
.mmdb binary. When provided, the analytics ingestion pipeline enriches each visit record with country, region, city, latitude, longitude, and timezone columns. When left unset, visits are still recorded but all geo columns are NULL.Download the free GeoLite2-City database from maxmind.com and place the .mmdb file at the configured path. The file is gitignored by default.When
true, visits made by logged-in admin sessions to public-facing pages (home, post detail, etc.) are written to access_log alongside regular visitor traffic and appear in the analytics dashboard. The default false keeps the dashboard owner out of their own visitor metrics.Set to true locally when debugging the analytics pipeline or testing the dashboard with live traffic.All other runtime settings — site name and description, navigation links, SEO meta, sidebar widgets, comment configuration, Redis cache TTLs, rate limits, search mode, fonts, and scheduled backups — are stored in the database and are edited from the admin console at
/admin/settings. No server restart is required to apply those changes. See the site settings sections overview for the full list.