Getting started
ๅฎ่ฃ
The recommended way is to install via pip.
Make sure you have ๐ Python โฉพ 3.9 installed
Due to PEP 668, you may need to install within a virtual environment, take venv as example:
Install directly with pip
If you don't want to use a virtual environment, you can install it directly with pip and add --break-system-packages
.
python3 -m venv /my/new/venv/position
source /my/new/venv/position/bin/activate
pip install -U "comiclib[full]"
Install from GitHub
If you want to try out the latest features or fixes, consider installing from source:
Docker (Experimental)
Minimal installation
Image with tag v0.0.6
(without -full
suffix) does not ship the ehentai metadata database, therefore its size is much smaller. You can download the ehentai metadata database to /userdata
if you need it.
docker run -p 8000:8000 \
--mount type=bind,source=<YOUR_COMIC_DIRECTORY_HERE>,target=/root/comiclib \
--mount type=bind,source=<USER_DATA_PATH>,target=/userdata \
ghcr.io/comiclib/comiclib:v0.0.6-full
P.S.: Monitoring comic folders is disabled by default for Docker currently.
Launch
Change the working directory to the location of your comic library and run the following command to start:
Warning
Do not have irrelevant *.py files in the working directory, as they will be mistaken for scanner.
If you use ehentai
It is strongly recommended to download the ehentai metadata database api_dump.sqlite to the working directory from here first. For details, see Scanner.
Do not change the working directory arbitrarily
The metadata obtained by scanning is stored in the working directory by default, so it should be the same directory the next time. You can set the metadata database to an absolute path so you don't have to worry about this problem.
After waiting for the startup completion prompt, you can now open http://localhost:8000 and start reading.
Almost all settings are specified through environment variables. You can find all environment variables in Settings. The following is the most common example.
Want a complete fresh start?
If you made a mistake and want to start over. Just stop the program, delete the metadata database (./comiclib_metadata.db), delete the thumbnails (default is in ./thumb).
Specify the location for scanning comics
The default scan location is the current working directory, which can be specified via the environment variable CONTENT
.
Modify the bound port or IP address
Instead of run comiclib
directly, run with the following command
--host 0.0.0.0
specifies the bound IP (0.0.0.0
enables LAN access), and --port 80
specifies the bound port.
Configure server network related settings through uvicorn
Server network related settings are configured by uvicorn.
For example, you can bind to a UNIX domain socket via --uds
and automatically reload during development via --reload
.
For more information, please refer to uvicornโs documentation.
Advanced: High-performance running with Gunicorn (only for UNIX-like systems)
Gunicorn provides powerful concurrency performance. It does not run on Windows due to its reliance on UNIX's fork functionality.
Install via pip (of course, if you use a virtual environment, activate it before any installation or use):
run:gunicorn comiclib.main:app --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:
80 --preload --workers 4
--worker-class uvicorn.workers.UvicornWorker
is required for gunicorn to utilize ASGI;--bind
specifies the bound IP address and port;--preload --workers 4
specifies multiple workers, here are 4, which can be increased according to the performance of the server.
For more settings, please refer to Gunicorn's documentation.
In the end your command might look like this (my personal use case):
or for debugging. Then use Nginx to reverse proxy to HTTPS connection.