Table of Contents
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) 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' and 'mobi' — so you may restrict to one or both of them, but not (yet) extend to more. This may change with future versions. 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. This setting must be a string. |
| fileloglevel | INFO | Priority of events to log to file. You can chose between the constants NOLOG, EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG. Higher priorities than specified ara automatically included (e.g. ALERT includes EMERGENCY). |
| screenloglevel | NOLOG | Same for output into the browser |
| screenloglevel_cli | INFO | Same for output on the console (e.g. for Scan) |
| scan_report_changes | FALSE | report added/moved books (directory, title) during Scan |
Book Cover
| Variable | Example-Setting | Explanation |
|---|---|---|
| cover_mode | 'off' | for the scan script: should covers be made available? Principally a simple yes/no question — but I used a string as the handling may be differently: using Calibre (and a $bookroot outside the DOCUMENT_ROOT) we need to create symlinks to the cover images (implemented for Calibre only at this time), with the bookroot inside the DOCUMENT_ROOT the scan script only tries to extract the cover images from *.epub files and saves them with the book file name (but the jpg/png file extension) to be used directly — unless you specify 'off' for this setting. This setting must be a string. Possible values: 'off', 'calibre', 'normal'. |
| cover_width | '200px' | Width of the cover image as displayed in the HTML view. This setting must be a string. |
| cover_base | 'covers' | where to place symlinks to cover images (see cover_mode above). The example uses the directory covers/ directly inside the miniCalOPe installation. This setting must be a string. |
| cover_fake_fallback | TRUE | shall we generate fake-cover-images on the book details page, if no real cover is available? (HTML-view only) |
Web Service
| Variable | Example-Setting | Explanation |
|---|---|---|
| timezone | '+01:00' | time zone of the timestamps used. This is required for the XML/OPDS views, and must be specified as in this example (so for GMT+1, +1 hour and 0 minutes; for GMT itself use +00:00. Always specify the relation to GMT — it's currently not possible to specify time zones directly as e.g. CET, PCT or the like). This setting must be a string. |
| sitetitle | 'Book Server' | Name of the site (e.g. 'Peters BookShelf?'). Used e.g. in the HTML TITLE Attribut (i.e. what is displayed in the web browsers title bar) and other places. This setting must be a string. |
| baseurl | 'http://localhost/opds/' | complete URL to your miniCalOPe installation. The example uses a hard-coded string; but surely the use of the $_SERVER['HTTP_HOST'] variable would be useful here for more dynamic configuration. This setting must be a string. |
| relurl | '/opds/' | the path segment of $baseurl This setting must be a string. |
| perpage | 25 | for "Pagination": how many entries to display per page? Keep in mind smaller displays of eBook-readers (and especially smartphones) when adjusting this value. The range of 10 to 50 should usually be fine. This setting must be an integer. |
| wikibase | 'http://de.wikipedia.org/wiki/' | used e.g. to obtain details on authors. Wikipedia in the resp. language is a very good source here, as most authors are covered — but in principle any similar wiki source can be used. Currently, the name of the author is simply appended to this URL — a future version may change this to contain a place holder. This setting must be a string. |
| isbnservices | (selection) | Which of the available book-shops should be used for ISBN-links on the HTML-views book details page, if an ISBN is available for the selected book? Available services are listed in CSV format in the lib/isbnsearch.csv file, the names to be used here are defined in the first column. This setting must be an array. |
| booksearchservices | (selection) | Similar to the ISBN-Search this defines sites to be searched via author and title, which are available for all books. Available services for this can be found in the lib/booksearch.csv file. This setting must be an array. |
Person Info
These data shall help to contact you (as the owner of the catalog), and are placed within the XML view according to the Atom/OPDS specifications:
| Variable | Example-Setting | Explanation |
|---|---|---|
| owner | 'John Doe' | Your Name (String) |
| homepage | 'http://www.johndoe.com/' | Your homepages URL (for more information; String natürlich) |
| 'john@johndoe.com' | EMail-Adresse to contact you (String) |
Language dependent stuff
This is meant to adjust some of the above settings depending on the language used (i.e. the value given by lang=XX at the URL). There are no additional settings - it's just to override the existing ones.
It is important to stick to the 2-char ISO language code for this value (and thus for the language-directory-level in the $bookroot), i.e. 'en' for English, 'es' for Spanish, 'de' for German, a.s.o. One specific exception is 'cal', which specifies to use a Calibre backend directly.
