Summary
I would like to propose a change that would make it possible to pass additional environment variables to a BotInstance’s process. Right now, when forking, only selected variables are passed to options.env. The current implementation overrides the NodeJS default value process.env, which contains the values of the main process.
Motivation
The bot instance may need to access additional environment variables defined externally, e.g., in a docker-compose.yaml, that get lost during the fork.
Proposed Solution
Introduce a new constructor option for BotInstance (and ManagedInstance / StandaloneInstance) that accepts key-value pairs and will get merged into the options.env object when forking.
Alternatives Considered
It is possible to call process.loadEnvFile() inside the bot instance, but can be inconvenient if environment variables are defined elsewhere.
Additional Context
No response
Summary
I would like to propose a change that would make it possible to pass additional environment variables to a
BotInstance’s process. Right now, when forking, only selected variables are passed tooptions.env. The current implementation overrides the NodeJS default valueprocess.env, which contains the values of the main process.Motivation
The bot instance may need to access additional environment variables defined externally, e.g., in a
docker-compose.yaml, that get lost during the fork.Proposed Solution
Introduce a new constructor option for
BotInstance(andManagedInstance/StandaloneInstance) that accepts key-value pairs and will get merged into theoptions.envobject when forking.Alternatives Considered
It is possible to call
process.loadEnvFile()inside the bot instance, but can be inconvenient if environment variables are defined elsewhere.Additional Context
No response