1 Configuration
Izzy edited this page 4 years ago

Configuration

A detailed description of the configuration options follows below. Please also consult the Installation page.

Basically, the configuration file is a simple PHP script by itself – even if it does nothing but setup some variables. This means, you will have to stick to PHP syntax when editing this file.

To make it easier to follow, settings are grouped in the example configurations. Normally, the order of the settings is not important (except if you want to use one setting inside another, and except for the adjustments for multiple repositories with the advanced configuration).

Following you find the settings listed using the same grouping, and having some explanations added:

Directories

Variable Example-Setting Explanation
dbfile dirname(__FILE__).'/metadata.db' database file used by SQLite. The scan script will save all metadata here, and the web frontend will read them from here. You should specify a file name including its path – this file must be writable by the user running the scan script, and readable for the web server process. As you can see in the example, PHP functions can be used for this setting: here it's ensured the database file will be located in the same directory as the conguration file.
This setting must be a string.
bookroot 'books' base directory for the book (epub/mobi/pdf) files. The example specifies it directly inside the miniCalOPe directory (and thus inside the DOCUMENT_ROOT of the web server), which is useful if you want to display cover images located next to the book files – but it is not urgently necessary: you might specify a directory outside of miniCalOPe, even outside the DOCUMENT_ROOT. With Calibre itself being used, this will probably even have to be the case.
This setting must be a string.
bookformats array('epub','mobi') book formats to be supported by this installation. At this time, miniCalOPe only knows to handle 'epub', 'mobi', 'fb2', and 'pdf' by default – so you may restrict to one or more of them. If you require additional formats, they can be added via the lib/formats.csv file (having tested them successfully, consider filing an enhancement request here, sharing your addition so it can be included by default; this also prevents losing that setting on an update, when this file would be overwritten/replaced).
This setting must be an array.
bookdesc_ext array('desc') file extension for files holding additional information on a book. For each book you can have a file with the same name (but this extension) within the same location. The information contained will then be displayed along on the books details page.
This setting must be an array.

Checking

Variable Example-Setting Explanation
check_xml TRUE Perform a simple XML check on the books description files (*.desc with the default configuration) and make sure each opening tag (e.g. <I>) has its corresponding closing tag (e.g. </I>, or in one like e.g. <BR/>). If some are missing, log this as ERROR.
skip_broken_xml TRUE As OPDS is using XML, and XML is strict, invalid XML leads to pages that do neither render nor display – hence the user could not download the book with his/her eBook reader. So if in doubt, we better "empty" the description to have the download enabled. ATTENTION: This needs check_xml to be enabled, or it won't know about broken XML.
scan_dbmode 'rebuild' Mode to use when scanning the file system for books and updating the database. Two modes are available: 'rebuild' is going to start everything from the scratch, emptying the database and inserting everything anew. As this way IDs (for books, authors, categories etc.) are subject to change, a second mode was added: 'merge'. This tries to figure out changes and merge them, while removed books are deleted from and new ones are added to the database.

Logging

Variable Example-Setting Explanation
logfile './minicalope.log' file for protocol entries (must be writeable for the web server process). This is the common logfile – to turn that off, simply specify an empty string here.
This setting must be a string.
dllogfile './minical_dl.log' Separate file to log downloads (must be writeable for the web server process). Is this specified (i.e. not empty), downloads will be logged hier – otherwise the common log is used.