Commit Graph

33 Commits

Author SHA1 Message Date
cyph3rasi a7a430a627 Add right-aligned post sharing with chat, copy-link, and native share actions, plus media downloads and mobile-safe action layout.
Hop-State: A_06FPA5BJBEJ930H9MP07GNG
Hop-Proposal: R_06FPA5AQ4HY44EBZAGHH5KG
Hop-Task: T_06FPA3T7TNGR6E7KE0A2ECR
Hop-Attempt: AT_06FPA3T7TN53HDSQHEBWSS8
2026-07-15 02:22:12 -07:00
cyph3rasi 270d5437f0 Use DiceBear bottts-neutral as the site-wide avatar fallback
Hop-State: A_06FP86GJ50CYTWZ5YZECQ0G
Hop-Proposal: R_06FP86FN4Y59N0Z8828K6W8
Hop-Task: T_06FP85JN26GSWT1GS5G0W20
Hop-Attempt: AT_06FP85JN25ZCGGGSSWN1CTR
2026-07-14 21:47:38 -07:00
cyph3rasi 5f21ea8e5d Fix reply consistency and source validation 2026-03-08 18:29:42 -07:00
cyph3rasi a8f104ee14 Fix unread badge refresh and reply thread UI 2026-03-08 00:31:21 -08:00
Christomatt 38ddbf8bc1 feat: Introduce runtime configuration for domain and enhance S3 storage settings with public base URL and Contabo support. 2026-02-03 01:27:46 +01:00
Christomatt f55dec9a60 feat: user-owned S3-compatible storage with credential verification 2026-02-01 02:51:52 +01:00
Clawd Deploy Bot 50355b740a Security fixes: swarm signature verification and error handling 2026-01-30 16:50:49 +01:00
Christomatt 9710a16f83 feat: Implement remote user profile caching and enhance chat conversation list display with updated styling. 2026-01-29 01:00:22 +01:00
Christomatt 491eb07fea fix: Validate user object before accessing DID and clarify error message for missing identity. 2026-01-29 00:08:29 +01:00
Christopher ceae76d58f Refactor chat system to remove E2EE and simplify messaging
Removed all E2EE chat endpoints, crypto logic, and related API routes, transitioning chat to plain text storage and transport. Updated chat send/receive endpoints to use signed actions and enforce DM privacy settings. Cleaned up Swarm chat inbox, key management, and related debug endpoints. Updated user profile to support DM privacy, improved search for handle queries, and refactored conversation/message logic to support the new model. Migrated bot settings and privacy settings to new locations.
2026-01-28 13:05:34 -08:00
Christopher 558c1aecdf Ensure chat key fetches bypass cache
Added `{ cache: 'no-store' }` to fetch requests for chat keys in both the chat page and useSodiumChat hook to prevent stale key data. Also updated the chat key query to order by `lastSeenAt` descending, ensuring the most recent bundle is retrieved.
2026-01-28 07:48:10 -08:00
Christopher 93a587f185 Refactor chat page useEffect organization and improve compose intent handling
Reorganizes useEffect hooks in chat/page.tsx to follow a helper-functions-first structure, improving readability and maintainability. Adds error handling and user feedback for compose intent, preventing UI flash while processing. In send/route.ts, ensures remote user handles are fully qualified and adds debug logging. Temporarily disables key caching in keys/route.ts to address development key mismatches.
2026-01-28 07:37:27 -08:00
Christopher a87977241c Refactor chat encryption to use sodium, update API
Replaces legacy chat encryption modules with new sodium-based implementation. Adds and updates API routes for chat key management and debugging, introduces new hooks and scripts for sodium chat, and updates related database schema and configuration. Removes old crypto modules and updates dependencies accordingly.
2026-01-28 06:07:03 -08:00
Christopher 222f1c6d8a Add sender DID resolution and self-decryption for chat messages
The messages API now resolves and includes sender DIDs for received messages, enabling proper decryption in the chat UI. The chat page adds logic to decrypt self-encrypted messages for sent items and improves V2 envelope handling, while useChatEncryption now serializes ratchet state before storage.
2026-01-27 22:06:47 -08:00
Christopher c8e4dedd61 Add sender_did to chat messages and new chat tables
Introduces a migration to add a sender_did column to the chat_messages table and creates new tables for chat_device_bundles, chat_inbox, and chat_one_time_keys. Updates related API routes and adds a script for sender DID migration. These changes support device-based messaging and improved chat security.
2026-01-27 21:57:33 -08:00
Christopher e92c747a5b Improve chat encryption, delivery, and session handling
Adds robust session serialization/deserialization for ratchet state, session cleanup for corrupted data, and improved error handling in chat encryption hooks. Enhances chat delivery to support both local and remote recipients, ensures conversation creation, and adds timeouts to key fetches. Also introduces utilities for deleting and clearing encrypted session data from storage.
2026-01-27 20:36:03 -08:00
Christopher 96053ebd65 Improve chat key fetch and self-repair logic
Refactors the chat key fetch API to support fallback lookups using user handle and did:web aliasing, improving reliability when primary lookups fail. Updates useChatEncryption to detect and repair 'Zombie State' where local keys exist but are missing on the server, ensuring keys are republished as needed. Modifies sendMessage to pass recipient handle and bind sessions to the correct DID, supporting aliasing scenarios.
2026-01-27 19:45:36 -08:00
Christopher 7eae96bc44 Add remote key fetch proxy and improve chat reliability
Introduces an API route to proxy remote key bundle fetches, improving CORS handling for secure chat. Updates chat UI to handle error states and retries, enhances key/identity synchronization, and refactors message sending to support remote node domains. Also adds CORS preflight support to the .well-known chat route and improves in-memory key store management.
2026-01-27 19:34:37 -08:00
Christopher f59625c83f Revamp chat UI and add V2 encrypted messaging support
Major update to chat page with new conversation list, message thread view, and support for V2 end-to-end encrypted messaging using DIDs. Adds chat lock state, message sending, conversation deletion, and improved polling. Updates user API and types to include DID and chatPublicKey. Fixes race conditions in feed loading, adds message button to user profile, and improves crypto and identity hooks for better locked/unlocked state detection.
2026-01-27 18:33:56 -08:00
Christopher 9ee0cbbb9a feat: Implement end-to-end encrypted chat with new API routes, crypto utilities, and UI components. 2026-01-27 17:59:08 -08:00
Christopher 374f707dbf Add conversation deletion to chat UI and API
Introduces an API route for deleting chat conversations, supporting deletion for self or both parties. Updates the chat page UI to allow users to delete conversations with confirmation modal and handles state updates after deletion.
2026-01-27 14:00:48 -08:00
Christopher 2a65f78610 Update feed labels and improve chat UX
Renamed 'Latest' feed to 'Following' across the home and profile pages for clarity, and updated related UI text. Improved chat experience by adding a scroll-to-bottom button, tracking scroll position, and only auto-scrolling when the user is at the bottom. Updated default node description to 'A swarm social network node.' in multiple locations.
2026-01-27 13:29:15 -08:00
Christopher a68aee8758 Migrate user/profile URLs to /u/[handle] and remove legacy scripts
All user and post profile URLs have been updated from /[handle] to /u/[handle] for consistency. Added a redirect page for /posts/[id] to the canonical /u/[handle]/posts/[id] route. Deprecated and removed legacy scripts and documentation related to chat and federation endpoints. Push-based federation endpoints are now disabled in favor of real-time pull-based federation.
2026-01-27 01:26:41 -08:00
Christopher 44610157a1 Add chat page, improve chat API, and remove ChatWidget
Introduces a new chat page with end-to-end encryption, conversation list, and message thread UI. Adds new API endpoints for unread message count and debugging chat keys/messages. Improves chat key validation and reciprocal conversation/message creation for local recipients. Removes the old ChatWidget component. Updates login and chat API logic for better Turnstile and key handling.
2026-01-27 01:05:40 -08:00
Christomatt 75a2d87d9a feat: Implement a new chat widget with enhanced encryption handling and supporting utility scripts, replacing the old chat page. 2026-01-27 08:07:32 +01:00
Christomatt 7d1e22e457 feat(chat): Enhance message decryption with improved key management and debug logging
- Add recipient public key fetching in messages API endpoint for sent message decryption
- Include `isE2E` flag in message response to indicate end-to-end encryption status
- Simplify encrypted content handling by always returning `encryptedContent` field
- Add comprehensive debug logging throughout message loading pipeline for troubleshooting
- Improve key resolution logic to fetch recipient keys when not available in conversation data
- Add detailed logging for each message processing step including key availability and decryption status
- Enhance error handling with more descriptive error messages in key fetching operations
- Better distinguish between sent and received message decryption requirements with clear comments
2026-01-27 06:18:20 +01:00
Christomatt 863cbc8dce feat(chat): Improve message decryption with better key management and error handling
- Add fallback logic to fetch recipient's public key if not already cached
- Distinguish between E2E encrypted messages (with senderPublicKey) and legacy RSA messages
- Return appropriate error messages for legacy encrypted messages and missing decryption keys
- Improve ECDH key derivation logic with clearer comments explaining sent vs received message handling
- Add comprehensive error logging for decryption failures and missing keys
- Refactor loadMessages function for better readability with expanded formatting
- Ensure recipient key is available before attempting message decryption to prevent silent failures
2026-01-27 04:27:06 +01:00
Christomatt c007741b65 feat: Include chat public key in conversation data and enhance chat page layout for full width and dynamic height. 2026-01-27 04:16:05 +01:00
Christomatt 5262cb1dbd Fix for chat 2026-01-27 04:10:03 +01:00
Christomatt 0d03933292 fix(chat): Correct template literal syntax in chat page
- Fix template literal syntax from escaped backticks to proper ${} notation
- Remove unnecessary comments from empty catch blocks for cleaner code
- Add emoji to initial chat greeting message for better UX
- Ensure consistent string interpolation across all API calls and JSX attributes
2026-01-27 03:39:06 +01:00
Christomatt f0253581d2 feat(chat): Implement client-side end-to-end encryption with key management
- Add chat keys API endpoint for storing and retrieving encrypted RSA public/private key pairs
- Create client-side crypto utilities for E2E encryption/decryption with hybrid encryption support
- Implement useChatEncryption hook for managing encryption state and key generation in chat UI
- Add chatPublicKey and chatPrivateKeyEncrypted fields to user schema for key storage
- Update chat messages API to return encrypted content with sender's public key for decryption
- Modify send message endpoint to accept pre-encrypted content from client while maintaining legacy server-side encryption
- Update chat page UI to integrate client-side encryption workflow
- Ensure private keys are encrypted client-side with user password before transmission to server
- Server cannot decrypt message content in E2E mode, providing true end-to-end encryption
2026-01-27 03:38:54 +01:00
Christomatt eb63194c56 refactor: Migrate from ActivityPub federation to native Swarm network
- Remove ActivityPub infrastructure (webfinger, nodeinfo, inbox, activities, signatures)
- Implement native peer-to-peer Swarm network with gossip protocol
- Replace federated timeline with Swarm timeline aggregating posts from all nodes
- Migrate direct messaging to end-to-end encrypted Swarm Chat system
- Update user interactions (follow, like, repost) to use Swarm protocol
- Add cryptographic key management for DID-based identity system
- Remove server-bound identity model in favor of portable DID identities
- Update documentation to reflect Swarm architecture and capabilities
- Add debug utilities and chat testing tools for Swarm network
- Refactor database schema to support distributed user directory
- Update bot framework to work with Swarm network interactions
- Simplify API routes to use Swarm protocol instead of ActivityPub
- This transition enables true peer-to-peer communication, instant interactions, and encrypted messaging while maintaining sovereign identity through DIDs
2026-01-27 01:27:15 +01:00
Christomatt 6b8eeb6814 feat(chat): Implement end-to-end encrypted swarm messaging system
- Add Swarm Chat documentation with architecture, API endpoints, and security considerations
- Create database schema for chat conversations, messages, and typing indicators
- Implement chat API endpoints for sending, receiving, and managing messages
- Add client-side encryption utilities using RSA-OAEP with SHA-256
- Create chat page UI for viewing conversations and messages
- Add chat type definitions for TypeScript support
- Update database schema with new chat tables and relationships
- Update sidebar navigation to include chat link
- Enable true end-to-end encrypted messaging across swarm nodes without ActivityPub limitations
2026-01-26 20:00:17 +01:00