-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
732 lines (644 loc) · 44.3 KB
/
Copy pathindex.html
File metadata and controls
732 lines (644 loc) · 44.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<!--
╔══════════════════════════════════════════════════════════════╗
║ ALL-SEEING-EYE ║
║ Open-source uptime, DNS, SSL & latency monitor ║
║ Made with ❤️ + AI ║
║ https://ase.so ║
╚══════════════════════════════════════════════════════════════╝
HOW IT WORKS
─────────────────────────────────────────────────────────────
1. On load, the app tries to fetch `domains.list` (same directory).
- Each non-empty, non-comment line becomes a monitored domain.
- If the file is missing or unreachable, the built-in TOP_30 list is used.
2. For each domain, a live DNS-over-HTTPS query is fired to
Cloudflare's public DoH API (cloudflare-dns.com/dns-query).
This gives us: A record presence (= "up"), latency, and NS info.
3. SSL expiry dates are seeded from scan data for the top-50 list.
Custom-added domains get a placeholder until a real check runs.
4. The "Add Domain" flow lets users add any domain on the fly.
If `domains.list` is writable (local server with write access),
the app will also persist the new domain there via a PUT request.
On a read-only static host, it just adds it to the in-memory list.
5. The PIN gate (SHA-256 hashed, no plaintext stored) prevents
casual access. Keyboard input + numpad both work.
PIN: 1 2 3 4 5 6 (SHA-256: 8d969eef…)
SECURITY NOTE
─────────────────────────────────────────────────────────────
- No data leaves the browser except DNS queries to Cloudflare DoH.
- No cookies, no persistent storage used.
- PIN is checked purely client-side via SHA-256 comparison.
- This is a monitoring DISPLAY tool, not a security perimeter.
-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="description" content="ASE — open-source uptime, DNS, SSL and latency monitor for any domain list.">
<title>The All-Seeing-Eye — Domain Guardian</title>
<!-- Space Grotesk (user-specified font) from Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="app.css">
</head>
<body>
<!-- ════════════════════════════════════════════════════════════
PIN OVERLAY
Shows until the user enters the correct 6-digit PIN.
SHA-256 of "123456" is hardcoded — no plaintext PIN stored.
═════════════════════════════════════════════════════════════ -->
<div id="pin-overlay" role="dialog" aria-modal="true" aria-label="PIN required">
<div class="pin-card">
<!-- Eye SVG logo -->
<div class="pin-eye" aria-hidden="true">
<!-- All-Seeing Eye / Illuminati pyramid -->
<svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- Pyramid body -->
<polygon points="32,4 60,58 4,58"
fill="currentColor" opacity="0.1"/>
<polygon points="32,4 60,58 4,58"
stroke="currentColor" stroke-width="2.5" stroke-linejoin="round" fill="none"/>
<!-- Capstone gap -->
<line x1="18" y1="38" x2="46" y2="38" stroke="currentColor"
stroke-width="1.2" opacity="0.45" stroke-dasharray="3 2"/>
<!-- Eye whites -->
<ellipse cx="32" cy="27" rx="12" ry="8" fill="currentColor" opacity="0.15"/>
<ellipse cx="32" cy="27" rx="12" ry="8" stroke="currentColor" stroke-width="2" fill="none"/>
<!-- Iris -->
<circle cx="32" cy="27" r="5.5" fill="currentColor" opacity="0.6"/>
<!-- Pupil -->
<circle cx="32" cy="27" r="2.8" fill="currentColor"/>
<!-- Glint -->
<circle cx="30.5" cy="25.5" r="1.2" fill="white" opacity="0.7"/>
<!-- Rays -->
<line x1="32" y1="17" x2="32" y2="13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" opacity="0.7"/>
<line x1="40" y1="20" x2="43" y2="17" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" opacity="0.55"/>
<line x1="24" y1="20" x2="21" y2="17" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" opacity="0.55"/>
<line x1="44" y1="27" x2="48" y2="27" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" opacity="0.55"/>
<line x1="20" y1="27" x2="16" y2="27" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" opacity="0.55"/>
</svg>
</div>
<h2>ASE</h2>
<p>Enter your PIN to access the dashboard</p>
<!-- 6 dot indicators -->
<div class="pin-dots" id="pin-dots">
<div class="pin-dot" id="dot-0"></div>
<div class="pin-dot" id="dot-1"></div>
<div class="pin-dot" id="dot-2"></div>
<div class="pin-dot" id="dot-3"></div>
<div class="pin-dot" id="dot-4"></div>
<div class="pin-dot" id="dot-5"></div>
</div>
<!-- Mobile PIN input: shown on touch devices instead of numpad.
type="tel" + inputmode="numeric" = numeric keyboard, no zoom, no autocomplete.
Visually shows as dots (password type) but triggers numeric keyboard. -->
<input type="password"
id="pin-mobile-input"
inputmode="numeric"
pattern="[0-9]*"
maxlength="6"
autocomplete="off"
autocorrect="off"
spellcheck="false"
placeholder="······"
class="pin-mobile-input"
oninput="pinMobileInput(this)"
aria-label="Enter PIN">
<!-- Numpad (3×3 + 0 + delete) — onclick is the only reliable cross-env method -->
<div class="pin-grid">
<button class="pin-btn" onclick="pinDigit('1')">1</button>
<button class="pin-btn" onclick="pinDigit('2')">2</button>
<button class="pin-btn" onclick="pinDigit('3')">3</button>
<button class="pin-btn" onclick="pinDigit('4')">4</button>
<button class="pin-btn" onclick="pinDigit('5')">5</button>
<button class="pin-btn" onclick="pinDigit('6')">6</button>
<button class="pin-btn" onclick="pinDigit('7')">7</button>
<button class="pin-btn" onclick="pinDigit('8')">8</button>
<button class="pin-btn" onclick="pinDigit('9')">9</button>
<!-- Empty slot, 0, Delete -->
<span></span>
<button class="pin-btn" onclick="pinDigit('0')">0</button>
<button class="pin-btn pin-btn-del" onclick="pinDelete()">⌫</button>
</div>
<div class="pin-error" id="pin-error"></div>
<div class="pin-hint">Enter PIN · keyboard works too</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
HEADER
═════════════════════════════════════════════════════════════ -->
<header>
<a class="logo" href="#" aria-label="ASE home">
<!-- Inline eye SVG — consistent with PIN modal, scales cleanly -->
<svg class="logo-eye" viewBox="0 0 64 64" fill="none" aria-hidden="true">
<path d="M4 32C4 32 14 14 32 14C50 14 60 32 60 32C60 32 50 50 32 50C14 50 4 32 4 32Z"
stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="32" cy="32" r="10" stroke="currentColor" stroke-width="3"/>
<circle cx="32" cy="32" r="4.5" fill="currentColor"/>
<circle cx="35" cy="28.5" r="2" fill="currentColor" opacity="0.4"/>
</svg>
<div class="logo-text">
<span class="logo-title">ASE</span>
<span class="logo-sub">DNS · SSL · Uptime</span>
</div>
</a>
<!-- Theme toggle: right of logo, before action buttons -->
<label class="theme-switch" title="Toggle light/dark mode">
<input type="checkbox" id="theme-checkbox" role="switch" aria-label="Toggle colour theme">
<span class="theme-track">
<span class="theme-thumb"></span>
<span class="theme-icon theme-icon-dark">🌙</span>
<span class="theme-icon theme-icon-light">☀️</span>
</span>
</label>
<div class="header-actions">
<!-- Primary actions: always visible -->
<button class="btn btn-accent" id="btn-add" onclick="openAddModal()">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Add Domain
</button>
<button class="btn" id="btn-refresh" title="Refresh" onclick="triggerRefresh()">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true"><path d="M1 4v6h6M23 20v-6h-6"/><path d="M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15"/></svg>
Refresh
</button>
<!-- Secondary actions in "More" dropdown -->
<div class="header-dropdown">
<button class="btn header-dropdown-toggle" onclick="toggleHeaderMenu(event)" title="More options" aria-haspopup="true" aria-expanded="false">
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="12" cy="5" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="12" cy="19" r="1.5"/></svg>
More
</button>
<div class="header-dropdown-menu" id="header-dropdown-menu" role="menu">
<a class="dropdown-item" href="https://github.com/paulfxyz/ase" target="_blank" rel="noopener" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.58 2 12.26c0 4.53 2.87 8.37 6.84 9.73.5.09.68-.22.68-.49v-1.7c-2.78.62-3.37-1.37-3.37-1.37-.45-1.17-1.11-1.48-1.11-1.48-.91-.64.07-.62.07-.62 1 .07 1.53 1.05 1.53 1.05.89 1.56 2.34 1.11 2.91.85.09-.66.35-1.11.63-1.37-2.22-.26-4.56-1.14-4.56-5.07 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.71 0 0 .84-.28 2.75 1.05A9.38 9.38 0 0112 7.4c.85 0 1.7.12 2.5.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.41.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.94-2.34 4.81-4.57 5.06.36.32.68.94.68 1.9v2.81c0 .27.18.59.69.49A10.27 10.27 0 0022 12.26C22 6.58 17.52 2 12 2z"/></svg>
GitHub
</a>
<button class="dropdown-item" onclick="event.stopPropagation();exportCSV();closeHeaderMenu()" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Export CSV
</button>
<button class="dropdown-item" onclick="event.stopPropagation();closeHeaderMenu();openWebhookModal()" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/></svg>
Webhook / Cron
</button>
<button class="dropdown-item" onclick="event.stopPropagation();closeHeaderMenu();openChangePinModal()" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z"/></svg>
Change PIN
</button>
<button class="dropdown-item" id="btn-notify-menu" onclick="event.stopPropagation();closeHeaderMenu();openNotifyModal()" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></svg>
Notifications <span id="notify-status-dot" style="display:none;width:7px;height:7px;border-radius:50%;background:var(--green);display:inline-block;margin-left:4px;vertical-align:middle"></span>
</button>
<button class="dropdown-item" onclick="event.stopPropagation();closeHeaderMenu();openInfoModal()" role="menuitem">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
Help
</button>
</div>
</div>
</div>
</header>
<!-- ════════════════════════════════════════════════════════════
STATUS BAR — live indicator + refresh countdown
═════════════════════════════════════════════════════════════ -->
<div class="status-bar">
<div style="display:flex;align-items:center;gap:var(--space-4)">
<span class="live-pill">
<span class="live-dot"></span>
LIVE
</span>
<span>Auto-refresh in <strong id="countdown">3:00</strong></span>
</div>
<span id="last-checked" style="font-family:var(--font-mono)">Not checked yet</span>
<div class="progress-track">
<div class="progress-fill" id="progress-fill" style="width:100%"></div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
STAT CARDS
═════════════════════════════════════════════════════════════ -->
<!-- SCAN PROGRESS BAR — animated sweep shown during a full refresh.
Hidden by default (class="hidden"), shown by checkAll() in app.js -->
<div class="scan-progress-wrap hidden" id="scan-progress-wrap">
<div class="scan-progress-bar"></div>
</div>
<div class="stats-row">
<div class="stat-card">
<div class="stat-label">Domains</div>
<div class="stat-value" id="stat-total" style="color:var(--accent)">—</div>
<div class="stat-sub">Monitored</div>
</div>
<div class="stat-card">
<div class="stat-label">Online</div>
<div class="stat-value" id="stat-online" style="color:var(--green)">—</div>
<div class="stat-sub">Responding</div>
</div>
<div class="stat-card">
<div class="stat-label">SSL Valid</div>
<div class="stat-value" id="stat-ssl-ok" style="color:var(--green)">—</div>
<div class="stat-sub">> 30 days left</div>
</div>
<div class="stat-card">
<div class="stat-label">Alerts</div>
<div class="stat-value" id="stat-alerts" style="color:var(--yellow)">—</div>
<div class="stat-sub">SSL expiring soon</div>
</div>
<div class="stat-card">
<div class="stat-label">Avg Latency</div>
<div class="stat-value" id="stat-latency" style="color:var(--teal)">—</div>
<div class="stat-sub">DNS resolve</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
ALERT BANNER (shown only when SSL certs are expiring)
═════════════════════════════════════════════════════════════ -->
<div class="alert-banner" id="alert-banner" style="display:none">
<span class="alert-icon">⚠</span>
<span id="alert-text"></span>
</div>
<!-- ════════════════════════════════════════════════════════════
CONTROLS — search, sort, filter
═════════════════════════════════════════════════════════════ -->
<div class="controls">
<div class="search-wrap">
<span class="search-icon">🔍</span>
<input class="search-input" type="text" id="search-input" oninput="renderTable()"
placeholder="Search domains…"
autocomplete="off" autocapitalize="none" spellcheck="false" onkeydown="if(event.key==='Enter'){event.preventDefault();queueDomain();}else if(event.key==='Escape'){closeAddModal();}">
</div>
<select class="sort-select" id="sort-select" onchange="renderTable()">
<option value="rank">Sort: Rank</option>
<option value="ssl">Sort: SSL expiry ↑</option>
<option value="latency">Sort: Latency</option>
<option value="status">Sort: Status</option>
<option value="az">Sort: A → Z</option>
</select>
<button class="filter-btn" id="filter-alerts" onclick="toggleFilter('alerts')">⚠ Alerts only</button>
<button class="filter-btn" id="filter-up" onclick="toggleFilter('up')">✓ Online only</button>
</div>
<!-- ════════════════════════════════════════════════════════════
MAIN TABLE
═════════════════════════════════════════════════════════════ -->
<div class="table-wrap">
<table id="main-table" aria-label="Domain monitor table">
<thead>
<tr>
<th>#</th>
<th>Domain</th>
<th>Status</th>
<th>Latency</th>
<th>SSL Expiry</th>
<th>NS Provider</th>
<th>MX</th>
<th>DMARC</th>
<th>SPF</th>
<th style="width:60px"></th>
</tr>
</thead>
<tbody id="table-body">
<!-- Rows rendered by JS -->
</tbody>
</table>
</div>
<!-- ════════════════════════════════════════════════════════════
ADD DOMAIN MODAL
═════════════════════════════════════════════════════════════ -->
<div id="add-overlay" role="dialog" aria-modal="true" aria-label="Add domain" onclick="if(event.target===this)closeAddModal()">
<div class="add-modal">
<h3>👁 Add a Domain</h3>
<p class="modal-sub">
Monitor any additional domain. Type a domain, pick a category, press
<kbd style="background:var(--surface-2);border:1px solid var(--border);padding:1px 5px;border-radius:4px;font-size:11px">Enter</kbd>
to queue it, then click <strong>Monitor</strong>.
</p>
<div class="form-row">
<input class="form-input" id="add-input" type="text"
placeholder="e.g. ase.so"
autocomplete="off" autocapitalize="none" spellcheck="false">
</div>
<!-- Tags for queued domains -->
<div class="queued-tags" id="queued-tags"></div>
<!-- File-write note -->
<div class="modal-note" id="add-file-note">
💾 If <code>domains.list</code> is writable (local server), new domains will be
persisted there automatically. On a static host, they are added to the
in-memory list for this session only.
</div>
<div class="modal-actions">
<button class="btn btn-cancel" id="btn-add-cancel" onclick="closeAddModal()">Cancel</button>
<button class="btn btn-accent" id="btn-add-queue" onclick="queueDomain()">Add to queue ↵</button>
<button class="btn btn-accent" id="btn-add-confirm" onclick="confirmAddDomains()">Monitor ✓</button>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
FOOTER
═════════════════════════════════════════════════════════════ -->
<footer>
<span>
<strong>ASE</strong> — open-source monitor
·
<span class="mit-tag">MIT</span>
·
<a href="https://github.com/paulfxyz/ase" target="_blank" rel="noopener">GitHub ↗</a>
</span>
<span>Data via <a href="https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/" target="_blank" rel="noopener">Cloudflare DoH</a> · No tracking · No cookies</span>
<span>
Made with ❤️ + AI
</span>
</footer>
<!-- ════════════════════════════════════════════════════════════
JAVASCRIPT
════════════════════════════════════════════════════════════ -->
<script src="app.js"></script>
<!-- ════════════════════════════════════════════════════════════
WEBHOOK MODAL
═════════════════════════════════════════════════════════════ -->
<div id="webhook-modal" class="modal-overlay" onclick="if(event.target===this)closeWebhookModal()">
<div class="modal-card">
<div class="modal-header">
<h3 class="modal-title">🔗 Webhook / Cron Setup</h3>
<button onclick="closeWebhookModal()" class="modal-close-btn" aria-label="Close">✕</button>
</div>
<div class="modal-body">
<p style="font-size:var(--text-sm);color:var(--text-muted);margin-bottom:var(--space-4);line-height:1.7">
Point any HTTP cron service at <code class="code-inline">yourdomain.com/webhook.do</code> to trigger an automatic check and update <code class="code-inline">domains.stats</code> without opening the dashboard.
</p>
<div class="code-block">
<div class="code-label">Recommended cron services (all free)</div>
🔁 <a href="https://cron-job.org" target="_blank" style="color:var(--accent)">cron-job.org</a> — every 5 min, HTTP GET<br>
🔁 <a href="https://uptimerobot.com" target="_blank" style="color:var(--accent)">uptimerobot.com</a> — HTTP monitor = free cron<br>
🔁 <a href="https://easycron.com" target="_blank" style="color:var(--accent)">easycron.com</a> — free tier available<br>
🔁 GitHub Actions with <code>schedule</code> trigger
</div>
<div class="code-block" style="margin-top:var(--space-3)">
<div class="code-label">Server route (Nginx)</div>
location = /webhook.do { try_files /index.html =404; }
</div>
<div class="code-block" style="margin-top:var(--space-3)">
<div class="code-label">Server route (Apache .htaccess)</div>
RewriteRule ^webhook\.do$ index.html [L]
</div>
</div>
<div class="modal-footer">
<button onclick="closeWebhookModal()" class="btn" style="width:100%">Close</button>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
INFO / HELP MODAL
═════════════════════════════════════════════════════════════ -->
<div id="info-modal" class="modal-overlay" onclick="if(event.target===this)closeInfoModal()">
<div class="modal-card modal-card-wide">
<div class="modal-header">
<h3 class="modal-title">👁 How It Works</h3>
<button onclick="closeInfoModal()" class="modal-close-btn" aria-label="Close">✕</button>
</div>
<div class="modal-body">
<p style="font-size:var(--text-sm);color:var(--text-muted);margin-bottom:var(--space-5);line-height:1.7">
<strong style="color:var(--text)">The All-Seeing-Eye</strong> is a self-hosted, open-source uptime, DNS, SSL and latency monitor. Everything runs in the browser — no server-side code needed for basic use.
</p>
<div style="display:grid;gap:var(--space-3);margin-bottom:var(--space-5)">
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4)">
<div style="font-weight:700;font-size:var(--text-sm);margin-bottom:var(--space-2)">📄 domains.list</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">One domain per line. Lines starting with <code>#</code> are comments. Loaded at startup — if missing, the built-in top-50 list is used as fallback. Edit this file to change what gets monitored.</div>
</div>
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4)">
<div style="font-weight:700;font-size:var(--text-sm);margin-bottom:var(--space-2)">📊 domains.stats</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">CSV snapshot written after every refresh cycle. Requires a server with HTTP PUT write access. On static hosts, the export CSV button gives the same data as a manual download.</div>
</div>
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4)">
<div style="font-weight:700;font-size:var(--text-sm);margin-bottom:var(--space-2)">🔗 webhook.do</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">Headless endpoint for cron services. When accessed, it loads the dashboard in an invisible iframe, runs all DNS checks, and writes domains.stats — no browser or PIN required.</div>
</div>
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4)">
<div style="font-weight:700;font-size:var(--text-sm);margin-bottom:var(--space-2)">🌐 DNS Checks</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">Each domain is queried via <a href="https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/" target="_blank" style="color:var(--accent)">Cloudflare DoH</a> (HTTPS, no CORS issues). An A-record response = online. Latency = full round-trip time. Auto-refreshes every 3 minutes.</div>
</div>
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4)">
<div style="font-weight:700;font-size:var(--text-sm);margin-bottom:var(--space-2)">🔔 Notifications</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">
Email alerts fire when a domain goes <strong style="color:var(--red)">DOWN</strong> or recovers — including SSL expiry warnings, missing DMARC/SPF detection, and a full health snapshot per domain.
Configure via <strong>More ⋮ → Notifications</strong>. Uses the <a href="https://resend.com" target="_blank" style="color:var(--accent)">Resend</a> API (free tier: 100 emails/day).
Your API key is encrypted server-side with AES-256-GCM and never stored in plaintext.
Rate-limited to 10 emails/hour. Each alert includes: status, latency, SSL days remaining, DMARC policy, SPF, nameserver, mail provider.
</div>
</div>
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4)">
<div style="font-weight:700;font-size:var(--text-sm);margin-bottom:var(--space-2)">🔐 PIN Security</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">PIN is stored as a SHA-256 hash only — never plaintext. The hash is checked client-side. No data is sent anywhere. Change the PIN by recomputing <code style="font-family:var(--font-mono)">sha256(yourPin)</code> and updating PIN_HASH in the script.</div>
</div>
</div>
<p style="font-size:var(--text-xs);color:var(--text-faint);text-align:center;margin-top:var(--space-2)">MIT License · No tracking · No cookies</p>
</div><!-- /modal-body -->
<div class="modal-footer">
<a href="https://github.com/paulfxyz/ase" target="_blank" rel="noopener" class="btn btn-ghost">⭐ GitHub</a>
<button onclick="closeInfoModal()" class="btn btn-accent" style="flex:1">Close</button>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SET-PIN MODAL
Shown once when the user enters the default PIN (123456)
for the first time, inviting them to set a personal PIN.
The new PIN hash is written into index.html via HTTP PUT
if the server allows it; otherwise the user gets instructions
to update PIN_HASH manually.
═════════════════════════════════════════════════════════════ -->
<div id="set-pin-overlay" style="display:none;position:fixed;inset:0;z-index:9500;
background:color-mix(in srgb,var(--bg) 90%,transparent);backdrop-filter:blur(20px);
align-items:center;justify-content:center">
<div style="background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);
padding:var(--space-8);width:min(380px,94vw);box-shadow:var(--shadow-lg),var(--shadow-glow);
text-align:center;animation:card-in 0.3s cubic-bezier(.34,1.56,.64,1)">
<div style="font-size:32px;margin-bottom:var(--space-4)">🔐</div>
<h2 style="font-family:var(--font-display);font-size:var(--text-lg);font-weight:700;
letter-spacing:-0.02em;margin-bottom:var(--space-2)">Set your PIN</h2>
<p style="font-size:var(--text-sm);color:var(--text-muted);margin-bottom:var(--space-5);line-height:1.6">
You're using the default PIN <code style="background:var(--surface-2);border:1px solid var(--border);
padding:1px 7px;border-radius:4px;font-family:var(--font-mono)">123456</code>.<br>
Enter a new 6-digit PIN to secure your dashboard.
</p>
<!-- New PIN dots -->
<p style="font-size:var(--text-xs);color:var(--text-faint);margin-bottom:var(--space-2);
font-family:var(--font-mono);letter-spacing:.06em">NEW PIN</p>
<div style="display:flex;justify-content:center;gap:12px;margin-bottom:var(--space-4)" id="sp-dots-1">
<div class="pin-dot" id="sp-dot-1-0"></div><div class="pin-dot" id="sp-dot-1-1"></div>
<div class="pin-dot" id="sp-dot-1-2"></div><div class="pin-dot" id="sp-dot-1-3"></div>
<div class="pin-dot" id="sp-dot-1-4"></div><div class="pin-dot" id="sp-dot-1-5"></div>
</div>
<!-- Confirm PIN dots -->
<p style="font-size:var(--text-xs);color:var(--text-faint);margin-bottom:var(--space-2);
font-family:var(--font-mono);letter-spacing:.06em" id="sp-confirm-label"
style="opacity:0.3">CONFIRM PIN</p>
<div style="display:flex;justify-content:center;gap:12px;margin-bottom:var(--space-5)" id="sp-dots-2">
<div class="pin-dot" id="sp-dot-2-0"></div><div class="pin-dot" id="sp-dot-2-1"></div>
<div class="pin-dot" id="sp-dot-2-2"></div><div class="pin-dot" id="sp-dot-2-3"></div>
<div class="pin-dot" id="sp-dot-2-4"></div><div class="pin-dot" id="sp-dot-2-5"></div>
</div>
<!-- Numpad (same layout as login) -->
<div class="pin-grid" style="margin-bottom:var(--space-3)">
<button class="pin-btn" onclick="spDigit('1')">1</button>
<button class="pin-btn" onclick="spDigit('2')">2</button>
<button class="pin-btn" onclick="spDigit('3')">3</button>
<button class="pin-btn" onclick="spDigit('4')">4</button>
<button class="pin-btn" onclick="spDigit('5')">5</button>
<button class="pin-btn" onclick="spDigit('6')">6</button>
<button class="pin-btn" onclick="spDigit('7')">7</button>
<button class="pin-btn" onclick="spDigit('8')">8</button>
<button class="pin-btn" onclick="spDigit('9')">9</button>
<span></span>
<button class="pin-btn" onclick="spDigit('0')">0</button>
<button class="pin-btn pin-btn-del" onclick="spDelete()">⌫</button>
</div>
<div id="sp-error" style="font-size:var(--text-xs);color:var(--red);min-height:18px;margin-bottom:var(--space-3)"></div>
<button onclick="spSkip()" style="font-size:var(--text-xs);color:var(--text-faint);
background:none;border:none;cursor:pointer;font-family:var(--font-display);
text-decoration:underline">Skip for now — keep using 123456</button>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
CHANGE PIN MODAL
Three-step flow: current PIN → new PIN → confirm new PIN
All validation is client-side via SHA-256.
═════════════════════════════════════════════════════════════ -->
<div id="change-pin-overlay" style="display:none;position:fixed;inset:0;z-index:8800;
background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(16px);
align-items:center;justify-content:center"
onclick="if(event.target===this)closeChangePinModal()">
<div id="cp-card" style="background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);
padding:var(--space-8);width:min(360px,94vw);text-align:center;
box-shadow:var(--shadow-lg),var(--shadow-glow);animation:card-in 0.25s cubic-bezier(.34,1.56,.64,1)">
<div style="font-size:32px;margin-bottom:var(--space-3)">🔐</div>
<h2 id="cp-title" style="font-family:var(--font-display);font-size:var(--text-lg);
font-weight:700;letter-spacing:-0.02em;margin-bottom:var(--space-2)">Change PIN</h2>
<p id="cp-subtitle" style="font-size:var(--text-sm);color:var(--text-muted);
margin-bottom:var(--space-5)">Enter your current PIN</p>
<!-- Dot indicators (hidden on mobile via .mobile-pin-active class) -->
<div style="display:flex;justify-content:center;gap:12px;margin-bottom:var(--space-5)" id="cp-dots">
<div class="pin-dot" id="cp-dot-0"></div><div class="pin-dot" id="cp-dot-1"></div>
<div class="pin-dot" id="cp-dot-2"></div><div class="pin-dot" id="cp-dot-3"></div>
<div class="pin-dot" id="cp-dot-4"></div><div class="pin-dot" id="cp-dot-5"></div>
</div>
<!-- Mobile numeric input — shown on touch devices, hidden on desktop.
Replaces the numpad with the native OS keyboard.
JS syncs oninput with cpBuffer + cpDigit() logic. -->
<input type="password"
id="cp-mobile-input"
inputmode="numeric"
pattern="[0-9]*"
maxlength="6"
autocomplete="off"
autocorrect="off"
spellcheck="false"
placeholder="······"
class="pin-mobile-input"
style="display:none"
oninput="cpMobileInput(this)"
aria-label="Enter PIN">
<!-- Numpad (hidden on mobile via .mobile-pin-active class on parent card) -->
<div class="pin-grid" id="cp-grid" style="margin-bottom:var(--space-3)">
<button class="pin-btn" onclick="cpDigit('1')">1</button>
<button class="pin-btn" onclick="cpDigit('2')">2</button>
<button class="pin-btn" onclick="cpDigit('3')">3</button>
<button class="pin-btn" onclick="cpDigit('4')">4</button>
<button class="pin-btn" onclick="cpDigit('5')">5</button>
<button class="pin-btn" onclick="cpDigit('6')">6</button>
<button class="pin-btn" onclick="cpDigit('7')">7</button>
<button class="pin-btn" onclick="cpDigit('8')">8</button>
<button class="pin-btn" onclick="cpDigit('9')">9</button>
<span></span>
<button class="pin-btn" onclick="cpDigit('0')">0</button>
<button class="pin-btn pin-btn-del" onclick="cpDelete()">⌫</button>
</div>
<div id="cp-error" style="font-size:var(--text-xs);color:var(--red);min-height:18px;
margin-bottom:var(--space-3)"></div>
<button onclick="closeChangePinModal()" style="font-size:var(--text-xs);color:var(--text-faint);
background:none;border:none;cursor:pointer;font-family:var(--font-display);
text-decoration:underline">Cancel</button>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
NOTIFICATIONS MODAL
Configure Resend API email alerts for downtime events.
API key is sent to config-write.php which encrypts it
server-side (AES-256-GCM) before storing in ase_config.json.
═════════════════════════════════════════════════════════════ -->
<div id="notify-modal" class="modal-overlay" onclick="if(event.target===this)closeNotifyModal()">
<div class="modal-card modal-card-wide">
<div class="modal-header">
<h3 class="modal-title">🔔 Notifications</h3>
<button onclick="closeNotifyModal()" class="modal-close-btn" aria-label="Close">✕</button>
</div>
<div class="modal-body">
<!-- Enable toggle -->
<div style="display:flex;align-items:center;justify-content:space-between;padding:var(--space-3) var(--space-4);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:var(--space-4)">
<div>
<div style="font-weight:700;font-size:var(--text-sm)">Email alerts</div>
<div style="font-size:var(--text-xs);color:var(--text-muted);margin-top:2px">Notify when a domain goes DOWN or recovers</div>
</div>
<label style="position:relative;display:inline-block;width:44px;height:24px;cursor:pointer">
<input type="checkbox" id="notify-enabled-toggle" style="opacity:0;width:0;height:0"
onchange="notifyToggleChanged(this)">
<span id="notify-toggle-track" style="position:absolute;inset:0;background:var(--border);border-radius:12px;transition:background 0.2s">
<span style="position:absolute;left:3px;top:3px;width:18px;height:18px;background:#fff;border-radius:50%;transition:transform 0.2s;box-shadow:0 1px 3px rgba(0,0,0,.3)"></span>
</span>
</label>
</div>
<!-- How it works info box -->
<div style="background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-4);margin-bottom:var(--space-4);font-size:var(--text-xs);color:var(--text-muted);line-height:1.7">
<div style="font-weight:700;color:var(--text);margin-bottom:var(--space-2)">How it works</div>
Alerts are sent via <a href="https://resend.com" target="_blank" style="color:var(--accent)">Resend</a> — a free email API (100 emails/day free tier).
Your API key is <strong>encrypted server-side</strong> (AES-256-GCM) and never stored in plaintext.
Get your free API key at <a href="https://resend.com/api-keys" target="_blank" style="color:var(--accent)">resend.com/api-keys</a>.
</div>
<!-- Form fields -->
<div style="display:grid;gap:var(--space-3)">
<div>
<label style="display:block;font-size:var(--text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-bottom:6px">
Resend API Key
</label>
<div style="display:flex;gap:var(--space-2)">
<input type="password" id="notify-api-key" placeholder="re_••••••••••••••••"
style="flex:1;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:10px 14px;font-family:var(--font-mono);font-size:var(--text-sm);color:var(--text);outline:none;transition:border-color var(--ease)"
onfocus="this.style.borderColor='var(--accent)'" onblur="this.style.borderColor='var(--border)'"
autocomplete="off" autocorrect="off" spellcheck="false">
<button onclick="notifyToggleKeyVisibility()" class="btn" title="Show/hide key"
style="min-width:40px;padding:0 var(--space-3)">
<svg id="notify-eye-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
<div id="notify-key-status" style="font-size:var(--text-xs);margin-top:4px;color:var(--text-muted)"></div>
</div>
<div>
<label style="display:block;font-size:var(--text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-bottom:6px">
From Email <span style="font-weight:400;text-transform:none">(must be verified in Resend)</span>
</label>
<input type="email" id="notify-from" placeholder="alerts@yourdomain.com"
style="width:100%;box-sizing:border-box;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:10px 14px;font-family:var(--font-display);font-size:var(--text-sm);color:var(--text);outline:none;transition:border-color var(--ease)"
onfocus="this.style.borderColor='var(--accent)'" onblur="this.style.borderColor='var(--border)'"
autocomplete="email">
</div>
<div>
<label style="display:block;font-size:var(--text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-bottom:6px">
Send Alerts To
</label>
<input type="email" id="notify-to" placeholder="you@example.com"
style="width:100%;box-sizing:border-box;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:10px 14px;font-family:var(--font-display);font-size:var(--text-sm);color:var(--text);outline:none;transition:border-color var(--ease)"
onfocus="this.style.borderColor='var(--accent)'" onblur="this.style.borderColor='var(--border)'"
autocomplete="email">
</div>
</div>
<!-- Status/feedback message -->
<div id="notify-msg" style="margin-top:var(--space-3);font-size:var(--text-xs);min-height:18px;line-height:1.5"></div>
</div><!-- /modal-body -->
<div class="modal-footer">
<button onclick="sendTestNotification().then(notifyShowTestResult)" class="btn btn-ghost" id="btn-notify-test">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="22 2 11 13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
Send Test
</button>
<button onclick="saveNotifySettings()" class="btn btn-accent" style="flex:1">Save</button>
</div>
</div>
</div>
</body>
</html>