Node Configuration¶
Node configuration of an individual node within an Emakin server farm. Node configuration primarily involves setting application host connections and other network-related parameters.
Node configuration only applies to local node and does not affect remote nodes.
Execution Mode¶
Emakin agent can be executed as a full agent mode or as micro-service mode.
- Full Mode: The agent is a full-fledged Emakin node. It's serves as web server and can process background jobs.
- Web Server Mode: The agent is a web server that can be used to serve web pages and API endpoints.
- Agent Mode: The agent is a micro-service that can be used to process background jobs.
Please refer to the CLI interface documentation for more details on command-line tools.
Configuration Precedence¶
Emakin uses a layered configuration system. Settings are loaded in the following order of precedence:
<installdir>/appsettings.json: The default configuration file. Direct modification is discouraged.<installdir>/Configuration/Data/appsettings.json: This file allows overriding default settings. Configuration changes should typically be made here.- Environment Variables: Environment variables prefixed with "AK_" override settings from
appsettings.json. <installdir>/Configuration/Data/protectedsettings.json: This file stores encrypted configuration settings, taking precedence over all other layers.
Environment Variable Overrides¶
Environment variables beginning with "AK_" override corresponding settings in appsettings.json. Double underscores ("__") are used as separators for nested settings.
Example: Database Connection
1 2 | |
Example: Web Server Port
1 | |
Command-Line Argument Overrides¶
Command-line arguments passed to the agent executable override all other configuration layers.
Example:
1 | |
Encrypting Configuration Settings¶
While appsettings.json stores settings as plain text, sensitive information (like database credentials) can be encrypted and stored in protectedsettings.json.
Warning
Encrypted settings in protectedsettings.json are write-only. They cannot be read back. Losing this file results in permanent data loss.
Encrypting using the CLI:
The setconfig command (described in the CLI interface documentation) encrypts settings. For example:
1 | |
This encrypts the provided database connection string and stores it in protectedsettings.json. This encrypted value will override any other settings for DbConnStr.
Encryption Key Storage Location¶
By default, encryption keys are stored in the agent user's home directory. In containerized environments, the default container user may lack write access to this directory, leading to silent failures when attempting to store keys.
To address this, define the following environment variable to specify an alternative home directory with appropriate write permissions. For Docker or Kubernetes deployments, it is recommended to mount this designated home directory to persistent storage.
1 | |
This layered configuration approach combines flexibility with a secure mechanism for managing Emakin agent settings. Refer to the CLI interface documentation for further details on command-line tools.