mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
Merge pull request #1385 from micromata/feature/redis-api-url-ssl-flag
Added boolean flag which enables ssl connection for redis nodes.
This commit is contained in:
@@ -35,6 +35,11 @@ class RedisCacheApi implements INodeCredential {
|
|||||||
name: 'redisCachePwd',
|
name: 'redisCachePwd',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
placeholder: '<REDIS_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 password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||||
|
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||||
|
|
||||||
|
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {}
|
||||||
|
|
||||||
client = new Redis({
|
client = new Redis({
|
||||||
port: portStr ? parseInt(portStr) : 6379,
|
port: portStr ? parseInt(portStr) : 6379,
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
...tlsOptions
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
client = new Redis(redisUrl)
|
client = new Redis(redisUrl)
|
||||||
|
|||||||
@@ -71,12 +71,16 @@ class RedisEmbeddingsCache implements INode {
|
|||||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||||
|
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||||
|
|
||||||
|
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {}
|
||||||
|
|
||||||
client = new Redis({
|
client = new Redis({
|
||||||
port: portStr ? parseInt(portStr) : 6379,
|
port: portStr ? parseInt(portStr) : 6379,
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
...tlsOptions
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
client = new Redis(redisUrl)
|
client = new Redis(redisUrl)
|
||||||
|
|||||||
@@ -103,12 +103,16 @@ const initalizeRedis = async (nodeData: INodeData, options: ICommonObject): Prom
|
|||||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||||
|
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||||
|
|
||||||
|
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {}
|
||||||
|
|
||||||
client = new Redis({
|
client = new Redis({
|
||||||
port: portStr ? parseInt(portStr) : 6379,
|
port: portStr ? parseInt(portStr) : 6379,
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
...tlsOptions
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
client = new Redis(redisUrl)
|
client = new Redis(redisUrl)
|
||||||
|
|||||||
Reference in New Issue
Block a user