fix(smartproxy): clean up legacy reverse proxy naming for SmartProxy
This commit is contained in:
@@ -10,7 +10,7 @@ import { logger } from '../logging.ts';
|
||||
import { getErrorMessage } from '../utils/error.ts';
|
||||
|
||||
const SMARTPROXY_SERVICE_NAME = 'onebox-smartproxy';
|
||||
const LEGACY_CADDY_SERVICE_NAME = 'onebox-caddy';
|
||||
const LEGACY_REVERSE_PROXY_SERVICE_NAME = 'onebox-caddy';
|
||||
const SMARTPROXY_IMAGE = 'code.foss.global/host.today/ht-docker-smartproxy:latest';
|
||||
const SMARTPROXY_ADMIN_CONTAINER_PORT = 3000;
|
||||
const SMARTPROXY_HTTP_CONTAINER_PORT = 80;
|
||||
@@ -102,10 +102,12 @@ export class SmartProxyManager {
|
||||
|
||||
logger.info('Starting SmartProxy Docker service...');
|
||||
|
||||
const legacyService = await this.getExistingService(LEGACY_CADDY_SERVICE_NAME);
|
||||
const legacyService = await this.getExistingService(LEGACY_REVERSE_PROXY_SERVICE_NAME);
|
||||
if (legacyService) {
|
||||
logger.info('Legacy Caddy service exists, removing it before SmartProxy startup...');
|
||||
await this.removeService(LEGACY_CADDY_SERVICE_NAME);
|
||||
logger.info(
|
||||
`Legacy reverse proxy service ${LEGACY_REVERSE_PROXY_SERVICE_NAME} exists, removing it before SmartProxy startup...`,
|
||||
);
|
||||
await this.removeService(LEGACY_REVERSE_PROXY_SERVICE_NAME);
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { TQueryFunction } from '../types.ts';
|
||||
|
||||
export class Migration015SmartProxyPlatformService extends BaseMigration {
|
||||
readonly version = 15;
|
||||
readonly description = 'Rename Caddy platform service to SmartProxy';
|
||||
readonly description = 'Rename legacy reverse proxy platform service to SmartProxy';
|
||||
|
||||
up(query: TQueryFunction): void {
|
||||
query(
|
||||
|
||||
Reference in New Issue
Block a user