Files
node/infra
beardthelion 532ffc7202 fix(node): create the p2p key with 0600 at creation and reject a loose one
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.
2026-08-13 21:40:26 -05:00
..
2026-06-05 22:38:53 +08:00

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 by scripts/build-macos-app.sh and used for repo detection by the app.

Future targets should follow the same per-platform layout.