basic OPDS (and HTML) catalog provider for eBooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

203 lines
9.6 KiB

  1. <?php
  2. #############################################################################
  3. # miniCalOPe (c) 2010-2019 by Itzchak Rehberg #
  4. # written by Itzchak Rehberg <izzysoft AT qumran DOT org> #
  5. # https://www.izzysoft.de/ #
  6. # ------------------------------------------------------------------------- #
  7. # This program is free software; you can redistribute and/or modify it #
  8. # under the terms of the GNU General Public License (see doc/LICENSE) #
  9. # ------------------------------------------------------------------------- #
  10. # Advanced configuration (use language-specific stuff) #
  11. #############################################################################
  12. #================================[ Directories ]===
  13. // default database file (override in language specific settings)
  14. $dbfile = dirname(__FILE__).'/metadata.db';
  15. // Where your books are stored.
  16. $bookroot = 'books';
  17. // Which book formats you want to use (file extensions). supported are epub and mobi
  18. $bookformats = ['epub','mobi'];
  19. // file extension for book descriptions
  20. $bookdesc_ext = ['desc'];
  21. // file extension for Metadata
  22. $bookmeta_ext = 'data';
  23. #===============================[ Checking ]===
  24. // check for possible XML errors in description files and log them?
  25. $check_xml = TRUE;
  26. // as XML errors break OPDS, better skip the broken content.
  27. // Needs above check to be enabled in order to work.
  28. $skip_broken_xml = TRUE;
  29. // how to insert books into the database:
  30. // 'rebuild': drop all data and do a fresh insert (books are likely to get new IDs this way)
  31. // 'merge' : try to figure out what has changed (recommended; keeps the book IDs, but is slower)
  32. $scan_dbmode = 'merge';
  33. #================================[ Logging ]===
  34. // Logfile to use. Empty means no logging to file.
  35. $logfile = './minicalope.log';
  36. // Seperate log file to log downloads to (in addition to the normal log).
  37. // Empty string to disable for now.
  38. $dllogfile = './minical_dl.log';
  39. // Available log levels: NOLOG, EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG
  40. // Yes - case IS important. Specified level includes all before-mentioned
  41. // File log level
  42. $fileloglevel = INFO;
  43. // Screen output when running in web mode
  44. $screenloglevel = NOLOG;
  45. // Screen output when running from command line
  46. $screenloglevel_cli = INFO;
  47. // Report New/Moved/Deleted on Scan
  48. $scan_report_changes = FALSE;
  49. #============================[ Book Covers ]===
  50. // Where to get the covers: calibre, simple, or off (none)
  51. $cover_mode = 'off';
  52. // maximum width (in px) to display them
  53. $cover_width = '200';
  54. // where to place the cover img links
  55. $cover_base = 'covers';
  56. // generate fake-covers when no real img available (HTML only)?
  57. $cover_fake_fallback = TRUE;
  58. #==========================[ Scan Specials ]===
  59. // Protect scan scripts against being run by web visitors
  60. $scan_cli_only = TRUE;
  61. // when found in .data files, what shall override definitions collected from the
  62. // directory structure? If not named here, it will be "merged". Currently
  63. // supported: author
  64. $data_overrides = ['author'];
  65. // As it's advisable to use 7-bit ASCII only for directory and file names,
  66. // one might wish to get the "correct spelling" into the Metadata by other means.
  67. // You can place ".name" files to have the directory name "replaced". Keep in
  68. // mind, however, that non-ASCII characters might cause issues with sorting.
  69. // Also remember to keep the .name and the "tag::"/"author::" in sync with .data files :)
  70. $dotname_overrides = ['author','genre'];
  71. // Whether to interprete content of .desc files as Markdown (1) or not (0).
  72. // This is the global switch. If enabled (1), you can override it per-genre
  73. // and/or per author by placing a file named .nomarkdown in their directory.
  74. $use_markdown = 0;
  75. #-------------------------------[ Checking ]---
  76. // check for possible XML errors in description files and log them?
  77. $check_xml = TRUE;
  78. // as XML errors break OPDS, better skip the broken content.
  79. // Needs above check to be enabled in order to work.
  80. $skip_broken_xml = TRUE;
  81. #------------------------[ data extraction ]---
  82. // we can extract some details from EPUB files. Define here whether we shall do
  83. // so, and what to extract.
  84. // Main switch to toggle it on/off:
  85. $autoExtract = TRUE;
  86. // Shall we extract covers? 0=no, 1=extract, 2=extract&resize
  87. // Covers will only be extracted if there is no cover image already.
  88. $extractCover = 1;
  89. // Which details to extract to .data files if autoExtract is enabled.
  90. // Valid values are either 'all' (to extract everything), or one or a
  91. // combination of author,isbn,publisher,rating,series,series_index,tag,title,uri
  92. // note that while 'isbn' and 'uri' are safe to use, there might be
  93. // issues with the others. For details, see issue #4 at Github:
  94. // https://github.com/IzzySoft/miniCalOPe/issues/4
  95. // Empty array switches off .data extraction completely (default)
  96. $extract2data = [];
  97. // What to extract to .desc files if autoExtract is enabled.
  98. // Valid values are either 'all' (to extract everything), or one or a
  99. // combination of 'desc' (book description only), 'head' (the heading
  100. // part with Metadata), 'toc' (table of contents). Future versions might diverse
  101. // further). For some background, make sure to read issue #4 at Github:
  102. // https://github.com/IzzySoft/miniCalOPe/issues/4
  103. // Empty array switches off .data extraction completely (default)
  104. $extract2desc = [];
  105. #============================[ Web Service ]===
  106. // Timezone
  107. $timezone = '+01:00';
  108. // Site Title
  109. $sitetitle = 'Book Server';
  110. // Full URL to miniCalOPe
  111. $baseurl = 'https://'.$_SERVER['SERVER_NAME'].'/opds/';
  112. // Path relative to the web servers DOCUMENT_ROOT
  113. $relurl = '/opds/';
  114. // how many items per page
  115. $perpage = 25;
  116. // Full URL to the Wikipedia to use for author info
  117. $wikibase= 'https://de.wikipedia.org/wiki/';
  118. // Enable some ISBN searches (empty array to disable this feature)
  119. $isbnservices = ['Amazon.DE','Bookzilla.DE','Buchhandel.DE','Google.DE','Buchfreund.DE','ZVAB.COM'];
  120. // Enable some book search services (search by author and title of the selected book;
  121. // empty array to disable this feature)
  122. $booksearchservices = ['Amazon.DE','Bookzilla.DE','Google.DE','Buchfreund.DE','ZVAB.COM'];
  123. #============================[ Person Info ]===
  124. // about you: Name, Homepage, Email
  125. $owner = 'John Doe';
  126. $homepage= 'https://www.johndoe.com/';
  127. $email = 'john@johndoe.com';
  128. #=========================[ Monetarization ]===
  129. // While our content is served for free, we won't object to any donations :)
  130. // -=[ Donations ]-
  131. // Specifying your Donation page here will enable the corresponding button.
  132. // Just copy the example file provided in 'doc/donationinfo.csv' and adjust it
  133. // to your liking (you can add more entries), then specify the file here:
  134. $donationInfo = 'doc/donationinfo.csv';
  135. // -=[ Flattr ]=-
  136. // Setting your FlattrID here will enable the FlattR button
  137. $flattrID = '';
  138. // The "dynamic button" shows FlattRs already received, but exposes your visitors to 3rd party sites
  139. $flattrMode = 'static'; // static|dynamic
  140. // -=[ Amazon ]=-
  141. // Your AmazonID will be used for Amazon ads (see below) as well as for the ISBN
  142. // and book-search services (see above). Simple leave it empty if you have none.
  143. $amazonID='';
  144. // Amazon ad content for book details page? (needs AmazonID, see Personal Info)
  145. $ads_bookdetails = TRUE;
  146. $ads_bookdetails_type = 'flash'; // flash|asap
  147. $ads_bordercolor = '4D9DFC';
  148. $ads_logocolor = 'AA4400';
  149. // --[ Amazon Simple Api (ASAP) ]--
  150. // your public and private API keys are needed for this. Leave empty if you have none,
  151. // this automatically disables ASAP. Same applies if you have no amazonID (see above).
  152. $ads_asap_pubkey = '';
  153. $ads_asap_privkey = '';
  154. $ads_asap_country = 'de';
  155. // where Asap should "proxy images" for more privacy. See Asap's "setImgBase" method for details. Empty=off (images will be served from Amazon directly).
  156. $ads_asap_imgbase = '';
  157. $ads_asap_lang = ''; // content language. Leave empty for default matching your local_site. See Asap's setLangPref() method for details.
  158. // use additional webvertizer class
  159. $ads_asap_webvertizer = FALSE;
  160. $ads_asap_webvertizer_domain = 'ebooks';
  161. // display ads on "initial pages" (i.e. those with no books, genres, authors)
  162. $ads_asap_initial = FALSE;
  163. // default string for "initial pages"
  164. $ads_asap_default_string = 'keywords::Buch;prodgroup::Books,DVD,Electronics';
  165. // file with genre specific strings (JSON; see 'lib/asap_genres.json.sample' for
  166. // an example file). Empty string disables this.
  167. $ads_asap_genre_strings = '';
  168. // disclaimer below the ads. Make sure it contains the '%cachedate%' placeholder.
  169. $ads_asap_disclaimer = 'Stand: %cachedate%<br>Preis &amp; Verfügbarkeit können sich geändert haben.';
  170. #=========================[ Language dependent stuff ]===
  171. # Here we make use of the language-specific directories. You either can set
  172. # the $use_lang variable directly in your scan scripts for command-line use
  173. # (takes precedence), or pass "?lang=<lang>" in the URL.
  174. // check what language shall be used
  175. if ( !isset($use_lang) && isset($_REQUEST['lang']) && !empty($_REQUEST['lang']) ) $use_lang = $_REQUEST['lang'];
  176. elseif ( empty($use_lang) ) $use_lang = 'de'; // define fallback to default lang
  177. // define language-specific settings
  178. switch ($use_lang) {
  179. case 'cal': // not a lang - but use the Calibre DB
  180. $dbfile = '/mnt/data/eBooks/metadata.db';
  181. break;
  182. case 'en':
  183. $uselangs = ['en'];
  184. $dbfile = dirname(__FILE__).'/metadata_en.db';
  185. $isbnservices = ['Amazon.COM','Google.COM','BookCrossing.COM','EuroBuch.COM'];
  186. $ads_asap_disclaimer = 'As of %cachedate%<br>prices &amp; availability might be subject to change.';
  187. $ads_asap_lang = 'en_GB';
  188. break;
  189. default :
  190. $uselangs = ['de'];
  191. break;
  192. }
  193. ?>