upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-12 22:51:43 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-12 22:51:43 +0000
commit51751d59f30a0c0f396afd1873ece9f4f77b44de (patch)
treecfec6555427f1be38997e00f313549c41dfaa609
parentab3337d0a3bf25c282f4d48e5d6150cf291f41e5 (diff)
Change default port from 8080 to 7334 (NGIT on phone keypad)
- Update default bind address in src/config.rs to 127.0.0.1:7334 - Update all four critical config sources per AGENTS.md: - src/config.rs (code default and tests) - .env.example (development template) - docs/reference/configuration.md (user documentation) - nix/module.nix (NixOS deployment) - Update all documentation examples and references: - README.md (with note about phone keypad mnemonic) - docs/how-to/*.md (deploy, prometheus-setup, test-compliance) - docs/explanation/*.md (architecture, comparison) - docs/learnings/grasp-audit.md Port 7334 spells NGIT on a phone keypad, making it memorable and project-specific. All tests pass (336 lib tests + 51 integration tests).
-rw-r--r--.env.example4
-rw-r--r--README.md6
-rw-r--r--docs/explanation/architecture.md2
-rw-r--r--docs/explanation/comparison.md2
-rw-r--r--docs/how-to/deploy.md2
-rw-r--r--docs/how-to/prometheus-setup.md6
-rw-r--r--docs/how-to/test-compliance.md4
-rw-r--r--docs/learnings/grasp-audit.md2
-rw-r--r--docs/reference/configuration.md24
-rw-r--r--nix/module.nix2
-rw-r--r--src/config.rs10
11 files changed, 32 insertions, 32 deletions
diff --git a/.env.example b/.env.example
index fb954c0..707efd4 100644
--- a/.env.example
+++ b/.env.example
@@ -23,8 +23,8 @@
23 23
24# Server bind address (IP:PORT) 24# Server bind address (IP:PORT)
25# CLI: --bind-address <address> 25# CLI: --bind-address <address>
26# Default: 127.0.0.1:8080 26# Default: 127.0.0.1:7334
27# NGIT_BIND_ADDRESS=127.0.0.1:8080 27# NGIT_BIND_ADDRESS=127.0.0.1:7334
28 28
29# ============================================================================ 29# ============================================================================
30# RELAY INFORMATION (NIP-11) 30# RELAY INFORMATION (NIP-11)
diff --git a/README.md b/README.md
index b4a430f..e0e39fd 100644
--- a/README.md
+++ b/README.md
@@ -381,7 +381,7 @@ This means CLI flags always take precedence over environment variables, which ta
381ngit-grasp --help 381ngit-grasp --help
382 382
383# Run with CLI flags (override everything else) 383# Run with CLI flags (override everything else)
384ngit-grasp --domain relay.example.com --relay-owner-nsec nsec1... --bind-address 0.0.0.0:8080 384ngit-grasp --domain relay.example.com --relay-owner-nsec nsec1... --bind-address 0.0.0.0:7334
385 385
386# Mix CLI flags with environment variables 386# Mix CLI flags with environment variables
387NGIT_RELAY_OWNER_NSEC=nsec1... ngit-grasp --domain relay.example.com 387NGIT_RELAY_OWNER_NSEC=nsec1... ngit-grasp --domain relay.example.com
@@ -399,7 +399,7 @@ NGIT_RELAY_OWNER_NSEC=nsec1... ngit-grasp --domain relay.example.com
399| Relay description | `--relay-description` | `NGIT_RELAY_DESCRIPTION` | `Git Nostr Relay - a grasp implementation` | 399| Relay description | `--relay-description` | `NGIT_RELAY_DESCRIPTION` | `Git Nostr Relay - a grasp implementation` |
400| Git data path | `--git-data-path` | `NGIT_GIT_DATA_PATH` | `./data/git` (temp dir for memory backend) | 400| Git data path | `--git-data-path` | `NGIT_GIT_DATA_PATH` | `./data/git` (temp dir for memory backend) |
401| Relay data path | `--relay-data-path` | `NGIT_RELAY_DATA_PATH` | `./data/relay` (temp dir for memory backend) | 401| Relay data path | `--relay-data-path` | `NGIT_RELAY_DATA_PATH` | `./data/relay` (temp dir for memory backend) |
402| Bind address | `--bind-address` | `NGIT_BIND_ADDRESS` | `127.0.0.1:8080` | 402| Bind address | `--bind-address` | `NGIT_BIND_ADDRESS` | `127.0.0.1:7334` (NGIT on phone keypad) |
403| Database backend | `--database-backend` | `NGIT_DATABASE_BACKEND` | `lmdb` | 403| Database backend | `--database-backend` | `NGIT_DATABASE_BACKEND` | `lmdb` |
404 404
405#### GRASP-02 Sync Settings 405#### GRASP-02 Sync Settings
@@ -445,7 +445,7 @@ NGIT_RELAY_OWNER_NSEC=nsec1... ngit-grasp --domain relay.example.com
445# Using environment variables (recommended for production) 445# Using environment variables (recommended for production)
446export NGIT_DOMAIN=gitnostr.com 446export NGIT_DOMAIN=gitnostr.com
447export NGIT_RELAY_OWNER_NSEC=nsec1... # Or let it auto-generate from .relay-owner.nsec 447export NGIT_RELAY_OWNER_NSEC=nsec1... # Or let it auto-generate from .relay-owner.nsec
448export NGIT_BIND_ADDRESS=0.0.0.0:8080 448export NGIT_BIND_ADDRESS=0.0.0.0:7334
449export NGIT_DATABASE_BACKEND=lmdb 449export NGIT_DATABASE_BACKEND=lmdb
450 450
451# Optional: Enable proactive sync from a bootstrap relay 451# Optional: Enable proactive sync from a bootstrap relay
diff --git a/docs/explanation/architecture.md b/docs/explanation/architecture.md
index d2a9bf7..e101425 100644
--- a/docs/explanation/architecture.md
+++ b/docs/explanation/architecture.md
@@ -580,7 +580,7 @@ RUN cargo build --release
580FROM debian:bookworm-slim 580FROM debian:bookworm-slim
581RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* 581RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
582COPY --from=builder /app/target/release/ngit-grasp /usr/local/bin/ 582COPY --from=builder /app/target/release/ngit-grasp /usr/local/bin/
583EXPOSE 8080 583EXPOSE 7334
584CMD ["ngit-grasp"] 584CMD ["ngit-grasp"]
585``` 585```
586 586
diff --git a/docs/explanation/comparison.md b/docs/explanation/comparison.md
index 72e49a7..090e0eb 100644
--- a/docs/explanation/comparison.md
+++ b/docs/explanation/comparison.md
@@ -65,7 +65,7 @@ This document compares ngit-grasp (this project) with ngit-relay (the reference
65┌────────────── ngit-grasp (Single Binary) ─────────────┐ 65┌────────────── ngit-grasp (Single Binary) ─────────────┐
66│ │ 66│ │
67│ ┌──────────────────────────────────────────────────┐ │ 67│ ┌──────────────────────────────────────────────────┐ │
68│ │ hyper HTTP Server (:8080) │ │ 68│ │ hyper HTTP Server (:7334) │ │
69│ │ - WebSocket upgrade for Nostr relay │ │ 69│ │ - WebSocket upgrade for Nostr relay │ │
70│ │ - Git Smart HTTP handlers │ │ 70│ │ - Git Smart HTTP handlers │ │
71│ │ - Landing page + metrics endpoint │ │ 71│ │ - Landing page + metrics endpoint │ │
diff --git a/docs/how-to/deploy.md b/docs/how-to/deploy.md
index 6fe8776..157e5f8 100644
--- a/docs/how-to/deploy.md
+++ b/docs/how-to/deploy.md
@@ -229,7 +229,7 @@ git ls-remote https://ngit.example.com/<npub>/<repo>.git
229 229
230### Network 230### Network
231- `bindAddress` - IP to bind to (default: "127.0.0.1") 231- `bindAddress` - IP to bind to (default: "127.0.0.1")
232- `port` - Port to listen on (default: 8080) 232- `port` - Port to listen on (default: 7334)
233 233
234### Storage 234### Storage
235- `dataDir` - Base directory for data (default: /var/lib/ngit-grasp-{name}) 235- `dataDir` - Base directory for data (default: /var/lib/ngit-grasp-{name})
diff --git a/docs/how-to/prometheus-setup.md b/docs/how-to/prometheus-setup.md
index 741255b..53ec480 100644
--- a/docs/how-to/prometheus-setup.md
+++ b/docs/how-to/prometheus-setup.md
@@ -13,7 +13,7 @@ This guide shows how to configure Prometheus and Grafana to monitor ngit-grasp.
13First, verify that ngit-grasp is exposing metrics: 13First, verify that ngit-grasp is exposing metrics:
14 14
15```bash 15```bash
16curl http://localhost:8080/metrics 16curl http://localhost:7334/metrics
17``` 17```
18 18
19You should see Prometheus-formatted metrics like: 19You should see Prometheus-formatted metrics like:
@@ -41,7 +41,7 @@ services.prometheus = {
41 { 41 {
42 job_name = "ngit-grasp"; 42 job_name = "ngit-grasp";
43 static_configs = [{ 43 static_configs = [{
44 targets = [ "localhost:8080" ]; # ngit-grasp bind address 44 targets = [ "localhost:7334" ]; # ngit-grasp bind address
45 }]; 45 }];
46 scrape_interval = "15s"; 46 scrape_interval = "15s";
47 metrics_path = "/metrics"; 47 metrics_path = "/metrics";
@@ -105,7 +105,7 @@ global:
105scrape_configs: 105scrape_configs:
106 - job_name: 'ngit-grasp' 106 - job_name: 'ngit-grasp'
107 static_configs: 107 static_configs:
108 - targets: ['host.docker.internal:8080'] # or your ngit-grasp host 108 - targets: ['host.docker.internal:7334'] # or your ngit-grasp host
109 metrics_path: /metrics 109 metrics_path: /metrics
110``` 110```
111 111
diff --git a/docs/how-to/test-compliance.md b/docs/how-to/test-compliance.md
index 370fb9a..8aa7ab1 100644
--- a/docs/how-to/test-compliance.md
+++ b/docs/how-to/test-compliance.md
@@ -184,7 +184,7 @@ nix develop -c cargo run
184 184
185# In another terminal, run audit tool 185# In another terminal, run audit tool
186cd grasp-audit 186cd grasp-audit
187nix develop -c cargo run -- --url ws://127.0.0.1:8080 187nix develop -c cargo run -- --url ws://127.0.0.1:7334
188``` 188```
189 189
190### For CI/CD 190### For CI/CD
@@ -424,7 +424,7 @@ nix develop -c cargo test --test nip01_compliance --test nip34_announcements
424**For deep compliance check:** 424**For deep compliance check:**
425```bash 425```bash
426cd grasp-audit 426cd grasp-audit
427nix develop -c cargo run -- --url ws://127.0.0.1:8080 427nix develop -c cargo run -- --url ws://127.0.0.1:7334
428``` 428```
429 429
430**Key points:** 430**Key points:**
diff --git a/docs/learnings/grasp-audit.md b/docs/learnings/grasp-audit.md
index f4620d9..c7eff16 100644
--- a/docs/learnings/grasp-audit.md
+++ b/docs/learnings/grasp-audit.md
@@ -110,7 +110,7 @@ use grasp_audit::client::AuditClient;
110use grasp_audit::audit::AuditConfig; 110use grasp_audit::audit::AuditConfig;
111 111
112let config = AuditConfig::isolated(); 112let config = AuditConfig::isolated();
113let client = AuditClient::new("ws://localhost:8080", config).await?; 113let client = AuditClient::new("ws://localhost:7334", config).await?;
114 114
115// Create and send an event - cleanup tags are added automatically 115// Create and send an event - cleanup tags are added automatically
116let event = client.event_builder() 116let event = client.event_builder()
diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md
index 66f39f1..8b49297 100644
--- a/docs/reference/configuration.md
+++ b/docs/reference/configuration.md
@@ -25,20 +25,20 @@ Configuration is loaded at startup and validated before the server starts.
25 25
26**Description:** Address and port for the HTTP server to bind to 26**Description:** Address and port for the HTTP server to bind to
27**Type:** String (IP:PORT format) 27**Type:** String (IP:PORT format)
28**Default:** `127.0.0.1:8080` 28**Default:** `127.0.0.1:7334`
29**Required:** No 29**Required:** No
30 30
31**Examples:** 31**Examples:**
32 32
33```bash 33```bash
34# Localhost only (development) 34# Localhost only (development)
35NGIT_BIND_ADDRESS=127.0.0.1:8080 35NGIT_BIND_ADDRESS=127.0.0.1:7334
36 36
37# All interfaces (production) 37# All interfaces (production)
38NGIT_BIND_ADDRESS=0.0.0.0:8080 38NGIT_BIND_ADDRESS=0.0.0.0:7334
39 39
40# IPv6 40# IPv6
41NGIT_BIND_ADDRESS=[::1]:8080 41NGIT_BIND_ADDRESS=[::1]:7334
42 42
43# Custom port 43# Custom port
44NGIT_BIND_ADDRESS=127.0.0.1:3000 44NGIT_BIND_ADDRESS=127.0.0.1:3000
@@ -64,7 +64,7 @@ NGIT_BIND_ADDRESS=127.0.0.1:3000
64```bash 64```bash
65NGIT_DOMAIN=gitnostr.com 65NGIT_DOMAIN=gitnostr.com
66NGIT_DOMAIN=git.example.org 66NGIT_DOMAIN=git.example.org
67NGIT_DOMAIN=localhost:8080 # Development only 67NGIT_DOMAIN=localhost:7334 # Development only
68``` 68```
69 69
70**Used for:** 70**Used for:**
@@ -77,7 +77,7 @@ NGIT_DOMAIN=localhost:8080 # Development only
77**Notes:** 77**Notes:**
78 78
79- Must be accessible from the internet for production 79- Must be accessible from the internet for production
80- Include port if non-standard (e.g., `localhost:8080`) 80- Include port if non-standard (e.g., `localhost:7334`)
81- Used in repository clone URLs: `https://{NGIT_DOMAIN}/{npub}/{repo}.git` 81- Used in repository clone URLs: `https://{NGIT_DOMAIN}/{npub}/{repo}.git`
82 82
83--- 83---
@@ -1007,13 +1007,13 @@ For development, create a `.env` file in the project root:
1007 1007
1008```bash 1008```bash
1009# .env file example 1009# .env file example
1010NGIT_DOMAIN=localhost:8080 1010NGIT_DOMAIN=localhost:7334
1011NGIT_OWNER_NPUB=npub1alice... 1011NGIT_OWNER_NPUB=npub1alice...
1012NGIT_RELAY_NAME="Development Relay" 1012NGIT_RELAY_NAME="Development Relay"
1013NGIT_RELAY_DESCRIPTION="Local development instance" 1013NGIT_RELAY_DESCRIPTION="Local development instance"
1014NGIT_GIT_DATA_PATH=./data/git 1014NGIT_GIT_DATA_PATH=./data/git
1015NGIT_RELAY_DATA_PATH=./data/relay 1015NGIT_RELAY_DATA_PATH=./data/relay
1016NGIT_BIND_ADDRESS=127.0.0.1:8080 1016NGIT_BIND_ADDRESS=127.0.0.1:7334
1017RUST_LOG=debug 1017RUST_LOG=debug
1018``` 1018```
1019 1019
@@ -1057,7 +1057,7 @@ NGIT_RELAY_NAME="GitNostr Public Relay"
1057NGIT_RELAY_DESCRIPTION="Public GRASP relay for open source projects" 1057NGIT_RELAY_DESCRIPTION="Public GRASP relay for open source projects"
1058NGIT_GIT_DATA_PATH=/var/lib/ngit-grasp/git 1058NGIT_GIT_DATA_PATH=/var/lib/ngit-grasp/git
1059NGIT_RELAY_DATA_PATH=/var/lib/ngit-grasp/relay 1059NGIT_RELAY_DATA_PATH=/var/lib/ngit-grasp/relay
1060NGIT_BIND_ADDRESS=0.0.0.0:8080 1060NGIT_BIND_ADDRESS=0.0.0.0:7334
1061RUST_LOG=info,ngit_grasp=debug 1061RUST_LOG=info,ngit_grasp=debug
1062``` 1062```
1063 1063
@@ -1076,13 +1076,13 @@ RUST_LOG=info,ngit_grasp=debug
1076 1076
1077```bash 1077```bash
1078# Development .env 1078# Development .env
1079NGIT_DOMAIN=localhost:8080 1079NGIT_DOMAIN=localhost:7334
1080NGIT_OWNER_NPUB=npub1test... 1080NGIT_OWNER_NPUB=npub1test...
1081NGIT_RELAY_NAME="Dev Relay" 1081NGIT_RELAY_NAME="Dev Relay"
1082NGIT_RELAY_DESCRIPTION="Local development" 1082NGIT_RELAY_DESCRIPTION="Local development"
1083NGIT_GIT_DATA_PATH=./data/git 1083NGIT_GIT_DATA_PATH=./data/git
1084NGIT_RELAY_DATA_PATH=./data/relay 1084NGIT_RELAY_DATA_PATH=./data/relay
1085NGIT_BIND_ADDRESS=127.0.0.1:8080 1085NGIT_BIND_ADDRESS=127.0.0.1:7334
1086RUST_LOG=debug 1086RUST_LOG=debug
1087``` 1087```
1088 1088
@@ -1124,7 +1124,7 @@ When multiple configuration sources exist:
1124 1124
1125```bash 1125```bash
1126# .env file 1126# .env file
1127NGIT_BIND_ADDRESS=127.0.0.1:8080 1127NGIT_BIND_ADDRESS=127.0.0.1:7334
1128 1128
1129# Environment variable (overrides .env) 1129# Environment variable (overrides .env)
1130NGIT_BIND_ADDRESS=0.0.0.0:3000 cargo run 1130NGIT_BIND_ADDRESS=0.0.0.0:3000 cargo run
diff --git a/nix/module.nix b/nix/module.nix
index 799ae2d..ae67512 100644
--- a/nix/module.nix
+++ b/nix/module.nix
@@ -43,7 +43,7 @@ let
43 43
44 port = mkOption { 44 port = mkOption {
45 type = types.port; 45 type = types.port;
46 default = 8080; 46 default = 7334;
47 description = "Port to listen on"; 47 description = "Port to listen on";
48 }; 48 };
49 49
diff --git a/src/config.rs b/src/config.rs
index a5e4344..0f0d853 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -352,7 +352,7 @@ pub struct Config {
352 pub relay_data_path: String, 352 pub relay_data_path: String,
353 353
354 /// Server bind address (IP:PORT) 354 /// Server bind address (IP:PORT)
355 #[arg(long, env = "NGIT_BIND_ADDRESS", default_value = "127.0.0.1:8080")] 355 #[arg(long, env = "NGIT_BIND_ADDRESS", default_value = "127.0.0.1:7334")]
356 pub bind_address: String, 356 pub bind_address: String,
357 357
358 /// Database backend type 358 /// Database backend type
@@ -678,13 +678,13 @@ impl Config {
678 .expect("Failed to generate test nsec"); 678 .expect("Failed to generate test nsec");
679 679
680 Self { 680 Self {
681 domain: "localhost:8080".to_string(), 681 domain: "localhost:7334".to_string(),
682 relay_owner_nsec: Some(nsec), 682 relay_owner_nsec: Some(nsec),
683 relay_name_override: Some("test relay".to_string()), 683 relay_name_override: Some("test relay".to_string()),
684 relay_description: "test description".to_string(), 684 relay_description: "test description".to_string(),
685 git_data_path: "./test_data/git".to_string(), 685 git_data_path: "./test_data/git".to_string(),
686 relay_data_path: "./test_data/relay".to_string(), 686 relay_data_path: "./test_data/relay".to_string(),
687 bind_address: "127.0.0.1:8080".to_string(), 687 bind_address: "127.0.0.1:7334".to_string(),
688 database_backend: DatabaseBackend::Memory, 688 database_backend: DatabaseBackend::Memory,
689 metrics_enabled: true, 689 metrics_enabled: true,
690 metrics_connection_per_ip_abuse_threshold: 10, 690 metrics_connection_per_ip_abuse_threshold: 10,
@@ -714,8 +714,8 @@ mod tests {
714 #[test] 714 #[test]
715 fn test_default_values() { 715 fn test_default_values() {
716 let config = Config::for_testing(); 716 let config = Config::for_testing();
717 assert_eq!(config.domain, "localhost:8080"); 717 assert_eq!(config.domain, "localhost:7334");
718 assert_eq!(config.bind_address, "127.0.0.1:8080"); 718 assert_eq!(config.bind_address, "127.0.0.1:7334");
719 // for_testing() uses Memory, but the actual default is Lmdb 719 // for_testing() uses Memory, but the actual default is Lmdb
720 assert_eq!(config.database_backend, DatabaseBackend::Memory); 720 assert_eq!(config.database_backend, DatabaseBackend::Memory);
721 } 721 }