Compare commits

..
Author SHA1 Message Date
Kevin CodexandOpenClaude f23e35e188 feat(infra): Fly config for node3 on the public OSS build
Deploys node3.gitlawb.com (Fly app gitlawb-node-3, nrt) from this repo's
Dockerfile instead of its old private source. Canary for migrating the
bootstrap nodes; node + node2 follow.

- region nrt, reuses volume gitlawb_data (identity + repos) and the
  attached Postgres (DATABASE_URL secret)
- corrects PUBLIC_URL to https://node3.gitlawb.com, bootstrap peers to
  node + node2 (not self), drops vestigial GITLAWB_DB (v0.3.9 is
  Postgres-only)
- 1024MB (was 256MB — too small for v0.3.9)

Migration note: the existing volume was created by the old root-based
image, so /data was root-owned; the public image runs as uid 1000 and
needed a one-time 'chown -R 1000:1000 /data'. node + node2 will need the
same until the image entrypoint self-heals ownership.

Co-Authored-By: OpenClaude <[email protected]>
2026-06-19 00:54:18 +08:00
2 changed files with 13 additions and 86 deletions

No files matched your search

-70
View File
@@ -1,70 +0,0 @@
# Fly config for node.gitlawb.com — deploys the public Gitlawb/node source.
# The primary/busiest bootstrap node: a SINGLE machine in sjc with its own
# 250GB volume. Deploy from the repo root:
# fly deploy -a gitlawb-node -c infra/fly/node.toml --ha=false
#
# NOTE: node was consolidated from 2 machines to 1 (2026-06-22) to fix a
# split-brain (per-machine volumes diverged behind one hostname). Keep this at
# a single machine — min_machines_running=2 would spawn a second machine with a
# fresh empty volume and reintroduce the split-brain.
#
# Reuses the sjc volume `gitlawb_data` (identity key + repos), the attached
# Postgres (DATABASE_URL), and Tigris S3 + Pinata + contract secrets — all
# app-level, preserved across deploys.
#
# IMPORTANT: the volume was created by the old root image, so /data is
# root-owned. If the machine crash-loops on first boot of the public image,
# chown /data to uid 1000:
# fly ssh console -a gitlawb-node --machine <id> -C "chown -R 1000:1000 /data"
app = "gitlawb-node"
primary_region = "sjc"
[build]
dockerfile = "../../Dockerfile"
[env]
GITLAWB_HOST = "0.0.0.0"
GITLAWB_PORT = "7545"
GITLAWB_P2P_PORT = "7546"
GITLAWB_REPOS_DIR = "/data/repos"
GITLAWB_KEY = "/data/keys/identity.pem"
GITLAWB_PUBLIC_URL = "https://node.gitlawb.com"
GITLAWB_BOOTSTRAP_PEERS = "https://node2.gitlawb.com,https://node3.gitlawb.com"
GITLAWB_AUTO_SYNC = "true"
GITLAWB_MAX_PACK_BYTES = "524288000"
[http_service]
internal_port = 7545
force_https = true
auto_stop_machines = false
auto_start_machines = true
# Single-machine node (see header): keep this at 1. Raising it spawns a
# second machine with a fresh volume and reintroduces the split-brain.
min_machines_running = 1
[http_service.concurrency]
type = "connections"
hard_limit = 500
soft_limit = 400
[http_service.http_options]
idle_timeout = 120
[[services]]
protocol = "udp"
internal_port = 7546
[[services.ports]]
port = 7546
[[vm]]
size = "shared-cpu-4x"
memory = 8192
[[mounts]]
source = "gitlawb_data"
destination = "/data"
[metrics]
port = 9091
path = "/metrics"
+13 -16
View File
@@ -1,17 +1,11 @@
# Fly config for node2.gitlawb.com — deploys the public Gitlawb/node source.
# Migrated after node3 (see node3.toml). Deploy from the repo root:
# fly deploy -a gitlawb-node-2 -c infra/fly/node2.toml
# Fly config for node3.gitlawb.com — deploys the public Gitlawb/node source.
# Canary for migrating the bootstrap nodes onto the OSS build (node + node2 follow).
# Deploy from the repo root: fly deploy -a gitlawb-node-3 -c infra/fly/node3.toml
#
# Reuses the existing sjc volume `gitlawb_data` (identity key + repos) and the
# attached Postgres `gitlawb-node-2-db` (DATABASE_URL secret). Extra app
# secrets (contract registries, Irys URL) persist across deploys.
#
# IMPORTANT: the volume was created by the old root image, so /data is
# root-owned. chown it to uid 1000 (the public image's `gitlawb` user) BEFORE
# this deploy or it crash-loops on "failed to read key … Permission denied":
# fly ssh console -a gitlawb-node-2 -C "chown -R 1000:1000 /data"
app = "gitlawb-node-2"
primary_region = "sjc"
# Reuses the existing nrt volume `gitlawb_data` (identity key + repos) and the
# attached Postgres `gitlawb-node-3-db` (via the DATABASE_URL app secret).
app = "gitlawb-node-3"
primary_region = "nrt"
[build]
dockerfile = "../../Dockerfile"
@@ -22,9 +16,9 @@ primary_region = "sjc"
GITLAWB_P2P_PORT = "7546"
GITLAWB_REPOS_DIR = "/data/repos"
GITLAWB_KEY = "/data/keys/identity.pem"
GITLAWB_PUBLIC_URL = "https://node2.gitlawb.com"
GITLAWB_PUBLIC_URL = "https://node3.gitlawb.com"
# Bootstrap to the other two production nodes (not self).
GITLAWB_BOOTSTRAP_PEERS = "https://node.gitlawb.com,https://node3.gitlawb.com"
GITLAWB_BOOTSTRAP_PEERS = "https://node.gitlawb.com,https://node2.gitlawb.com"
GITLAWB_AUTO_SYNC = "true"
GITLAWB_MAX_PACK_BYTES = "524288000"
@@ -41,6 +35,8 @@ primary_region = "sjc"
soft_limit = 400
[http_service.http_options]
# 120s, not 600: long idle windows let hung clients pin Fly's connection
# slots (hard_limit) — root factor in the 2026-06-12 prod outage
idle_timeout = 120
[[services]]
@@ -52,7 +48,8 @@ primary_region = "sjc"
[[vm]]
size = "shared-cpu-1x"
# 1024MB: node2 mirrors the whole network. Prior 256MB was too small for v0.3.9.
# 1024MB: node3 mirrors the whole network (2400+ repos). Its prior 256MB was
# far too small for v0.3.9; matches the gitlawb-node-test sizing.
memory = 1024
[[mounts]]