ngit-grasp configuration
This reference lists all 51 public runtime configuration options exported by ngit-grasp.
Upcoming operator surface
This page is generated from an unreleased ngit-grasp commit. Its interface may change before the next release.
Loading behaviour
ngit-grasp automatically reads a .env file from its working directory. Variables already present in the process environment take precedence over .env values.
Configuration changes require a process restart. See constraint rules for relationships that cannot be expressed as one option, and secret precedence for relay-owner key discovery.
Options
NGIT_ARCHIVE_ALL— Enable GRASP-05 archive mode: accept all announcements regardless of listing (WARNING: storage risk)- CLI:
--archive-all - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules:
archive-services-with-archive-all,archive-read-only-requires-archive,repository-whitelist-with-read-only-archive
- CLI:
NGIT_ARCHIVE_GRASP_SERVICES— GRASP-05 archive GRASP services: comma-separated list of GRASP server domains to archive When set, archives all repositories from the specified GRASP server domains Mutually exclusive with archive_all and archive_whitelist- CLI:
--archive-grasp-services <ARCHIVE_GRASP_SERVICES> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules:
archive-services-with-archive-all,archive-services-with-whitelist,archive-read-only-requires-archive,repository-whitelist-with-read-only-archive
- CLI:
NGIT_ARCHIVE_READ_ONLY— Archive read-only mode: relay is a read-only sync of archived repositories Defaults to true if archive_all, archive_whitelist, or archive_grasp_services is set, false otherwise Throws error if set to true without archive_all, archive_whitelist, or archive_grasp_services- CLI:
--archive-read-only <ARCHIVE_READ_ONLY> - Runtime: scope
serve; default —; valuestrue,false; reloadrestart required - Rules:
archive-read-only-requires-archive,repository-whitelist-with-read-only-archive
- CLI:
NGIT_ARCHIVE_WHITELIST— GRASP-05 archive whitelist: comma-separated list of npub/identifier/npub/identifier entries Formats: "npub1...", "npub1.../identifier", "identifier"- CLI:
--archive-whitelist <ARCHIVE_WHITELIST> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules:
archive-services-with-whitelist,archive-read-only-requires-archive,repository-whitelist-with-read-only-archive
- CLI:
NGIT_BASE_PATH— Public URL path where this instance is mounted. Use/for a domain-root deployment or an absolute path such as/graspwhen sharing a domain with another service.- CLI:
--base-path <BASE_PATH> - Runtime: scope
serve; default/; values —; reloadrestart required - Rules:
base-path-normalized
- CLI:
NGIT_BIND_ADDRESS— Server bind address (IP:PORT)- CLI:
--bind-address <BIND_ADDRESS> - Runtime: scope
serve; default127.0.0.1:7334; values —; reloadrestart required - Rules:
bind-address-format
- CLI:
NGIT_BLACKLIST_AUTO_RESTORE— Automatically restore blacklist-deleted repositories on startup when they are no longer blacklisted and still within holding retention- CLI:
--blacklist-auto-restore - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules: —
- CLI:
NGIT_DATABASE_BACKEND— Database backend type- CLI:
--database-backend <DATABASE_BACKEND> - Runtime: scope
serve; defaultlmdb; valueslmdb,memory; reloadrestart required - Rules: —
- CLI:
NGIT_DELETION_REQUEST_DISRESPECTOR— Deletion request disrespector: ignore NIP-09 and NIP-62 requests (archival mode) Whentrue, the relay stores incoming NIP-09 (kind 5) deletion requests and NIP-62 request-to-vanish events but does NOT act on them: their targets remain fully accessible. This makes the relay an archival server, preventing "left-pad" scenarios by ensuring at least some relays preserve deleted content. This setting ONLY affects NIP-09 and NIP-62 user-initiated requests. Policy-driven blacklist/whitelist deletion flows still run because they enforce local relay serving policy rather than client requests. Whentrue, NIP-09 ("deletion") and NIP-62 ("request to vanish") are NOT advertised in the NIP-11 supported NIPs list so clients can discover that the relay does not honour either request type.- CLI:
--deletion-request-disrespector - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules: —
- CLI:
NGIT_DELETION_REQUEST_RETENTION_UNUSED_SERVED_SECS— How long an unused deletion or vanish request remains served after relay-observed first_seen_at- CLI:
--deletion-request-retention-unused-served-secs <DELETION_REQUEST_RETENTION_UNUSED_SERVED_SECS> - Runtime: scope
serve; default2592000; values —; reloadrestart required - Rules:
deletion-retention-durations-positive,unused-deletion-retention-sum
- CLI:
NGIT_DELETION_REQUEST_RETENTION_UNUSED_UNSERVED_GATING_ADDITIONAL_SECS— Additional time an unused deletion or vanish request remains unserved but eligible to gate- CLI:
--deletion-request-retention-unused-unserved-gating-additional-secs <DELETION_REQUEST_RETENTION_UNUSED_UNSERVED_GATING_ADDITIONAL_SECS> - Runtime: scope
serve; default15552000; values —; reloadrestart required - Rules:
deletion-retention-durations-positive,unused-deletion-retention-sum
- CLI:
NGIT_DELETION_REQUEST_RETENTION_USED_SERVED_AFTER_LAST_USED_SECS— Normal-mode time a used deletion or vanish request remains served after last_used_at- CLI:
--deletion-request-retention-used-served-after-last-used-secs <DELETION_REQUEST_RETENTION_USED_SERVED_AFTER_LAST_USED_SECS> - Runtime: scope
serve; default23328000; values —; reloadrestart required - Rules:
deletion-retention-durations-positive,used-deletion-retention-sum
- CLI:
NGIT_DELETION_REQUEST_RETENTION_USED_UNSERVED_GATING_ADDITIONAL_SECS— Additional normal-mode time a used request remains unserved but continues gating after serving ends- CLI:
--deletion-request-retention-used-unserved-gating-additional-secs <DELETION_REQUEST_RETENTION_USED_UNSERVED_GATING_ADDITIONAL_SECS> - Runtime: scope
serve; default7776000; values —; reloadrestart required - Rules:
deletion-retention-durations-positive,used-deletion-retention-sum
- CLI:
NGIT_DOMAIN— Domain where this instance is hosted (required, used in GRASP validation)- CLI:
--domain <DOMAIN> - Runtime: scope
serve; default —; values —; reloadrestart required - Rules: —
- CLI:
NGIT_EVENT_BLACKLIST— Event blacklist: comma-separated list of npubs whose events are rejected All events from these authors are blocked from both relay storage and purgatory- CLI:
--event-blacklist <EVENT_BLACKLIST> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules: —
- CLI:
NGIT_GIT_DATA_PATH— Path to store Git repositories Path to the git data directory (contains bare repositories). Defaults to./data/git(same default as the relay itself). Git data path containing the.archivesubtree Git data path containing the.graspfamily storage directory- CLI:
--git-data-path <GIT_DATA_PATH> - Runtime: scope
shared; default./data/git; values —; reloadrestart required - Rules: —
- CLI:
NGIT_GRASP06_ENABLE— Enable GRASP-06 contributor PR submission endpoint at /prs/<npub>/<identifier>.git When enabled, the relay exposes an unauthenticated PR submission endpoint at/prs/<npub>/<identifier>.gitthat accepts pushes ofrefs/nostr/<event-id>from any contributor. Security relies on the signed PR/PR-Update events the refs reference, not on HTTP-level auth. Default: false. This is an opt-in feature that adds an unauthenticated write surface; operators must understand the tradeoffs (see GRASP-06 spec anddocs/explanation/grasp-06-contributor-pr-submission.md) before enabling it.- CLI:
--grasp06-enable - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules:
private-mode-with-grasp06
- CLI:
NGIT_HOLDING_CLEANUP_INTERVAL_SECS— Interval in seconds between background holding cleanup passes- CLI:
--holding-cleanup-interval-secs <HOLDING_CLEANUP_INTERVAL_SECS> - Runtime: scope
serve; default86400; values —; reloadrestart required - Rules:
holding-cleanup-interval-positive
- CLI:
NGIT_HOLDING_RETENTION_SECS— Retention window in seconds for deleted events kept in holding DB- CLI:
--holding-retention-secs <HOLDING_RETENTION_SECS> - Runtime: scope
serve; default7776000; values —; reloadrestart required - Rules:
holding-retention-positive
- CLI:
NGIT_LOG_LEVEL— Application log level or an explicit tracing filter expression. Bare levels keep dependency logging at warn- CLI:
--log-level <LOG_LEVEL> - Runtime: scope
serve; defaultinfo; values —; reloadrestart required - Rules: —
- CLI:
NGIT_MAX_CONNECTIONS— Maximum total connections to the relay (default: unlimited, defers to OS/infrastructure limits)- CLI:
--max-connections <MAX_CONNECTIONS> - Runtime: scope
serve; default —; values —; reloadrestart required - Rules: —
- CLI:
NGIT_METRICS_CONNECTION_PER_IP_ABUSE_THRESHOLD— Connections per IP before flagging as potential abuse in metrics (display only, no rate limiting)- CLI:
--metrics-connection-per-ip-abuse-threshold <METRICS_CONNECTION_PER_IP_ABUSE_THRESHOLD> - Runtime: scope
serve; default10; values —; reloadrestart required - Rules: —
- CLI:
NGIT_METRICS_ENABLED— Enable Prometheus metrics endpoint- CLI:
--metrics-enabled - Runtime: scope
serve; defaulttrue; values —; reloadrestart required - Rules: —
- CLI:
NGIT_METRICS_TOP_N_REPOS— Number of top bandwidth repos to track in metrics- CLI:
--metrics-top-n-repos <METRICS_TOP_N_REPOS> - Runtime: scope
serve; default10; values —; reloadrestart required - Rules: —
- CLI:
NGIT_NAUGHTY_LIST_EXPIRATION_HOURS— Hours before removing relay from naughty list (default: 12) Relays with persistent infrastructure issues (DNS, TLS, protocol errors) are tracked separately and retried after this expiration period- CLI:
--naughty-list-expiration-hours <NAUGHTY_LIST_EXPIRATION_HOURS> - Runtime: scope
serve; default12; values —; reloadrestart required - Rules: —
- CLI:
NGIT_PRIVATE_MEMBERS— Permanently configured GRASP-08 members as comma-separated npubs. The effective whitelist also includes NIP-11 owners of relays referenced by accepted repository announcements. Required and fail-closed when private mode is enabled.- CLI:
--private-members <PRIVATE_MEMBERS> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules:
private-mode-requires-members,private-members-require-mode,private-members-format
- CLI:
NGIT_PRIVATE_MODE— Enable GRASP-08 private-service authentication. When enabled, every Nostr WebSocket session must authenticate with NIP-42 and every standard Git Smart HTTP request must carry the GRASP-08 repository-scoped NIP-98 credential.- CLI:
--private-mode - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules:
private-mode-requires-members,private-members-require-mode,private-mode-with-grasp06
- CLI:
NGIT_PRIVATE_PUBLIC_ORIGIN— Canonical externally visible origin used by GRASP-08 NIP-98utags. Set this when TLS terminates upstream or a non-loopback deployment uses plain HTTP. When empty, the origin is inferred fromNGIT_DOMAIN.- CLI:
--private-public-origin <PRIVATE_PUBLIC_ORIGIN> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules:
private-public-origin-format
- CLI:
NGIT_REJECTED_COLD_INDEX_EXPIRY_SECS— Cold index expiry in seconds for rejected announcements (default: 604800 = 7 days) Stores metadata only to prevent repeated downloads of rejected events- CLI:
--rejected-cold-index-expiry-secs <REJECTED_COLD_INDEX_EXPIRY_SECS> - Runtime: scope
serve; default604800; values —; reloadrestart required - Rules: —
- CLI:
NGIT_REJECTED_HOT_CACHE_DURATION_SECS— Hot cache duration in seconds for rejected announcements (default: 120 = 2 minutes) Stores full event objects for immediate re-processing when dependencies resolve. Too short (<30s): Miss events from slow relays Too long (>5min): Waste memory- CLI:
--rejected-hot-cache-duration-secs <REJECTED_HOT_CACHE_DURATION_SECS> - Runtime: scope
serve; default120; values —; reloadrestart required - Rules: —
- CLI:
NGIT_RELAY_DATA_PATH— Path to store Nostr relay data Path to the LMDB relay data directory (contains the nostr event database). Defaults to./data/relay(same default as the relay itself). Relay data path containing the holding LMDB directory- CLI:
--relay-data-path <RELAY_DATA_PATH> - Runtime: scope
shared; default./data/relay; values —; reloadrestart required - Rules: —
- CLI:
NGIT_RELAY_DESCRIPTION— Relay description for NIP-11 information document- CLI:
--relay-description <RELAY_DESCRIPTION> - Runtime: scope
serve; defaultGit Nostr Relay - a grasp implementation; values —; reloadrestart required - Rules: —
- CLI:
NGIT_RELAY_FILTER_LIMIT— Per-filter result cap, including when a filter omits limit- CLI:
--relay-filter-limit <RELAY_FILTER_LIMIT> - Runtime: scope
serve; default500; values —; reloadrestart required - Rules:
relay-limits-positive
- CLI:
NGIT_RELAY_MAX_EVENT_SIZE_BYTES— Maximum serialized event size in bytes- CLI:
--relay-max-event-size-bytes <RELAY_MAX_EVENT_SIZE_BYTES> - Runtime: scope
serve; default196608; values —; reloadrestart required - Rules:
relay-limits-positive,relay-event-size-websocket-limit
- CLI:
NGIT_RELAY_MAX_SUBSCRIPTIONS— Maximum active REQ subscriptions per WebSocket connection- CLI:
--relay-max-subscriptions <RELAY_MAX_SUBSCRIPTIONS> - Runtime: scope
serve; default500; values —; reloadrestart required - Rules:
relay-limits-positive
- CLI:
NGIT_RELAY_NAME— Relay name for NIP-11 information document (defaults to "${domain} grasp relay")- CLI:
--relay-name <RELAY_NAME_OVERRIDE> - Runtime: scope
serve; default —; values —; reloadrestart required - Rules: —
- CLI:
NGIT_RELAY_OWNER_NSEC(secret) — Read the relay_owner_nsec systemd credential when it exists. Read the process environment, including an automatically loaded .env file; an existing process variable wins over .env. Read .relay-owner.nsec from the working directory, or generate it with owner-only permissions when absent.- CLI: —
- Runtime: scope
serve; default —; values —; reloadrestart required - Rules:
relay-owner-key-format
NGIT_REPOSITORY_BLACKLIST— Repository blacklist: comma-separated list of npub/identifier/npub/identifier entries to reject Formats: "npub1...", "npub1.../identifier", "identifier" Blacklist takes precedence over all whitelists (archive and repository)- CLI:
--repository-blacklist <REPOSITORY_BLACKLIST> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules: —
- CLI:
NGIT_REPOSITORY_WHITELIST— Repository whitelist: comma-separated list of npub/identifier/npub/identifier entries Formats: "npub1...", "npub1.../identifier", "identifier" When set, only announcements matching the whitelist AND listing the service are accepted- CLI:
--repository-whitelist <REPOSITORY_WHITELIST> - Runtime: scope
serve; defaultempty string; values —; reloadrestart required - Rules:
repository-whitelist-with-read-only-archive
- CLI:
NGIT_STARTUP_INTEGRITY_IDENTIFIERS— Restrict automatic startup integrity passes to these repository identifiers. Empty by default, which checks every installed identifier family. This is intended only for staged validation before a full production sweep.- CLI:
--startup-integrity-identifiers <STARTUP_INTEGRITY_IDENTIFIERS> - Runtime: scope
serve; default —; values —; reloadrestart required - Rules:
startup-integrity-identifiers-valid,startup-integrity-identifiers-unique
- CLI:
NGIT_SYNC_ALLOW_NON_GLOBAL_TARGETS— Allow event-directed sync targets that are not globally reachable (default: false) Repository announcements and PR events are untrusted; by default their relay and clone URLs may only point at globally reachable hosts. Loopback, private, link-local and other special-purpose addresses, local hostnames, and hosts resolving to such addresses are rejected before any outbound connection or git fetch (SSRF protection). Setting this to true disables the reachability checks. Intended only for integration tests and closed development networks; production relays must leave it false. The operator-configured bootstrap relay is always allowed regardless of this setting.- CLI:
--sync-allow-non-global-targets - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_BASE_BACKOFF_SECS— Base backoff time in seconds for relay reconnection (default: 5) Used for exponential backoff: base * 2^(failures-1) Set to 1 for faster test cycles Note: The connection timeout is capped at this value- CLI:
--sync-base-backoff-secs <SYNC_BASE_BACKOFF_SECS> - Runtime: scope
serve; default5; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_BOOTSTRAP_RELAY_URL— URL of bootstrap relay to sync from on startup (optional) Sync discovers additional relays from repository announcements that list our service If no scheme is provided (wss:// or ws://), wss:// is assumed Examples: "relay.example.com" -> "wss://relay.example.com", "wss://relay.example.com" -> unchanged- CLI:
--sync-bootstrap-relay-url <SYNC_BOOTSTRAP_RELAY_URL> - Runtime: scope
serve; default —; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_DISABLE_NEGENTROPY— Disable NIP-77 negentropy sync (default: false) When enabled, sync will use REQ+EOSE instead of negentropy for history sync. Primarily useful for testing that sync works without negentropy support- CLI:
--sync-disable-negentropy - Runtime: scope
serve; defaultfalse; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS— Interval in seconds for checking disconnected relays and attempting reconnection (default: 60) Set to lower value for faster reconnection testing- CLI:
--sync-disconnect-check-interval-secs <SYNC_DISCONNECT_CHECK_INTERVAL_SECS> - Runtime: scope
serve; default60; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_MAX_BACKOFF_SECS— Maximum backoff time in seconds for sync relay reconnection (default: 3600 = 1 hour)- CLI:
--sync-max-backoff-secs <SYNC_MAX_BACKOFF_SECS> - Runtime: scope
serve; default3600; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_PLUS_ENABLED— Enable GRASP-03 Sync+ mailbox discovery on top of proactive GRASP-02 sync- CLI:
--sync-plus-enabled <SYNC_PLUS_ENABLED> - Runtime: scope
serve; defaulttrue; valuestrue,false; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_PLUS_FALLBACK_RELAYS— Comma-separated inbox fallbacks for eligible authors whose NIP-65 relay list is absent- CLI:
--sync-plus-fallback-relays <SYNC_PLUS_FALLBACK_RELAYS> - Runtime: scope
serve; defaultwss://relay.ditto.pub,wss://relay.damus.io,wss://nos.lol,wss://relay.primal.net; values —; reloadrestart required - Rules: —
- CLI:
NGIT_SYNC_RECURSIVE_DESCENDANT_LIMIT— Soft limit on recursive query-frontier members below each event which directly tags a repository root. Direct root-tagging events are not counted- CLI:
--sync-recursive-descendant-limit <SYNC_RECURSIVE_DESCENDANT_LIMIT> - Runtime: scope
serve; default500; values —; reloadrestart required - Rules:
sync-descendant-limit-positive
- CLI:
NGIT_TRUSTED_PROXY_CIDRS— Proxy address ranges allowed to supply client IP forwarding headers. Empty by default so forwarded headers from direct clients are ignored.- CLI:
--trusted-proxy-cidrs <TRUSTED_PROXY_CIDRS> - Runtime: scope
serve; default —; values —; reloadrestart required - Rules: —
- CLI:
NGIT_USER_INDEX_RELAYS— Comma-separated relays used to publish the relay-owner identity and to discover eligible accepted repository participants' NIP-65 relay lists- CLI:
--user-index-relays <USER_INDEX_RELAYS> - Runtime: scope
serve; defaultwss://purplepag.es,wss://index.hzrd149.com,wss://indexer.coracle.social; values —; reloadrestart required - Rules: —
- CLI: