Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Commit be33566

Browse files
grafana-bridge: route via grafana subdomain to bypass WAF challenge
New subdomains get Cloudflare WAF managed challenges which block browser fetch() calls. Instead, mount the bridge routes at /grafana-bridge/ so they're reachable via grafana.westernformularacing.org (ZT Access protected) using path-based tunnel ingress routing. Security bonus: only ZT-authenticated users can reach the bridge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 077426d commit be33566

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

installer/grafana-bridge/server.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ function buildPanel(signalName, index) {
103103
};
104104
}
105105

106-
app.post("/api/grafana/create-dashboard", async (req, res) => {
106+
// Routes are mounted at both /api/grafana (direct) and /grafana-bridge/api/grafana
107+
// (path-based via grafana.westernformularacing.org tunnel to avoid WAF challenges).
108+
const router = express.Router();
109+
110+
router.post("/api/grafana/create-dashboard", async (req, res) => {
107111
const { signals } = req.body;
108112

109113
if (!signals || !Array.isArray(signals) || signals.length === 0) {
@@ -193,14 +197,18 @@ app.post("/api/grafana/create-dashboard", async (req, res) => {
193197
});
194198

195199
// Health check
196-
app.get("/api/grafana/health", (_req, res) => {
200+
router.get("/api/grafana/health", (_req, res) => {
197201
res.json({
198202
status: "ok",
199203
grafana: GRAFANA_EXTERNAL_URL,
200204
tokenConfigured: !!GRAFANA_API_TOKEN,
201205
});
202206
});
203207

208+
// Mount at root (direct port 3001 access) and under /grafana-bridge (via grafana subdomain tunnel)
209+
app.use("/", router);
210+
app.use("/grafana-bridge", router);
211+
204212
const PORT = process.env.PORT || 3001;
205213
app.listen(PORT, () => {
206214
console.log(`Grafana bridge listening on port ${PORT}`);

0 commit comments

Comments
 (0)