mirror of
https://github.com/saymrwulf/puncture.git
synced 2026-05-14 20:48:10 +00:00
| .. | ||
| cmd | ||
| internal | ||
| ios | ||
| packaging/macos | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
Puncture Go
Go implementation of the primary puncturable-key system, plus:
- a desktop macOS app build target
- a DMG installer pipeline
- a native iOS emergency puncture companion app
Layout
cmd/server: headless primary app server (web UI + APIs)cmd/desktop: macOS desktop target (embedded webview + local server)internal/crypto: GGM puncturable key manager in Gointernal/app: providers, key journal, assets, encryption/decryption, tree-viz stateinternal/server: HTTP routes + embedded web UIpackaging/macos:.appand.dmgbuild scriptsios/EmergencyPuncture: SwiftUI iOS app (generated with xcodegen)
Run Primary (Go Server)
cd goapp
go run ./cmd/server --host 0.0.0.0 --port 9122
Open: http://127.0.0.1:9122
Local Persistence
State now persists automatically across restarts (frontier, punctures, providers, key journal, asset mappings, history).
- Default state file:
- if asset root ends with
assets: siblingstate.json - otherwise:
<asset-root>/.puncture-state.json
- if asset root ends with
- Override path with
PUNCTURE_STATE_FILE=/absolute/path/state.json
Build macOS Desktop App + DMG
cd goapp
./packaging/macos/build_dmg.sh
Output:
goapp/dist/Puncture.appgoapp/dist/Puncture.dmg
Desktop app behavior:
- On launch,
Puncture.appnow auto-starts iOS Simulator. - It auto-installs/launches the bundled
EmergencyPunctureiOS app in Simulator. - It attempts to place macOS + Simulator windows side-by-side.
- For auto window positioning, macOS may ask Accessibility permission for the app.
Runtime toggles (optional):
PUNCTURE_WITH_SIMULATOR=0disables auto-launch.PUNCTURE_SIM_DEVICE="iPhone 17 Pro"chooses preferred simulator device.PUNCTURE_IOS_SIM_APP=/path/to/EmergencyPuncture.appoverrides bundled app path.
Build macOS Desktop Binary (without DMG)
cd goapp
CGO_ENABLED=1 go build -tags desktop -o dist/PunctureDesktop ./cmd/desktop
iOS Emergency Puncture App
Project location:
goapp/ios/EmergencyPuncture/EmergencyPuncture.xcodeproj
Open in Xcode and run on device/simulator.
What it does:
- Connects to master
http://<master-ip>:9122 - Loads providers from
/api/live/state - Sends emergency puncture to
/api/remote/puncture-provider - Optional
X-Puncture-Tokenheader support
iPhone install + signing manual:
goapp/ios/INSTALL_IPHONE.md
Signed IPA build helper:
cd goapp/ios
TEAM_ID=YOURTEAMID ./build_signed_ipa.sh
API Highlights
GET /api/statePOST /api/derivePOST /api/puncturePOST /api/providers/addPOST /api/providers/deletePOST /api/assets/uploadPOST /api/assets/encryptPOST /api/assets/decryptPOST /api/remote/puncture-provider
Tests
cd goapp
go test ./...