allow public holesail keys

This commit is contained in:
Raven Scott
2025-12-20 17:03:20 -05:00
parent a2cdd0497d
commit 14cd0d98dd
7 changed files with 45 additions and 7 deletions
@@ -5,6 +5,7 @@ const { logDebug, logInfo, logError, logWarn } = require('../../infrastructure/l
const { checkPortResponsive, parseMinutesToMs } = require('../../infrastructure/utils');
const { checkPortAvailability, freePort } = require('../../maintenance/cleanup');
const { trackHolesailEvent } = require('../../maintenance/metrics');
const { isSecureHolesailKey } = require('../../infrastructure/utils');
// Start Holesail client
async function startHolesailClient(domain, hash, ip, port, persistent = false) {
@@ -33,11 +34,16 @@ async function startHolesailClient(domain, hash, ip, port, persistent = false) {
}
logInfo('Holesail', `Successfully freed port ${port} on ${ip}`);
}
const secure = isSecureHolesailKey(hash);
logInfo('Holesail', `Creating Holesail client for ${domain} with secure=${secure} (key starts with: ${hash.substring(0, 10)}...)`);
const holesail = new Holesail({
client: true,
key: hash,
port: port,
host: ip,
secure: secure,
log: false
});
try {
@@ -8,6 +8,7 @@ const { logDebug, logError, logInfo, logWarn } = require('../../infrastructure/l
const { ensurePortFree } = require('./port-management');
const { startHolesailClient } = require('./admin-holesail');
const { broadcast } = require('./websocket');
const { isSecureHolesailKey } = require('../../infrastructure/utils');
const holesailClientsFile = process.env.HOLESAIL_CLIENTS_FILE || './cache/holesail_clients.json';
@@ -191,11 +192,15 @@ async function startForkedHolesailClient(id, opts) {
return;
}
const ip = state.domainToIPMap.get(opts.domain);
const secure = isSecureHolesailKey(opts.key);
logDebug('Holesail', `Creating forked Holesail client for ${opts.domain} with secure=${secure} (key starts with: ${opts.key.substring(0, 10)}...)`);
const childOpts = {
client: true,
key: opts.key,
port: opts.port,
host: ip,
secure: secure,
log: false,
protocol: opts.protocol || 'tcp'
};