Update scripts
This commit is contained in:
1 parent
409352a95b
commit
daa7a976ec
2 files changed
+13
-10
No files matched your search
@@ -143,6 +143,14 @@ const processLogLine = async (line, test = false) => {
|
|||||||
(async () => {
|
(async () => {
|
||||||
log(`${repoFullUrl} - v${version} | Author: ${authorEmailWebsite}`);
|
log(`${repoFullUrl} - v${version} | Author: ${authorEmailWebsite}`);
|
||||||
|
|
||||||
|
// Auto updates
|
||||||
|
if (AUTO_UPDATE_ENABLED && AUTO_UPDATE_SCHEDULE && SERVER_ID !== 'development') {
|
||||||
|
await require('./scripts/services/updates.js')();
|
||||||
|
} else {
|
||||||
|
await require('./scripts/services/version.js')();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bulk
|
||||||
await loadReportedIPs();
|
await loadReportedIPs();
|
||||||
await loadBufferFromFile();
|
await loadBufferFromFile();
|
||||||
|
|
||||||
@@ -151,6 +159,8 @@ const processLogLine = async (line, test = false) => {
|
|||||||
await sendBulkReport();
|
await sendBulkReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Fetch IPs
|
||||||
log('Trying to fetch your IPv4 and IPv6 address from api.sefinek.net...');
|
log('Trying to fetch your IPv4 and IPv6 address from api.sefinek.net...');
|
||||||
await refreshServerIPs();
|
await refreshServerIPs();
|
||||||
log(`Fetched ${getServerIPs()?.length} of your IP addresses. If any of them accidentally appear in the UFW logs, they will be ignored.`, 1);
|
log(`Fetched ${getServerIPs()?.length} of your IP addresses. If any of them accidentally appear in the UFW logs, they will be ignored.`, 1);
|
||||||
@@ -160,8 +170,8 @@ const processLogLine = async (line, test = false) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Watch
|
||||||
fileOffset = fs.statSync(UFW_LOG_FILE).size;
|
fileOffset = fs.statSync(UFW_LOG_FILE).size;
|
||||||
|
|
||||||
chokidar.watch(UFW_LOG_FILE, { persistent: true, ignoreInitial: true })
|
chokidar.watch(UFW_LOG_FILE, { persistent: true, ignoreInitial: true })
|
||||||
.on('change', path => {
|
.on('change', path => {
|
||||||
const stats = fs.statSync(path);
|
const stats = fs.statSync(path);
|
||||||
@@ -177,20 +187,13 @@ const processLogLine = async (line, test = false) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Auto updates
|
|
||||||
if (AUTO_UPDATE_ENABLED && AUTO_UPDATE_SCHEDULE && SERVER_ID !== 'development') {
|
|
||||||
await require('./scripts/services/updates.js')();
|
|
||||||
} else {
|
|
||||||
await require('./scripts/services/version.js')();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Summaries
|
// Summaries
|
||||||
if (DISCORD_WEBHOOKS_ENABLED && DISCORD_WEBHOOKS_URL) await require('./scripts/services/summaries.js')();
|
if (DISCORD_WEBHOOKS_ENABLED && DISCORD_WEBHOOKS_URL) await require('./scripts/services/summaries.js')();
|
||||||
|
|
||||||
// Ready
|
// Ready
|
||||||
await sendWebhook(`[${name}](${repoFullUrl}) has been successfully started on the device \`${SERVER_ID}\`.`, 0x59D267);
|
await sendWebhook(`[${name}](${repoFullUrl}) has been successfully started on the device \`${SERVER_ID}\`.`, 0x59D267);
|
||||||
log(`Ready! Now monitoring: ${UFW_LOG_FILE}`, 1);
|
log(`Ready! Now monitoring: ${UFW_LOG_FILE}`, 1);
|
||||||
process.send && process.send('ready');
|
process.send?.('ready');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = processLogLine;
|
module.exports = processLogLine;
|
||||||
+1
-1
Submodule scripts updated: 0688a8955e...a84dc770ce.
Reference in new issue
Block a user