Introduction
This is a guide to the management and deployment of your digital library using QTS and Calibre. The digital library set consists is a storage server with multiple networking interfaces built in to enable local connections to its WiFi network. When connected to the included 5G modem, or to an active gateway, it also becomes an Internet capable device. The set also includes laptops to connect to the server for content retrieval.
Hardware
A fully-functional digital library should include all of the following hardware as of May 2023:
- 1 QMiroPlus QNAP server;
- 1 IGE01 5G modem;
- 3 JOI laptops.
Recommendations
The QMiroPlus (hereafter referred to as the server) runs QTS, a NAS-centric operating system that hosts the software for managing your library. The IGE01 5G modem (hereafter referred to as the modem) provides Internet connectivity when in proximity to a 5G tower. The JOI laptops are to be connected to the network provided by the server to retrieve books from its database, and also to connect to an included Penang Digital Library subscription.
We suggest placing these devices in the school MakerLab to encourage additional tinkering. Makerlab and and computer lab devices can be connected to the QMiroPlus router's WiFI router to access the 5G internet provided by the modem. These devices should be left on 24/7 to allow everyone, especially underprivileged students to use before and after school.
Support and Service
Remote support
This digital library project will be supported remotely by being added to a VPN managed by the Penang Science Cluster. A ticket can be raised by emailing us or using the discussion section in our GitHub repository at https://github.com/PenangScienceCluster/qnap-digital-library/discussions.
We encourage you to file bugs at the GitHub repository so we may easily track and triage problems with the hardware and software.
YTL 5G Subscription
From 2023-05-23 to 2024-05-22, YTL shall provide a sponsored subscription to its 5G service via the IGE01 modem. After the latter date, schools may decide to renew the subscription. Pending further discussion, the subscription may require payment or be renewed for free. Schools have the freedom to switch Internet providers after the end of the service period. Unused modems owned by YTL will be collected from the schools.
Assembly
At present, we have identified an issue with connectivity between the server and the modem during initial setup that appears to be based on which devices are turned on first.
We therefore suggest following the steps below in sequence:
-
Take out the IGE01 modem and follow the included instructions to plug in the power and networking cables. Turn on the device. If the illustrated instructions are missing contact support for new copies.
-
Take out the QMiroPlus server and plug in the Ethernet cable from the modem into the Ethernet port labeled "WAN". Note that any router or switch with Internet can be substituted here in case the included modem does not provide sufficient Internet connectivity.
-
Plug in the barrel connector into the server and turn on the device by pushing the power button on the back once. The LEDs will be green when booting up; red if there is no Internet connection; and blue when there is Internet available.
-
The server can be safely shutdown by holding the power button until you hear a long beep. Wait until all the smaller LEDs in the bottom left are off before unplugging the server from the power outlet.
-
The laptops can be treated as standard laptops. Connect them to to router's SSID to start using them with an Internet connection.
The Server
Each server runs (or will run after updates) the latest available version of QTS available from QNAP. QTS is a heavily customized Linux operating system. The main software for use, Calibre-Web, is a web service running in a Docker container that serves as the library for managing published media.
Tailnet
As part of this deployment, we will also connect the server to a Tailnet, which is a special kind of VPN based on the WireGuard protocol developed by Tailscale, to allow us to properly provide remote technical assistance in a secure manner. The URL for the Tailnet and login credentials will be provided separately from this document.
First Connection
The units tested have very limited connectivity options upon boot-up, as they do not yet conform to the country's regulatory radio frequency settings. As such, we recommend connecting to the server from a laptop using an Ethernet cable, to the port labelled LAN1. The port marked WAN is for connecting to the 5G modem, or to any gateway device.
Connecting via WiFi for setup is possible if the proper associated QNAP app is installed. Consult and follow the QNAP documentation for the most up-to-date set-up options if using their app.
Once connected, open a browser and navigate to the IP address: 192.168.100.1.
There, follow the first time setup options. Pay attention to the country settings. Accept the other default options.
Connecting to the WiFi
The server contains its own wireless router, and is capable of routing network traffic from the Internet from the WAN port, to devices connected to the remaining Ethernet ports, and the WiFi. Details on the default WiFi SSID and password can be found in the sticker on the bottom of the server.
Admin Account
The login screen for QTS, which is the main web admin interface for running web services is accessible via a web browser once you have connected your device to the WiFi SSID provided by the server, or via Ethernet. The IP address by default should be 192.168.100.100. The login details are:
Username: admin
Password: Check the sticker on the bottom of your device.
We highly recommend you change the default admin account's password to something more secure. Since this is a networked device, there is a risk of your account being compromised if the password is weak. We will try our best to deploy the most hardened system we can to the user, however that will be for naught if the admin password is weak.
Click on the user drop-down arrow, selecting Options > Password Settings, and changing the default admin password to something else more secure. If you have problems with figuring out a secure but memorable passphrase, we recommend the Diceware method of passphrase generation. Afterwards, set up 2-Step Verification as an additional level of protection even if your passphrase is compromised.
Managing Container Apps
The digital library is being served using Docker containers. In a nutshell, running a Docker app requires firstly a Docker image, and secondly a Docker Container which will is the running app based on the Docker image. To create our library container, we will need to install the app Container Station.
-
Click on AppCenter.
-
Search for and install Container Station.
-
Launch Container Station and accept all default options.
Data is managed using volumes attached from the host file system to Docker containers. For this set-up, we will set up a non-root user to run the Docker containers, alongside volumes that are needed to store the associated app data.
Creating a Docker user
-
Click on Users in QTS.
-
Create a user named
dockuser
. -
Set a password. Leave all settings at default options.
Installing Calibre-Web as a Docker Container
Create Calibre-Web Data Folders
-
Open File Station in QTS.
-
Create a Shared Folder. For Calibre, a folder named
calibre
can be created under DataVol1. -
In "Configure access privileges for users", give
dockuser
read/write access. Leave the rest as default. -
In the new
calibre
shared folder, create two folders namedbooks
andconfig
. -
Get the UID/GID of
dockuser
withid dockuser
in ssh. -
Download our Calibre seed library to your computer at:
-
Copy the contents of
calibre-seed/books
folder to thebooks
folder created earlier. By navigating into the books folder, the followingrsync
command will copy the folder contents to the right folder:rsync -ahvz . <user>@<hostname>:/share/calibre/books/
-
Set permissions for the folder to
dockuser
with:sudo chown -R <UID>:<GID> /share/calibre/books
Create Calibre-Web Container
-
Open Container Station and click on Create. In the search box type in
calibre
. When you see the Docker imagelinuxserver/calibre-web
click on the install button. -
Select the latest image, and click on install. Accept the disclaimer.
-
In the "Create Container" dialog box, click on "Advanced Settings".
-
In Environment, create two fields,
PUID
andPGID
, filling in the values ofdockuser
from earlier. -
Select
Shared Folders
.-
Click the "Add" button above "Volume from host" (or "Bind Mount Host Path") and in the first column, choose the
config
folder created earlier. Under theMount Point
column enter/config
and make sure the "Write" (or RW) checkbox is selected. -
Click the "Add" button above "Volume from host" and in the first column, choose the
books
folder created earlier. Under theMount Point
column enter/books
and make sure the "Write" (or RW) checkbox is selected.
-
-
Click on Create when done. Confirm the information is correct in the "Summary" dialog box, and click "OK".
First-Time Configuration
-
In Container Station's overview tab, start
calibre-web-1
(the default name given unless modified) if not started. -
Click on the blue hyperlink to bring up the container management box.
-
Click on the URL. It will open Calibre-Web's first time setup page.
-
The default login credentials for the admin user are:
Username:
admin
Password:
admin123
-
In the Database Configuration dialog box, for the database location type in
/books
or navigate to thebooks
folder.
Once completed, you should be seeing books immediately available for reading. Remember to change the admin password to something stronger!
Congratulations! You now have a working library!
Enabling Uploads
There are many methods to upload books and other media to your Calibre-Web library. Here we will show you the simplest method, which is via the web interface. By default, book uploading is not activated. To begin:
-
In the Admin view, select "Edit Basic Configuration".
-
Open the "Feature Configuration" drop-down.
-
Select "Enable Uploads" and check your reading material fileformat is in the "Allowed Upload Fileformats" option.
Using the admin account, you can immediately upload books with the "Upload" button that will pop up in the menubar at the top. For more fine-tuned options, we suggest creating a librarian account with permissions to upload files while reserving all other administrative options to the admin account.
Uploading Books
-
If your user has upload privileges, an "Upload" selection will be available in the menu bar. Click to begin.
-
Select a books from your local device to upload to the server.
Adding Metadata
Calibre-Web can automatically find and add metadata to the uploaded books. There are a few quirks with the process, so here are a few tips to ensure you find your books online.
- Clear out all data except for the title and the first author.
- In the Fetch Metadata dialog box, choose only Amazon and Google if no results show up.
Once you have found a matching book, click on the thumbnail image, and all available fields will be automagically populated. If it looks acceptable, click on "Save".
User Setup
For reasons of security, if we set up the Calibre-Web container for you, we shall change the default admin password to a randomly-generated string.
We will also create an example reader account, which only allows the user to read books from within the web viewer. We will or have set the username and password as the same for all participating schools so everyone can easily try the digital library.
The credentials are:
Username: reader
Password: Read4life.