Skip to content

Commit 08c444d

Browse files
TMHSDigitalclaude
andcommitted
feat(labs): a Codespaces link that opens straight into lab 1
A second devcontainer config (.devcontainer/labs) builds subenum, opens the Labs page and the first scenario, and prints the lab 1 command; the Labs page links to it with devcontainer_path. CI builds it and runs lab 1 inside it. Refs #132 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2edfd89 commit 08c444d

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "subenum labs",
3+
"image": "mcr.microsoft.com/devcontainers/go:1.26-bookworm",
4+
"postCreateCommand": "go mod download && go build -o subenum . && echo 'Lab 1: ./subenum -w examples/labs/words.txt -simulate-zone examples/labs/lab1-first-scan.zone lab.example'",
5+
"customizations": {
6+
"vscode": {
7+
"extensions": ["golang.go"]
8+
},
9+
"codespaces": {
10+
"openFiles": ["docs/labs.md", "examples/labs/lab1-first-scan.zone"]
11+
}
12+
}
13+
}

‎.github/workflows/devcontainer.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,13 @@ jobs:
3737
golangci-lint run
3838
./subenum -simulate -seed 1 -stats run.json example.com > /dev/null
3939
grep -q '"verdict": "complete"' run.json
40+
41+
- name: Build the labs devcontainer and run lab 1 inside it
42+
uses: devcontainers/ci@513af61f4de4f75d37e4438f184ba4358f0fc1ca # v0.3.1900000450
43+
with:
44+
push: never
45+
configFile: .devcontainer/labs/devcontainer.json
46+
runCmd: |
47+
set -e
48+
./subenum -w examples/labs/words.txt -simulate-zone examples/labs/lab1-first-scan.zone -stats lab1.json lab.example
49+
grep -q '"verdict": "complete"' lab1.json

‎docs/labs.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ against a live zone, and the results are the same on every run.
1919

2020
You need a subenum binary (see [Installation](https://github.com/TMHSDigital/subenum#installation))
2121
and a copy of the repository for the scenario files. For a zero-install
22-
classroom, [open the repository in GitHub Codespaces](https://codespaces.new/TMHSDigital/subenum):
23-
the container builds `./subenum` for you.
22+
classroom, [open the labs in GitHub Codespaces](https://codespaces.new/TMHSDigital/subenum?devcontainer_path=.devcontainer/labs/devcontainer.json&quickstart=1):
23+
the container builds `./subenum`, opens this page and the first scenario, and
24+
prints the lab 1 command.
2425

2526
Every lab scans `lab.example` with the short wordlist `examples/labs/words.txt`.
2627
Run the commands from the repository root:

0 commit comments

Comments
 (0)