Files
ngit-grasp/1beb-deploy-ngit-relay-rate-limiting-fix.md
T

2.5 KiB

Deploy ngit-relay Rate Limiting Fix to Production

ID: 1beb

Problem

The ngit-relay rate limiting fix (commit 81e35bb) is on branch fix-rate-limiting but not deployed to production. The fix increases khatru rate limiter from 100→500 connections/IP and 1/2min→10/min refill rate. Docker image was built locally but not pushed to registry, and containers are still running old v0.0.3 image.

Plan

  • Merge fix-rate-limiting to master in ngit-relay repo
  • Build and tag Docker image as v0.0.4
  • Push Docker image to GitHub Container Registry
  • Update nixos-vps1 service configs to use v0.0.4
  • Commit nixos-vps1 config changes
  • Deploy to VPS using deploy command
  • Verify deployment (containers running v0.0.4, reduced 429 errors)
  • Push ngit-relay master branch to remote

Progress

2026-01-16 [Session Start]

  • Started: Created issue to track deployment workflow
  • Created worktree for deployment work
  • Completed: Merged fix-rate-limiting to master (fast-forward)
  • Completed: Built Docker image v0.0.4 and tagged as latest locally
  • Blocker: Docker push failed - authentication required for ghcr.io
  • Completed: Created v0.0.4 tag locally
  • Blocker: Git push to GitHub failed - nostr:// origin causes timeouts, GitHub remote requires auth
  • Completed: Updated nixos-vps1 configs for both services (commit a7fbcd7)
  • Next: Manual push of master + v0.0.4 tag to GitHub required to trigger Action

Notes

  • Branch: fix-rate-limiting in /persistent/dcdev/clones/ngit-relay
  • Commit: 81e35bb
  • Services affected: gitnostr-com-ngit-relay, relay-ngit-dev-ngit-relay
  • VPS: 94.156.119.146

Manual Steps Required

The deployment is blocked on pushing to GitHub. Two options:

Option 1: Push to GitHub (Recommended - triggers GitHub Action)

cd /persistent/dcdev/clones/ngit-relay
# Add GitHub remote if not exists
git remote add github https://github.com/danconwaydev/ngit-relay.git
# Push master and tag (requires GitHub authentication)
git push github master
git push github v0.0.4

This will trigger the GitHub Action to build and push the Docker image automatically.

Option 2: Manual Docker Push

# Login to GitHub Container Registry
echo $GITHUB_TOKEN | docker login ghcr.io -u danconwaydev --password-stdin
# Push locally built images
docker push ghcr.io/danconwaydev/ngit-relay:v0.0.4
docker push ghcr.io/danconwaydev/ngit-relay:latest

After Docker image is available:

cd /persistent/dcdev/clones/nixos-vps1
# Deploy to VPS (configs already updated and committed)
deploy .