diff --git a/.env.example b/.env.example index fb954c0..707efd4 100644 --- a/.env.example +++ b/.env.example @@ -23,8 +23,8 @@ # Server bind address (IP:PORT) # CLI: --bind-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) 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 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 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 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"] ``` 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 ┌────────────── 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 │ │ 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//.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}) 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. 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 ``` 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 # 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:** 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; 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() 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. **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 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 port = mkOption { type = types.port; - default = 8080; + default = 7334; description = "Port to listen on"; }; 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 { 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); }