feat: Implement Docker registry token endpoint and enhance registry request handling

This commit is contained in:
2025-11-25 19:46:18 +00:00
parent 76793d512b
commit 5cf9c72dd4
4 changed files with 201 additions and 4 deletions

View File

@@ -83,6 +83,29 @@ export class Onebox {
// Initialize Reverse Proxy
await this.reverseProxy.init();
// Load routes and certificates for reverse proxy
await this.reverseProxy.reloadRoutes();
await this.reverseProxy.reloadCertificates();
// Start HTTP reverse proxy (non-critical - don't fail init if ports are busy)
// Use 8080/8443 in dev mode to avoid permission issues
const isDev = Deno.env.get('ONEBOX_DEV') === 'true' || Deno.args.includes('--ephemeral');
const httpPort = isDev ? 8080 : 80;
const httpsPort = isDev ? 8443 : 443;
try {
await this.reverseProxy.startHttp(httpPort);
} catch (error) {
logger.warn(`Failed to start HTTP reverse proxy: ${getErrorMessage(error)}`);
}
// Start HTTPS reverse proxy if certificates are available
try {
await this.reverseProxy.startHttps(httpsPort);
} catch (error) {
logger.warn(`Failed to start HTTPS reverse proxy: ${getErrorMessage(error)}`);
}
// Initialize DNS (non-critical)
try {
await this.dns.init();