[monitoring] fix liquid health check hostnames

This commit is contained in:
Mononaut 2026-01-12 11:05:19 +00:00
parent eb029aef95
commit 267b4f00f7
No known key found for this signature in database
GPG key ID: A3F058E41374C04E

View file

@ -253,7 +253,12 @@ class FailoverRouter {
private async $updateFrontendGitHash(host: FailoverHost): Promise<void> {
try {
const url = `${host.publicDomain}/resources/config.js`;
const response = await this.pollConnection.get<string>(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT });
const response = await this.pollConnection.get<string>(
url, {
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined
}
);
const match = response.data.match(/GIT_COMMIT_HASH\s*=\s*['"](.*?)['"]/);
if (match && match[1]?.length) {
host.hashes.frontend = match[1];
@ -276,7 +281,7 @@ class FailoverRouter {
path: '/en-US/resources/config.js',
method: 'GET',
headers: {
'Host': 'mempool.space'
'Host': Common.isLiquid() ? 'liquid.network' : 'mempool.space'
},
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
}, (res) => {
@ -307,7 +312,12 @@ class FailoverRouter {
private async $updateBackendVersions(host: FailoverHost): Promise<void> {
try {
const url = `${host.publicDomain}/api/v1/backend-info`;
const response = await this.pollConnection.get<any>(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT });
const response = await this.pollConnection.get<any>(
url, {
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined
}
);
if (response.data?.gitCommit) {
host.hashes.backend = response.data.gitCommit;
}
@ -322,7 +332,12 @@ class FailoverRouter {
private async $updateSSRGitHash(host: FailoverHost): Promise<void> {
try {
const url = `${host.publicDomain}/ssr/api/status`;
const response = await this.pollConnection.get<any>(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT });
const response = await this.pollConnection.get<any>(
url, {
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined
}
);
if (response.data?.gitHash) {
host.hashes.ssr = response.data.gitHash;
}