Some fixes
This commit is contained in:
parent
a81105f62a
commit
60b620b860
4 changed files with 5 additions and 5 deletions
2
index.js
2
index.js
|
|
@ -7,7 +7,7 @@ const generateComment = require('./scripts/generateComment.js');
|
||||||
const SefinekAPI = require('./scripts/sefinekAPI.js');
|
const SefinekAPI = require('./scripts/sefinekAPI.js');
|
||||||
const isImageRequest = require('./scripts/isImageRequest.js');
|
const isImageRequest = require('./scripts/isImageRequest.js');
|
||||||
const headers = require('./scripts/headers.js');
|
const headers = require('./scripts/headers.js');
|
||||||
const { logToCSV, readReportedIPs, wasImageRequestLogged } = require('./scripts/csv.js');
|
const { logToCSV, readReportedIPs, wasImageRequestLogged } = require('./services/csv.js');
|
||||||
const formatDelay = require('./scripts/formatDelay.js');
|
const formatDelay = require('./scripts/formatDelay.js');
|
||||||
const clientIp = require('./scripts/clientIp.js');
|
const clientIp = require('./scripts/clientIp.js');
|
||||||
const whitelist = require('./whitelist.js');
|
const whitelist = require('./whitelist.js');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
const { axios } = require('../services/axios.js');
|
const { axios } = require('../services/axios.js');
|
||||||
const { readReportedIPs, updateSefinekAPIInCSV } = require('./csv.js');
|
const { readReportedIPs, updateSefinekAPIInCSV } = require('../services/csv.js');
|
||||||
const log = require('./log.js');
|
const log = require('./log.js');
|
||||||
const clientIp = require('./clientIp.js');
|
const clientIp = require('./clientIp.js');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@ const { UserAgent } = require('../scripts/headers.js');
|
||||||
const { version } = require('../package.json');
|
const { version } = require('../package.json');
|
||||||
|
|
||||||
axios.defaults.headers.common['User-Agent'] = UserAgent;
|
axios.defaults.headers.common['User-Agent'] = UserAgent;
|
||||||
axios.defaults.timeout = 9000;
|
axios.defaults.timeout = 7000;
|
||||||
|
|
||||||
module.exports = { axios, moduleVersion: version };
|
module.exports = { axios, moduleVersion: version };
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const log = require('./log.js');
|
const log = require('../scripts/log.js');
|
||||||
|
|
||||||
const CSV_FILE_PATH = path.join(__dirname, '..', 'reported_ips.csv');
|
const CSV_FILE_PATH = path.join(__dirname, '..', 'reported_ips.csv');
|
||||||
const MAX_CSV_SIZE_BYTES = 4 * 1024 * 1024; // 4 MB
|
const MAX_CSV_SIZE_BYTES = 3 * 1024 * 1024; // 3 MB
|
||||||
const CSV_HEADER = 'Timestamp,CF RayID,IP,Country,Hostname,Endpoint,User-Agent,Action taken,Status,Sefinek API\n';
|
const CSV_HEADER = 'Timestamp,CF RayID,IP,Country,Hostname,Endpoint,User-Agent,Action taken,Status,Sefinek API\n';
|
||||||
|
|
||||||
if (!fs.existsSync(CSV_FILE_PATH)) fs.writeFileSync(CSV_FILE_PATH, CSV_HEADER);
|
if (!fs.existsSync(CSV_FILE_PATH)) fs.writeFileSync(CSV_FILE_PATH, CSV_HEADER);
|
||||||
Loading…
Add table
Reference in a new issue