-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
347 lines (310 loc) · 17 KB
/
index.html
File metadata and controls
347 lines (310 loc) · 17 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ESP32 SD Card NAS Web Server</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
:root {
--primary: #00d2ff;
--secondary: #3a7bd5;
--bg-dark: #0f172a;
--bg-card: #1e293b;
--text-main: #f8fafc;
--text-muted: #94a3b8;
--danger: #ef4444;
--success: #22c55e;
--warning: #f59e0b;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
scroll-behavior: smooth;
}
body {
background-color: var(--bg-dark);
color: var(--text-main);
line-height: 1.6;
}
/* Navigation */
nav {
position: fixed;
top: 0;
width: 100%;
padding: 1.5rem 2rem;
background: rgba(15, 23, 42, 0.9);
backdrop-filter: blur(10px);
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary); text-decoration: none; }
.nav-links a { color: var(--text-main); text-decoration: none; margin-left: 2rem; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--primary); }
/* Container & Header */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
header {
padding: 8rem 0 4rem;
text-align: center;
background: linear-gradient(135deg, rgba(58,123,213,0.1) 0%, rgba(0,210,255,0.1) 100%);
}
h1 {
font-size: 3.5rem;
margin-bottom: 1rem;
background: linear-gradient(to right, var(--primary), var(--secondary));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.hero-text { font-size: 1.2rem; color: var(--text-muted); max-width: 800px; margin: 0 auto 2rem; }
/* Sections General */
section { padding: 5rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
h2 { font-size: 2.2rem; margin-bottom: 2rem; color: var(--primary); display: flex; align-items: center; gap: 10px; }
/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 2rem; }
.card {
background: var(--bg-card);
padding: 2rem;
border-radius: 12px;
border: 1px solid rgba(255,255,255,0.05);
transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-5px); border-color: var(--primary); }
.card i { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; }
/* Badges */
.badge {
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-size: 0.85rem;
font-weight: bold;
display: inline-block;
margin-bottom: 1rem;
}
.badge.admin { background: rgba(239, 68, 68, 0.2); color: var(--danger); border: 1px solid var(--danger); }
.badge.user { background: rgba(0, 210, 255, 0.2); color: var(--primary); border: 1px solid var(--primary); }
.badge.viewer { background: rgba(34, 197, 94, 0.2); color: var(--success); border: 1px solid var(--success); }
/* Terminal/Console Mockup */
.terminal {
background: #000;
border-radius: 8px;
padding: 1.5rem;
font-family: monospace;
color: #a5d6ff;
border: 1px solid #333;
margin-top: 1rem;
}
.terminal-header { border-bottom: 1px solid #333; padding-bottom: 0.5rem; margin-bottom: 1rem; color: var(--text-muted); }
/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { background: rgba(255,255,255,0.05); color: var(--primary); }
tr:last-child td { border-bottom: none; }
code { background: #000; padding: 0.2rem 0.5rem; border-radius: 4px; color: #ff7b72; font-family: monospace; }
/* Media Gallery */
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; margin-top: 2rem; }
.media-box { background: var(--bg-card); border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.media-placeholder { width: 100%; aspect-ratio: 16/9; background: #000; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.media-info { padding: 1.5rem; }
/* Footer */
footer { text-align: center; padding: 3rem; color: var(--text-muted); background: var(--bg-card); }
@media (max-width: 768px) {
.nav-links { display: none; }
h1 { font-size: 2.5rem; }
}
</style>
</head>
<body>
<nav id="navbar">
<a href="#" class="logo"><i class="fas fa-server"></i> ESP32 NAS</a>
<div class="nav-links">
<a href="#features">Features</a>
<a href="#roles">Security & Roles</a>
<a href="#admin">Admin Console</a>
<a href="#hardware">Setup</a>
<a href="#media">Gallery</a>
</div>
</nav>
<header>
<div class="container">
<h1>ESP32 SD Card NAS Web Server</h1>
<p class="hero-text">Turn your ESP32 + SD card into a highly secure, offline Network Attached Storage (NAS) device. Featuring Role-Based Access Control, brute-force IP protection, live server logs, and advanced system monitoring.</p>
<a href="#roles" style="padding: 10px 20px; background: var(--primary); color: #000; text-decoration: none; border-radius: 5px; font-weight: bold;">Explore Features</a>
</div>
</header>
<div class="container">
<section id="features">
<h2><i class="fas fa-layer-group"></i> Core NAS Capabilities</h2>
<div class="grid-3">
<div class="card">
<i class="fas fa-wifi"></i>
<h3>Standalone AP Mode</h3>
<p>Creates a secure, offline Wi-Fi network (<code>wireless server</code>). No external router needed to access files.</p>
</div>
<div class="card">
<i class="fas fa-shield-alt"></i>
<h3>Advanced Security</h3>
<p>Session-based authentication, path traversal blocking, and automatic IP bans for brute-force login attempts.</p>
</div>
<div class="card">
<i class="fas fa-hdd"></i>
<h3>Storage Management</h3>
<p>Visual progress bars showing total capacity, used space, and free space on the FAT32 formatted SD card.</p>
</div>
</div>
</section>
<section id="roles">
<h2><i class="fas fa-users-cog"></i> Role-Based Access Control (RBAC)</h2>
<p style="color: var(--text-muted); margin-bottom: 2rem;">Users are securely managed in memory via C++ STL (`std::map`). Access is strictly controlled based on user level.</p>
<div class="grid-3">
<div class="card" style="border-top: 4px solid var(--danger);">
<span class="badge admin">ADMIN</span>
<h3>Full Control</h3>
<ul style="color: var(--text-muted); margin-left: 1.5rem; margin-top: 1rem;">
<li>Upload, Download, Delete files</li>
<li>Access System Info Page</li>
<li>Access Live Admin Console</li>
<li>Manage Banned IPs manually</li>
</ul>
</div>
<div class="card" style="border-top: 4px solid var(--primary);">
<span class="badge user">USER</span>
<h3>Standard Access</h3>
<ul style="color: var(--text-muted); margin-left: 1.5rem; margin-top: 1rem;">
<li>Upload files to SD</li>
<li>Download files from SD</li>
<li>Delete files from SD</li>
<li>View storage usage</li>
</ul>
</div>
<div class="card" style="border-top: 4px solid var(--success);">
<span class="badge viewer">VIEWER</span>
<h3>Read-Only</h3>
<ul style="color: var(--text-muted); margin-left: 1.5rem; margin-top: 1rem;">
<li>View file list</li>
<li>Download files</li>
<li><em>Cannot upload</em></li>
<li><em>Cannot delete</em></li>
</ul>
</div>
</div>
</section>
<section id="admin">
<h2><i class="fas fa-terminal"></i> Admin Console & System Info</h2>
<div class="grid-2">
<div>
<h3 style="color: var(--text-main); margin-bottom: 1rem;">Live Dashboard Updates</h3>
<p style="color: var(--text-muted); margin-bottom: 1rem;">The web UI uses AJAX polling to fetch JSON data from <code>/console/data</code>, updating the dashboard in real-time without refreshing.</p>
<ul style="color: var(--text-muted); margin-left: 1.5rem; line-height: 2;">
<li><strong>System Info:</strong> Chip model, Cores, CPU Freq, SDK version.</li>
<li><strong>Memory:</strong> Heap info, Flash size & speed, Sketch size.</li>
<li><strong>Network:</strong> AP IP, MAC address, Active connected clients.</li>
<li><strong>Security:</strong> Live list of manually or automatically banned IPs.</li>
</ul>
</div>
<div class="terminal">
<div class="terminal-header">Live Server Log Simulation</div>
<div>[INFO] System booted. AP Started: 192.168.4.1</div>
<div>[INFO] SD Card initialized. Size: 32GB</div>
<div>[AUTH] User 'admin' logged in from 192.168.4.2</div>
<div>[FILE] 192.168.4.2 uploaded 'project.zip' (2.4MB)</div>
<div style="color: var(--warning);">[WARN] Failed login attempt from 192.168.4.5</div>
<div style="color: var(--warning);">[WARN] Failed login attempt from 192.168.4.5</div>
<div style="color: var(--danger);">[SEC] IP 192.168.4.5 BANNED (Brute Force Detected)</div>
</div>
</div>
</section>
<section id="hardware">
<h2><i class="fas fa-microchip"></i> Hardware & Software Setup</h2>
<div class="grid-2">
<div>
<h3 style="margin-bottom: 1rem; color: var(--text-main);">Required Libraries</h3>
<p style="color: var(--text-muted); margin-bottom: 1rem;">Ensure these are installed in your Arduino IDE or PlatformIO:</p>
<ul style="color: var(--text-muted); margin-left: 1.5rem; margin-bottom: 2rem;">
<li><code>WiFi.h</code> & <code>WebServer.h</code></li>
<li><code>SD.h</code> & <code>SPI.h</code></li>
<li><code>esp_wifi.h</code> & <code>esp_netif.h</code></li>
<li>Standard C++ STL (<code><map></code>, <code><list></code>, <code><set></code>)</li>
</ul>
</div>
<div>
<h3 style="margin-bottom: 1rem; color: var(--text-main);">SPI Wiring</h3>
<p style="color: var(--text-muted); margin-bottom: 1rem;"><strong>Important:</strong> <code>CS_PIN</code> is specifically defined as GPIO 5 in the firmware.</p>
<table>
<thead>
<tr><th>SD Card Module</th><th>ESP32 Pin</th></tr>
</thead>
<tbody>
<tr><td>VCC / GND</td><td>3.3V / GND</td></tr>
<tr><td>MISO</td><td>GPIO 19</td></tr>
<tr><td>MOSI</td><td>GPIO 23</td></tr>
<tr><td>SCK</td><td>GPIO 18</td></tr>
<tr><td style="color: var(--primary); font-weight: bold;">CS (Chip Select)</td><td style="color: var(--primary); font-weight: bold;">GPIO 5</td></tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="media">
<h2><i class="fas fa-photo-video"></i> Interface Gallery</h2>
<p style="color: var(--text-muted);">See the NAS Web UI in action.</p>
<div class="media-grid">
<div class="media-box" style="grid-column: 1 / -1;">
<div class="video-container" style="position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-bottom: 1px solid rgba(255,255,255,0.1);">
<iframe
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;"
src="https://www.youtube.com/embed/z_vi_seD-0M"
title="ESP32 SD Card NAS Demo"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen>
</iframe>
</div>
<div class="media-info">
<h3><i class="fas fa-play-circle" style="color: var(--danger);"></i> Live NAS Demonstration</h3>
<p style="color: var(--text-muted); font-size: 0.9rem;">
Watch the full walkthrough of the ESP32 NAS system: including the login portal, role-based file management (Admin vs. Viewer), and real-time system monitoring.
</p>
</div>
</div>
<div class="media-box">
<img src="login.jpeg" alt="NAS Login Screen" style="width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;">
<div class="media-info">
<h3>Authentication Portal</h3>
<p style="color: var(--text-muted); font-size: 0.9rem;">The /login page where users authenticate to establish a session.</p>
</div>
</div>
<div class="media-box">
<img src="admin.jpeg" alt="NAS Login Screen" style="width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;">
<div class="media-info">
<h3>Admin Console & System Info</h3>
<p style="color: var(--text-muted); font-size: 0.9rem;">Live view of RAM, Flash, active MAC addresses, and banned IPs.</p>
</div>
</div>
<div class="media-box">
<img src="file.png" alt="NAS Login Screen" style="width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;">
<div class="media-info">
<h3>File Manager & Storage Info</h3>
<p style="color: var(--text-muted); font-size: 0.9rem;">Upload/Download interface showing the visual storage progress bar.</p>
</div>
</div>
</div>
</section>
</div>
<footer>
<h2><i class="fas fa-check-circle"></i> Project Status: Active</h2>
<p>Built using standard ESP32 WebServer, FAT32 SD libraries, and vanilla HTML/CSS/JS.</p>
<p style="margin-top: 2rem; opacity: 0.5;">ESP32 NAS Project | Open Source</p>
</footer>
<script>
window.addEventListener('scroll', () => {
const nav = document.getElementById('navbar');
if (window.scrollY > 50) { nav.style.boxShadow = '0 4px 30px rgba(0, 0, 0, 0.5)'; }
else { nav.style.boxShadow = 'none'; }
});
</script>
</body>
</html>