Added optional onionIP for onion service checks

This commit is contained in:
MarcUs7i 2025-03-11 17:52:33 +01:00
parent df871a95f1
commit 4ef82b6a18
2 changed files with 6 additions and 6 deletions

View file

@ -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]

View file

@ -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;