mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 11:01:22 +03:00
Added boolean flag which enables ssl connection for redis nodes.
This is needed for example connecting to the azure redis sever.
This commit is contained in:
@@ -35,6 +35,11 @@ class RedisCacheApi implements INodeCredential {
|
||||
name: 'redisCachePwd',
|
||||
type: 'password',
|
||||
placeholder: '<REDIS_PASSWORD>'
|
||||
},
|
||||
{
|
||||
label: 'Use SSL',
|
||||
name: 'redisCacheSslEnabled',
|
||||
type: 'boolean'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -56,12 +56,16 @@ class RedisCache implements INode {
|
||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||
|
||||
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {};
|
||||
|
||||
client = new Redis({
|
||||
port: portStr ? parseInt(portStr) : 6379,
|
||||
host,
|
||||
username,
|
||||
password
|
||||
password,
|
||||
...tlsOptions
|
||||
})
|
||||
} else {
|
||||
client = new Redis(redisUrl)
|
||||
|
||||
@@ -71,12 +71,16 @@ class RedisEmbeddingsCache implements INode {
|
||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||
|
||||
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {};
|
||||
|
||||
client = new Redis({
|
||||
port: portStr ? parseInt(portStr) : 6379,
|
||||
host,
|
||||
username,
|
||||
password
|
||||
password,
|
||||
...tlsOptions
|
||||
})
|
||||
} else {
|
||||
client = new Redis(redisUrl)
|
||||
|
||||
@@ -103,12 +103,16 @@ const initalizeRedis = async (nodeData: INodeData, options: ICommonObject): Prom
|
||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||
|
||||
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {};
|
||||
|
||||
client = new Redis({
|
||||
port: portStr ? parseInt(portStr) : 6379,
|
||||
host,
|
||||
username,
|
||||
password
|
||||
password,
|
||||
...tlsOptions
|
||||
})
|
||||
} else {
|
||||
client = new Redis(redisUrl)
|
||||
|
||||
Reference in New Issue
Block a user