mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Feature/add disabled nodes env variable (#3797)
* add disabled nodes env variable * add bugfix to speech to text
This commit is contained in:
@@ -52,6 +52,7 @@ PORT=3000
|
||||
|
||||
# APIKEY_STORAGE_TYPE=json (json | db)
|
||||
# SHOW_COMMUNITY_NODES=true
|
||||
# DISABLED_NODES=bufferMemory,chatOpenAI (comma separated list of node names to disable)
|
||||
|
||||
######################
|
||||
# METRICS COLLECTION
|
||||
|
||||
@@ -24,6 +24,7 @@ export class NodesPool {
|
||||
* Initialize nodes
|
||||
*/
|
||||
private async initializeNodes() {
|
||||
const disabled_nodes = process.env.DISABLED_NODES ? process.env.DISABLED_NODES.split(',') : []
|
||||
const packagePath = getNodeModulesPackagePath('flowise-components')
|
||||
const nodesPath = path.join(packagePath, 'dist', 'nodes')
|
||||
const nodeFiles = await this.getFiles(nodesPath)
|
||||
@@ -65,7 +66,9 @@ export class NodesPool {
|
||||
let conditionTwo = true
|
||||
if (!isCommunityNodesAllowed && isAuthorPresent) conditionTwo = false
|
||||
|
||||
if (conditionOne && conditionTwo) {
|
||||
const isDisabled = disabled_nodes.includes(newNodeInstance.name)
|
||||
|
||||
if (conditionOne && conditionTwo && !isDisabled) {
|
||||
this.componentNodes[newNodeInstance.name] = newNodeInstance
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@ export default class Start extends Command {
|
||||
S3_STORAGE_REGION: Flags.string(),
|
||||
S3_ENDPOINT_URL: Flags.string(),
|
||||
S3_FORCE_PATH_STYLE: Flags.string(),
|
||||
SHOW_COMMUNITY_NODES: Flags.string()
|
||||
SHOW_COMMUNITY_NODES: Flags.string(),
|
||||
DISABLED_NODES: Flags.string()
|
||||
}
|
||||
|
||||
async stopProcess() {
|
||||
@@ -100,6 +101,7 @@ export default class Start extends Command {
|
||||
if (flags.NUMBER_OF_PROXIES) process.env.NUMBER_OF_PROXIES = flags.NUMBER_OF_PROXIES
|
||||
if (flags.DISABLE_CHATFLOW_REUSE) process.env.DISABLE_CHATFLOW_REUSE = flags.DISABLE_CHATFLOW_REUSE
|
||||
if (flags.SHOW_COMMUNITY_NODES) process.env.SHOW_COMMUNITY_NODES = flags.SHOW_COMMUNITY_NODES
|
||||
if (flags.DISABLED_NODES) process.env.DISABLED_NODES = flags.DISABLED_NODES
|
||||
|
||||
// Authorization
|
||||
if (flags.FLOWISE_USERNAME) process.env.FLOWISE_USERNAME = flags.FLOWISE_USERNAME
|
||||
|
||||
Reference in New Issue
Block a user