Readwyn 0.1.0

Run a home ebook server on a Mac

A Mac with Readwyn is already a server for its own libraries. The setting “Readwyn server” opens that server to the other devices in your home: Macs that you pair, and reader apps on phones, tablets, and e-readers. With it on, the server keeps running after you quit Readwyn and starts when you log in, so your libraries stay available while the Mac is on.

Turn on Readwyn server

Open Settings › Other devices and turn on “Readwyn server”. The line under it says “Other devices can open the libraries of this Mac. It keeps running when you quit Readwyn, and starts at login.” macOS then shows its own notice that Readwyn added a background item.

The state line changes to something like “Running · 2 devices connected”, and the line below names this Mac: “This Mac: Sid’s iMac”. From now on the server runs in the background, and the Readwyn window talks to it over a local socket on the same Mac. Each macOS user on the Mac has a server and libraries of their own.

Settings › Other devices: Readwyn server is on, Running with 2 devices connected; This Mac: Sid’s iMac at 192.168.1.20:7313; Show libraries from This Mac; Listen on Wi-Fi · 192.168.1.20, port 7313; the paired devices with their levels; and the reader apps
Readwyn server on, with paired devices and reader apps

Choose the network

“Listen on” starts as “This Mac only”. For other devices to reach the Mac, choose your home network, for example “Wi-Fi · 192.168.1.20”, and keep port 7313 or type another. The Mac’s address then joins the line under the switch, “This Mac: Sid’s iMac · 192.168.1.20:7313”, and Readwyn warns: “Anything on your Wi-Fi can reach this Mac. Only paired devices can open the libraries.” macOS may ask whether Readwyn can accept incoming connections; allow it.

The server is meant for your home network only. Nothing in Readwyn opens it to the internet.

Pair another Mac

Click “Pair a device…”. The sheet shows the address to type, with Copy, a 6-digit code, and what the device will be able to do (“It can”). The code works once, for 10 minutes. On the other Mac, open Settings › Other devices › Another device, type the address, click Connect, and enter the code.

Each paired device has a level:

  • Guest: reads the libraries, and each book opens in private reading.
  • Read, the default: also saves progress, status, highlights, notes, and My Words.
  • Admin: also adds, removes, and edits books, and changes the server.

A device can also ask to pair without a code. The request shows up in “Paired devices” with Deny and Allow, and as a notification such as “Sid’s MacBook Air asks to connect.” In Settings you can first pick its level from the menu beside the buttons; it starts at Read. Allow in the notification always gives Read. Read, Guest, and Admin explains what each level can do.

Serve reader apps

Under “Reader apps”, turn on “Share with reader apps (OPDS)”. The Mac then also serves an OPDS catalogue on a second port, 7314, for example http://192.168.1.20:7314/opds. Reader apps such as KOReader, Thorium, or Moon+ Reader can browse it and download books, but they can’t change anything. Set up an OPDS catalogue for KOReader gives the steps.

The menu bar icon

While the server is on, the Readwyn mark sits in the menu bar. Its menu has “Readwyn server is running”, a status line such as “2 devices connected · 1 asks to connect”, “Open Readwyn”, “Pair a device…”, “Connected devices…”, “Turn off Readwyn server”, and “Don’t show this icon”.

When the setting is off

With the setting off, no other device can connect, even while Readwyn is open, and the state line says “Off”. Your paired devices stay paired, and they connect again when you turn it back on.

A server without a Mac

For a machine without a display, such as a NAS, Readwyn has a server for Linux: Run a headless ebook server on Linux. It serves the Readwyn apps, but not reader apps yet.