| cmd/server | ||
| internal | ||
| web/templates | ||
| .dockerignore | ||
| .gitignore | ||
| default.nix | ||
| Dockerfile | ||
| flake.lock | ||
| flake.nix | ||
| fly.toml | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
| shell.nix | ||
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
-
Export the required environment variables:
MINIFLUX_API_ENDPOINTMINIFLUX_API_KEY
-
Run the server:
-
With Go:
go run ./cmd/server
-
Or build and run:
go build -o miniflux-to-epub ./cmd/server./miniflux-to-epub
-
-
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.