diff --git a/public/s/css/f0ckm.css b/public/s/css/f0ckm.css index 23cd9a3..192e361 100644 --- a/public/s/css/f0ckm.css +++ b/public/s/css/f0ckm.css @@ -1237,7 +1237,7 @@ html[theme='95'] .item-main-content .metadata { .notif-count { position: absolute; - top: 0px; + top: -5px; right: -5px; background: var(--badge-nsfw); color: white; diff --git a/src/index.mjs b/src/index.mjs index c7e1c4d..0d9f9ff 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -282,11 +282,35 @@ try { } // Called on every gated request — produces a fresh page with unique Ray ID + timestamp -// Accepts an optional request object to inject the visitor's real IP into the footer reveal. +// Accepts an optional request object to inject the visitor's real IP into the footer reveal and dynamic host into page text/title. function buildGatePage(req) { if (!_cfRender) return nginx502Fallback; - let html = _cfRender({ ...gateOptions, what_can_i_do: gateSignInButton }); + let reqHost = cfg.main.url.domain; + if (req && req.headers) { + const rawHost = req.headers['x-forwarded-host'] || req.headers['host']; + if (rawHost) { + const firstHost = rawHost.split(',')[0].trim(); + if (firstHost.startsWith('[')) { + const closeBracket = firstHost.indexOf(']'); + reqHost = closeBracket !== -1 ? firstHost.substring(1, closeBracket) : firstHost; + } else { + reqHost = firstHost.split(':')[0].trim(); + } + } + } + if (!reqHost) reqHost = cfg.main.url.domain; + + const currentGateOptions = { + ...gateOptions, + host_status: { + ...gateOptions.host_status, + location: reqHost, + }, + what_can_i_do: gateSignInButton, + }; + + let html = _cfRender(currentGateOptions); // Inject real visitor IP into the footer "Your IP: [Click to reveal]" span if (req) { @@ -305,7 +329,7 @@ function buildGatePage(req) { // Patch the