feat: Implement platform service providers for MinIO and MongoDB
- Added base interface and abstract class for platform service providers. - Created MinIOProvider class for S3-compatible storage with deployment, provisioning, and deprovisioning functionalities. - Implemented MongoDBProvider class for MongoDB service with similar capabilities. - Introduced error handling utilities for better error management. - Developed TokensComponent for managing registry tokens in the UI, including creation, deletion, and display of tokens.
This commit is contained in:
29
ts/cli.ts
29
ts/cli.ts
@@ -4,6 +4,7 @@
|
||||
|
||||
import { logger } from './logging.ts';
|
||||
import { projectInfo } from './info.ts';
|
||||
import { getErrorMessage } from './utils/error.ts';
|
||||
import { Onebox } from './classes/onebox.ts';
|
||||
import { OneboxDaemon } from './classes/daemon.ts';
|
||||
|
||||
@@ -80,7 +81,7 @@ export async function runCli(): Promise<void> {
|
||||
// Cleanup
|
||||
await onebox.shutdown();
|
||||
} catch (error) {
|
||||
logger.error(error.message);
|
||||
logger.error(getErrorMessage(error));
|
||||
Deno.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -227,20 +228,36 @@ async function handleSslCommand(onebox: Onebox, subcommand: string, args: string
|
||||
}
|
||||
}
|
||||
|
||||
// Nginx commands
|
||||
// Reverse proxy commands (formerly nginx commands)
|
||||
async function handleNginxCommand(onebox: Onebox, subcommand: string, _args: string[]) {
|
||||
switch (subcommand) {
|
||||
case 'reload':
|
||||
await onebox.nginx.reload();
|
||||
// Reload routes and certificates
|
||||
await onebox.reverseProxy.reloadRoutes();
|
||||
await onebox.reverseProxy.reloadCertificates();
|
||||
logger.success('Reverse proxy configuration reloaded');
|
||||
break;
|
||||
|
||||
case 'test':
|
||||
await onebox.nginx.test();
|
||||
// Verify reverse proxy is running
|
||||
const proxyStatus = onebox.reverseProxy.getStatus();
|
||||
if (proxyStatus.http.running || proxyStatus.https.running) {
|
||||
logger.success('Reverse proxy is running');
|
||||
logger.info(`HTTP: ${proxyStatus.http.running ? 'active' : 'inactive'} (port ${proxyStatus.http.port})`);
|
||||
logger.info(`HTTPS: ${proxyStatus.https.running ? 'active' : 'inactive'} (port ${proxyStatus.https.port})`);
|
||||
logger.info(`Routes: ${proxyStatus.routes}, Certificates: ${proxyStatus.https.certificates}`);
|
||||
} else {
|
||||
logger.error('Reverse proxy is not running');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'status': {
|
||||
const status = await onebox.nginx.getStatus();
|
||||
logger.info(`Nginx status: ${status}`);
|
||||
const status = onebox.reverseProxy.getStatus();
|
||||
logger.info(`Reverse proxy status:`);
|
||||
logger.info(` HTTP: ${status.http.running ? 'running' : 'stopped'} (port ${status.http.port})`);
|
||||
logger.info(` HTTPS: ${status.https.running ? 'running' : 'stopped'} (port ${status.https.port})`);
|
||||
logger.info(` Routes: ${status.routes}`);
|
||||
logger.info(` Certificates: ${status.https.certificates}`);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user