feature/webhook-sync #1

Merged
huantrinh1802 merged 5 commits from feature/webhook-sync into main 2026-03-29 12:36:47 +11:00
No description provided.
Why:
- Need to sync Karakeep bookmarks to Discord forum channels
- Bookmarks in lists should auto-post to corresponding Discord channels

What:
- Added webhook server to handle crawled, ai_tagged, and edited events
- Created Database class with SQLite for channel/message mappings
- Implemented DiscordBot with forum channel and thread support
- Added proper type hints and resolved Pyright/Ruff warnings
- Preserved emojis in channel names when creating Discord forums

Impact:
- New service that syncs Karakeep bookmarks to Discord
Why:
- Need to sync missed bookmarks on startup after server restart
- Only sync lists that have collaborators (shared lists)

What:
- Added iter_bookmarks async generator for pagination
- Added _sync_missed_bookmarks to sync bookmarks since last sync
- Filter lists by hasCollaborators in all sync methods
- Store created_at/updated_at in bookmark_messages table
- Switched to basedpyright for stricter type checking
Why:
- Improve type safety with strict mode
- Add type aliases for Karakeep API responses

What:
- Added BookmarkDict, ListDict, BookmarkListDict type aliases
- Added type annotations to KarakeepClient methods
- Configured basedpyright with targeted suppressions for external API types
- Include list emoji/icon in channel name format
- Remove hasCollaborators filter to sync all lists
- Modernize type hints using Python 3.10+ syntax
- Add @final decorators to classes
- Improve code formatting and lint compliance

Channel names now appear as "🔥 Fire" instead of just "fire"
(Note: Discord converts spaces to dashes internally)
Add missing environment variables:
- WEBHOOK_HOST (default: 0.0.0.0)
- WEBHOOK_PORT (default: 8080)
- DATABASE_PATH (default: data.db)

Organize variables by section for clarity
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
huantrinh1802/karakeep_discord!1
No description provided.