Skip to content

Commit 211afbd

Browse files
authored
Merge pull request #20 from DataDog/labs
Adding Labs
2 parents 839461e + d019b6a commit 211afbd

4,461 files changed

Lines changed: 157607 additions & 714 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@ jobs:
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545

46+
- name: Generate labs JSON
47+
run: |
48+
python scripts/generate-labs-json.py
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Set up Node.js (for Playwright hero-image generator)
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: '20'
56+
57+
- name: Install Playwright
58+
run: |
59+
npm install
60+
npx playwright install --with-deps chromium
61+
62+
- name: Generate per-lab social hero images
63+
run: |
64+
node scripts/generate-lab-hero-images.js
65+
66+
- name: Generate per-lab static HTML stubs
67+
run: |
68+
python scripts/generate-lab-stubs.py
69+
4670
- name: Setup Pages
4771
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
4872

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ ENV/
4040
docs/paths.json
4141
docs/metadata.json
4242

43+
# Node / Playwright (used by scripts/generate-lab-hero-images.js)
44+
node_modules/
45+
package-lock.json
46+
4347
# Logs
4448
*.log
4549

@@ -58,4 +62,9 @@ PROJECT_SETUP_SUMMARY.md
5862

5963
demos/
6064
ignored/
61-
local-scripts/
65+
local-scripts/
66+
research/
67+
68+
.claude/launch.json
69+
docs/design-lab.html
70+
docs/slide-generator.html

CLAUDE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,33 @@ cd docs && python3 dev-server.py
6767
# Then visit http://localhost:8888
6868
```
6969

70+
### Per-Lab Social Sharing (OG/Twitter unfurls)
71+
72+
Each lab gets a static stub at `docs/labs/{slug}/index.html` with lab-specific
73+
OG/Twitter meta tags, plus a hero image at `docs/labs/{slug}/hero.png`
74+
rendered from the lab's attack map. Required because social crawlers don't
75+
execute JavaScript, so the SPA's client-side meta tag updates are invisible
76+
to them.
77+
78+
```bash
79+
# One-time setup (Playwright + Chromium for headless rendering)
80+
npm install
81+
npx playwright install chromium
82+
83+
# Regenerate per-lab hero images (incremental: skips labs whose PNG is
84+
# newer than the lab JSON and the renderer JS/CSS files)
85+
node scripts/generate-lab-hero-images.js
86+
node scripts/generate-lab-hero-images.js --force # force-regen all
87+
node scripts/generate-lab-hero-images.js --slug iam-002 # single lab
88+
89+
# Regenerate per-lab HTML stubs (cheap, always runs all labs)
90+
python scripts/generate-lab-stubs.py
91+
```
92+
93+
Run hero-image generation BEFORE stub generation so stubs that find a per-lab
94+
PNG can reference it. If a PNG is missing, the stub falls back to the generic
95+
`/images/pathfinding-cloud-labs.png`.
96+
7097
### GitHub Token for Better Contributor Info
7198

7299
```bash

SCHEMA.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ This document defines the YAML schema used for documenting AWS IAM privilege esc
44

55
## Schema Version
66

7-
Current version: `1.6.0`
7+
Current version: `1.7.0`
88

99
### Version History
1010

11+
#### Version 1.7.0 (2026-04-18)
12+
- Added `supportsOnlineMode` optional boolean field to **lab data** (sourced from pathfinding-labs, consumed via `labs.json`): indicates the lab has a deployed online environment that can be played directly from the game map terminal
13+
- Added `onlineEndpoint` optional string field to **lab data**: the API Gateway URL that the in-browser terminal POSTs commands to (fronts the Lambda backend)
14+
- These are lab-level fields, not path YAML fields — they live in the pathfinding-labs scenario configuration and flow through `generate-json.py` into `labs.json`
15+
- The game map "Play Online" button reads both fields; labs missing `supportsOnlineMode: true` fall back to the "Coming Soon" UI automatically
16+
- See also: `PLAY_ONLINE_GLOBALLY_ENABLED` constant in `docs/js/map-game.js` (global kill-switch, currently `false`)
17+
1118
#### Version 1.6.0 (2025-01-15)
1219
- **Breaking change**: `parent` field changed from string to nested object
1320
- Added `parent.id` (string, required if parent present): The parent path ID

docs/404.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,21 @@
1616

1717
var redirect;
1818

19+
// Known sub-pages that have their own index.html — redirect directly with trailing slash
20+
var knownLabPages = ['/labs/getting-started'];
21+
var isKnownLabPage = knownLabPages.some(function(p) {
22+
return pathname === p || pathname === p + '/';
23+
});
24+
1925
// If path starts with /paths/, redirect to /paths/ (which will load /paths/index.html)
2026
if (pathname.startsWith('/paths/')) {
2127
redirect = window.location.origin + '/paths/';
2228
sessionStorage.setItem('redirectPath', pathname);
29+
} else if (isKnownLabPage) {
30+
redirect = window.location.origin + '/labs/getting-started/';
31+
} else if (pathname.startsWith('/labs/')) {
32+
redirect = window.location.origin + '/labs/';
33+
sessionStorage.setItem('redirectPath', pathname);
2334
} else {
2435
// Otherwise redirect to root
2536
redirect = window.location.origin + '/';

0 commit comments

Comments
 (0)