From 4ef82b6a18697776a9365d96fb9dd47e901dc167 Mon Sep 17 00:00:00 2001 From: MarcUs7i <96580944+MarcUs7i@users.noreply.github.com> Date: Tue, 11 Mar 2025 17:52:33 +0100 Subject: [PATCH] Added optional onionIP for onion service checks --- config.js | 8 ++++---- watcher.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.js b/config.js index 31cd902..dd4e868 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,3 @@ -import { SocksProxyAgent } from 'socks-proxy-agent'; - export default { interval : 1440, // Interval in minutes between each pulse; 1 day (24 * 60) nDataPoints : 90, // Number of datapoints to display on the dashboard @@ -52,10 +50,11 @@ export default { validStatus : [200], // optional, Which http status should be considered non errors [defaults to 200-299] }, { - id : 'btcnd-onion-POWERFUL', // optional + id : 'btcnd-onion', // optional name : 'Bitcoin Node (Onion)', // optional link : 'http://erkuzp5gzrcjqtrcuiku5whcjnioalwskgo3hjg5oq2mmailml7k7jad.onion:8333', // optional, for notifications and dashboard only, [defaults to endpoint.url], can be disabled by setting it to false url : 'http://erkuzp5gzrcjqtrcuiku5whcjnioalwskgo3hjg5oq2mmailml7k7jad.onion:8333', // required + onionIP : '192.168.0.105', // optional, IP to use for onion service check customCheck : async (content, response)=>{return true;}, validStatus : ['SOCKET'], // optional, Which http status should be considered non errors [defaults to 200-299] }, @@ -138,10 +137,11 @@ export default { validStatus : [200], // optional, Which http status should be considered non errors [defaults to 200-299] }, { - id : 'xmrnd-onion-POWERFUL', // optional + id : 'xmrnd-onion', // optional name : 'Monero Node (Onion)', // optional link : 'bto4zcx3tbss5f6mhbc4guumv66og2udpg3n26254f2sbkdvhnr2bwyd.onion:18081', // optional, for notifications and dashboard only, [defaults to endpoint.url], can be disabled by setting it to false url : 'bto4zcx3tbss5f6mhbc4guumv66og2udpg3n26254f2sbkdvhnr2bwyd.onion:18081', // required + onionIP : '192.168.0.105', // optional, IP to use for onion service check request : null, customCheck : async (content, response)=>{return true;}, validStatus : ['SOCKET'], // optional, Which http status should be considered non errors [defaults to 200-299] diff --git a/watcher.js b/watcher.js index 82df86f..6a9f4c4 100644 --- a/watcher.js +++ b/watcher.js @@ -224,8 +224,8 @@ while(true) { try { if (endpoint.url.includes('.onion')) { let [host, port] = endpoint.url.replace('http://', '').split(':'); - host = endpoint.id.includes('-POWERFUL') ? '192.168.0.105' : '127.0.0.1'; - const result = await checkOnionService(host, port || 8333); + host = endpoint.onionIP || '127.0.0.1'; + const result = await checkOnionService(host, port || 80); endpointStatus.t = Date.now(); endpointStatus.dur = 0;