feat: add dcrouter external gateway sync
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user