Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/umami-software/umami into qa
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscao633 committed Dec 16, 2024
2 parents 5fbd19c + 67164a7 commit f89984c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "umami",
"version": "2.15.0",
"version": "2.15.1",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Umami Software, Inc. <hello@umami.is>",
"license": "MIT",
Expand Down
9 changes: 8 additions & 1 deletion scripts/check-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ if (!process.env.SKIP_DB_CHECK && !process.env.DATABASE_TYPE) {
}

if (process.env.CLOUD_MODE) {
checkMissing(['CLOUD_URL', 'KAFKA_BROKER', 'KAFKA_URL', 'REDIS_URL']);
checkMissing([
'CLOUD_URL',
'KAFKA_BROKER',
'KAFKA_URL',
'REDIS_URL',
'KAFKA_SASL_MECHANISM',
'KAFKA_SSL',
]);
}
10 changes: 6 additions & 4 deletions src/lib/kafka.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import debug from 'debug';
import { Kafka, Mechanism, Producer, RecordMetadata, SASLOptions, logLevel } from 'kafkajs';
import { Kafka, Producer, RecordMetadata, SASLOptions, logLevel } from 'kafkajs';
import { KAFKA, KAFKA_PRODUCER } from 'lib/db';
import * as tls from 'tls';

Expand All @@ -12,13 +12,15 @@ 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 | Mechanism } =
const ssl: { ssl?: tls.ConnectionOptions | boolean; sasl?: SASLOptions } =
username && password
? {
ssl: true,
ssl: sslEnabled,
sasl: {
mechanism: 'scram-sha-256',
mechanism,
username,
password,
},
Expand Down

0 comments on commit f89984c

Please sign in to comment.