mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
split db files
This commit is contained in:
parent
46b4b98d40
commit
bb50753704
36 changed files with 496 additions and 454 deletions
|
|
@ -4,7 +4,7 @@ import ipaddr from 'ipaddr.js';
|
|||
import { savePageView, saveEvent } from 'queries';
|
||||
import { useCors, useSession } from 'lib/middleware';
|
||||
import { getJsonBody, getIpAddress } from 'lib/request';
|
||||
import { ok, send, badRequest, forbidden } from 'lib/response';
|
||||
import { unauthorized, send, badRequest, forbidden } from 'lib/response';
|
||||
import { createToken } from 'lib/crypto';
|
||||
import { removeTrailingSlash } from 'lib/url';
|
||||
import { uuid } from 'lib/crypto';
|
||||
|
|
@ -13,7 +13,7 @@ export default async (req, res) => {
|
|||
await useCors(req, res);
|
||||
|
||||
if (isbot(req.headers['user-agent'])) {
|
||||
return ok(res);
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const ignoreIps = process.env.IGNORE_IP;
|
||||
|
|
@ -93,3 +93,38 @@ export default async (req, res) => {
|
|||
|
||||
return send(res, token);
|
||||
};
|
||||
|
||||
// async function relational(req, res) {
|
||||
// await useSession(req, res);
|
||||
|
||||
// const {
|
||||
// session: { website_id, session_id, session_uuid },
|
||||
// } = req;
|
||||
|
||||
// const { type, payload } = getJsonBody(req);
|
||||
|
||||
// let { url, referrer, event_name, event_data } = payload;
|
||||
|
||||
// if (process.env.REMOVE_TRAILING_SLASH) {
|
||||
// url = removeTrailingSlash(url);
|
||||
// }
|
||||
|
||||
// const event_uuid = uuid();
|
||||
|
||||
// if (type === 'pageview') {
|
||||
// await savePageView(website_id, { session_id, session_uuid, url, referrer });
|
||||
// } else if (type === 'event') {
|
||||
// await saveEvent(website_id, {
|
||||
// event_uuid,
|
||||
// session_id,
|
||||
// session_uuid,
|
||||
// url,
|
||||
// event_name,
|
||||
// event_data,
|
||||
// });
|
||||
// } else {
|
||||
// return badRequest(res);
|
||||
// }
|
||||
// }
|
||||
|
||||
// function clickhouse() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue