mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
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).
This commit is contained in:
+2
-2
@@ -23,8 +23,8 @@
|
||||
|
||||
# Server bind address (IP:PORT)
|
||||
# CLI: --bind-address <address>
|
||||
# Default: 127.0.0.1:8080
|
||||
# NGIT_BIND_ADDRESS=127.0.0.1:8080
|
||||
# Default: 127.0.0.1:7334
|
||||
# NGIT_BIND_ADDRESS=127.0.0.1:7334
|
||||
|
||||
# ============================================================================
|
||||
# RELAY INFORMATION (NIP-11)
|
||||
|
||||
@@ -381,7 +381,7 @@ This means CLI flags always take precedence over environment variables, which ta
|
||||
ngit-grasp --help
|
||||
|
||||
# Run with CLI flags (override everything else)
|
||||
ngit-grasp --domain relay.example.com --relay-owner-nsec nsec1... --bind-address 0.0.0.0:8080
|
||||
ngit-grasp --domain relay.example.com --relay-owner-nsec nsec1... --bind-address 0.0.0.0:7334
|
||||
|
||||
# Mix CLI flags with environment variables
|
||||
NGIT_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
|
||||
| Relay description | `--relay-description` | `NGIT_RELAY_DESCRIPTION` | `Git Nostr Relay - a grasp implementation` |
|
||||
| Git data path | `--git-data-path` | `NGIT_GIT_DATA_PATH` | `./data/git` (temp dir for memory backend) |
|
||||
| Relay data path | `--relay-data-path` | `NGIT_RELAY_DATA_PATH` | `./data/relay` (temp dir for memory backend) |
|
||||
| Bind address | `--bind-address` | `NGIT_BIND_ADDRESS` | `127.0.0.1:8080` |
|
||||
| Bind address | `--bind-address` | `NGIT_BIND_ADDRESS` | `127.0.0.1:7334` (NGIT on phone keypad) |
|
||||
| Database backend | `--database-backend` | `NGIT_DATABASE_BACKEND` | `lmdb` |
|
||||
|
||||
#### GRASP-02 Sync Settings
|
||||
@@ -445,7 +445,7 @@ NGIT_RELAY_OWNER_NSEC=nsec1... ngit-grasp --domain relay.example.com
|
||||
# Using environment variables (recommended for production)
|
||||
export NGIT_DOMAIN=gitnostr.com
|
||||
export NGIT_RELAY_OWNER_NSEC=nsec1... # Or let it auto-generate from .relay-owner.nsec
|
||||
export NGIT_BIND_ADDRESS=0.0.0.0:8080
|
||||
export NGIT_BIND_ADDRESS=0.0.0.0:7334
|
||||
export NGIT_DATABASE_BACKEND=lmdb
|
||||
|
||||
# Optional: Enable proactive sync from a bootstrap relay
|
||||
|
||||
@@ -580,7 +580,7 @@ RUN cargo build --release
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=builder /app/target/release/ngit-grasp /usr/local/bin/
|
||||
EXPOSE 8080
|
||||
EXPOSE 7334
|
||||
CMD ["ngit-grasp"]
|
||||
```
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ This document compares ngit-grasp (this project) with ngit-relay (the reference
|
||||
┌────────────── ngit-grasp (Single Binary) ─────────────┐
|
||||
│ │
|
||||
│ ┌──────────────────────────────────────────────────┐ │
|
||||
│ │ hyper HTTP Server (:8080) │ │
|
||||
│ │ hyper HTTP Server (:7334) │ │
|
||||
│ │ - WebSocket upgrade for Nostr relay │ │
|
||||
│ │ - Git Smart HTTP handlers │ │
|
||||
│ │ - Landing page + metrics endpoint │ │
|
||||
|
||||
@@ -229,7 +229,7 @@ git ls-remote https://ngit.example.com/<npub>/<repo>.git
|
||||
|
||||
### Network
|
||||
- `bindAddress` - IP to bind to (default: "127.0.0.1")
|
||||
- `port` - Port to listen on (default: 8080)
|
||||
- `port` - Port to listen on (default: 7334)
|
||||
|
||||
### Storage
|
||||
- `dataDir` - Base directory for data (default: /var/lib/ngit-grasp-{name})
|
||||
|
||||
@@ -13,7 +13,7 @@ This guide shows how to configure Prometheus and Grafana to monitor ngit-grasp.
|
||||
First, verify that ngit-grasp is exposing metrics:
|
||||
|
||||
```bash
|
||||
curl http://localhost:8080/metrics
|
||||
curl http://localhost:7334/metrics
|
||||
```
|
||||
|
||||
You should see Prometheus-formatted metrics like:
|
||||
@@ -41,7 +41,7 @@ services.prometheus = {
|
||||
{
|
||||
job_name = "ngit-grasp";
|
||||
static_configs = [{
|
||||
targets = [ "localhost:8080" ]; # ngit-grasp bind address
|
||||
targets = [ "localhost:7334" ]; # ngit-grasp bind address
|
||||
}];
|
||||
scrape_interval = "15s";
|
||||
metrics_path = "/metrics";
|
||||
@@ -105,7 +105,7 @@ global:
|
||||
scrape_configs:
|
||||
- job_name: 'ngit-grasp'
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:8080'] # or your ngit-grasp host
|
||||
- targets: ['host.docker.internal:7334'] # or your ngit-grasp host
|
||||
metrics_path: /metrics
|
||||
```
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ nix develop -c cargo run
|
||||
|
||||
# In another terminal, run audit tool
|
||||
cd grasp-audit
|
||||
nix develop -c cargo run -- --url ws://127.0.0.1:8080
|
||||
nix develop -c cargo run -- --url ws://127.0.0.1:7334
|
||||
```
|
||||
|
||||
### For CI/CD
|
||||
@@ -424,7 +424,7 @@ nix develop -c cargo test --test nip01_compliance --test nip34_announcements
|
||||
**For deep compliance check:**
|
||||
```bash
|
||||
cd grasp-audit
|
||||
nix develop -c cargo run -- --url ws://127.0.0.1:8080
|
||||
nix develop -c cargo run -- --url ws://127.0.0.1:7334
|
||||
```
|
||||
|
||||
**Key points:**
|
||||
|
||||
@@ -110,7 +110,7 @@ use grasp_audit::client::AuditClient;
|
||||
use grasp_audit::audit::AuditConfig;
|
||||
|
||||
let config = AuditConfig::isolated();
|
||||
let client = AuditClient::new("ws://localhost:8080", config).await?;
|
||||
let client = AuditClient::new("ws://localhost:7334", config).await?;
|
||||
|
||||
// Create and send an event - cleanup tags are added automatically
|
||||
let event = client.event_builder()
|
||||
|
||||
@@ -25,20 +25,20 @@ Configuration is loaded at startup and validated before the server starts.
|
||||
|
||||
**Description:** Address and port for the HTTP server to bind to
|
||||
**Type:** String (IP:PORT format)
|
||||
**Default:** `127.0.0.1:8080`
|
||||
**Default:** `127.0.0.1:7334`
|
||||
**Required:** No
|
||||
|
||||
**Examples:**
|
||||
|
||||
```bash
|
||||
# Localhost only (development)
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:8080
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:7334
|
||||
|
||||
# All interfaces (production)
|
||||
NGIT_BIND_ADDRESS=0.0.0.0:8080
|
||||
NGIT_BIND_ADDRESS=0.0.0.0:7334
|
||||
|
||||
# IPv6
|
||||
NGIT_BIND_ADDRESS=[::1]:8080
|
||||
NGIT_BIND_ADDRESS=[::1]:7334
|
||||
|
||||
# Custom port
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:3000
|
||||
@@ -64,7 +64,7 @@ NGIT_BIND_ADDRESS=127.0.0.1:3000
|
||||
```bash
|
||||
NGIT_DOMAIN=gitnostr.com
|
||||
NGIT_DOMAIN=git.example.org
|
||||
NGIT_DOMAIN=localhost:8080 # Development only
|
||||
NGIT_DOMAIN=localhost:7334 # Development only
|
||||
```
|
||||
|
||||
**Used for:**
|
||||
@@ -77,7 +77,7 @@ NGIT_DOMAIN=localhost:8080 # Development only
|
||||
**Notes:**
|
||||
|
||||
- Must be accessible from the internet for production
|
||||
- Include port if non-standard (e.g., `localhost:8080`)
|
||||
- Include port if non-standard (e.g., `localhost:7334`)
|
||||
- Used in repository clone URLs: `https://{NGIT_DOMAIN}/{npub}/{repo}.git`
|
||||
|
||||
---
|
||||
@@ -1007,13 +1007,13 @@ For development, create a `.env` file in the project root:
|
||||
|
||||
```bash
|
||||
# .env file example
|
||||
NGIT_DOMAIN=localhost:8080
|
||||
NGIT_DOMAIN=localhost:7334
|
||||
NGIT_OWNER_NPUB=npub1alice...
|
||||
NGIT_RELAY_NAME="Development Relay"
|
||||
NGIT_RELAY_DESCRIPTION="Local development instance"
|
||||
NGIT_GIT_DATA_PATH=./data/git
|
||||
NGIT_RELAY_DATA_PATH=./data/relay
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:8080
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:7334
|
||||
RUST_LOG=debug
|
||||
```
|
||||
|
||||
@@ -1057,7 +1057,7 @@ NGIT_RELAY_NAME="GitNostr Public Relay"
|
||||
NGIT_RELAY_DESCRIPTION="Public GRASP relay for open source projects"
|
||||
NGIT_GIT_DATA_PATH=/var/lib/ngit-grasp/git
|
||||
NGIT_RELAY_DATA_PATH=/var/lib/ngit-grasp/relay
|
||||
NGIT_BIND_ADDRESS=0.0.0.0:8080
|
||||
NGIT_BIND_ADDRESS=0.0.0.0:7334
|
||||
RUST_LOG=info,ngit_grasp=debug
|
||||
```
|
||||
|
||||
@@ -1076,13 +1076,13 @@ RUST_LOG=info,ngit_grasp=debug
|
||||
|
||||
```bash
|
||||
# Development .env
|
||||
NGIT_DOMAIN=localhost:8080
|
||||
NGIT_DOMAIN=localhost:7334
|
||||
NGIT_OWNER_NPUB=npub1test...
|
||||
NGIT_RELAY_NAME="Dev Relay"
|
||||
NGIT_RELAY_DESCRIPTION="Local development"
|
||||
NGIT_GIT_DATA_PATH=./data/git
|
||||
NGIT_RELAY_DATA_PATH=./data/relay
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:8080
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:7334
|
||||
RUST_LOG=debug
|
||||
```
|
||||
|
||||
@@ -1124,7 +1124,7 @@ When multiple configuration sources exist:
|
||||
|
||||
```bash
|
||||
# .env file
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:8080
|
||||
NGIT_BIND_ADDRESS=127.0.0.1:7334
|
||||
|
||||
# Environment variable (overrides .env)
|
||||
NGIT_BIND_ADDRESS=0.0.0.0:3000 cargo run
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ let
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8080;
|
||||
default = 7334;
|
||||
description = "Port to listen on";
|
||||
};
|
||||
|
||||
|
||||
+5
-5
@@ -352,7 +352,7 @@ pub struct Config {
|
||||
pub relay_data_path: String,
|
||||
|
||||
/// Server bind address (IP:PORT)
|
||||
#[arg(long, env = "NGIT_BIND_ADDRESS", default_value = "127.0.0.1:8080")]
|
||||
#[arg(long, env = "NGIT_BIND_ADDRESS", default_value = "127.0.0.1:7334")]
|
||||
pub bind_address: String,
|
||||
|
||||
/// Database backend type
|
||||
@@ -678,13 +678,13 @@ impl Config {
|
||||
.expect("Failed to generate test nsec");
|
||||
|
||||
Self {
|
||||
domain: "localhost:8080".to_string(),
|
||||
domain: "localhost:7334".to_string(),
|
||||
relay_owner_nsec: Some(nsec),
|
||||
relay_name_override: Some("test relay".to_string()),
|
||||
relay_description: "test description".to_string(),
|
||||
git_data_path: "./test_data/git".to_string(),
|
||||
relay_data_path: "./test_data/relay".to_string(),
|
||||
bind_address: "127.0.0.1:8080".to_string(),
|
||||
bind_address: "127.0.0.1:7334".to_string(),
|
||||
database_backend: DatabaseBackend::Memory,
|
||||
metrics_enabled: true,
|
||||
metrics_connection_per_ip_abuse_threshold: 10,
|
||||
@@ -714,8 +714,8 @@ mod tests {
|
||||
#[test]
|
||||
fn test_default_values() {
|
||||
let config = Config::for_testing();
|
||||
assert_eq!(config.domain, "localhost:8080");
|
||||
assert_eq!(config.bind_address, "127.0.0.1:8080");
|
||||
assert_eq!(config.domain, "localhost:7334");
|
||||
assert_eq!(config.bind_address, "127.0.0.1:7334");
|
||||
// for_testing() uses Memory, but the actual default is Lmdb
|
||||
assert_eq!(config.database_backend, DatabaseBackend::Memory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user