allow public holesail keys
This commit is contained in:
@@ -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'
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ const { createInterfaceForDomain } = require('../networking/virtual_interfaces')
|
||||
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';
|
||||
|
||||
@@ -54,11 +55,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'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user