No description
Find a file
2025-12-15 23:25:03 +05:30
cmd/server opds: allow serving directly 2025-12-15 23:23:17 +05:30
internal miniflux: add an expontential backoff 2025-12-15 23:25:03 +05:30
web/templates Initial commit 2025-12-15 20:25:27 +05:30
.dockerignore Initial commit 2025-12-15 20:25:27 +05:30
.gitignore Initial commit 2025-12-15 20:25:27 +05:30
default.nix Initial commit 2025-12-15 20:25:27 +05:30
Dockerfile Initial commit 2025-12-15 20:25:27 +05:30
flake.lock Initial commit 2025-12-15 20:25:27 +05:30
flake.nix Initial commit 2025-12-15 20:25:27 +05:30
fly.toml Initial commit 2025-12-15 20:25:27 +05:30
go.mod Initial commit 2025-12-15 20:25:27 +05:30
go.sum Initial commit 2025-12-15 20:25:27 +05:30
README.md Initial commit 2025-12-15 20:25:27 +05:30
shell.nix Initial commit 2025-12-15 20:25:27 +05:30

miniflux-to-epub

This is a Golang server that periodically fetches unread posts from a Miniflux v2 instance and generates ePUB files for each of them. It also includes an OPDS server that serves these generated ePUB files to be consumed by a compatible e-reader.

It is intended for single-user deployments on a service like fly.io, where ephemeral storage is not necessary but expected. The project has a minimal Web UI that lets you see some statistics such as the last time it synced from Miniflux, and the number of ePUBs that were generated.

Configuration

Required environment variables

  • MINIFLUX_API_ENDPOINT: Base URL of your Miniflux instance (example: https://reader.example.com)
  • MINIFLUX_API_KEY: Your Miniflux API key (create one in Miniflux settings)

Optional environment variables

  • PORT: HTTP listen port (default: 8080)
  • DATA_DIR: Directory where generated ePUBs and on-disk state are stored (default: ./data)
  • SYNC_INTERVAL: How often to poll Miniflux for unread entries (default: 15m)
  • BASE_URL: Public base URL used for absolute links in OPDS feeds (example: https://miniflux-to-epub.example.com). If unset, the server derives it from the incoming request.
  • LOG_LEVEL: Logging level (example: info, debug)

Running locally

  1. Export the required environment variables:

    • MINIFLUX_API_ENDPOINT
    • MINIFLUX_API_KEY
  2. Run the server:

    • With Go:

      • go run ./cmd/server
    • Or build and run:

      • go build -o miniflux-to-epub ./cmd/server
      • ./miniflux-to-epub
  3. Open endpoints:

  • Web UI: http://localhost:${PORT:-8080}/
  • OPDS catalog: http://localhost:${PORT:-8080}/opds
  • Health check: http://localhost:${PORT:-8080}/healthz

Deployment notes

This project targets single-user deployments (for example on fly.io). Use a persistent volume if you want ePUBs and state to survive restarts; otherwise expect a fresh library after redeploys when using ephemeral storage.