Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Dec 18, 2024
2 parents 85a348c + 2ab30d2 commit 2d27333
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
9 changes: 1 addition & 8 deletions scripts/check-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,5 @@ if (!process.env.SKIP_DB_CHECK && !process.env.DATABASE_TYPE) {
}

if (process.env.CLOUD_MODE) {
checkMissing([
'CLOUD_URL',
'KAFKA_BROKER',
'KAFKA_URL',
'REDIS_URL',
'KAFKA_SASL_MECHANISM',
'KAFKA_SSL',
]);
checkMissing(['CLOUD_URL', 'KAFKA_BROKER', 'KAFKA_URL', 'REDIS_URL', 'KAFKA_SASL_MECHANISM']);
}
5 changes: 3 additions & 2 deletions src/lib/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ const enabled = Boolean(process.env.KAFKA_URL && process.env.KAFKA_BROKER);
function getClient() {
const { username, password } = new URL(process.env.KAFKA_URL);
const brokers = process.env.KAFKA_BROKER.split(',');
const sslEnabled = process.env.KAFKA_SSL.toLowerCase() === 'true';
const mechanism = process.env.KAFKA_SASL_MECHANISM as 'plain' | 'scram-sha-256' | 'scram-sha-512';

const ssl: { ssl?: tls.ConnectionOptions | boolean; sasl?: SASLOptions } =
username && password
? {
ssl: sslEnabled,
ssl: {
rejectUnauthorized: false,
},
sasl: {
mechanism,
username,
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7962,9 +7962,9 @@ nanoclone@^0.2.1:
integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==

nanoid@^3.3.6, nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
version "3.3.8"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf"
integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==

natural-compare@^1.4.0:
version "1.4.0"
Expand Down

0 comments on commit 2d27333

Please sign in to comment.