Skip to content

About

Something like superfeeder but on deno and my own

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Super Duper Feeder

A service for subscribing to RSS/Atom feeds, receiving real-time updates via WebSub/PubSubHubbub, and delivering those updates to a developer-defined webhook.

This service acts as a WebSub client, subscribing to external hubs when discovered. Developers can register their webhook endpoints to receive notifications when subscribed feeds are updated.

There is also a developer friendly API for real-time updates to RSS feeds delivered directly to a developer defined endpoint.

WebSub Concepts

WebSub (formerly PubSubHubbub) is a protocol that enables real-time notifications for content updates. It involves three main components:

  • Publishers: Content creators who publish feeds (e.g., blogs, news sites).
  • Hub: An intermediary server that facilitates communication between publishers and subscribers. Publishers notify the hub of updates, and the hub pushes those updates to subscribers. Super Duper Feeder acts as a subscriber to these external hubs.
  • Subscribers: Services or applications (like Super Duper Feeder, or the developer's webhook registered with it) that want to receive real-time updates about content changes from a hub.

The flow works as follows:

  1. A subscriber (like Super Duper Feeder) discovers the hub URL from a publisher's feed.
  2. The subscriber sends a subscription request to the external hub.
  3. The hub verifies the subscription request with the subscriber (using the /callback/:id endpoint of Super Duper Feeder).
  4. When the publisher updates content, they notify their designated hub.
  5. The hub fetches the updated content and sends it to all its verified subscribers (including Super Duper Feeder).
  6. Super Duper Feeder receives the update and forwards it to any developer-registered webhooks for that feed.

Features

  • Feed Subscription Management: Subscribe to RSS/Atom feeds via a simple API or UI.
  • WebSub Client: Automatically discovers and subscribes to external WebSub hubs for real-time updates.
    • Handles WebSub subscription verification (/callback/:id endpoint).
    • Receives content pushes from external hubs.
  • Webhook Delivery: Forwards feed updates from WebSub to developer-registered webhook URLs.
    • Callback URL verification for security.
  • Simple UI & Admin Panel:
    • Manage feed subscriptions.
    • Basic documentation access.

Technology Stack

  • Runtime: Deno
  • Hosting: Deno Deploy
  • Database: DenoKV
  • Scheduling: Deno cron jobs for periodic tasks

Getting Started

Local Development

# Start the server locally
deno task dev

The server will be available at http://localhost:8000.

Testing

The project includes a comprehensive test harness for unit and integration testing:

# Run all tests
deno task test

See the tests/README.md file for more details on the test harness.

Documentation

The documentation is available at http://localhost:8000/docs when running locally.

Endpoints

Core Endpoints

  • GET /: Redirects to /ui
  • GET /api: Provides basic API information (name, version, description)
  • GET /health: Health check endpoint

Webhook API & Callbacks

  • POST /api/webhook: Allows developers to subscribe their service (callback URL) to a feed topic. Handles hub discovery and subscription requests.
  • ALL /callback/:id: Endpoint used by external WebSub hubs to verify subscriptions initiated by this service (GET with hub.mode, hub.topic, hub.challenge) or deliver content updates (POST). This service receives the updates here.

Static Content & UI

  • GET /ui, GET /ui/:path*: Serves the main user interface files from ui/public/ui/.
  • GET /admin, GET /admin/:path*: Serves the admin panel files from ui/public/admin/.
  • GET /docs, GET /docs/:path*: Serves the documentation files from ui/public/docs/.

Deployment

The service is deployed to Deno Deploy at: superduperfeeder.deno.dev

Project Structure

/
├── .gitignore
├── config.ts               # Configuration settings
├── deno.json               # Deno configuration (tasks, imports)
├── deno.lock               # Dependency lock file
├── deps.ts                 # Centralized dependency management
├── LICENSE
├── main.ts                 # Application entry point
├── prompt.md               # (Likely related to AI/LLM interaction)
├── README.md               # This file
├── models/                 # Data models (DenoKV schema)
│   ├── external_subscription.ts # Model for subscriptions made via this service to external hubs
│   ├── queue.ts            # Model for background job queue
│   ├── user_callback.ts    # Model for developer-provided callback URLs
│   └── user.ts             # User model (if authentication is implemented)
├── routes/                 # API route definitions (using Oak router)
│   ├── index.ts            # Main router, basic routes (/api, /health)
│   ├── static.ts           # Static file serving (/ui, /docs, /admin)
│   └── webhook.ts          # Webhook endpoints (/api/webhook, /callback/:id)
├── services/               # Business logic layer
│   └── webhook.ts          # Service for handling webhook subscriptions and callbacks
├── tests/                  # Test suite
│   ├── README.md           # Documentation for running tests
│   ├── run_tests.ts        # Main test runner script
│   ├── test_config.ts      # Configuration for tests
│   ├── test_setup.ts       # Setup logic for tests
│   ├── integration/        # Integration tests (directory exists)
│   ├── mocks/              # Mock objects for testing
│   │   └── mock_feed.ts
│   ├── unit/               # Unit tests
│   │   └── crypto_test.ts
│   └── utils/              # Utility functions for tests
│       └── test_database.ts
├── ui/                     # Parent directory for UI assets
│   └── public/             # Root directory for served static assets
│       ├── admin/          # Admin panel interface
│       │   ├── feeds.html
│       │   ├── index.html
│       │   ├── items.html
│       │   ├── styles.css
│       │   └── subscriptions.html
│       ├── docs/           # Documentation site
│       │   ├── index.html
│       │   └── styles.css
│       └── ui/             # Main user-facing interface
│           ├── index.html
│           ├── styles.css
│           ├── subscribe.html
│           ├── subscriptions.html
│           └── unsubscribe.html
└── utils/                  # Utility functions
    ├── crypto.ts           # Cryptographic utilities (hashing)
    └── database.ts         # DenoKV database interaction utilities

API Documentation

The service provides an API for managing feed subscriptions and receiving updates via webhooks:

Webhook Subscription API (/api/webhook)

  • Subscribe to a Feed: Provide a feed URL (topic) and optionally your webhook URL (callback).
  • Automatic Hub Discovery: The service attempts to find and subscribe to an external WebSub hub for the feed.
  • Callback Verification: If a callback URL is provided, it must be verified before receiving updates.

Callback Endpoint (/callback/:id)

  • WebSub Verification: Handles GET requests from external hubs to verify subscriptions initiated by this service.
  • Content Delivery: Receives POST requests from external hubs containing feed updates.

See the documentation (or /docs when running locally) for detailed API usage, including request/response formats, callback verification details, error handling, and best practices.

Deno Deploy Compatibility

Password Hashing

This project uses the Web Crypto API for password hashing instead of bcrypt because bcrypt is not compatible with Deno Deploy. The implementation in utils/crypto.ts provides:

  • Secure password hashing using PBKDF2 with SHA-256
  • AES-GCM encryption for password verification
  • A drop-in replacement for bcrypt's hash and compare functions
  • Automatic salt generation for each password
  • Compatibility with the existing user authentication system

The implementation has been thoroughly tested and provides the same level of security as bcrypt while being compatible with Deno Deploy's runtime environment.

License

See the LICENSE file for details.

About

Something like superfeeder but on deno and my own

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages