-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstudent-setup.html
More file actions
821 lines (662 loc) · 39 KB
/
student-setup.html
File metadata and controls
821 lines (662 loc) · 39 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
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OTForge Student Setup Guide</title>
<style>
/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #ffffff;
--surface: #f6f8fa;
--border: #d0d7de;
--text: #1f2328;
--text-muted: #636c76;
--accent: #0550ae;
--accent-bg: #ddf4ff;
--warn-bg: #fff8c5;
--warn-border: #d4a72c;
--code-bg: #f6f8fa;
--code-border: #d0d7de;
--green: #1a7f37;
--sidebar-w: 260px;
}
html { scroll-behavior: smooth; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 1.65;
color: var(--text);
background: var(--bg);
display: flex;
}
/* ── Sidebar ── */
nav {
position: fixed;
top: 0; left: 0;
width: var(--sidebar-w);
height: 100vh;
overflow-y: auto;
background: var(--surface);
border-right: 1px solid var(--border);
padding: 24px 0 40px;
font-size: 13px;
}
nav .nav-logo {
padding: 0 20px 16px;
font-weight: 700;
font-size: 14px;
color: var(--text);
border-bottom: 1px solid var(--border);
margin-bottom: 12px;
}
nav ul { list-style: none; }
nav ul li a {
display: block;
padding: 4px 20px;
color: var(--text-muted);
text-decoration: none;
border-left: 2px solid transparent;
}
nav ul li a:hover { color: var(--accent); background: var(--accent-bg); }
nav .nav-section {
padding: 10px 20px 4px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
}
nav ul li.sub a { padding-left: 32px; font-size: 12.5px; }
/* ── Main content ── */
main {
margin-left: var(--sidebar-w);
max-width: 860px;
padding: 48px 48px 80px;
width: 100%;
}
/* ── Typography ── */
h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
h2 { font-size: 21px; font-weight: 700; margin: 48px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 17px; font-weight: 600; margin: 32px 0 10px; }
p { margin-bottom: 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
em { font-style: italic; }
/* ── Horizontal rule ── */
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
/* ── Ordered / unordered lists ── */
ol, ul { padding-left: 24px; margin-bottom: 12px; }
li { margin-bottom: 4px; }
li > ul, li > ol { margin-top: 4px; margin-bottom: 0; }
/* ── Inline code ── */
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 13px;
background: var(--code-bg);
border: 1px solid var(--code-border);
border-radius: 4px;
padding: 1px 5px;
}
/* ── Code blocks ── */
pre {
background: #1b1f23;
border-radius: 8px;
padding: 16px 20px;
overflow-x: auto;
margin: 12px 0 16px;
position: relative;
}
pre code {
font-size: 13px;
background: none;
border: none;
padding: 0;
color: #e6edf3;
white-space: pre;
}
/* ── Blockquotes (notes / callouts) ── */
blockquote {
border-left: 4px solid var(--warn-border);
background: var(--warn-bg);
border-radius: 0 6px 6px 0;
padding: 10px 16px;
margin: 14px 0;
color: var(--text);
}
blockquote p { margin-bottom: 0; }
blockquote.note {
border-left-color: var(--accent);
background: var(--accent-bg);
}
/* ── Tables ── */
table {
width: 100%;
border-collapse: collapse;
margin: 16px 0;
font-size: 14px;
}
th {
background: var(--surface);
font-weight: 600;
text-align: left;
padding: 8px 12px;
border: 1px solid var(--border);
}
td {
padding: 8px 12px;
border: 1px solid var(--border);
vertical-align: top;
}
tr:nth-child(even) td { background: var(--surface); }
/* ── Step badge ── */
.step-badge {
display: inline-block;
background: var(--accent);
color: #fff;
font-size: 12px;
font-weight: 700;
border-radius: 12px;
padding: 2px 10px;
margin-right: 6px;
vertical-align: middle;
}
/* ── Quick reference card ── */
.ref-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 0;
overflow: hidden;
margin: 16px 0;
}
.ref-card table { margin: 0; }
.ref-card th { background: #e8ecf0; }
/* ── Footer ── */
footer {
margin-top: 48px;
padding-top: 16px;
border-top: 1px solid var(--border);
font-size: 13px;
color: var(--text-muted);
font-style: italic;
}
/* ── Responsive ── */
@media (max-width: 768px) {
nav { display: none; }
main { margin-left: 0; padding: 24px 20px 60px; }
}
</style>
</head>
<body>
<!-- ══════════════════════════════════════════════════════════
Sidebar navigation
════════════════════════════════════════════════════════════ -->
<nav>
<div class="nav-logo">OTForge Setup Guide</div>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#requirements">System Requirements</a></li>
<div class="nav-section">Windows Setup</div>
<li class="sub"><a href="#win-docker">Step 1 — Docker Desktop</a></li>
<li class="sub"><a href="#win-git">Step 2 — Git</a></li>
<li class="sub"><a href="#win-node">Step 3 — Node.js 22</a></li>
<li class="sub"><a href="#win-ps">Step 4 — Configure PowerShell</a></li>
<li class="sub"><a href="#win-clone">Step 5 — Clone Repo</a></li>
<li class="sub"><a href="#win-deps">Step 6 — Dependencies</a></li>
<li class="sub"><a href="#win-build">Step 7 — Build Packages</a></li>
<li class="sub"><a href="#win-launch">Step 8 — Launch</a></li>
<li class="sub"><a href="#win-scenarios">Step 9 — Scenarios Folder</a></li>
<div class="nav-section">macOS Setup</div>
<li class="sub"><a href="#mac-docker">Step 1 — Docker Desktop</a></li>
<li class="sub"><a href="#mac-brew">Step 2 — Homebrew</a></li>
<li class="sub"><a href="#mac-git">Step 3 — Git</a></li>
<li class="sub"><a href="#mac-node">Step 4 — Node.js 22</a></li>
<li class="sub"><a href="#mac-clone">Step 5 — Clone Repo</a></li>
<li class="sub"><a href="#mac-deps">Step 6 — Dependencies</a></li>
<li class="sub"><a href="#mac-build">Step 7 — Build Packages</a></li>
<li class="sub"><a href="#mac-launch">Step 8 — Launch</a></li>
<li class="sub"><a href="#mac-scenarios">Step 9 — Scenarios Folder</a></li>
<div class="nav-section">Reference</div>
<li><a href="#first-run">First Simulation Run</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
<li><a href="#updating">Keeping Updated</a></li>
<li><a href="#network-isolation">Network Isolation</a></li>
<li><a href="#quick-ref">Quick Reference</a></li>
</ul>
</nav>
<!-- ══════════════════════════════════════════════════════════
Main content
════════════════════════════════════════════════════════════ -->
<main>
<h1 id="overview">OTForge Student Setup Guide</h1>
<p>This guide walks you through installing everything you need to run OTForge on your personal computer. By the end you will have Docker Desktop and OTForge running, and your computer will be ready to load lab scenario files.</p>
<blockquote>
<p><strong>Your instructor will distribute Lab 01 (<code>.otflab</code> file) through Canvas.</strong> You do not need it before completing this setup — just make sure your <code>scenarios</code> folder is ready when it arrives.</p>
</blockquote>
<!-- ── What you are installing ── -->
<h2>What You Are Installing</h2>
<table>
<thead>
<tr><th>Component</th><th>Purpose</th></tr>
</thead>
<tbody>
<tr><td><strong>Docker Desktop</strong></td><td>Runs the virtual ICS/OT devices (PLCs, sensors, network equipment) as containers</td></tr>
<tr><td><strong>Git</strong></td><td>Downloads the OTForge source code from GitHub</td></tr>
<tr><td><strong>Node.js 22</strong></td><td>Builds and runs the OTForge desktop application</td></tr>
<tr><td><strong>OTForge</strong></td><td>The SCADA canvas application you will use for all labs</td></tr>
</tbody>
</table>
<p><strong>Estimated time:</strong> 30–45 minutes, depending on download speed.</p>
<p><strong>Disk space needed:</strong> ~8 GB total (Docker, Node.js, Docker images).</p>
<!-- ── System Requirements ── -->
<h2 id="requirements">System Requirements</h2>
<table>
<thead>
<tr><th></th><th>Windows</th><th>macOS</th></tr>
</thead>
<tbody>
<tr><td><strong>OS version</strong></td><td>Windows 10 22H2 (build 19045) or later; Windows 11 23H2 (build 22631) or later</td><td>macOS 12 Monterey or later</td></tr>
<tr><td><strong>RAM</strong></td><td>8 GB minimum, 16 GB recommended</td><td>8 GB minimum, 16 GB recommended</td></tr>
<tr><td><strong>Disk</strong></td><td>20 GB free</td><td>20 GB free</td></tr>
<tr><td><strong>CPU</strong></td><td>64-bit, virtualization enabled in BIOS</td><td>Intel or Apple Silicon (M1/M2/M3/M4)</td></tr>
</tbody>
</table>
<blockquote>
<p><strong>Windows only — Virtualization check:</strong><br>
Open Task Manager → Performance → CPU. Confirm "Virtualization: Enabled". If it says Disabled, ask your instructor for BIOS help before proceeding.</p>
</blockquote>
<hr>
<!-- ════════════════════════════════════════════════════════
WINDOWS SETUP
═════════════════════════════════════════════════════════ -->
<h2 id="windows-setup">Windows Setup</h2>
<!-- Step 1 -->
<h3 id="win-docker"><span class="step-badge">1</span> Install Docker Desktop</h3>
<ol>
<li>Go to <a href="https://www.docker.com/products/docker-desktop" target="_blank">https://www.docker.com/products/docker-desktop</a> and click <strong>Download for Windows</strong>.</li>
<li>Run the installer (<code>Docker Desktop Installer.exe</code>).</li>
<li>When prompted, leave <strong>Use WSL 2 instead of Hyper-V</strong> checked (recommended for most systems).</li>
<li>Click <strong>OK</strong> and let the installer finish. Your computer may restart.</li>
<li>After restart, Docker Desktop launches automatically and shows a whale icon in your taskbar.</li>
<li>Wait for the status to say <strong>"Engine running"</strong> (green circle) before continuing.</li>
</ol>
<blockquote class="note">
<p><strong>First-time Docker sign-in is not required.</strong> You can skip account creation by clicking "Continue without signing in."</p>
</blockquote>
<p><strong>Verify Docker works:</strong></p>
<p>Open <strong>PowerShell</strong> (search the Start menu) and run:</p>
<pre><code>docker --version</code></pre>
<p>You should see something like <code>Docker version 27.x.x</code>. If you get an error, restart Docker Desktop and try again.</p>
<!-- Step 2 -->
<h3 id="win-git"><span class="step-badge">2</span> Install Git</h3>
<ol>
<li>Go to <a href="https://git-scm.com/download/win" target="_blank">https://git-scm.com/download/win</a> and download the latest <strong>64-bit</strong> installer.</li>
<li>Run the installer. Accept all defaults — the standard options work fine.</li>
<li>When the installer finishes, close and reopen PowerShell.</li>
</ol>
<p><strong>Verify Git works:</strong></p>
<pre><code>git --version</code></pre>
<p>You should see <code>git version 2.x.x</code>.</p>
<!-- Step 3 -->
<h3 id="win-node"><span class="step-badge">3</span> Install Node.js 22</h3>
<ol>
<li>Go to <a href="https://nodejs.org" target="_blank">https://nodejs.org</a> and click the <strong>LTS</strong> download button (Long Term Support).<br>
Make sure it says <strong>v22.x.x</strong> — if the site shows a different major version, click "Other Downloads" and select v22.</li>
<li>Run the installer. When you reach each screen, do the following:
<table style="margin: 10px 0 4px;">
<thead>
<tr><th>Installer screen</th><th>What to do</th></tr>
</thead>
<tbody>
<tr><td><strong>End-User License Agreement</strong></td><td>Accept and click Next</td></tr>
<tr><td><strong>Destination Folder</strong></td><td>Leave the default path (<code>C:\Program Files\nodejs\</code>) and click Next</td></tr>
<tr><td><strong>Custom Setup</strong></td><td>Leave all four items checked (Node.js runtime, npm package manager, Add to PATH, Online documentation) — these are the defaults. Click Next.</td></tr>
<tr><td><strong>Tools for Native Modules</strong></td><td><strong>Leave the checkbox unchecked.</strong> This screen offers to install Chocolatey and Visual Studio Build Tools — OTForge does not need them. Checking it triggers a separate 1 GB download that is not required. Click Next.</td></tr>
<tr><td><strong>Ready to Install</strong></td><td>Click Install. Windows may ask for administrator permission — click Yes.</td></tr>
</tbody>
</table>
</li>
</ol>
<blockquote>
<p><strong>Node.js 20 will not work.</strong> OTForge uses Vite 8, which requires Node.js 22 or later. If you have Node.js 20 installed, uninstall it first (Windows Settings → Apps → search "Node.js" → Uninstall), then install v22 from the link above.</p>
</blockquote>
<p><strong>Verify Node.js works:</strong></p>
<pre><code>node --version
npm --version</code></pre>
<p>Both commands should return version numbers (e.g., <code>v22.x.x</code> and <code>10.x.x</code>).</p>
<!-- Step 4 -->
<h3 id="win-ps"><span class="step-badge">4</span> Configure PowerShell Script Execution</h3>
<p>Windows blocks PowerShell scripts by default. Running <code>npm</code> commands requires scripts to be allowed. This is a one-time change — you will not need to repeat it.</p>
<p>In PowerShell, run:</p>
<pre><code>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser</code></pre>
<p>Type <strong>Y</strong> and press Enter when prompted. This does not require administrator access and only affects your user account.</p>
<blockquote>
<p><strong>What this does:</strong> Sets PowerShell to allow locally created scripts and signed remote scripts to run. Without this, <code>npm</code> commands will fail with a message saying scripts are disabled on your system.</p>
</blockquote>
<!-- Step 5 -->
<h3 id="win-clone"><span class="step-badge">5</span> Clone the OTForge Repository</h3>
<p>You will create a dedicated folder on your <code>C:</code> drive and download the project into it.</p>
<p>In PowerShell, run these commands <strong>one at a time</strong>:</p>
<pre><code>mkdir C:\OTForge
cd C:\OTForge
git clone https://github.com/iburres/otforge.git .</code></pre>
<blockquote class="note">
<p>The final <code>.</code> (period) tells Git to clone into the current folder instead of creating a subfolder. Make sure you include it.</p>
</blockquote>
<p>When the clone finishes, you will see a list of files and folders inside <code>C:\OTForge</code>.</p>
<!-- Step 6 -->
<h3 id="win-deps"><span class="step-badge">6</span> Install OTForge Dependencies</h3>
<p>Still in PowerShell (inside <code>C:\OTForge</code>), run:</p>
<pre><code>npm ci</code></pre>
<p>This downloads all the JavaScript packages OTForge needs. It may take a few minutes. You will see a lot of output — that is normal. Wait for the prompt to return.</p>
<!-- Step 7 -->
<h3 id="win-build"><span class="step-badge">7</span> Build the Support Packages</h3>
<pre><code>npm run build:packages</code></pre>
<p>This compiles two internal packages (<code>schema</code> and <code>orchestrator</code>) that the main app depends on. It takes about 30 seconds.</p>
<!-- Step 8 -->
<h3 id="win-launch"><span class="step-badge">8</span> Launch OTForge</h3>
<pre><code>npm run dev</code></pre>
<p>The OTForge window will open. The first time you run it, you may see a Windows Defender prompt asking to allow network access — click <strong>Allow</strong>.</p>
<p>You are now ready for lab work.</p>
<!-- Step 9 -->
<h3 id="win-scenarios"><span class="step-badge">9</span> Prepare Your Scenarios Folder</h3>
<p>Your scenario files (<code>.otflab</code>) live in:</p>
<pre><code>C:\OTForge\scenarios\</code></pre>
<p>This folder already exists after cloning. When your instructor releases a lab file through Canvas, download it and save it to that folder.</p>
<hr>
<!-- ════════════════════════════════════════════════════════
macOS SETUP
═════════════════════════════════════════════════════════ -->
<h2 id="macos-setup">macOS Setup</h2>
<!-- Step 1 -->
<h3 id="mac-docker"><span class="step-badge">1</span> Install Docker Desktop</h3>
<ol>
<li>Go to <a href="https://www.docker.com/products/docker-desktop" target="_blank">https://www.docker.com/products/docker-desktop</a> and click <strong>Download for Mac</strong>.</li>
<li><strong>Important:</strong> On the download page, choose the correct version for your chip:
<ul>
<li><strong>Apple Silicon (M1/M2/M3/M4):</strong> Choose "Mac with Apple Silicon"</li>
<li><strong>Intel Mac:</strong> Choose "Mac with Intel chip"</li>
</ul>
<em>To check your chip: Apple menu () → About This Mac. Look for "Chip" (Apple M-series) or "Processor" (Intel).</em>
</li>
<li>Open the downloaded <code>.dmg</code> file and drag Docker to your Applications folder.</li>
<li>Open Docker from Applications. macOS will ask for your password to allow the Docker helper to install.</li>
<li>Wait for the Docker menu bar icon (whale) to show <strong>"Docker Desktop is running"</strong>.</li>
</ol>
<blockquote class="note">
<p><strong>Sign-in is not required.</strong> Click "Continue without signing in" if prompted.</p>
</blockquote>
<p><strong>Verify Docker works:</strong></p>
<p>Open <strong>Terminal</strong> (Applications → Utilities → Terminal) and run:</p>
<pre><code>docker --version</code></pre>
<p>You should see <code>Docker version 27.x.x</code>.</p>
<!-- Step 2 -->
<h3 id="mac-brew"><span class="step-badge">2</span> Install Homebrew (Package Manager)</h3>
<p>Homebrew makes installing Git and Node.js much easier on macOS. If you already have it, skip to Step 3.</p>
<p>In Terminal, run:</p>
<pre><code>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</code></pre>
<p>Follow the prompts. You will need your macOS password. On Apple Silicon, the installer may ask you to add Homebrew to your PATH — copy and run the two commands it shows before continuing.</p>
<p><strong>Verify Homebrew works:</strong></p>
<pre><code>brew --version</code></pre>
<!-- Step 3 -->
<h3 id="mac-git"><span class="step-badge">3</span> Install Git</h3>
<p>macOS often includes a system Git, but installing a newer version through Homebrew is recommended:</p>
<pre><code>brew install git</code></pre>
<p><strong>Verify:</strong></p>
<pre><code>git --version</code></pre>
<!-- Step 4 -->
<h3 id="mac-node"><span class="step-badge">4</span> Install Node.js 22</h3>
<pre><code>brew install node@22</code></pre>
<p>After installation, Homebrew may ask you to add Node 22 to your PATH. If so, run the commands it prints (they look like <code>echo 'export PATH=...' >> ~/.zshrc</code>).</p>
<p>Then reload your shell configuration:</p>
<pre><code>source ~/.zshrc</code></pre>
<p><strong>Verify:</strong></p>
<pre><code>node --version
npm --version</code></pre>
<p>Both should return version numbers (<code>v22.x.x</code> and <code>10.x.x</code>).</p>
<blockquote>
<p><strong>Node.js 20 will not work.</strong> OTForge uses Vite 8, which requires Node.js 22 or later. If you already have Node.js 20 via Homebrew, run <code>brew unlink node@20 && brew link --overwrite node@22</code> to switch.</p>
</blockquote>
<blockquote class="note">
<p><strong>Already have a different Node version?</strong> You can use <code>nvm</code> (Node Version Manager) to switch versions. Run <code>nvm install 22 && nvm use 22</code> if you have nvm installed.</p>
</blockquote>
<!-- Step 5 -->
<h3 id="mac-clone"><span class="step-badge">5</span> Clone the OTForge Repository</h3>
<p>In Terminal, run these commands <strong>one at a time</strong>:</p>
<pre><code>mkdir ~/OTForge
cd ~/OTForge
git clone https://github.com/iburres/otforge.git .</code></pre>
<blockquote class="note">
<p>The final <code>.</code> (period) clones into the current folder. Do not omit it.</p>
</blockquote>
<!-- Step 6 -->
<h3 id="mac-deps"><span class="step-badge">6</span> Install OTForge Dependencies</h3>
<pre><code>npm ci</code></pre>
<p>Wait for it to finish (a few minutes). You will see package installation output — that is normal.</p>
<!-- Step 7 -->
<h3 id="mac-build"><span class="step-badge">7</span> Build the Support Packages</h3>
<pre><code>npm run build:packages</code></pre>
<p>This takes about 30 seconds.</p>
<!-- Step 8 -->
<h3 id="mac-launch"><span class="step-badge">8</span> Launch OTForge</h3>
<pre><code>npm run dev</code></pre>
<p>The OTForge window opens. On first launch, macOS may show a security dialog — click <strong>Open</strong> to allow the Electron application to run.</p>
<!-- Step 9 -->
<h3 id="mac-scenarios"><span class="step-badge">9</span> Prepare Your Scenarios Folder</h3>
<p>Your scenario files live in:</p>
<pre><code>~/OTForge/scenarios/</code></pre>
<p>(This is <code>/Users/yourname/OTForge/scenarios/</code> — the <code>~</code> is shorthand for your home folder.)</p>
<p>When your instructor releases a lab file through Canvas, download it and save it here.</p>
<hr>
<!-- ── First simulation run ── -->
<h2 id="first-run">What Happens on First Simulation Run</h2>
<p>When you open a lab scenario and click <strong>Start Simulation</strong> for the first time, OTForge will automatically pull the required Docker container images from GitHub's container registry. This is a <strong>one-time download of approximately 2–4 GB</strong> and may take several minutes depending on your internet connection. You will see a progress overlay in the application while this happens.</p>
<p>Subsequent runs use the cached images and start in seconds.</p>
<hr>
<!-- ════════════════════════════════════════════════════════
TROUBLESHOOTING
═════════════════════════════════════════════════════════ -->
<h2 id="troubleshooting">Troubleshooting</h2>
<h3>"Docker Desktop is not running" error in OTForge</h3>
<p>Make sure Docker Desktop is open and the taskbar/menu bar icon shows a running state (green indicator). OTForge cannot start simulations if Docker is not running.</p>
<h3><code>npm ci</code> fails with permission errors (Windows)</h3>
<p>Right-click PowerShell in the Start menu and choose <strong>Run as Administrator</strong>, then retry the command from <code>C:\OTForge</code>.</p>
<h3><code>npm ci</code> fails with permission errors (macOS)</h3>
<p>Run <code>sudo npm ci</code> and enter your password, or fix npm permissions:</p>
<pre><code>sudo chown -R $(whoami) ~/.npm
npm ci</code></pre>
<h3><code>npm run dev</code> fails with "Error: Electron uninstall"</h3>
<p>The Electron binary did not download correctly. OTForge includes a repair script that fixes this automatically.</p>
<p><strong>Run the repair script (regular PowerShell window — do NOT run as Administrator):</strong></p>
<pre><code>cd C:\OTForge
.\fix-electron.ps1</code></pre>
<p>The script checks <code>path.txt</code>, tries the built-in installer, and if that fails downloads and installs the Electron binary directly from GitHub. When it finishes, run <code>npm run dev</code>.</p>
<p>If the script itself fails due to a network error, see the manual steps in the <strong><code>Path.txt</code> missing</strong> section below.</p>
<h3><code>Path.txt</code> missing in <code>node_modules\electron\</code> (Windows)</h3>
<p>OTForge launches Electron by reading <code>node_modules\electron\Path.txt</code> to locate the binary. If that file is missing, <code>npm run dev</code> will fail with a message like <code>Electron failed to install correctly</code> or <code>Cannot find module</code>.</p>
<p>This happens when Electron's post-install download script runs but fails silently — usually caused by Windows Defender, a corporate firewall, or a flaky network connection interrupting the download.</p>
<p><strong>Step 1 — Re-run the Electron installer script directly:</strong></p>
<pre><code>cd C:\OTForge
node node_modules\electron\install.js</code></pre>
<p>Wait for it to finish (it downloads the Electron binary — about 90 MB). Then check that <code>Path.txt</code> now exists:</p>
<pre><code>Test-Path node_modules\electron\Path.txt</code></pre>
<p>If it prints <code>True</code>, run <code>npm run dev</code> and you are done.</p>
<p><strong>Step 2 — If Step 1 fails, delete and re-download just the Electron package:</strong></p>
<pre><code>cd C:\OTForge
Remove-Item -Recurse -Force node_modules\electron
npm install</code></pre>
<p>This reinstalls only the Electron package and re-runs its download script. If Windows Defender blocks the download, you may see a prompt — allow it.</p>
<p><strong>Step 3 — If Steps 1 and 2 both fail, set an alternate download mirror and retry:</strong></p>
<p>Some campus networks block GitHub releases (where Electron binaries are hosted by default). Setting a mirror tells npm to fetch from a different server:</p>
<pre><code>cd C:\OTForge
$env:ELECTRON_MIRROR = "https://npmmirror.com/mirrors/electron/"
Remove-Item -Recurse -Force node_modules\electron
npm install</code></pre>
<p>Once <code>Path.txt</code> appears, clear the variable and verify OTForge starts:</p>
<pre><code>Remove-Item Env:\ELECTRON_MIRROR
npm run dev</code></pre>
<p><strong>Step 4 — Last resort: manually place the Electron binary (only if Steps 1–3 all failed)</strong></p>
<p>If every automated approach has failed, you can download the Electron binary directly in your browser and install it by hand.</p>
<ol>
<li>Download this file in your browser and save it to your <strong>Downloads</strong> folder:<br>
<code>https://github.com/electron/electron/releases/download/v42.0.1/electron-v42.0.1-win32-x64.zip</code></li>
<li>Right-click the zip → <strong>Extract All</strong> → extract to your Downloads folder.</li>
<li>Open PowerShell (<strong>regular window — do NOT run as Administrator</strong>) and run each command one at a time:</li>
</ol>
<p>First, confirm the extraction worked:</p>
<pre><code>Test-Path "$env:USERPROFILE\Downloads\electron-v42.0.1-win32-x64\electron.exe"</code></pre>
<p>This should print <code>True</code>. If it prints <code>False</code>, the zip did not extract correctly — try again.</p>
<p>Copy all the Electron files into the <code>dist</code> folder:</p>
<pre><code>Copy-Item -Recurse "$env:USERPROFILE\Downloads\electron-v42.0.1-win32-x64\*" "C:\OTForge\node_modules\electron\dist\" -Force</code></pre>
<blockquote>
<p><strong>Important:</strong> The Electron zip extracts files directly into the folder — there is no <code>dist</code> subfolder inside the zip. The files (<code>electron.exe</code>, <code>resources.pak</code>, <code>locales\</code>, etc.) go directly into <code>node_modules\electron\dist\</code>.</p>
</blockquote>
<blockquote class="note">
<p><strong>Note:</strong> <code>path.txt</code> should already exist and contain <code>electron.exe</code> — do <strong>not</strong> change it.</p>
</blockquote>
<ol start="4">
<li>Verify it worked:</li>
</ol>
<pre><code>cd C:\OTForge
.\node_modules\.bin\electron --version</code></pre>
<p>You should see <code>v42.0.1</code> with no download message.</p>
<ol start="5">
<li>Run OTForge:</li>
</ol>
<pre><code>npm run dev</code></pre>
<h3><code>node_modules</code> folder does not exist after running <code>npm ci</code></h3>
<p>If the entire <code>node_modules</code> folder is missing after <code>npm ci</code> completes (or <code>npm ci</code> exits with an error mid-way), the most common cause is Electron's binary download failing — Electron is a large download (~90 MB) and is the last major step of the install. A network timeout, antivirus block, or proxy interruption can abort the install and leave <code>node_modules</code> in a partial or missing state.</p>
<p><strong>Step 1 — Clear the npm cache and retry:</strong></p>
<pre><code>cd C:\OTForge
npm cache clean --force
npm ci</code></pre>
<p>The cache clean removes any corrupted partial downloads that would cause the same failure on the next attempt.</p>
<p><strong>Step 2 — If <code>npm ci</code> fails again, increase the network timeout:</strong></p>
<p>Default npm network timeout is 30 seconds — too short on slow or congested campus Wi-Fi:</p>
<pre><code>cd C:\OTForge
npm ci --fetch-timeout=300000</code></pre>
<p>This gives npm 5 minutes per request instead of 30 seconds.</p>
<p><strong>Step 3 — If Electron specifically is still failing, set an alternate mirror:</strong></p>
<pre><code>cd C:\OTForge
$env:ELECTRON_MIRROR = "https://npmmirror.com/mirrors/electron/"
npm ci</code></pre>
<p>Then clear the variable once the install succeeds:</p>
<pre><code>Remove-Item Env:\ELECTRON_MIRROR</code></pre>
<p><strong>Step 4 — Verify the install completed correctly:</strong></p>
<pre><code>Test-Path node_modules\electron\Path.txt</code></pre>
<p>If this prints <code>True</code>, the install is good. Run <code>npm run build:packages</code> and then <code>npm run dev</code>.</p>
<blockquote>
<p><strong>Note:</strong> Always run <code>npm ci</code> in a <strong>regular</strong> (non-Administrator) PowerShell window. Running as Administrator can cause file permission issues that prevent the install from completing correctly.</p>
</blockquote>
<h3><code>npm run dev</code> opens no window</h3>
<p>Check that <code>npm run build:packages</code> completed without errors first. If it did, try closing and reopening your terminal, then run <code>npm run dev</code> again.</p>
<h3>Docker images fail to pull</h3>
<p>Confirm you have an internet connection and that Docker Desktop is signed in (or that your network does not block <code>ghcr.io</code>). On campus networks, check with IT if container registry traffic is blocked.</p>
<h3>"EOF" error while importing containers (simulation hangs on startup)</h3>
<p>You may see an error like:</p>
<pre><code>failed to copy: httpReadSeeker: failed open: failed to do request:
Get "https://production.cloudfront.docker.com/...": EOF</code></pre>
<p>This means the connection to Docker's CDN was dropped mid-download — the image layer was interrupted before it finished. It is a network issue, not a problem with OTForge or your installation.</p>
<p><strong>Step 1 — Simply retry.</strong> Click <strong>Stop Simulation</strong> in OTForge (or close and reopen the app if it is stuck), then click <strong>Run Simulation</strong> again. Docker resumes interrupted downloads and usually succeeds on the second or third attempt.</p>
<p><strong>Step 2 — Sign in to Docker Hub if you have not already.</strong> Unauthenticated pulls have lower rate limits and are more likely to be dropped by Docker's CDN. Open PowerShell and run:</p>
<pre><code>docker login</code></pre>
<p>Enter your Docker Hub username and password (free account at hub.docker.com). Then retry the simulation.</p>
<p><strong>Step 3 — If it keeps failing on your network,</strong> the issue is likely a campus firewall or VPN dropping large HTTPS downloads. Try:</p>
<ul>
<li>Switching to a different Wi-Fi network (personal hotspot works well)</li>
<li>Disconnecting from any VPN before starting the simulation</li>
<li>Pulling the images manually one at a time so Docker can retry each layer:</li>
</ul>
<pre><code>docker pull ghcr.io/iburres/otforge-suricata:latest
docker pull ghcr.io/iburres/otforge-zeek:latest</code></pre>
<p>Once the images are cached locally, OTForge's startup will be fast and will not need to re-download them.</p>
<h3>"Virtualization not supported" on Windows</h3>
<p>You need to enable virtualization in your computer's BIOS/UEFI firmware. The exact steps vary by manufacturer — search for your laptop model + "enable virtualization BIOS". Contact your instructor if you need help.</p>
<h3>Apple Silicon Mac — "image not found" or architecture mismatch</h3>
<p>Make sure you downloaded the <strong>Apple Silicon</strong> version of Docker Desktop (not the Intel version). Check Docker Desktop → Settings → General → confirm "Use Virtualization Framework" is enabled.</p>
<h3><code>TypeError: crypto.hash is not a function</code> (Mac or Windows)</h3>
<p>You are running Node.js 20, which is too old. OTForge uses Vite 8, which requires Node.js 22 or later.</p>
<p><strong>Fix (macOS):</strong></p>
<pre><code>brew install node@22
brew unlink node@20
brew link --overwrite node@22
node --version # should print v22.x.x
npm ci
npm run dev</code></pre>
<p><strong>Fix (Windows):</strong> Uninstall Node.js from Windows Settings → Apps → search "Node.js" → Uninstall. Then install Node.js 22 LTS from <a href="https://nodejs.org" target="_blank">https://nodejs.org</a> and repeat the setup from Step 6.</p>
<hr>
<!-- ── Keeping updated ── -->
<h2 id="updating">Keeping OTForge Updated</h2>
<p>Your instructor may push updates to the repository during the semester. To get the latest version:</p>
<pre><code># Windows (PowerShell in C:\OTForge)
git pull
npm install
npm run build:packages</code></pre>
<pre><code># macOS (Terminal in ~/OTForge)
git pull
npm install
npm run build:packages</code></pre>
<p>Then relaunch with <code>npm run dev</code>.</p>
<blockquote class="note">
<p><strong>Why <code>npm install</code> and not <code>npm ci</code>?</strong><br>
<code>npm ci</code> does a full clean reinstall every time — it deletes <code>node_modules</code> and re-downloads everything, including the 90 MB Electron binary, even when the Electron version has not changed. <code>npm install</code> is incremental: it only downloads packages that actually changed since your last update. For ongoing updates this is much faster and avoids the Electron download errors students sometimes see on campus networks.</p>
</blockquote>
<hr>
<!-- ── Network isolation ── -->
<h2 id="network-isolation">Network Isolation — Protect Your Lab Ports</h2>
<p>When OTForge is running, Docker publishes several local ports so the app can open the Grafana dashboard, FUXA HMI, OpenPLC IDE, and VNC desktops in browser windows. On Windows, Docker binds these ports to <strong>all network interfaces</strong> (<code>0.0.0.0</code>), which means anyone on the same Wi-Fi network as your laptop could connect to your simulated devices while a lab is running.</p>
<p>Add a single Windows Firewall rule to block inbound connections to all OTForge ports. Open <strong>PowerShell as Administrator</strong> and paste:</p>
<pre><code>New-NetFirewallRule `
-DisplayName "OTForge — Block inbound lab ports" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 1881,3000,3100,6800-6899,6900-6999,18080-18199 `
-Action Block `
-Profile Any</code></pre>
<p>This blocks the following ports from being reachable by anyone other than your own machine:</p>
<table>
<thead>
<tr><th>Port(s)</th><th>Service</th></tr>
</thead>
<tbody>
<tr><td>1881</td><td>FUXA process HMI</td></tr>
<tr><td>3000</td><td>Grafana dashboards</td></tr>
<tr><td>3100</td><td>Loki log API</td></tr>
<tr><td>6800–6899</td><td>Engineering workstation VNC desktops</td></tr>
<tr><td>6900–6999</td><td>Kali Linux attack machine VNC desktop</td></tr>
<tr><td>18080–18199</td><td>OpenPLC web IDE and Modbus ports (per PLC)</td></tr>
</tbody>
</table>
<p>To verify the rule was created:</p>
<pre><code>Get-NetFirewallRule -DisplayName "OTForge*"</code></pre>
<p>To remove the rule if you ever need to (e.g., for a collaborative demo):</p>
<pre><code>Remove-NetFirewallRule -DisplayName "OTForge — Block inbound lab ports"</code></pre>
<blockquote class="note">
<p><strong>macOS:</strong> Docker Desktop for Mac binds published ports to <code>127.0.0.1</code> (localhost only) by default — they are not reachable from your network without custom configuration. No firewall rule is needed on macOS.</p>
</blockquote>
<hr>
<!-- ── Quick reference ── -->
<h2 id="quick-ref">Quick Reference</h2>
<div class="ref-card">
<table>
<thead>
<tr><th>Task</th><th>Windows</th><th>macOS</th></tr>
</thead>
<tbody>
<tr><td>Open terminal</td><td>Start → PowerShell</td><td>Applications → Utilities → Terminal</td></tr>
<tr><td>Navigate to OTForge</td><td><code>cd C:\OTForge</code></td><td><code>cd ~/OTForge</code></td></tr>
<tr><td>Start OTForge</td><td><code>npm run dev</code></td><td><code>npm run dev</code></td></tr>
<tr><td>Scenarios folder</td><td><code>C:\OTForge\scenarios\</code></td><td><code>~/OTForge/scenarios/</code></td></tr>
<tr><td>Update OTForge</td><td><code>git pull && npm install && npm run build:packages</code></td><td><code>git pull && npm install && npm run build:packages</code></td></tr>
</tbody>
</table>
</div>
<footer>
<p>Questions? Post in the course discussion board or bring your laptop to office hours.</p>
</footer>
</main>
</body>
</html>