Commit Graph

15 Commits

Author SHA1 Message Date
fd76013c10 refactor(tests): replace bytes imports with orly.dev/pkg/utils globally
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- pkg/crypto/ec/ecdsa/signature_test.go
  - Removed `bytes`; added `orly.dev/pkg/utils`.

- pkg/encoders/filter/filter_test.go
  - Removed `bytes`; added `orly.dev/pkg/utils`.

- pkg/database/query-for-kinds-authors-tags_test.go
  - Added `orly.dev/pkg/utils`.
  - Changed `idTsPk` type from `[]store.IdPkTs` to `[]*store.IdPkTs`.

- pkg/version/version
  - Bumped version from `v0.8.0` to `v0.8.1`.

- pkg/database/fetch-event-by-serial_test.go
  - Added `orly.dev/pkg/utils`.

- pkg/encoders/filters/filters_test.go
  - Removed `bytes`; added `orly.dev/pkg/utils`.

- pkg/database/query-for-kinds_test.go
  - Added `orly.dev/pkg/utils`.
  - Changed `idTsPk` type from `[]store.IdPkTs` to `[]*store.IdPkTs`.

- pkg/database/get-serials-by-range_test.go
  - Added `orly.dev/pkg/utils`.

- pkg/crypto/ec/base58/base58_test.go
  - Removed `bytes`; added `orly.dev/pkg/utils`.

- pkg/database/query-events-multiple-param-replaceable_test.go
  - Removed `bytes`; added `orly.dev/pkg/utils`.

... and additional test files updated to address similar import changes or type adjustments.
2025-08-17 18:04:44 +01:00
02bf704e28 add fast bytes compare and start revising QueryForIds 2025-08-17 15:24:38 +01:00
dda39de5a5 refactor logging to use closures for intensive tasks
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
2025-08-15 22:27:16 +01:00
f3f933675e fix a lot of tests 2025-08-08 07:27:01 +01:00
9c8ff2976d backporting relay client and pool from latest go-nostr 2025-08-06 22:18:26 +01:00
109326dfa3 Merge remote-tracking branch 'origin/main' 2025-08-05 23:06:24 +01:00
b74f4757e7 refactor: Simplify NWC protocol structures and update method handling
- cmd/lerproxy/app/bufpool.go
  - Removed bufferPool-related code and `Pool` struct

- cmd/nwcclient/main.go
  - Renamed `Method` to `Capability` for clarity in method handling

- pkg/utils/values/values.go
  - Added utility functions to return pointers for various types

- pkg/utils/pointers/pointers.go
  - Revised documentation to reference `utils/values` package for pointer utilities

- pkg/protocol/nwc/types.go
  - Replaced redundant types and structures with simplified versions
  - Introduced dedicated structs for `MakeInvoice`, `PayInvoice`, and related results
  - Refactored `Transaction` and its fields for consistent type usage

- pkg/protocol/nwc/uri.go
  - Added `ParseConnectionURI` function for URI parsing and validation

- pkg/protocol/nwc/client.go
  - Refactored `Client` struct to improve key management and relay handling
  - Introduced `Request` struct for generic method invocation payloads
2025-08-05 20:18:32 +01:00
fff61ceca1 fmt 2025-08-05 14:09:15 -04:00
1641d18993 Add IP blocking with authentication-based unblocking and offense tracking
- pkg/protocol/socketapi/handleAuth.go
  - Added import for "orly.dev/pkg/utils/iptracker"
  - Added logic to call iptracker.Global.Authenticate() on successful authentication
- pkg/protocol/openapi/event.go
  - Added logic to call iptracker.Global.Authenticate() on successful authentication
- pkg/utils/iptracker/iptracker.go
  - Introduced offense tracking and block duration calculation based on offense count
  - Added Authenticate method to remove blocks upon successful authentication
  - Modified isBlockedNoLock to always return true when an IP is blocked
  - Added HasBlockDurationPassed, GetBlockDuration, and Reset methods
- pkg/version/version
  - Bumped version number from v0.4.4 to v0.4.5
2025-08-02 12:30:47 +01:00
eab5d236db Add IP blocking based on failed authentication attempts
- pkg/protocol/socketapi/socketapi.go
  - Added import for "orly.dev/pkg/utils/iptracker"
  - Added logic to check if an IP is blocked and reject the connection if it is
- pkg/protocol/socketapi/handleEvent.go
  - Added imports for "orly.dev/pkg/utils/iptracker" and "time"
  - Added logic to check if an IP is blocked, send a notice to the client, and close the connection if it is
  - Added logic to record failed authentication attempts and block IPs that exceed the threshold
- pkg/protocol/openapi/event.go
  - Added imports for "orly.dev/pkg/utils/iptracker" and "time"
  - Added logic to check if an IP is blocked and return a forbidden error if it is
  - Added logic to record failed authentication attempts and return appropriate errors based on whether the IP is blocked or not
- pkg/utils/iptracker/iptracker.go
  - Created new package with functionality to track and block IPs based on failed authentication attempts
- pkg/version/version
  - Bumped version number from v0.4.3 to v0.4.4
2025-08-02 12:01:37 +01:00
c62d685fa4 implement cluster replication
todo: need to add chain of senders in a header to a header to prevent unnecessary sends
2025-07-31 15:55:07 +01:00
0544159d4b added fetch of metadata and relay lists, and private flag to stop spider fetching 2025-07-20 11:42:39 +01:00
681cdb3a64 Standardize parameter/return value comments in protocol/socketapi package
- Updated `pkg/protocol/socketapi/handleClose.go` to use "# Parameters" and "# Return Values" for consistent comment formatting
- Updated `pkg/protocol/socketapi/handleReq.go` with standardized parameter and return value documentation
- Modified `pkg/interfaces/relay/interface.go` to align comment style with parameter/return value sections
- Standardized comments in `pkg/protocol/socketapi/pinger.go` using "# Parameters" format
- Improved comment structure in `pkg/protocol/socketapi/socketapi.go` for parameter documentation
- Updated `pkg/protocol/socketapi/handleEvent.go` with consistent return value comment formatting
2025-07-19 14:19:54 +01:00
1d18425677 fixed missing bits
- **readme.adoc**:
  - Updated contact information with nostr profile for better user engagement.
2025-07-17 13:30:34 +01:00
fc68bcf3cb moved everything into pkg/ 2025-07-17 13:18:55 +01:00