mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-24 13:02:16 +00:00
let realtimedb-help build redis configuraiton from env variables (#256)
* let realtimedb-help build redis configuraiton from env variables * update speech-utils version
This commit is contained in:
@@ -46,18 +46,14 @@ const {
|
||||
addKey,
|
||||
retrieveKey,
|
||||
deleteKey,
|
||||
incrKey,
|
||||
JAMBONES_REDIS_SENTINELS
|
||||
incrKey
|
||||
} = require('./lib/helpers/realtimedb-helpers');
|
||||
const {
|
||||
getTtsVoices,
|
||||
getTtsSize,
|
||||
purgeTtsCache,
|
||||
synthAudio
|
||||
} = require('@jambonz/speech-utils')(JAMBONES_REDIS_SENTINELS || {
|
||||
host: process.env.JAMBONES_REDIS_HOST,
|
||||
port: process.env.JAMBONES_REDIS_PORT || 6379
|
||||
}, logger);
|
||||
} = require('@jambonz/speech-utils')({redis_client: client}, logger);
|
||||
const {
|
||||
lookupAppBySid,
|
||||
lookupAccountBySid,
|
||||
|
||||
@@ -1,29 +1,5 @@
|
||||
const logger = require('../logger');
|
||||
|
||||
const JAMBONES_REDIS_SENTINELS = process.env.JAMBONES_REDIS_SENTINELS ? {
|
||||
sentinels: process.env.JAMBONES_REDIS_SENTINELS.split(',').map((sentinel) => {
|
||||
let host, port = 26379;
|
||||
if (sentinel.includes(':')) {
|
||||
const arr = sentinel.split(':');
|
||||
host = arr[0];
|
||||
port = parseInt(arr[1], 10);
|
||||
} else {
|
||||
host = sentinel;
|
||||
}
|
||||
return {host, port};
|
||||
}),
|
||||
name: process.env.JAMBONES_REDIS_SENTINEL_MASTER_NAME,
|
||||
...(process.env.JAMBONES_REDIS_SENTINEL_PASSWORD && {
|
||||
password: process.env.JAMBONES_REDIS_SENTINEL_PASSWORD
|
||||
}),
|
||||
...(process.env.JAMBONES_REDIS_SENTINEL_USERNAME && {
|
||||
username: process.env.JAMBONES_REDIS_SENTINEL_USERNAME
|
||||
}),
|
||||
...(process.env.JAMBONES_REDIS_SENTINEL_SENTINAL_PASSWORD && {
|
||||
sentinelPassword: process.env.JAMBONES_REDIS_SENTINEL_SENTINAL_PASSWORD
|
||||
}),
|
||||
} : null;
|
||||
|
||||
const {
|
||||
client,
|
||||
retrieveCall,
|
||||
@@ -37,10 +13,7 @@ const {
|
||||
deleteKey,
|
||||
incrKey,
|
||||
client: redisClient,
|
||||
} = require('@jambonz/realtimedb-helpers')(JAMBONES_REDIS_SENTINELS || {
|
||||
host: process.env.JAMBONES_REDIS_HOST || 'localhost',
|
||||
port: process.env.JAMBONES_REDIS_PORT || 6379
|
||||
}, logger);
|
||||
} = require('@jambonz/realtimedb-helpers')({}, logger);
|
||||
|
||||
module.exports = {
|
||||
client,
|
||||
@@ -54,6 +27,5 @@ module.exports = {
|
||||
retrieveKey,
|
||||
deleteKey,
|
||||
redisClient,
|
||||
incrKey,
|
||||
JAMBONES_REDIS_SENTINELS
|
||||
incrKey
|
||||
};
|
||||
|
||||
Generated
+9
-9
@@ -19,7 +19,7 @@
|
||||
"@jambonz/lamejs": "^1.2.2",
|
||||
"@jambonz/mw-registrar": "^0.2.5",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.7",
|
||||
"@jambonz/speech-utils": "^0.0.25",
|
||||
"@jambonz/speech-utils": "^0.0.26",
|
||||
"@jambonz/time-series": "^0.2.8",
|
||||
"@jambonz/verb-specifications": "^0.0.45",
|
||||
"@soniox/soniox-node": "^1.1.1",
|
||||
@@ -1968,19 +1968,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jambonz/speech-utils": {
|
||||
"version": "0.0.25",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.0.25.tgz",
|
||||
"integrity": "sha512-ry0FbGjgXxhYOQXSnkXQN5/Num057w3zdYpX8modZubK5TsH0AhHNC+6ph0IQrvk7LcnNJfCDqtNbKQZYQ/OHA==",
|
||||
"version": "0.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.0.26.tgz",
|
||||
"integrity": "sha512-g5AdiPZGY1HnWJ8lbKwBbV5NcyPn8A1s6/IqQQ8sNCQzRyd/aveBI9FuOH1bIUNhwUDdMSXkyuxntUOt+/0TIw==",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-polly": "^3.359.0",
|
||||
"@google-cloud/text-to-speech": "^4.2.1",
|
||||
"@grpc/grpc-js": "^1.8.13",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.7",
|
||||
"bent": "^7.3.12",
|
||||
"debug": "^4.3.4",
|
||||
"form-urlencoded": "^6.1.0",
|
||||
"google-protobuf": "^3.21.2",
|
||||
"ibm-watson": "^8.0.0",
|
||||
"ioredis": "^5.3.2",
|
||||
"microsoft-cognitiveservices-speech-sdk": "^1.31.0",
|
||||
"openai": "^4.16.2",
|
||||
"undici": "^5.21.0"
|
||||
@@ -11430,19 +11430,19 @@
|
||||
}
|
||||
},
|
||||
"@jambonz/speech-utils": {
|
||||
"version": "0.0.25",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.0.25.tgz",
|
||||
"integrity": "sha512-ry0FbGjgXxhYOQXSnkXQN5/Num057w3zdYpX8modZubK5TsH0AhHNC+6ph0IQrvk7LcnNJfCDqtNbKQZYQ/OHA==",
|
||||
"version": "0.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.0.26.tgz",
|
||||
"integrity": "sha512-g5AdiPZGY1HnWJ8lbKwBbV5NcyPn8A1s6/IqQQ8sNCQzRyd/aveBI9FuOH1bIUNhwUDdMSXkyuxntUOt+/0TIw==",
|
||||
"requires": {
|
||||
"@aws-sdk/client-polly": "^3.359.0",
|
||||
"@google-cloud/text-to-speech": "^4.2.1",
|
||||
"@grpc/grpc-js": "^1.8.13",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.7",
|
||||
"bent": "^7.3.12",
|
||||
"debug": "^4.3.4",
|
||||
"form-urlencoded": "^6.1.0",
|
||||
"google-protobuf": "^3.21.2",
|
||||
"ibm-watson": "^8.0.0",
|
||||
"ioredis": "^5.3.2",
|
||||
"microsoft-cognitiveservices-speech-sdk": "^1.31.0",
|
||||
"openai": "^4.16.2",
|
||||
"undici": "^5.21.0"
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
"@jambonz/lamejs": "^1.2.2",
|
||||
"@jambonz/mw-registrar": "^0.2.5",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.7",
|
||||
"@jambonz/speech-utils": "^0.0.25",
|
||||
"@jambonz/speech-utils": "^0.0.26",
|
||||
"@jambonz/time-series": "^0.2.8",
|
||||
"@jambonz/verb-specifications": "^0.0.45",
|
||||
"@soniox/soniox-node": "^1.1.1",
|
||||
|
||||
Reference in New Issue
Block a user