From b570c5d0aef0b6ebf41075f02a2acc425287b506 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 4 Jan 2026 02:14:47 +0000 Subject: [PATCH 1/6] feat: Integrate cf_mock.html design into auth.js - Replace original captcha template with cf_mock.html layout - Insert captcha card between time and status panel - Implement realtime JST clock - Add dynamic Hostname, Ray ID, and IP reveal using EO headers - Ensure compact layout with Tailwind CSS - Preserve captcha functionality (fetch, verify, render) --- gateway/edge-functions/auth.js | 463 +++++++++++++++++++++------------ 1 file changed, 291 insertions(+), 172 deletions(-) diff --git a/gateway/edge-functions/auth.js b/gateway/edge-functions/auth.js index 326f40f..6d0ce64 100644 --- a/gateway/edge-functions/auth.js +++ b/gateway/edge-functions/auth.js @@ -14,217 +14,336 @@ const CONFIG = { export async function onRequest({ request }) { const url = new URL(request.url); const hostname = url.searchParams.get('hostname') || url.hostname; - const html = getCaptchaPage(hostname); + const clientIP = request.headers.get("EO-Client-IP") || "1.1.1.1"; + const zoneID = request.headers.get("EO-Zone-ID") || "UNKNOWN"; + + const html = getCaptchaPage(hostname, clientIP, zoneID); return new Response(html, { headers: { "Content-Type": "text/html; charset=utf-8" } }); } -function getCaptchaPage(hostname) { +function getCaptchaPage(hostname, clientIP, zoneID) { return ` - + + + +
- - -
- Please complete the security check to access
- ${hostname}
-
+ Please complete the security check to access
+ ${hostname}
+
Protected by EdgeOne Functions
+Protected by EdgeOne Functions
+ +
- Please complete the security check to access
- ${hostname}
-
Protected by EdgeOne Functions
+Protected by EdgeOne Functions • ${hostname}
Robots/Low-sanity commonalty should stay out.
Do the captcha to prove you are human (and welcome or not).
Robots/Low-sanity commonalty should stay out.
Do the captcha to prove you are human (and welcome or not).
Ray ID: ${zoneID} •