Commit Graph

215 Commits

Author SHA1 Message Date
54f65d8740 Enhance relay testing and event handling
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated TestRelay to include a wait mechanism for relay readiness, improving test reliability.
- Refactored startTestRelay to return the assigned port, allowing dynamic port assignment.
- Added timestamp validation in HandleEvent to reject events with timestamps more than one hour in the future.
- Introduced channels for handling OK and COUNT messages in the Client struct, improving message processing.
- Updated tests to reflect changes in event timestamp handling and increased wait times for event processing.
- Bumped version to v0.20.6 to reflect these enhancements.
2025-10-30 19:12:11 +00:00
ba2d35012c Enhance WebSocket connection management and error handling
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Set initial read deadline for connections to prevent premature timeouts on idle connections.
- Improved pong and ping handlers to extend read deadlines and handle timeout errors more effectively.
- Refined error logging for connection issues, distinguishing between timeouts and connection errors to enhance debugging.
- Updated subscriber delivery logic to handle timeouts gracefully, allowing for potential recovery without immediate disconnection.
2025-10-30 18:32:03 +00:00
80ab3caa5f Implement policy-based event filtering and add integration tests
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Enhanced the HandleReq function to incorporate policy checks for privileged events, ensuring only authorized users can access sensitive data.
- Introduced a new integration test suite for policy filtering, validating the behavior of event access based on user authentication and policy rules.
- Added a script to automate the policy filter integration tests, improving testing efficiency and reliability.
- Updated version to v0.20.2 to reflect the new features and improvements.
2025-10-30 17:51:15 +00:00
62f244d114 Refactor event handling and testing utilities
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated the HandleReq function to improve event filtering logic, ensuring that privileged events are consistently checked against user access levels.
- Refactored event deduplication to utilize filtered events instead of all events, enhancing performance and clarity.
- Enhanced test utilities by generating keypairs for event creation, ensuring proper signing and validation in tests.
- Updated various test cases to use the new event creation methods, improving reliability and maintainability of tests.
- Bumped version to reflect changes made.
2025-10-30 15:53:02 +00:00
88ebf6eccc Update WebSocket implementation to use Gorilla WebSocket library
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Replaced the existing `github.com/coder/websocket` package with `github.com/gorilla/websocket` for improved functionality and compatibility.
- Adjusted WebSocket connection handling, including message reading and writing, to align with the new library's API.
- Enhanced error handling and logging for WebSocket operations.
- Bumped version to v0.20.0 to reflect the changes made.
2025-10-30 15:20:39 +00:00
4f97cb9a42 Improve error handling and logging in message processing
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated HandleMessage function to include the actual message content in error notices for invalid messages, enhancing clarity for debugging.
- Added nil check in Value method of tag encoder to prevent potential nil pointer dereference.
- Refactored tag handling in spider to utilize hex-encoded pubkeys for improved compatibility and clarity in filter creation.
- bump to v0.19.10
2025-10-28 20:26:09 +00:00
f5d13a6807 Update error handling and logging in message processing
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Modified the HandleMessage function to avoid logging actual message content and instead send generic error notices to clients for invalid or malformed messages, enhancing security by preventing exposure of binary data.
- Updated the NostrEscape function to escape all control characters to ensure valid JSON, preventing parsing errors with binary data.
- Adjusted policy checks to handle hex-encoded pubkeys correctly, ensuring compatibility with the updated encoding scheme.
- Introduced blackout period for relay connections after exceeding maximum reconnection delays, improving connection stability and management.
2025-10-28 19:12:02 +00:00
7906bb2295 Add WebSocket Connection Testing Scripts
- Introduced two new test scripts: `test-relay-connection.js` and `test-websocket-close.js` to verify WebSocket connection stability and closure behavior.
- `test-relay-connection.js` tests multiple connections, monitors their open/close events, and analyzes premature closures.
- `test-websocket-close.js` focuses on connection closure issues with concurrent connections and logs results for connected, closed, and error states.
- Both scripts utilize the NostrWebSocket from the @nostr-dev-kit/ndk package for testing purposes.
2025-10-28 18:42:18 +00:00
50a8b39ea3 fix broken pprof web by removing for now 2025-10-28 13:32:30 +00:00
f4358eeee0 Enhance Event Loading Logic and Update Permissions
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated event loading logic in App.svelte to reset the attempt flag when toggling filters or switching tabs, preventing infinite load loops.
- Modified role-based permissions to include "read" access for viewing events, ensuring users with "read", "write", "admin", or "owner" roles can access the event list.
- Adjusted alert messages to reflect the updated permission structure.
- Incremented the version number to v0.19.5 to reflect these changes.
2025-10-27 13:25:18 +00:00
ebb11686d5 Update Role-Based Permissions and Increment Version
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Modified role-based permissions in App.svelte and EventsView.svelte to include "read" access for viewing events, enhancing user access control.
- Updated conditional rendering logic to reflect the new permission structure, ensuring users with "read", "write", "admin", or "owner" roles can view events.
- Incremented the version number to v0.19.4 to reflect these changes.
2025-10-27 11:59:54 +00:00
d4f4f2a186 Implement New Views and Refactor App Structure
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Added new components: Header, Sidebar, ExportView, ImportView, EventsView, ComposeView, RecoveryView, SprocketView, and SearchResultsView to enhance the application's functionality and user experience.
- Updated App.svelte to integrate the new views and improve the overall layout.
- Refactored existing components for better organization and maintainability.
- Adjusted CSS styles for improved visual consistency across the application.
- Incremented version number to v0.19.3 to reflect the latest changes and additions.
2025-10-25 23:03:34 +01:00
9abcb32030 Refactor Event Signing and Update Test Cases
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Changed the event signing method in App.svelte from `sign` to `signEvent` for clarity and consistency.
- Updated the privileged events test to replace `PrivateDirectMessage` with `DirectMessage`, aligning with the latest event kind definitions.
- Adjusted the bundle.js and bundle.js.map files to reflect the latest build changes and optimizations.
2025-10-25 20:45:36 +01:00
fe0ed11ce4 Enhance App Functionality with Role-Based Permissions and UI Improvements
- Introduced a new permission menu and role view settings to manage user access more effectively.
- Updated tab filtering logic to accommodate role-based permissions, ensuring users see only relevant options based on their roles.
- Enhanced the App.svelte component with new CSS styles for the view-as section, improving user experience and visual consistency.
- Added debug logging for tab filtering to assist in development and troubleshooting.
- Incremented the version number to reflect the latest changes and improvements.
2025-10-25 20:37:18 +01:00
5452da6ecc Update IndexedDB Handling and Enhance App Functionality
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Modified the NostrClient's publish method to allow for specific relay usage and added event storage in IndexedDB.
- Introduced a debug function for IndexedDB to inspect stored events and their counts by kind.
- Updated the App.svelte component to expose the debug function globally for easier access during development.
- Enhanced the CSS styles for better user feedback on export results and status messages.
- Incremented the IndexedDB version to accommodate new indexes and improve event storage management.
- Updated the version number to v0.19.1.
2025-10-25 19:26:31 +01:00
c5ff2c648c Refactor Nostr Client and Update Dependencies
- Replaced NDKPrivateKeySigner with PrivateKeySigner from applesauce-signers for improved signing functionality.
- Updated the Nostr client implementation to utilize nostr-tools for event management and connection pooling.
- Enhanced event fetching logic to support multiple versions of replaceable events based on limit parameters.
- Updated package dependencies in package.json and bun.lock, including the addition of applesauce-core and applesauce-signers.
- Refined event kind definitions and improved documentation for clarity and consistency with NIP specifications.
- Adjusted CSS styles in bundle.css for better visual consistency across components.
2025-10-25 17:27:25 +01:00
5652cec845 Refactor NIP-XX Document and Protocol Implementation for Directory Consensus
- Updated the NIP-XX document to clarify terminology, replacing "attestations" with "acts" for consistency.
- Enhanced the protocol by introducing new event kinds: Trust Act (Kind 39101) and Group Tag Act (Kind 39102), with detailed specifications for their structure and usage.
- Modified the signature generation process to include the canonical WebSocket URL, ensuring proper binding and verification.
- Improved validation mechanisms for identity tags and event replication requests, reinforcing security and integrity within the directory consensus protocol.
- Added comprehensive documentation for new event types and their respective validation processes, ensuring clarity for developers and users.
- Introduced new helper functions and structures to facilitate the creation and management of directory events and acts.
2025-10-25 12:33:47 +01:00
44d22a383e Update dependencies and enhance deployment scripts
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Bumped versions of several dependencies in go.mod, including golang.org/x/crypto to v0.43.0 and golang.org/x/net to v0.46.0.
- Added new indirect dependencies for improved functionality.
- Removed outdated files: package.json, POLICY_TESTS_SUCCESS.md, and POLICY_TESTS_SUMMARY.md.
- Introduced a comprehensive deployment script for automated setup and configuration.
- Added testing scripts for deployment validation and policy system tests.
- Bumped version to v0.19.0.
2025-10-24 21:03:44 +01:00
75f2f379ec Enhance authentication handling in request processing
- Updated HandleCount, HandleEvent, and HandleReq functions to improve authentication checks based on new configuration options.
- Introduced `AuthToWrite` configuration to allow unauthenticated access for COUNT and REQ operations while still enforcing ACL checks.
- Enhanced comments for clarity on authentication requirements and access control logic.
- Bumped version to v0.17.18.
2025-10-24 20:16:03 +01:00
28ab665285 Implement privileged event filtering and add comprehensive tests
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Refactored the HandleReq function to improve the handling of privileged events, ensuring that only authorized users can access them based on their authentication status and associated tags.
- Introduced a new test suite for privileged event filtering, covering various scenarios including authorized access, unauthorized access, and edge cases with malformed tags.
- Enhanced the publisher logic to deny delivery of privileged events to unauthenticated subscribers.
- Bumped version to v0.17.18.
2025-10-24 19:53:34 +01:00
bc8a557f07 Refactor context handling in HandleCount and HandleReq functions
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated context creation in HandleCount and HandleReq to use context.Background() instead of the connection context, isolating timeouts to prevent affecting long-lived websocket connections.
- Improved comments for clarity on the purpose of the context changes.
- bump version to v0.17.17
2025-10-24 16:55:15 +01:00
a4fc3d8d9b Implement spider functionality for event synchronization
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Introduced a new `spider` package to manage connections to admin relays and synchronize events for followed pubkeys.
- Added configuration options for spider mode in the application settings, allowing for different operational modes (e.g., follows).
- Implemented callback mechanisms to dynamically retrieve admin relays and follow lists.
- Enhanced the main application to initialize and manage the spider, including starting and stopping its operation.
- Added tests to validate spider creation, callbacks, and operational behavior.
- Bumped version to v0.17.14.
2025-10-22 22:24:21 +01:00
cd6a53a7b7 Remove spider functionality and related configurations
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Deleted the spider package and its associated functionality from the main application.
- Removed references to spider mode and frequency from configuration files and documentation.
- Updated the main application to eliminate spider initialization and related logic.
- Cleaned up import statements and configuration options to reflect the removal of spider features.
2025-10-22 11:56:59 +01:00
117e5924fd Remove deprecated JSON encoder/decoder and update dependencies
- Deleted the custom JSON encoder/decoder implementation in favor of the standard library's `encoding/json` package.
- Removed the `next.orly.dev/pkg/encoders/json` package and its associated files.
- Updated `go.mod` to remove the `github.com/nostr-dev-kit/ndk` dependency and bump the version of `lol.mleku.dev` from v1.0.3 to v1.0.4.
- Cleaned up import statements across various files to reflect the removal of the custom JSON package.
- Ensured that all references to the old JSON encoding/decoding methods are replaced with the standard library equivalents.
2025-10-22 11:37:39 +01:00
6cff006e54 Update policy management and documentation
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Bumped the version of the `lol.mleku.dev` dependency from v1.0.3 to v1.0.4.
- Removed redundant checks for disabled policy in event handling.
- Introduced a `default_policy` field in the policy configuration, allowing for more flexible event handling based on default behaviors.
- Enhanced documentation to clarify the default policy logic and its implications on event processing.
- Updated tests to validate the new default policy behavior and ensure correct fallback mechanisms are in place.
2025-10-21 21:46:07 +01:00
7f5bd3960c Update user tagging in payment processor and bump version to v0.17.11
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Modified the user tagging logic in the payment processor to include a mention in the third field of the "p" tag.
- Incremented the version number to v0.17.11 for the release.
2025-10-21 20:05:45 +01:00
54a01e1255 Enhance welcome note personalization and privacy
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated the welcome note content to include a personalized greeting using the user's npub.
- Added a privacy notice to ensure users are aware that the note is only visible to them.
- Simplified the addition of the user npub to the authorized list by removing redundant encoding logic.
2025-10-21 19:35:16 +01:00
26c754bb2e Add protected tag to event processing
- Introduced a new protected tag "-" to mark events as protected in the payment processor.
- Updated event tagging logic to include this new tag for events with authorized public keys, enhancing event categorization and security.
- Ensured consistency in tagging across multiple event handling functions.
2025-10-21 19:22:01 +01:00
da66e26614 Implement private tag filtering for event visibility
- Added functionality to filter events based on "private" tags, allowing only authorized users to see private events.
- Introduced a new method `canSeePrivateEvent` to check user permissions against private tags.
- Updated event delivery logic to deny access to unauthorized users for private events, enhancing security and user experience.
- Bumped version to v0.17.7.
2025-10-21 19:17:16 +01:00
9aa1e7fab3 Enhance graceful shutdown and logging for HTTP server
- Implemented graceful shutdown for the HTTP server, allowing for a controlled shutdown process with a timeout.
- Added logging for shutdown signals and server exit to improve traceability during application termination.
- Introduced IP blacklist configuration to enhance security by blocking specified IP addresses.
- Updated database cache configurations to allow dynamic adjustment via environment variables for better performance tuning.
2025-10-21 17:20:48 +01:00
15e2988222 Refactor self-connection handling and improve message processing
- Removed self-connection detection logic from the Listener and Server, simplifying the message handling process.
- Updated the HandleMessage and handle-websocket functions to eliminate checks for self-connections, enhancing clarity and maintainability.
- Adjusted AUTH challenge logic to focus solely on blacklisted IPs, streamlining connection management.
2025-10-21 16:31:28 +01:00
95c6082564 Implement blacklisting for IPs and enhance follow list fetching
- Added functionality to handle blacklisted IPs, allowing connections to remain open until a timeout is reached.
- Introduced periodic fetching of admin follow lists to improve synchronization with relay data.
- Updated WebSocket message size limits to accommodate larger payloads.
- Enhanced logging for better traceability during follow list fetching and event processing.
- Refactored event subscription logic to improve clarity and maintainability.
2025-10-21 16:31:17 +01:00
384b6113bc fixes memory problem with many pubkeys in query
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
2025-10-20 22:20:21 +01:00
65e8ab4fbe Enhance logging and add policy test client
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Refactored logOutput function to trace-log stdout and stderr lines for better debugging.
- Introduced a new policy test client in cmd/policytest/main.go to publish events and check policy responses.
- Added a script to run the policy test, ensuring proper cleanup and error handling.
- Updated policy event processing to ensure newline-terminated JSON for compatibility with shell-readers.
2025-10-20 16:30:39 +01:00
105e372712 Refactor and enhance UI components for improved styling and functionality
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
- Updated CSS styles for modal and tab components to enhance visual consistency and responsiveness.
- Refactored JavaScript imports in App.svelte for better readability and organization.
- Improved layout and padding in ManagedACL.svelte for a more user-friendly interface.
- Adjusted event handling and state management in App.svelte to streamline user interactions.
- Updated bundle files to reflect the latest changes in the application structure and styling.
- bump to v0.17.1
2025-10-16 18:02:39 +01:00
bcd79aa967 implemented nip-86 relay management API and added to relay client
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled
2025-10-16 17:20:04 +01:00
1cfd4a6dbe Include app/web/dist in repository
- Remove app/web/dist/** from .gitignore
- Add built web assets to repository for deployment
- Includes bundle.css, bundle.js, index.html and other static assets
2025-10-16 11:41:57 +01:00
a84782bd52 Implement policy system with comprehensive testing and configuration
Some checks failed
Go / build (push) Has been cancelled
- Introduced a new policy system for event processing, allowing fine-grained control over event storage and retrieval based on various criteria.
- Added support for policy configuration via JSON files, including whitelists, blacklists, and custom scripts.
- Implemented a test suite for the policy system, ensuring 100% test coverage of core functionality and edge cases.
- Created benchmark tests to evaluate policy performance under various conditions.
- Updated event handling to integrate policy checks for both read and write access.
- Enhanced documentation with examples and usage instructions for the policy system.
- Bumped version to v0.16.0.
2025-10-16 11:37:30 +01:00
f19dc4e5c8 Implement compose tab for event creation and management
Some checks failed
Go / build (push) Has been cancelled
- Added a new compose tab for users to create, sign, and publish Nostr events.
- Introduced functions for JSON reformatting, event signing, and publishing with WebSocket authentication.
- Implemented clipboard functionality to copy event JSON directly from the UI.
- Enhanced UI with buttons for reformatting, signing, and publishing events, improving user experience.
- Created a new websocket-auth.js module for handling WebSocket authentication with Nostr relays.
- Bumped version to v0.14.5.
2025-10-11 10:30:38 +01:00
49619f74c7 fix user button and images
Some checks failed
Go / build (push) Has been cancelled
2025-10-11 09:23:01 +01:00
5952c7e657 Revert "Update project structure and enhance build process"
This reverts commit 4cf3d9cfb5.
2025-10-11 08:46:30 +01:00
4cf3d9cfb5 Update project structure and enhance build process
Some checks failed
Go / build (push) Has been cancelled
- Removed unnecessary entries from .gitignore related to the app/web/dist directory.
- Updated app/web/.gitignore to exclude the dist directory.
- Added rollup-plugin-copy to package.json and updated rollup.config.js to copy static assets during the build process.
- Introduced new CSS and JS files in the dist directory for improved styling and functionality.
- Updated index.html to reference new global CSS and JS files, enhancing the overall user interface.
- Added favicon and other image assets to the dist directory for branding consistency.
2025-10-11 08:05:50 +01:00
b0f919cd5a Enhance event display and UI in App.svelte
- Added a formatTimestamp function to display event creation timestamps.
- Refactored event rendering to include timestamps and improved content truncation.
- Updated the events view header and buttons for better layout and usability.
- Adjusted styles for event items and timestamps for improved readability.
- Implemented responsive design adjustments for smaller screens.
2025-10-11 07:52:48 +01:00
3c11aa6f01 refactored SaveEvent to return if it is replacing an event
Some checks failed
Go / build (push) Has been cancelled
2025-10-10 22:18:53 +01:00
bc5177e0ec refactor save event method to expose whether it replaced an event 2025-10-10 22:16:07 +01:00
0cdf44c2c9 fully working deletes bump to v0.14.0
Some checks failed
Go / build (push) Has been cancelled
2025-10-10 21:52:32 +01:00
40f3cb6f6e Enhance delete event functionality and UI updates
- Improved logging in handle-delete.go for admin and owner checks during delete operations.
- Updated handle-event.go to ensure delete events are saved before processing, with enhanced error handling.
- Added fetchDeleteEventsByTarget function in nostr.js to retrieve delete events targeting specific event IDs.
- Modified App.svelte to include delete event verification and improved event sorting by creation timestamp.
- Enhanced UI to display delete event information and added loading indicators for event refresh actions.
2025-10-10 21:23:36 +01:00
67a74980f9 Enhance delete event handling and logging
- Improved logging for delete events in handle-delete.go, including detailed information about the event and its tags.
- Added checks for admin and owner deletions, with appropriate logging for each case.
- Updated HandleEvent to process delete events more robustly, including success and error logging.
- Introduced a new fetchEventById function in nostr.js to verify event deletion.
- Updated App.svelte to handle event deletion verification and state management.
- Changed favicon references in HTML files to use the new orly-favicon.png.
- Added orly-favicon.png to the public and docs directories for consistent branding.
2025-10-10 20:36:53 +01:00
dc184d7ff5 Revert ephemeral event handling changes that broke relaytester
- Remove ephemeral event handling in handle-event.go
- Remove ephemeral event rejection in save-event.go
- Remove formatTimestamp function and title attributes in App.svelte
- Remove TestEphemeralEventRejection test
- Fix slice bounds bug in get-serials-by-range.go
- Restore correct error message format for existing events
- Revert version from v0.13.2 to v0.12.3

This reverts commit 075838150d which introduced
a critical bug causing runtime panics in the relaytester.
2025-10-10 19:55:39 +01:00
075dc6b545 Integrate NDK for Nostr client functionality and update dependencies
This commit introduces the Nostr Development Kit (NDK) to enhance the Nostr client functionality. Key changes include:

- Added `NDKPrivateKeySigner` for improved authentication methods in `LoginModal.svelte` and `App.svelte`.
- Refactored the Nostr client to utilize NDK for connection and event fetching, streamlining the connection process and event handling.
- Updated `go.mod` and `package.json` to include `@nostr-dev-kit/ndk` as a dependency.
- Created a new `package-lock.json` to reflect the updated dependency tree.

These changes improve the overall architecture and maintainability of the Nostr client.
2025-10-10 17:37:43 +01:00