maxmind fix
This commit is contained in:
13
maxmind.js
13
maxmind.js
@@ -112,6 +112,11 @@ async function downloadAndExtractMaxmindData(url, outputDir, tempDir, username,
|
|||||||
* @return {Promise<void>} Resolves when the data check and optional update process is completed.
|
* @return {Promise<void>} Resolves when the data check and optional update process is completed.
|
||||||
*/
|
*/
|
||||||
async function checkAndUpdateMaxmindData(outputDir, tempDir, url, username, password) {
|
async function checkAndUpdateMaxmindData(outputDir, tempDir, url, username, password) {
|
||||||
|
if (username === '' || password === '') {
|
||||||
|
console.log('No MaxMind credentials provided. Skipping MaxMind database update.');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Checking for MaxMind database updates.');
|
console.log('Checking for MaxMind database updates.');
|
||||||
|
|
||||||
// Ensure the output directory exists
|
// Ensure the output directory exists
|
||||||
@@ -146,10 +151,10 @@ async function checkAndUpdateMaxmindData(outputDir, tempDir, url, username, pass
|
|||||||
|
|
||||||
const url = 'https://download.maxmind.com/geoip/databases/GeoIP2-Country/download?suffix=tar.gz';
|
const url = 'https://download.maxmind.com/geoip/databases/GeoIP2-Country/download?suffix=tar.gz';
|
||||||
const outputDirectory = './maxmind';
|
const outputDirectory = './maxmind';
|
||||||
const username = '1102431';
|
// const username = '1102431';
|
||||||
const password = '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';
|
// const password = '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';
|
||||||
// const username = process.env.MAXMIND_ACCOUNT_NUMBER;
|
const username = process.env.MAXMIND_ACCOUNT_NUMBER;
|
||||||
// const password = process.env.MAXMIND_LICENSE_KEY;
|
const password = process.env.MAXMIND_LICENSE_KEY;
|
||||||
|
|
||||||
await checkAndUpdateMaxmindData(outputDirectory, '/tmp', url, username, password);
|
await checkAndUpdateMaxmindData(outputDirectory, '/tmp', url, username, password);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user