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:
@@ -50,6 +50,10 @@ std::shared_ptr<fw::Application> build_application(Services& services) {
|
||||
register_ops_demo(ops, services);
|
||||
app->include_router("", ops);
|
||||
|
||||
fw::Router doos;
|
||||
register_doos_demo(doos, services);
|
||||
app->include_router("", doos);
|
||||
|
||||
fw::Router stats;
|
||||
register_stats_demo(stats, services);
|
||||
app->include_router("", stats);
|
||||
|
||||
@@ -81,6 +81,7 @@ void register_security_demo(fw::Router& router, Services& services);
|
||||
void register_formats_demo(fw::Router& router, Services& services);
|
||||
void register_realtime_demo(fw::Router& router, Services& services);
|
||||
void register_ops_demo(fw::Router& router, Services& services);
|
||||
void register_doos_demo(fw::Router& router, Services& services);
|
||||
void register_stats_demo(fw::Router& router, Services& services);
|
||||
void register_security_extra_demo(fw::Router& router, Services& services);
|
||||
void register_platform_demo(fw::Router& router, Services& services);
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
#include "App.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../fw/Http.hpp"
|
||||
#include "../fw/Router.hpp"
|
||||
#include "../fw/Templates.hpp"
|
||||
#include "../fw/Validate.hpp"
|
||||
#include "doos/caps.h"
|
||||
#include "doos/cli.hpp"
|
||||
#include "doos/container.hpp"
|
||||
#include "doos/network.hpp"
|
||||
#include "doos/util.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
namespace {
|
||||
|
||||
// Demo store: DOOS_HOME when the harness sets it (tests point it at scratch),
|
||||
// else build/doos-demo. Never the user's real store.
|
||||
void use_demo_home() {
|
||||
const char* h = ::getenv("DOOS_HOME");
|
||||
if (!h || !*h) ::setenv("DOOS_HOME", "build/doos-demo", 1);
|
||||
}
|
||||
|
||||
std::string input_or(const std::map<std::string, std::string>& input, const char* key) {
|
||||
auto it = input.find(key);
|
||||
return it == input.end() ? "" : it->second;
|
||||
}
|
||||
|
||||
// One {"ok":true,<key>:<value>} body from run_json, unwrapped to <key>:<value>
|
||||
// so /doos/status composes the single renderer instead of forking its fields.
|
||||
std::string run_inner(const std::vector<std::string>& argv) {
|
||||
std::string body, err;
|
||||
int rc = molo::doos::run_json(argv, body, err);
|
||||
if (rc != 0) throw std::runtime_error(err.empty() ? "doos status failed" : err);
|
||||
const std::string pre = "{\"ok\":true,";
|
||||
if (body.rfind(pre, 0) != 0 || body.size() < pre.size() + 2) {
|
||||
throw std::runtime_error("bad doos json");
|
||||
}
|
||||
return body.substr(pre.size(), body.size() - pre.size() - 2); // strip trailing "}\n"
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void register_doos_demo(fw::Router& router, Services& services) {
|
||||
use_demo_home();
|
||||
fw::Environment* env = services.templates.get();
|
||||
|
||||
router.get("/doos", "doos-page", [env](fw::Request req) {
|
||||
(void)req;
|
||||
fw::TemplateCtx ctx;
|
||||
ctx["title"] = std::string("Sandboxed containers");
|
||||
ctx["heading"] = std::string("Sandboxed containers (doos)");
|
||||
molo::doos::Store store = molo::doos::Store::fromEnvironment();
|
||||
fw::TemplateList items;
|
||||
for (const auto& c : store.list()) {
|
||||
items.push_back({{"name", c.name()},
|
||||
{"kind", std::string(c.runningPid() ? "running" : "stopped") + " - " +
|
||||
molo::doos::Network::name(c.net()) + " - " +
|
||||
(c.imageMode() ? c.image() : "host")}});
|
||||
}
|
||||
ctx["items"] = items;
|
||||
ctx["snippet"] = std::to_string(items.size()) + " containers (demo store)";
|
||||
return fw::Response(200, env->render("page.html", ctx), "text/html; charset=utf-8");
|
||||
});
|
||||
|
||||
router.get("/doos/status", "doos-status", [](fw::Request req) {
|
||||
(void)req;
|
||||
try {
|
||||
std::string s = "{" + run_inner({"list"}) + "," + run_inner({"image", "list"}) + "," +
|
||||
run_inner({"davmount", "list"}) + "," + run_inner({"version"}) + "}";
|
||||
return fw::JsonResponse(s, 200);
|
||||
} catch (const std::exception& e) {
|
||||
return fw::JsonResponse("{\"error\":\"" + fw::json_escape(e.what()) + "\"}", 500);
|
||||
}
|
||||
});
|
||||
|
||||
router.post("/doos/create", "doos-create", [](fw::Request req) {
|
||||
auto input = fw::parse_json_object_flat(req.body);
|
||||
if (input.empty()) input = fw::parse_form(req.body);
|
||||
std::vector<std::string> failures;
|
||||
std::string name = input_or(input, "name");
|
||||
if (name.empty()) failures.push_back("name is required");
|
||||
molo::doos::Options opts;
|
||||
try {
|
||||
if (!input_or(input, "size").empty()) {
|
||||
opts.size = molo::doos::parseSize(input_or(input, "size"));
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
failures.push_back(e.what());
|
||||
}
|
||||
try {
|
||||
if (!input_or(input, "memory").empty()) {
|
||||
opts.memory = molo::doos::parseSize(input_or(input, "memory"));
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
failures.push_back(e.what());
|
||||
}
|
||||
try {
|
||||
if (!input_or(input, "net").empty()) {
|
||||
opts.net = molo::doos::Network::parse(input_or(input, "net"));
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
failures.push_back(e.what());
|
||||
}
|
||||
if (!failures.empty()) {
|
||||
std::ostringstream o;
|
||||
o << "{\"errors\":[";
|
||||
for (std::size_t i = 0; i < failures.size(); ++i) {
|
||||
if (i) o << ",";
|
||||
o << "\"" << fw::json_escape(failures[i]) << "\"";
|
||||
}
|
||||
o << "]}";
|
||||
return fw::JsonResponse(o.str(), 422);
|
||||
}
|
||||
try {
|
||||
molo::doos::Store store = molo::doos::Store::fromEnvironment();
|
||||
auto [c, created] = store.getOrCreate(name, opts);
|
||||
std::ostringstream o;
|
||||
o << "{\"name\":\"" << molo::doos::json_escape(c.name()) << "\",\"created\":"
|
||||
<< (created ? "true" : "false") << "}";
|
||||
return fw::JsonResponse(o.str(), 200);
|
||||
} catch (const std::exception& e) {
|
||||
return fw::JsonResponse("{\"errors\":[\"" + fw::json_escape(e.what()) + "\"]}", 422);
|
||||
}
|
||||
});
|
||||
|
||||
router.post("/doos/delete", "doos-delete", [](fw::Request req) {
|
||||
auto input = fw::parse_json_object_flat(req.body);
|
||||
if (input.empty()) input = fw::parse_form(req.body);
|
||||
std::string name = input_or(input, "name");
|
||||
if (name.empty()) return fw::JsonResponse("{\"errors\":[\"name is required\"]}", 422);
|
||||
bool confirm = input_or(input, "confirm") == "yes";
|
||||
try {
|
||||
molo::doos::Store store = molo::doos::Store::fromEnvironment();
|
||||
std::string report = store.remove(name, confirm);
|
||||
std::ostringstream o;
|
||||
o << "{\"name\":\"" << molo::doos::json_escape(name) << "\",\"dry_run\":"
|
||||
<< (confirm ? "false" : "true") << ",\"report\":\"" << molo::doos::json_escape(report)
|
||||
<< "\"}";
|
||||
return fw::JsonResponse(o.str(), 200);
|
||||
} catch (const std::exception& e) {
|
||||
std::string msg = e.what();
|
||||
int code = msg.find("no such container") != std::string::npos ? 404 : 422;
|
||||
std::string key = code == 404 ? "error" : "errors";
|
||||
std::string val = code == 404 ? "\"" + fw::json_escape(msg) + "\""
|
||||
: "[\"" + fw::json_escape(msg) + "\"]";
|
||||
return fw::JsonResponse("{\"" + key + "\":" + val + "}", code);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
+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");
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
#include "IndexCatalog.hpp"
|
||||
|
||||
#include <cctype>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include "../fw/Templates.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
namespace {
|
||||
|
||||
bool has_prefix(const std::string& route, const std::string& prefix) {
|
||||
if (route.compare(0, prefix.size(), prefix) != 0) return false;
|
||||
if (route.size() == prefix.size()) return true;
|
||||
// Whole-segment match, so "/data" does not claim "/database". A prefix with
|
||||
// a scheme ("http://") is a plain string prefix.
|
||||
if (prefix.back() == '/') return true;
|
||||
char next = route[prefix.size()];
|
||||
return next == '/' || next == '?';
|
||||
}
|
||||
|
||||
const char* kVendorKeys =
|
||||
"Needs vendor API keys (XAI_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, "
|
||||
"OPENROUTER_API_KEY, DEEPSEEK_API_KEY, META_API_KEY, ...) in the environment "
|
||||
"or .env.json.local. Without a key the page still loads and calls answer "
|
||||
"503 not_configured; paid routes are dry runs unless confirmed.";
|
||||
|
||||
} // namespace
|
||||
|
||||
IndexCatalog::IndexCatalog() {
|
||||
groups_ = {
|
||||
{"routing", "Routing and views",
|
||||
"Paths, class views, routers, app chaining, redirects, dependency injection.", "",
|
||||
{"/routing", "/middleware", "/app1", "/redirect", "/conditional", "/context", "/di", "/hello",
|
||||
"/greet", "/deep"}},
|
||||
{"requests", "Requests, forms and templates",
|
||||
"Forms, validation with all field errors, templates, content negotiation, uploads, i18n.",
|
||||
"", {"/forms", "/validate", "/templates", "/formats", "/flash", "/compress", "/i18n",
|
||||
"/uploads"}},
|
||||
{"data", "Data and events",
|
||||
"ORM on SQLite and Postgres with self-healing, key-value store, cache, pubsub, events, replication.",
|
||||
"", {"/orm", "/data", "/kv", "/cache", "/pubsub", "/events", "/replication"}},
|
||||
{"security", "Security",
|
||||
"Auth, sessions, CSRF, CORS, rate limits, security headers, CSP, crypto, roles, upload and input guards.",
|
||||
"", {"/auth", "/sessions", "/security", "/csp", "/crypto"}},
|
||||
{"static", "Static and embedded files",
|
||||
"Assets from disk and from the binary, with ETags and range requests.", "",
|
||||
{"/static", "/embedded"}},
|
||||
{"realtime", "Realtime",
|
||||
"WebSocket, Socket.IO, server-sent events, streaming, passthrough, WebDAV, reverse tunnels.",
|
||||
"", {"/ws", "/socketio", "/sse", "/streaming", "/webdav", "/expose"}},
|
||||
{"observability", "Observability",
|
||||
"Metrics, Prometheus scrape, tracing, structured logging, live charts, health.", "",
|
||||
{"/metrics", "/telemetry", "/logging", "/stats", "/health", "/healthz", "/readyz",
|
||||
"/startupz"}},
|
||||
{"operations", "Operations and delivery",
|
||||
"Supervisor and tasks, REST client, operability tools, OpenAPI and docs, release workflow, supply chain.",
|
||||
"", {"/supervisor", "/restclient", "/clients", "/operability", "/cli", "/workflow", "/supplychain",
|
||||
"/openapi.json", "/docs"}},
|
||||
{"doos", "Sandboxed containers",
|
||||
"Rootless user-level containers: status page, create, inspect, delete (demo store).", "",
|
||||
{"/doos"}},
|
||||
{"tenancy", "Multi-tenancy",
|
||||
"Tenant resolution, data isolation, quotas, feature flags, per-tenant config and metrics.",
|
||||
"", {"/tenancy"}},
|
||||
{"audit", "Audit and compliance",
|
||||
"Hash-chained audit log, tamper detection, PII masking, retention, export and erasure.",
|
||||
"", {"/audit"}},
|
||||
{"governance", "API governance",
|
||||
"API keys, rate tiers, versioning with Deprecation and Sunset, linter, OpenAPI diff, problem+json.",
|
||||
"", {"/governance", "/v1", "/v2"}},
|
||||
{"google", "Google Cloud and voice",
|
||||
"Gemini, Google Cloud APIs and the live spoken conversation. Without a key pages load and calls answer 503 not_configured.",
|
||||
"GOOGLE_API_KEY", {"/google", "/voice"}},
|
||||
{"agent", "Agent Platform",
|
||||
"Gemini Enterprise Agent Platform modules: models, runtime, sessions, sandbox, registry, armor, live.",
|
||||
"GOOGLE_API_KEY", {"/agent"}},
|
||||
{"vendors", "LLM vendors", kVendorKeys, "vendor API keys", {"/ai"}},
|
||||
{"tools", "Tools", "Load testing and other helpers outside the app.", "",
|
||||
{"http://", "https://"}},
|
||||
};
|
||||
other_ = {"other", "Other", "Registered by the app, not yet grouped.", "", {}};
|
||||
}
|
||||
|
||||
std::string IndexCatalog::pretty_name(const std::string& feature) {
|
||||
if (feature.empty()) return feature;
|
||||
if (feature.find(' ') != std::string::npos ||
|
||||
std::isupper(static_cast<unsigned char>(feature[0]))) {
|
||||
std::string out = feature;
|
||||
out[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(out[0])));
|
||||
return out;
|
||||
}
|
||||
static const std::map<std::string, std::string> kTokens = {
|
||||
{"ai", "AI"}, {"api", "API"}, {"orm", "ORM"},
|
||||
{"sse", "SSE"}, {"kv", "KV"}, {"cli", "CLI"},
|
||||
{"csp", "CSP"}, {"tls", "TLS"}, {"webdav", "WebDAV"},
|
||||
{"socketio", "Socket.IO"}, {"openapi", "OpenAPI"}, {"openai", "OpenAI"},
|
||||
{"xai", "xAI"}, {"sqlite", "SQLite"}, {"postgres", "Postgres"},
|
||||
{"deepseek", "DeepSeek"}, {"openrouter", "OpenRouter"},
|
||||
{"huggingface", "Hugging Face"}, {"restclient", "REST client"},
|
||||
};
|
||||
std::string out;
|
||||
std::string token;
|
||||
auto flush = [&] {
|
||||
if (token.empty()) return;
|
||||
if (!out.empty()) out += ' ';
|
||||
auto it = kTokens.find(token);
|
||||
if (it != kTokens.end()) {
|
||||
out += it->second;
|
||||
} else {
|
||||
if (out.empty()) token[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(token[0])));
|
||||
out += token;
|
||||
}
|
||||
token.clear();
|
||||
};
|
||||
for (char c : feature) {
|
||||
if (c == '-' || c == '_') flush();
|
||||
else token += c;
|
||||
}
|
||||
flush();
|
||||
return out;
|
||||
}
|
||||
|
||||
const FeatureGroup& IndexCatalog::group_for(const std::string& route) const {
|
||||
for (const auto& g : groups_) {
|
||||
for (const auto& p : g.prefixes) {
|
||||
if (has_prefix(route, p)) return g;
|
||||
}
|
||||
}
|
||||
return other_;
|
||||
}
|
||||
|
||||
std::string IndexCatalog::render(
|
||||
const std::vector<std::pair<std::string, std::string>>& rows,
|
||||
std::size_t* feature_count, std::size_t* group_count) const {
|
||||
using fw::html_escape;
|
||||
std::map<std::string, std::vector<FeatureRow>> by_group;
|
||||
std::set<std::string> seen;
|
||||
std::size_t total = 0;
|
||||
for (const auto& [name, route] : rows) {
|
||||
if (!seen.insert(name + '\n' + route).second) continue;
|
||||
by_group[group_for(route).id].push_back({pretty_name(name), route});
|
||||
++total;
|
||||
}
|
||||
std::vector<const FeatureGroup*> order;
|
||||
for (const auto& g : groups_) order.push_back(&g);
|
||||
order.push_back(&other_);
|
||||
|
||||
std::string chips = "<nav class=\"chips\" aria-label=\"Groups\">";
|
||||
std::string body;
|
||||
std::size_t groups = 0;
|
||||
for (const FeatureGroup* g : order) {
|
||||
auto it = by_group.find(g->id);
|
||||
if (it == by_group.end()) continue;
|
||||
++groups;
|
||||
chips += "<a href=\"#g-" + html_escape(g->id) + "\">" + html_escape(g->title) + "</a>";
|
||||
body += "<section class=\"group\" id=\"g-" + html_escape(g->id) + "\">\n<h2>" +
|
||||
html_escape(g->title) + " <span class=\"count\">" +
|
||||
std::to_string(it->second.size()) + "</span>";
|
||||
if (!g->key_hint.empty()) {
|
||||
body += " <span class=\"badge\" title=\"" + html_escape(g->key_hint) +
|
||||
"\">needs API key</span>";
|
||||
}
|
||||
body += "</h2>\n<p class=\"hint\">" + html_escape(g->blurb) +
|
||||
"</p>\n<div class=\"scroll\"><table>\n<thead><tr><th>Feature</th>"
|
||||
"<th class=\"route\">Route</th></tr></thead>\n<tbody>\n";
|
||||
for (const auto& r : it->second) {
|
||||
body += "<tr><td><a href=\"" + html_escape(r.route) + "\">" + html_escape(r.name) +
|
||||
"</a></td><td class=\"route\"><code>" + html_escape(r.route) +
|
||||
"</code></td></tr>\n";
|
||||
}
|
||||
body += "</tbody></table></div>\n</section>\n";
|
||||
}
|
||||
chips += "</nav>\n";
|
||||
if (feature_count) *feature_count = total;
|
||||
if (group_count) *group_count = groups;
|
||||
return chips + body;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// One row of the index page: a display name and the route that demonstrates it.
|
||||
struct FeatureRow {
|
||||
std::string name;
|
||||
std::string route;
|
||||
};
|
||||
|
||||
// A themed section of the index page. A route belongs to the first group that
|
||||
// lists its path prefix; routes matching no group fall into "Other".
|
||||
struct FeatureGroup {
|
||||
std::string id;
|
||||
std::string title;
|
||||
std::string blurb;
|
||||
std::string key_hint; // non-empty: the demos need these credentials
|
||||
std::vector<std::string> prefixes;
|
||||
};
|
||||
|
||||
// Groups the feature rows and renders the index sections (SPEC.md, index).
|
||||
class IndexCatalog {
|
||||
public:
|
||||
IndexCatalog();
|
||||
|
||||
// Display name for a registered feature ("ai-openai" -> "AI OpenAI").
|
||||
static std::string pretty_name(const std::string& feature);
|
||||
|
||||
// HTML for the jump chips and one table per non-empty group. Everything
|
||||
// dynamic is escaped; the result is safe to insert unescaped.
|
||||
std::string render(const std::vector<std::pair<std::string, std::string>>& rows,
|
||||
std::size_t* feature_count, std::size_t* group_count) const;
|
||||
|
||||
private:
|
||||
const FeatureGroup& group_for(const std::string& route) const;
|
||||
|
||||
std::vector<FeatureGroup> groups_;
|
||||
FeatureGroup other_;
|
||||
};
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -50,21 +50,13 @@ const char kBase[] = R"BASE(<!DOCTYPE html>
|
||||
const char kIndex[] = R"INDEX({% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>Living example</h1>
|
||||
<p>Every framework feature, one click away. Mobile-first: narrow the window
|
||||
and the top nav collapses into a dropdown menu.</p>
|
||||
{% if show_matrix %}
|
||||
<table>
|
||||
<thead><tr><th>Feature</th><th>Route</th></tr></thead>
|
||||
<tbody>
|
||||
{% for row in matrix %}
|
||||
<tr><td>{{ row.feature }}</td><td><a href="{{ row.route }}">{{ row.route }}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>Matrix hidden.</p>
|
||||
{% endif %}
|
||||
<p>{{ feature_count }} features in {{ group_count }} groups, each one click away.
|
||||
Every row is a live route with a test behind it. Mobile-first: narrow the
|
||||
window and the top nav collapses into a dropdown menu.</p>
|
||||
<p class="filter"><input id="filter" type="search" placeholder="Filter features" aria-label="Filter features" autocomplete="off"></p>
|
||||
{{ sections|safe }}
|
||||
{% include "nav_hint.html" %}
|
||||
<script src="/static/index.js" defer></script>
|
||||
{% endblock %}
|
||||
)INDEX";
|
||||
|
||||
|
||||
@@ -50,11 +50,6 @@ events as they arrive.</p>
|
||||
{% endblock %}
|
||||
)LIVE";
|
||||
|
||||
std::string env_or(const char* name, const char* fallback) {
|
||||
std::string v = google::Credentials::env(name);
|
||||
return v.empty() ? std::string(fallback) : v;
|
||||
}
|
||||
|
||||
[[noreturn]] void rethrow(const google::GoogleError& e) {
|
||||
if (e.http_status() == 503 && e.status() == "NOT_CONFIGURED")
|
||||
throw fw::HttpError(503, "google_not_configured", e.message());
|
||||
|
||||
Reference in New Issue
Block a user