Skip to content

Environment Variables

All environment variables recognised by NENE2. Set them in .env (loaded by phpdotenv) or export them before starting the server.

Application

VariableTypeDefaultDescription
APP_ENVstringlocalRuntime environment. Accepted: local, test, production.
APP_DEBUGbooleanfalseEnable debug output. Use true only in development.
APP_NAMEstringNENE2Application name used in log output. Must not be empty.
PROBLEM_DETAILS_BASE_URLstringhttps://nene2.dev/problems/Base URL prepended to Problem Details type identifiers. Override when deploying custom problem types under your own domain.

Authentication

VariableTypeDefaultDescription
NENE2_MACHINE_API_KEYstring(empty — disabled)API key expected in the X-NENE2-API-Key request header for machine client endpoints. Leave empty to disable the machine key path entirely.
NENE2_LOCAL_JWT_SECRETstring(empty — disabled)HMAC-HS256 secret used by LocalBearerTokenVerifier. Enables Bearer JWT validation for GET /examples/protected and gates write tools in the local MCP server. Leave empty to disable JWT auth and allow read-only MCP access only.

Local MCP server

VariableTypeDefaultDescription
NENE2_LOCAL_API_BASE_URLstring(required)Base URL the local MCP server uses to proxy API calls (e.g. http://app). Required when running the MCP server in Docker Compose.

Database

VariableTypeDefaultDescription
DATABASE_URLstring(empty — use DB_*)Full database connection URL. When non-empty, overrides all individual DB_* variables.
DB_ADAPTERstringmysqlDatabase driver. Accepted: sqlite, mysql.
DB_HOSTstring127.0.0.1Database hostname or IP. Not used by SQLite.
DB_PORTinteger3306Database port (1–65535). Not validated for SQLite.
DB_NAMEstringnene2Database name. For SQLite, set this to the file path (e.g. /tmp/myapp.sqlite).
DB_USERstringnene2Database username. Not used by SQLite.
DB_PASSWORDstring(empty)Database password.
DB_CHARSETstringutf8mb4Database character set. Not used by SQLite.

SQLite adapter

When DB_ADAPTER=sqlite, only DB_NAME (the file path) is required. DB_HOST, DB_USER, and DB_CHARSET are not validated and do not need to be set.

dotenv
DB_ADAPTER=sqlite
DB_NAME=/tmp/myapp.sqlite

For in-memory SQLite (useful in tests), use DB_NAME=:memory:.

Never commit secrets

Do not commit .env files containing passwords, API keys, or JWT secrets to version control.

Released under the MIT License.