bugfix on webdav url retriving

This commit is contained in:
Pierre
2026-02-21 18:46:51 +01:00
parent f998d2edfd
commit d7cd0f05ff
3 changed files with 18 additions and 4 deletions
+2 -2
View File
@@ -178,9 +178,9 @@ process.on('SIGINT', async () => {
if (existsSync(config.CONTAINER_PLUGINS_CONFIG)) { if (existsSync(config.CONTAINER_PLUGINS_CONFIG)) {
console.log('[Startup] Initializing container plugins...'); console.log('[Startup] Initializing container plugins...');
try { try {
// Get webdavUrl from meta-core via LeaderClient // Get webdavUrlInternal from meta-core via LeaderClient (for container-to-container access)
const leaderInfo = kvManager?.getLeaderInfo(); const leaderInfo = kvManager?.getLeaderInfo();
const webdavUrl = leaderInfo?.webdavUrl; const webdavUrl = leaderInfo?.webdavUrlInternal ?? leaderInfo?.webdavUrl;
if (webdavUrl) { if (webdavUrl) {
console.log(`[Startup] WebDAV URL from meta-core: ${webdavUrl}`); console.log(`[Startup] WebDAV URL from meta-core: ${webdavUrl}`);
} else { } else {
+4 -1
View File
@@ -155,9 +155,12 @@ export interface LeaderLockInfo {
/** Redis connection URL (e.g., redis://10.0.1.50:6379) */ /** Redis connection URL (e.g., redis://10.0.1.50:6379) */
redisUrl: string; redisUrl: string;
/** WebDAV URL for file access */ /** WebDAV URL for file access (external, via nginx/HTTPS) */
webdavUrl: string; webdavUrl: string;
/** WebDAV URL for internal container-to-container access (direct to port 9000) */
webdavUrlInternal: string;
/** Timestamp when leadership was acquired */ /** Timestamp when leadership was acquired */
timestamp: number; timestamp: number;
+12 -1
View File
@@ -29,6 +29,7 @@ export interface URLsResponse {
apiUrl: string; apiUrl: string;
redisUrl: string; redisUrl: string;
webdavUrl: string; webdavUrl: string;
webdavUrlInternal: string;
isLeader: boolean; isLeader: boolean;
} }
@@ -117,6 +118,7 @@ export class LeaderClient {
apiUrl: urls.apiUrl, apiUrl: urls.apiUrl,
redisUrl: urls.redisUrl, redisUrl: urls.redisUrl,
webdavUrl: urls.webdavUrl, webdavUrl: urls.webdavUrl,
webdavUrlInternal: urls.webdavUrlInternal,
timestamp: Date.now(), timestamp: Date.now(),
pid: 0 // Unknown for remote leader pid: 0 // Unknown for remote leader
}; };
@@ -136,13 +138,22 @@ export class LeaderClient {
} }
/** /**
* Get WebDAV URL from leader info * Get WebDAV URL from leader info (external, via nginx/HTTPS)
*/ */
async getWebdavUrl(): Promise<string | null> { async getWebdavUrl(): Promise<string | null> {
const info = await this.getLeaderInfo(); const info = await this.getLeaderInfo();
return info?.webdavUrl ?? null; return info?.webdavUrl ?? null;
} }
/**
* Get internal WebDAV URL from leader info (direct to port 9000)
* Use this for container-to-container communication
*/
async getWebdavUrlInternal(): Promise<string | null> {
const info = await this.getLeaderInfo();
return info?.webdavUrlInternal ?? null;
}
/** /**
* Get meta-core API URL from leader info * Get meta-core API URL from leader info
*/ */