feat(doos): add container runtime, audit cases, example demo and tests
- New rootless doos container runtime: sandbox, cgroup, network, images, hardening, davmount, CLI plus molo integration - 18 CVE audit reproductions with READMEs and Makefiles - Example DoosDemo routes, IndexCatalog, static assets, spec update - CLI serve on 0.0.0.0:8000, arg parser, dev server improvements - Runtime HTTP fixes, supervisor isolation backend - Tests for doos, example doos routes, CLI serve; suite count 261 to 265
This commit is contained in:
+11
-9
@@ -1,4 +1,5 @@
|
||||
#include "App.hpp"
|
||||
#include "IndexCatalog.hpp"
|
||||
|
||||
#include "../fw/Http.hpp"
|
||||
#include "../fw/Router.hpp"
|
||||
@@ -42,6 +43,8 @@ const char* kFeatures[][2] = {
|
||||
{"restclient", "/restclient/self"},
|
||||
{"openapi", "/openapi.json"},
|
||||
{"docs", "/docs"},
|
||||
{"doos", "/doos"},
|
||||
{"doos-status", "/doos/status"},
|
||||
{"ai", "/cli/ai"},
|
||||
{"workflow", "/workflow/release"},
|
||||
{"redirect", "/redirect/here"},
|
||||
@@ -54,18 +57,17 @@ const char* kFeatures[][2] = {
|
||||
void register_index(fw::Router& router, Services& services_ref) {
|
||||
fw::Environment* env = services_ref.templates.get();
|
||||
Services* services = &services_ref;
|
||||
static const IndexCatalog catalog;
|
||||
router.get("/", "index", [env, services](fw::Request req) {
|
||||
fw::TemplateCtx ctx;
|
||||
ctx["title"] = std::string("MoloApp living example");
|
||||
ctx["show_matrix"] = std::string("true");
|
||||
fw::TemplateList rows;
|
||||
for (const auto& [feature, route] : kFeatures) {
|
||||
rows.push_back({{"feature", feature}, {"route", route}});
|
||||
}
|
||||
for (const auto& [feature, route] : services->features) {
|
||||
rows.push_back({{"feature", feature}, {"route", route}});
|
||||
}
|
||||
ctx["matrix"] = rows;
|
||||
std::vector<std::pair<std::string, std::string>> rows;
|
||||
for (const auto& [feature, route] : kFeatures) rows.emplace_back(feature, route);
|
||||
for (const auto& [feature, route] : services->features) rows.emplace_back(feature, route);
|
||||
std::size_t features = 0, groups = 0;
|
||||
ctx["sections"] = catalog.render(rows, &features, &groups);
|
||||
ctx["feature_count"] = std::to_string(features);
|
||||
ctx["group_count"] = std::to_string(groups);
|
||||
(void)req;
|
||||
return fw::Response(200, env->render("index.html", ctx),
|
||||
"text/html; charset=utf-8");
|
||||
|
||||
Reference in New Issue
Block a user