feat: add dcrouter external gateway sync

This commit is contained in:
2026-04-29 15:24:25 +00:00
parent 1f3705fa25
commit 7ee740695f
12 changed files with 643 additions and 6 deletions
+13
View File
@@ -24,6 +24,7 @@ import { AppStoreManager } from './appstore.ts';
import { ProxyLogReceiver } from './proxy-log-receiver.ts';
import { BackupManager } from './backup-manager.ts';
import { BackupScheduler } from './backup-scheduler.ts';
import { ExternalGatewayManager } from './external-gateway.ts';
import { OpsServer } from '../opsserver/index.ts';
export class Onebox {
@@ -44,6 +45,7 @@ export class Onebox {
public proxyLogReceiver: ProxyLogReceiver;
public backupManager: BackupManager;
public backupScheduler: BackupScheduler;
public externalGateway: ExternalGatewayManager;
public opsServer: OpsServer;
private initialized = false;
@@ -86,6 +88,9 @@ export class Onebox {
// Initialize Backup scheduler
this.backupScheduler = new BackupScheduler(this);
// Initialize optional dcrouter edge gateway integration
this.externalGateway = new ExternalGatewayManager(this);
// Initialize OpsServer (TypedRequest-based server)
this.opsServer = new OpsServer(this);
}
@@ -160,6 +165,14 @@ export class Onebox {
logger.warn('Cloudflare domain sync initialization failed - domain sync will be limited');
}
// Initialize external dcrouter gateway (non-critical)
try {
await this.externalGateway.init();
} catch (error) {
logger.warn('External dcrouter gateway initialization failed - edge sync will be disabled');
logger.warn(`Error: ${getErrorMessage(error)}`);
}
// Initialize Onebox Registry (non-critical)
try {
await this.registry.init();