mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
Francis/uc 37 secure kafka (#1532)
* add ssl encryption to kafka client * fix missing columns in getPageview CH. fix Kafka SSL Pathing
This commit is contained in:
parent
3932583bc9
commit
55218d1ddd
3
.gitignore
vendored
3
.gitignore
vendored
@ -38,3 +38,6 @@ yarn-error.log*
|
||||
|
||||
*.dev.yml
|
||||
|
||||
# cert
|
||||
/lib/cert
|
||||
|
||||
|
10
lib/kafka.js
10
lib/kafka.js
@ -8,11 +8,17 @@ const log = debug('umami:kafka');
|
||||
function getClient() {
|
||||
const { username, password } = new URL(process.env.KAFKA_URL);
|
||||
const brokers = process.env.KAFKA_BROKER.split(',');
|
||||
const fs = require('fs');
|
||||
|
||||
const ssl =
|
||||
username && password
|
||||
? {
|
||||
ssl: true,
|
||||
ssl: {
|
||||
checkServerIdentity: () => undefined,
|
||||
ca: [fs.readFileSync('./lib/cert/ca_cert.pem', 'utf-8')],
|
||||
key: fs.readFileSync('./lib/cert/client_key.pem', 'utf-8'),
|
||||
cert: fs.readFileSync('./lib/cert/client_cert.pem', 'utf-8'),
|
||||
},
|
||||
sasl: {
|
||||
mechanism: 'plain',
|
||||
username,
|
||||
@ -63,7 +69,7 @@ async function sendMessage(params, topic) {
|
||||
value: JSON.stringify(params),
|
||||
},
|
||||
],
|
||||
acks: 0,
|
||||
acks: 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -27,9 +27,8 @@ async function relationalQuery(websites, start_at) {
|
||||
async function clickhouseQuery(websites, start_at) {
|
||||
return clickhouse.rawQuery(
|
||||
`select
|
||||
view_id,
|
||||
website_id,
|
||||
session_id,
|
||||
session_uuid,
|
||||
created_at,
|
||||
url
|
||||
from event
|
||||
|
Loading…
Reference in New Issue
Block a user