feat: replace onebox ingress with SmartProxy

This commit is contained in:
2026-04-28 21:30:48 +00:00
parent 0f5ce708d9
commit c5d9158078
20 changed files with 697 additions and 824 deletions
+3 -3
View File
@@ -166,20 +166,20 @@ export class LogsHandler {
const encoder = new TextEncoder();
const clientId = crypto.randomUUID();
// Create a mock WebSocket-like object for the CaddyLogReceiver
// Create a mock WebSocket-like object for the proxy log receiver.
const mockSocket = {
readyState: 1, // WebSocket.OPEN
send: (data: string) => {
try {
virtualStream.sendData(encoder.encode(data));
} catch {
this.opsServerRef.oneboxRef.caddyLogReceiver.removeClient(clientId);
this.opsServerRef.oneboxRef.proxyLogReceiver.removeClient(clientId);
}
},
};
const filter = dataArg.filter || {};
this.opsServerRef.oneboxRef.caddyLogReceiver.addClient(
this.opsServerRef.oneboxRef.proxyLogReceiver.addClient(
clientId,
mockSocket as any,
filter,
+3 -3
View File
@@ -19,7 +19,7 @@ export class NetworkHandler {
redis: 6379,
postgresql: 5432,
rabbitmq: 5672,
caddy: 80,
smartproxy: 80,
clickhouse: 8123,
mariadb: 3306,
};
@@ -85,7 +85,7 @@ export class NetworkHandler {
async (dataArg) => {
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
const proxyStatus = this.opsServerRef.oneboxRef.reverseProxy.getStatus() as any;
const logReceiverStats = this.opsServerRef.oneboxRef.caddyLogReceiver.getStats();
const logReceiverStats = this.opsServerRef.oneboxRef.proxyLogReceiver.getStats();
return {
stats: {
@@ -115,7 +115,7 @@ export class NetworkHandler {
'getTrafficStats',
async (dataArg) => {
await requireAdminIdentity(this.opsServerRef.adminHandler, dataArg);
const trafficStats = this.opsServerRef.oneboxRef.caddyLogReceiver.getTrafficStats(60);
const trafficStats = this.opsServerRef.oneboxRef.proxyLogReceiver.getTrafficStats(60);
return { stats: trafficStats };
},
),
+2 -2
View File
@@ -119,7 +119,7 @@ export class PlatformHandler {
const isCore = 'isCore' in provider && (provider as any).isCore === true;
let status: string = service?.status || 'not-deployed';
if (provider.type === 'caddy') {
if (provider.type === 'smartproxy') {
const proxyStatus = this.opsServerRef.oneboxRef.reverseProxy.getStatus() as any;
status = (proxyStatus.running ?? proxyStatus.http?.running) ? 'running' : 'stopped';
}
@@ -156,7 +156,7 @@ export class PlatformHandler {
const isCore = 'isCore' in provider && (provider as any).isCore === true;
let rawStatus: string = service?.status || 'not-deployed';
if (dataArg.serviceType === 'caddy') {
if (dataArg.serviceType === 'smartproxy') {
const proxyStatus = this.opsServerRef.oneboxRef.reverseProxy.getStatus() as any;
rawStatus = (proxyStatus.running ?? proxyStatus.http?.running) ? 'running' : 'stopped';
}