Commit Graph

409 Commits

Author SHA1 Message Date
fb39cb3347 fix go.mod v0.31.1-bump 2025-11-27 22:07:32 +00:00
48b0b6984c Fix directory spider tag loss: size limits and validation
Some checks failed
Go / build-and-release (push) Has been cancelled
- Increase WebSocket message size limit from 500KB to 10MB to prevent
  truncation of large kind 3 follow list events (8000+ follows)
- Add validation in SaveEvent to reject kind 3 events without p tags
  before storage, preventing malformed events from buggy relays
- Implement CleanupKind3WithoutPTags() to remove existing malformed
  kind 3 events at startup
- Add enhanced logging showing tag count and event ID when rejecting
  invalid kind 3 events for better observability
- Create round-trip test proving binary tag encoding preserves p tags
  correctly through JSON→binary→JSON cycle
- Root cause: 500KB limit was truncating large follow lists during
  WebSocket receive, causing tags to be lost or incomplete
- Three-layer defense: prevent at gate (size), validate (save time),
  and cleanup (startup)

Files modified:
- app/handle-websocket.go: Increase DefaultMaxMessageSize to 10MB
- pkg/database/save-event.go: Add kind 3 validation with logging
- pkg/database/cleanup-kind3.go: New cleanup function
- pkg/database/cleanup-kind3_test.go: Round-trip test
- app/main.go: Invoke cleanup at startup
v0.31.1
2025-11-27 13:49:33 +00:00
7fedcd24d3 initial draft of hot reload policy 2025-11-27 06:31:34 +00:00
5fbe131755 bump to v0.31.0 directory spider
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.31.0
2025-11-27 00:03:23 +00:00
8757b41dd9 add directory spider 2025-11-27 00:02:14 +00:00
1810c8bef3 Fix binary tag value handling for e/p tags across database layer
Some checks failed
Go / build-and-release (push) Has been cancelled
- Update nostr library to v1.0.3 with improved binary tag support
- Replace tag.Value() calls with tag.ValueHex() to handle both binary and hex formats
- Add NormalizeTagValueForHash() for consistent filter tag normalization
- Update QueryPTagGraph to handle binary-encoded and hex-encoded pubkeys
- Fix tag matching in query-events.go using TagValuesMatchUsingTagMethods
- Add filter_utils.go with tag normalization helper functions
- Update delete operations in process-delete.go and neo4j/delete.go
- Fix ACL follows extraction to use ValueHex() for consistent decoding
- Add binary_tag_filter_test.go for testing tag value normalization
- Bump version to v0.30.3
v0.30.3
2025-11-26 21:16:46 +00:00
fad39ec201 Add serve mode, fix binary tags, document CLI tools, improve Docker
Some checks failed
Go / build-and-release (push) Has been cancelled
- Add 'serve' subcommand for ephemeral RAM-based relay at /dev/shm with
  open ACL mode for testing and benchmarking
- Fix e-tag and p-tag decoding to use ValueHex()/ValueBinary() methods
  instead of Value() which returns raw bytes for binary-optimized storage
- Document all command-line tools in readme.adoc (relay-tester, benchmark,
  stresstest, blossomtest, aggregator, convert, FIND, policytest, etc.)
- Switch Docker images from Alpine to Debian for proper libsecp256k1
  Schnorr signature and ECDH support required by Nostr
- Upgrade Docker Go version from 1.21 to 1.25
- Add ramdisk mode (--ramdisk) to benchmark script for eliminating disk
  I/O bottlenecks in performance measurements
- Add docker-compose.ramdisk.yml for tmpfs-based benchmark volumes
- Add test coverage for privileged policy with binary-encoded p-tags
- Fix blossom test to expect 200 OK for anonymous uploads when auth is
  not required (RequireAuth=false with ACL mode 'none')
- Update follows ACL to handle both binary and hex p-tag formats
- Grant owner access to all users in serve mode via None ACL
- Add benchmark reports from multi-relay comparison run
- Update CLAUDE.md with binary tag handling documentation
- Bump version to v0.30.2
v0.30.2
2025-11-26 09:52:29 +00:00
f1ddad3318 fix policy logic error caused by interface breach
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.30.1
2025-11-25 20:46:46 +00:00
0161825be8 bump for social graph feature for neo4j v0.30.0
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.30.0
2025-11-25 18:09:51 +00:00
6412edeabb implement preliminary implementation of graph data model 2025-11-25 18:08:44 +00:00
655a7d9473 update workflow to update web app bundle correctly
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.20
2025-11-25 15:41:01 +00:00
a03af8e05a self-detection elides self url at startup, handles multiple DNS pointers
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.19
2025-11-25 13:26:37 +00:00
1522bfab2e add relay self-connection via authed pubkey
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.18
2025-11-25 12:54:37 +00:00
a457d22baf update go.yml workflow 2025-11-25 12:12:08 +00:00
2b8f359a83 fix workflow to fetch libsecp256k1.so
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.17
2025-11-25 11:04:04 +00:00
2e865c9616 fix workflow to fetch libsecp256k1.so
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.16
2025-11-25 06:03:22 +00:00
7fe1154391 fix policy load failure to panic, remove fallback case
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.15
2025-11-25 05:49:05 +00:00
6e4f24329e fix silent fail of loading policy with panic, and bogus fallback logic 2025-11-24 20:24:51 +00:00
da058c37c0 blossom works fully correctly 2025-11-23 12:32:53 +00:00
1c376e6e8d migrate to new nostr library 2025-11-23 08:15:06 +00:00
86cf8b2e35 unignore files that should be there 2025-11-22 20:12:55 +00:00
ef51382760 optimize e and p tags 2025-11-22 19:40:48 +00:00
5c12c467b7 some more gitea 2025-11-21 22:40:03 +00:00
76e9166a04 fix paths 2025-11-21 21:49:50 +00:00
350b4eb393 gitea 2025-11-21 21:47:28 +00:00
b67f7dc900 fix policy to require auth and ignore all reqs before valid auth is made
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.14
2025-11-21 20:19:24 +00:00
fb65282702 develop registration ratelimit mechanism 2025-11-21 19:13:18 +00:00
ebe0012863 fix auth, read/white whitelisting and rule precedence, bump to v0.29.13
Some checks failed
Go / build-and-release (push) Has been cancelled
Policy System Verification & Testing (Latest Updates) Authentication & Security:

Verified policy system enforces authentication for all REQ and EVENT messages when enabled

Confirmed AUTH challenges are sent immediately on connection and repeated until authentication succeeds

Validated unauthenticated requests are silently rejected regardless of other policy rules

Access Control Logic:

Confirmed privileged flag only restricts read access (REQ queries), not write operations (EVENT submissions)

Validated read_allow and privileged use OR logic: users get access if EITHER they're in the allow list OR they're a party to the event (author/p-tag)
This design allows both explicit whitelisting and privacy for involved parties

Kind Whitelisting:

Verified kind filtering properly rejects unlisted events in all scenarios:

Explicit kind.whitelist: Only listed kinds accepted, even if rules exist for other kinds

Implicit whitelist (rules only): Only kinds with defined rules accepted

Blacklist mode: Blacklisted kinds rejected, others require rules

Added comprehensive test suite (10 scenarios) covering edge cases and real-world configurations
v0.29.13
2025-11-21 16:13:34 +00:00
917bcf0348 fix policy to ignore all req/events without auth 2025-11-21 15:28:07 +00:00
55add34ac1 add rely-sqlite to benchmark
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.12
2025-11-20 20:55:37 +00:00
00a6a78a41 fix cache to disregard subscription ids
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.11
2025-11-20 12:30:17 +00:00
1b279087a9 add vertexes between npubs and events, use for p tags 2025-11-20 09:16:54 +00:00
b7417ab5eb create new index that records the links between pubkeys, events, kinds, and inbound/outbound/author 2025-11-20 05:13:56 +00:00
d4e2f48b7e bump to v0.29.10
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.10
2025-11-19 13:08:00 +00:00
a79beee179 fixed and unified privilege checks across ACLs
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.9
2025-11-19 13:05:21 +00:00
f89f41b8c4 full benchmark run 2025-11-19 12:22:04 +00:00
be6cd8c740 fixed error comparing hex/binary in pubkey white/blacklist, complete neo4j and tests"
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.8
2025-11-19 11:25:38 +00:00
8b3d03da2c fix workflow setup
Some checks failed
Go / build-and-release (push) Has been cancelled
v0.29.7
2025-11-18 20:56:18 +00:00
5bcb8d7f52 upgrade to gitea workflows
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.29.6
2025-11-18 20:50:05 +00:00
b3b963ecf5 replace github workflows with gitea 2025-11-18 20:46:54 +00:00
d4fb6cbf49 fix handleevents not prompting auth for event publish with auth-required
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.29.4
2025-11-18 20:26:36 +00:00
d5c0e3abfc bump to v0.29.3
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.29.3
2025-11-18 18:22:39 +00:00
1d4d877a10 fix auth-required not sending immediate challenge, benchmark leak 2025-11-18 18:21:11 +00:00
038d1959ed add dgraph backend to benchmark suite with safe type assertions for multi-backend support 2025-11-17 16:52:38 +00:00
86481a42e8 initial draft of neo4j database driver 2025-11-17 08:19:44 +00:00
beed174e83 make query cache normalize filters so same query different order filters are cache hits
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.29.2
2025-11-17 00:04:21 +00:00
511b8cae5f improve query cache with zstd level 9
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
v0.29.1
2025-11-16 20:52:18 +00:00
dfe8b5f8b2 add a filter query cache 512mb that stores already decoded recent query results
this should improve performance noticeably for typical kind 1 client queries
2025-11-16 18:29:53 +00:00
95bcf85ad7 optimizing badger cache, won a 10-15% improvement in most benchmarks 2025-11-16 15:07:36 +00:00
9bb3a7e057 totally off topic little document about ion drives 2025-11-16 00:00:04 +00:00