Initial commit: DashCaddy v1.0

Full codebase including API server (32 modules + routes), dashboard frontend,
DashCA certificate distribution, installer script, and deployment skills.
This commit is contained in:
2026-03-05 02:26:12 -08:00
commit f61e85d9a7
337 changed files with 75282 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
const express = require('express');
module.exports = function(ctx) {
const router = express.Router();
// List all stored credentials (keys only, no values)
router.get('/credentials/list', ctx.asyncHandler(async (req, res) => {
const keys = await ctx.credentialManager.list();
res.json({ success: true, credentials: keys, count: keys.length });
}, 'credentials-list'));
// Rotate encryption key — re-encrypts all stored credentials
router.post('/credentials/rotate-key', ctx.asyncHandler(async (req, res) => {
const success = await ctx.credentialManager.rotateEncryptionKey();
if (success) {
res.json({ success: true, message: 'Encryption key rotated, all credentials re-encrypted' });
} else {
ctx.errorResponse(res, 500, 'Key rotation failed');
}
}, 'credentials-rotate'));
return router;
};