- Container exec/shell via WebSocket + xterm.js (subtle >_ button on cards) - Live dashboard updates via SSE (resource alerts, health changes, update notices) - Docker Compose import with YAML parsing, preview, and dependency-ordered deploy - Volume & network management modal with disk usage overview - CPU/memory resource limits on deploy and live update - Email SMTP notifications (nodemailer) alongside Discord/Telegram/ntfy - Scheduled auto-update scheduler with maintenance windows (daily/weekly/monthly) New deps: ws, js-yaml, nodemailer Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
const express = require('express');
|
|
const initHelpers = require('./helpers');
|
|
const initDeploy = require('./deploy');
|
|
const initRemoval = require('./removal');
|
|
const initTemplates = require('./templates');
|
|
const initRestore = require('./restore');
|
|
const initCompose = require('./compose');
|
|
|
|
/**
|
|
* Apps routes aggregator
|
|
* Assembles all apps sub-routes with their dependencies
|
|
* @param {Object} ctx - Application context (for backward compatibility)
|
|
* @returns {express.Router}
|
|
*/
|
|
module.exports = function(ctx) {
|
|
const router = express.Router();
|
|
|
|
// Extract dependencies from context
|
|
const deps = {
|
|
docker: ctx.docker,
|
|
caddy: ctx.caddy,
|
|
credentialManager: ctx.credentialManager,
|
|
servicesStateManager: ctx.servicesStateManager,
|
|
portLockManager: ctx.portLockManager,
|
|
asyncHandler: ctx.asyncHandler,
|
|
errorResponse: ctx.errorResponse,
|
|
log: ctx.log,
|
|
// Additional context properties needed by routes
|
|
APP_TEMPLATES: ctx.APP_TEMPLATES,
|
|
siteConfig: ctx.siteConfig,
|
|
buildDomain: ctx.buildDomain,
|
|
buildServiceUrl: ctx.buildServiceUrl,
|
|
addServiceToConfig: ctx.addServiceToConfig,
|
|
dns: ctx.dns,
|
|
notification: ctx.notification,
|
|
safeErrorMessage: ctx.safeErrorMessage
|
|
};
|
|
|
|
// Initialize helpers with dependencies
|
|
const helpers = initHelpers(ctx);
|
|
|
|
// Mount sub-routes — pass full ctx so sub-routes can reference ctx.* properties
|
|
const subCtx = Object.assign({}, ctx, { helpers });
|
|
router.use(initDeploy(subCtx));
|
|
router.use(initRemoval(subCtx));
|
|
router.use(initTemplates(subCtx));
|
|
router.use(initRestore(subCtx));
|
|
router.use(initCompose(subCtx));
|
|
|
|
return router;
|
|
};
|