Environment Variables
Blocklet Server uses environment variables for detailed configuration of its behavior, from network ports to security settings. This approach provides a flexible way to customize your server instance for different environments (development, staging, production) without altering configuration files.
All server-specific variables are prefixed with ABT_NODE_
.
Configuration Priority#
Environment variables have the highest precedence in the configuration hierarchy. The server applies settings in the following order, with later sources overwriting earlier ones:
- Default values
- Configuration file (
config.yml
) - Environment variables (
ABT_NODE_*
)
Server Configuration Variables#
The following tables provide a comprehensive reference for all ABT_NODE_
environment variables that you can use to customize the server.
Network and Ports#
These variables control the network bindings and ports used by the Blocklet Server and its components.
Variable | Purpose | Default | Example |
---|---|---|---|
| Host address for the server to bind to |
|
|
| Main port where the Blocklet Server daemon listens |
|
|
| HTTP port for the gateway/router |
|
|
| HTTPS port for the gateway/router |
|
|
| Starting port for blocklet applications |
|
|
| Port for internal service communication |
|
|
| Port for the updater service |
| - |
| Port for event hub communication |
| - |
| HTTP port specifically for router provider | Same as | - |
| HTTPS port specifically for router provider | Same as | - |
Authentication and Security#
Manage access control, session settings, and cryptographic keys. Variables marked as system-generated should not be set manually.
Variable | Purpose | Default / Status | Example |
---|---|---|---|
| Decentralized Identifier for the server instance | System-generated |
|
| Public key for the server's DID | System-generated |
|
| Secret key for the server's DID. Keep secure. | System-generated |
|
| Secret key for session encryption | System-generated |
|
| Secret key for JWT token signing | System-generated |
|
| Session time-to-live in seconds |
|
|
| Session cache time-to-live in seconds |
|
|
| Path prefix for the admin dashboard |
|
|
| Comma-separated list of IPs allowed to access admin | (all IPs allowed) |
|
| Comma-separated list of domains allowed for CORS | (none) |
|
| Comma-separated list of domains to block | (none) |
|
| Additional headers for CORS whitelist responses | (none) |
|
| Disable passkey user verification ( |
|
|
Database and Storage#
Configure the primary database and caching layer.
Variable | Purpose | Default | Example |
---|---|---|---|
| PostgreSQL connection URL. If not set, SQLite is used. | (uses SQLite) |
|
| Redis connection URL for caching. If not set, in-memory cache is used. | (in-memory cache) |
|
| Path to SQLite cache database file |
|
|
| Disable caching entirely ( |
|
|
| Force use of SQLite even if PostgreSQL is configured ( |
|
|
| Enable large cache for SQLite ( |
|
|
Docker Configuration#
Set default resource limits and behavior for blocklets running in Docker containers.
Variable | Purpose | Default | Example |
---|---|---|---|
| Disable Docker support entirely ( |
|
|
| Default memory limit for Docker containers |
|
|
| Default CPU limit for Docker containers |
|
|
| Default disk size limit for Docker containers |
|
|
| Skip chown operations in Docker containers ( |
|
|
Logging and Debugging#
Control logging levels, locations, and enable development modes.
Variable | Purpose | Default | Example |
---|---|---|---|
| Directory for log files |
|
|
| Name of the log file |
|
|
| Logging level ( |
|
|
| Enable development mode with additional debugging ( |
|
|
| Enable serverless debugging mode ( |
|
|
Performance and Limits#
Tune server performance and set operational limits.
Variable | Purpose | Default | Example |
---|---|---|---|
| Maximum number of cluster instances |
|
|
| Backoff time for job scheduling in seconds |
|
|
| Rate limit for email operations (per minute) |
|
|
| Interval for checking running blocklets (ms) |
|
|
| CPU threshold (%) for high load detection |
|
|
| Memory threshold (%) for high load detection |
|
|
| Disk threshold (%) for high load detection |
|
|
| Enable automatic blocklet running assurance ( |
|
|
Domain and Routing#
Configure how the server handles domains, routing, and certificates.
Variable | Purpose | Default | Example |
---|---|---|---|
| Domain for DID-based routing | Auto-detected |
|
| Domain for admin dashboard | Auto-detected |
|
| Router provider implementation ( |
|
|
| Enable IPv6 support ( |
|
|
| Force intranet mode ( |
|
|
| Host for downloading wildcard certificates |
|
|
External Services#
Configure endpoints for external services like the web wallet and DID registry.
Variable | Purpose | Default | Example |
---|---|---|---|
| URL for the web wallet service |
|
|
| DID registry endpoint |
|
|
System Generated Variables#
These variables are set internally by the system for its own operational purposes. You should not set these manually.
Variable | Purpose |
---|---|
| Name of the CLI binary |
| Name of the CLI command |
| NPM package name for the server |
| Version of the Blocklet Server |
| Flag indicating component restart status |
| Current blocklet mode |
| Current kernel mode |
Blocklet-Specific Environments#
In addition to server-wide configuration, individual blocklets can define their own required environment variables in their blocklet.yml
meta file.
When developing a blocklet locally, you can provide values for these variables by creating a .env
file in the blocklet's root directory. The CLI (blocklet dev
) will automatically load these files and prompt you for any required variables that are still missing.
Security Considerations#
- Use strong, randomly generated values for secret keys and other sensitive variables.
- Limit access to the server environment and any files where these variables are stored.
- Consider using a secrets management tool for production deployments to securely inject environment variables.