feat: default code interpreter and logic function to Disabled in production (#18559)
## Summary For security reasons, the code interpreter and logic function drivers now default based on `NODE_ENV`: - **Production** (`NODE_ENV=production` or unset): Default to **Disabled** - **Development** (`NODE_ENV=development`): Default to **LOCAL** for convenience This ensures self-hosted production deployments don't accidentally run user-provided code without explicit configuration. ## Changes ### Config (`config-variables.ts`) - `CODE_INTERPRETER_TYPE`: Disabled in prod, LOCAL in dev - `LOGIC_FUNCTION_TYPE`: Disabled in prod, LOCAL in dev ### Documentation (`setup.mdx`) - Added **Security Defaults** section explaining NODE_ENV-based behavior - Fixed variable names: `SERVERLESS_TYPE` → `LOGIC_FUNCTION_TYPE`, `SERVERLESS_LAMBDA_*` → `LOGIC_FUNCTION_LAMBDA_*` - Added **Code Interpreter** section with available drivers (Disabled, Local, E2B) ### Environment files - `.env.example`: Updated to `LOGIC_FUNCTION_TYPE` with comments - `.env.test`: Added `LOGIC_FUNCTION_TYPE=LOCAL` for logic function integration tests Made with [Cursor](https://cursor.com) --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
This commit is contained in:
@@ -479,7 +479,10 @@ export class ConfigVariables {
|
||||
})
|
||||
@IsOptional()
|
||||
@CastToUpperSnakeCase()
|
||||
LOGIC_FUNCTION_TYPE: LogicFunctionDriverType = LogicFunctionDriverType.LOCAL;
|
||||
LOGIC_FUNCTION_TYPE: LogicFunctionDriverType =
|
||||
process.env.NODE_ENV === NodeEnvironment.DEVELOPMENT
|
||||
? LogicFunctionDriverType.LOCAL
|
||||
: LogicFunctionDriverType.DISABLED;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.LOGIC_FUNCTION_CONFIG,
|
||||
@@ -598,7 +601,9 @@ export class ConfigVariables {
|
||||
@IsOptional()
|
||||
@CastToUpperSnakeCase()
|
||||
CODE_INTERPRETER_TYPE: CodeInterpreterDriverType =
|
||||
CodeInterpreterDriverType.DISABLED;
|
||||
process.env.NODE_ENV === NodeEnvironment.DEVELOPMENT
|
||||
? CodeInterpreterDriverType.LOCAL
|
||||
: CodeInterpreterDriverType.DISABLED;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.CODE_INTERPRETER_CONFIG,
|
||||
|
||||
Reference in New Issue
Block a user