Skip to content

Commit 2fff53c

Browse files
Michael Borisovclaude
authored andcommitted
fix: rename boot artifacts to boot_cyb.zip/Boot Cyb.app + improve boot.dat discovery
- Rename boot-cyb.zip → boot_cyb.zip and boot cyb.app → Boot Cyb.app everywhere - Add ~/Desktop as boot.dat search path - Scan immediate subdirectories of ~/Downloads and ~/Desktop for boot.dat Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1533882 commit 2fff53c

File tree

5 files changed

+50
-29
lines changed

5 files changed

+50
-29
lines changed

.github/workflows/macos_release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ jobs:
160160
codesign --force --options runtime --sign "$APPLE_SIGNING_IDENTITY" "$BOOT_BIN"
161161
162162
# Create .app bundle (no boot.dat — server appends it per-user)
163-
APP="$RUNNER_TEMP/boot cyb.app"
163+
APP="$RUNNER_TEMP/Boot Cyb.app"
164164
mkdir -p "$APP/Contents/MacOS"
165165
cp "$BOOT_BIN" "$APP/Contents/MacOS/cyb-boot"
166166
printf '%s\n' '<?xml version="1.0" encoding="UTF-8"?>' \
167167
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
168168
'<plist version="1.0"><dict>' \
169169
'<key>CFBundleExecutable</key><string>cyb-boot</string>' \
170-
'<key>CFBundleName</key><string>boot cyb</string>' \
171-
'<key>CFBundleDisplayName</key><string>boot cyb</string>' \
170+
'<key>CFBundleName</key><string>Boot Cyb</string>' \
171+
'<key>CFBundleDisplayName</key><string>Boot Cyb</string>' \
172172
'<key>CFBundleIdentifier</key><string>ai.cyb.boot</string>' \
173173
'<key>CFBundleVersion</key><string>1.0</string>' \
174174
'<key>CFBundleShortVersionString</key><string>1.0</string>' \
@@ -181,17 +181,17 @@ jobs:
181181
codesign --force --options runtime --sign "$APPLE_SIGNING_IDENTITY" "$APP"
182182
183183
# Notarize
184-
ditto -c -k --keepParent "$APP" "$RUNNER_TEMP/boot-cyb-notarize.zip"
185-
xcrun notarytool submit "$RUNNER_TEMP/boot-cyb-notarize.zip" \
184+
ditto -c -k --keepParent "$APP" "$RUNNER_TEMP/boot_cyb_notarize.zip"
185+
xcrun notarytool submit "$RUNNER_TEMP/boot_cyb_notarize.zip" \
186186
--key "$APPLE_API_KEY_PATH" --key-id "$APPLE_API_KEY" \
187187
--issuer "$APPLE_API_ISSUER" --wait
188-
rm -f "$RUNNER_TEMP/boot-cyb-notarize.zip"
188+
rm -f "$RUNNER_TEMP/boot_cyb_notarize.zip"
189189
190190
# Staple notarization ticket into the .app
191191
xcrun stapler staple "$APP"
192192
193193
# Final zip (with stapled ticket) — internal artifact for boot server
194-
ditto -c -k --keepParent "$APP" "$RUNNER_TEMP/boot-cyb.zip"
194+
ditto -c -k --keepParent "$APP" "$RUNNER_TEMP/boot_cyb.zip"
195195
196196
# ── Artifacts ───────────────────────────────────────────────
197197
- name: Collect release artifacts
@@ -214,7 +214,7 @@ jobs:
214214
mkdir -p boot-artifacts
215215
216216
# Notarized .app bundle template (upload to Cyberproxy artifacts/)
217-
cp "$RUNNER_TEMP/boot-cyb.zip" boot-artifacts/
217+
cp "$RUNNER_TEMP/boot_cyb.zip" boot-artifacts/
218218
219219
# Bare cyb-boot binary (upload to Cyberproxy artifacts/)
220220
cp cyb-boot/target/aarch64-apple-darwin/release/cyb-boot \

cyb-boot/CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ cd server && GOOS=linux GOARCH=amd64 go build -o cyb-boot-server .
4848

4949
- Server runs on Cyberproxy (167.235.28.94:8098), locally proxied via cyb.ai/api/boot
5050
- Server binary: `/home/cyber/cyb-boot/server/cyb-boot-server`
51-
- Artifacts: `/home/cyber/cyb-boot/artifacts/` (platform binaries + boot-cyb.zip)
51+
- Artifacts: `/home/cyber/cyb-boot/artifacts/` (platform binaries + boot_cyb.zip)
5252
- Systemd service: `cyb-boot-server.service`
5353
- Artifacts are auto-deployed via webhook on master/tag pushes (secret: `BOOT_DEPLOY_WEBHOOK_SECRET`). Manual SCP still works as fallback
54-
- boot-cyb.zip is an internal server artifact, NOT a GitHub Release asset
54+
- boot_cyb.zip is an internal server artifact, NOT a GitHub Release asset
5555

5656
## Rules
5757

58-
- Never put boot-cyb.zip in GitHub Releases — it's an internal server template
58+
- Never put boot_cyb.zip in GitHub Releases — it's an internal server template
5959
- The distribution server's only job is bundling pre-built binaries with boot.dat
6060
- cyb-boot does the smart work: iroh networking, registry resolution, app download
6161
- The version registry lives in the knowledge graph (particle at known CID), not on the server

cyb-boot/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ The current `main.rs` is a **simplified stepping stone**:
9494

9595
macOS Gatekeeper blocks unsigned apps. For macOS, CI:
9696
1. Builds the cyb-boot binary
97-
2. Wraps it in an `.app` bundle (`boot cyb.app`)
97+
2. Wraps it in an `.app` bundle (`Boot Cyb.app`)
9898
3. Signs with Developer ID Application certificate + hardened runtime
9999
4. Notarizes with Apple (xcrun notarytool)
100100
5. Staples the notarization ticket
101-
6. Zips as `boot-cyb.zip`
101+
6. Zips as `boot_cyb.zip`
102102

103-
The server stores `boot-cyb.zip` as a template. On each macOS request, it clones the zip and appends `boot.dat` alongside the `.app`. The binary inside cannot be modified (would break signature), but `boot.dat` sits next to the `.app` in the zip.
103+
The server stores `boot_cyb.zip` as a template. On each macOS request, it clones the zip and appends `boot.dat` alongside the `.app`. The binary inside cannot be modified (would break signature), but `boot.dat` sits next to the `.app` in the zip.
104104

105105
For Windows/Linux, the server zips the bare binary + `boot.dat` directly.
106106

@@ -133,14 +133,14 @@ Go HTTP server on Cyberproxy. Its only job: serve pre-built cyb-boot binaries bu
133133

134134
**API:** `POST /api/boot` with `{"platform": "<target-triple>", "data": "<base64-encrypted-bootstrap>"}`
135135

136-
**macOS:** reads `boot-cyb.zip` template from artifacts, appends `boot.dat`, returns combined zip.
136+
**macOS:** reads `boot_cyb.zip` template from artifacts, appends `boot.dat`, returns combined zip.
137137
**Windows/Linux:** reads bare binary from artifacts, zips with `boot.dat`, returns zip.
138138

139139
### Server artifacts (on Cyberproxy)
140140

141141
```
142142
/home/cyber/cyb-boot/artifacts/
143-
├── boot-cyb.zip # notarized macOS .app template
143+
├── boot_cyb.zip # notarized macOS .app template
144144
├── cyb-boot-aarch64-apple-darwin # bare macOS ARM binary
145145
├── cyb-boot-x86_64-apple-darwin # bare macOS Intel binary
146146
├── cyb-boot-x86_64-pc-windows-msvc # Windows binary
@@ -219,7 +219,7 @@ CI builds artifacts → uploads to GitHub Actions artifacts
219219

220220
```bash
221221
# Upload new macOS .app bundle template
222-
scp -P 8333 boot-cyb.zip cyber@cyberproxy:/home/cyber/cyb-boot/artifacts/
222+
scp -P 8333 boot_cyb.zip cyber@cyberproxy:/home/cyber/cyb-boot/artifacts/
223223

224224
# Upload new platform binary
225225
scp -P 8333 cyb-boot-aarch64-apple-darwin cyber@cyberproxy:/home/cyber/cyb-boot/artifacts/
@@ -244,7 +244,7 @@ location = /api/boot {
244244

245245
`.github/workflows/macos_release.yml` produces:
246246
- **Release artifacts** (GitHub Releases): `cyb.dmg`, `cyb.pkg` — the actual cyb app
247-
- **Boot server artifacts** (auto-deployed to Cyberproxy via webhook on master/tag push): `boot-cyb.zip`, `cyb-boot-aarch64-apple-darwin`
247+
- **Boot server artifacts** (auto-deployed to Cyberproxy via webhook on master/tag push): `boot_cyb.zip`, `cyb-boot-aarch64-apple-darwin`
248248

249249
## Open Questions
250250

cyb-boot/server/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ func handleBoot(w http.ResponseWriter, r *http.Request) {
8585
isDarwin := strings.Contains(req.Platform, "darwin")
8686

8787
if isDarwin {
88-
// macOS: read pre-signed notarized boot-cyb.zip and append boot.dat
89-
templatePath := filepath.Join(artifactsDir, "boot-cyb.zip")
88+
// macOS: read pre-signed notarized boot_cyb.zip and append boot.dat
89+
templatePath := filepath.Join(artifactsDir, "boot_cyb.zip")
9090
templateZip, err := os.ReadFile(templatePath)
9191
if err != nil {
92-
log.Printf("boot-cyb.zip not found: %s", templatePath)
92+
log.Printf("boot_cyb.zip not found: %s", templatePath)
9393
http.Error(w, "macOS app bundle not available", http.StatusServiceUnavailable)
9494
return
9595
}
@@ -102,10 +102,10 @@ func handleBoot(w http.ResponseWriter, r *http.Request) {
102102
}
103103

104104
w.Header().Set("Content-Type", "application/zip")
105-
w.Header().Set("Content-Disposition", `attachment; filename="boot-cyb.zip"`)
105+
w.Header().Set("Content-Disposition", `attachment; filename="boot_cyb.zip"`)
106106
w.Header().Set("Content-Length", fmt.Sprintf("%d", outBuf.Len()))
107107
w.Write(outBuf.Bytes())
108-
log.Printf("Served boot-cyb.zip + boot.dat for %s (%d bytes)", req.Platform, outBuf.Len())
108+
log.Printf("Served boot_cyb.zip + boot.dat for %s (%d bytes)", req.Platform, outBuf.Len())
109109
return
110110
}
111111

cyb-boot/src/main.rs

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,34 @@ fn find_boot_dat() -> Option<PathBuf> {
4343
}
4444
}
4545

46-
// ~/Downloads/ — browser download flow
46+
// Common user directories — browser download flow, Desktop extraction
4747
if let Some(home) = dirs::home_dir() {
48-
let downloads = home.join("Downloads").join(BOOT_DAT);
49-
println!("[cyb-boot] Checking: {:?}", downloads);
50-
if downloads.exists() {
51-
println!("[cyb-boot] Found boot.dat at {:?}", downloads);
52-
return Some(downloads);
48+
let search_dirs = vec![
49+
home.join("Downloads"),
50+
home.join("Desktop"),
51+
];
52+
53+
for search_dir in &search_dirs {
54+
// Direct: ~/Downloads/boot.dat or ~/Desktop/boot.dat
55+
let direct = search_dir.join(BOOT_DAT);
56+
println!("[cyb-boot] Checking: {:?}", direct);
57+
if direct.exists() {
58+
println!("[cyb-boot] Found boot.dat at {:?}", direct);
59+
return Some(direct);
60+
}
61+
62+
// Scan immediate subdirectories (e.g. ~/Downloads/boot_cyb/boot.dat)
63+
if let Ok(entries) = fs::read_dir(search_dir) {
64+
for entry in entries.flatten() {
65+
if entry.path().is_dir() {
66+
let nested = entry.path().join(BOOT_DAT);
67+
if nested.exists() {
68+
println!("[cyb-boot] Found boot.dat at {:?}", nested);
69+
return Some(nested);
70+
}
71+
}
72+
}
73+
}
5374
}
5475
}
5576

0 commit comments

Comments
 (0)