mirror of
https://github.com/Twigpine/node.git
synced 2026-11-09 05:20:05 -10:00
Open the key file with create_new and the mode set at creation, then fsync, instead of writing it and narrowing the mode afterwards. The secret is never on disk under a wider mode, an interrupted start cannot leave it readable, and the exclusive open also refuses a pre-existing entry at the path and makes a concurrent start take the key that landed rather than clobber it. Refuse to load a key file whose mode grants group or other access, and name the observed mode so the operator can fix it. Report an empty key file as empty rather than surfacing a protobuf decode error that blames a missing rsa feature. Pin GITLAWB_P2P_KEY onto the mounted volume in the Docker and fly configs and document it, so the key does not depend on home-directory resolution to land on persistent storage.
infra/
Deployment configuration, organized by target — one subdirectory per platform.
infra/
├── fly/
│ └── fly.toml # Fly.io app config (gitlawb-node-test)
└── aws/ # Terraform: single EC2 + Docker (see aws/README.md)
Deploying to Fly.io
Run from the repo root so the Docker build context includes crates/,
Cargo.toml, and bootstrap-peers.json:
fly deploy -c infra/fly/fly.toml
The dockerfile path inside fly.toml is resolved relative to the config
file, so it points to ../../Dockerfile.
Deploying to AWS
See aws/README.md — Terraform for a single EC2 instance
running the published ghcr.io/gitlawb/node image with Docker compose.
What intentionally stays at the repo root
Dockerfile/Dockerfile.bins— shared by the release CI workflow (.github/workflows/release.yml),scripts/build-bins.sh, and Fly builds.docker-compose.yml— local dev stack; bundled into the macOS app byscripts/build-macos-app.shand used for repo detection by the app.
Future targets should follow the same per-platform layout.