1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# COPS
COPS stands for Calibre OPDS (and HTML) Php Server.
See : [COPS's home](http://blog.slucas.fr/en/oss/calibre-opds-php-server) for more details.
Don't forget to check the [Wiki](https://github.com/seblucas/cops/wiki).
[](https://scrutinizer-ci.com/g/seblucas/cops/?branch=master)
[](https://scrutinizer-ci.com/g/seblucas/cops/?branch=master)
[](https://scrutinizer-ci.com/g/seblucas/cops/build-status/master)
[](https://travis-ci.org/seblucas/cops)
[](https://saucelabs.com/u/seblucas)
# Why ?
In my opinion Calibre is a marvelous tool but is too big and has too much
dependencies to be used for its content server.
That's the main reason why I coded this OPDS server. I needed a simple
tool to be installed on a small server (Seagate Dockstar in my case).
I initially thought of Calibre2OPDS but as it generate static file no
search was possible.
Later I added an simple HTML catalog that should be usable on my Kobo.
So COPS's main advantages are :
* No need for many dependencies.
* No need for a lot of CPU or RAM.
* Not much code.
* Search is available.
* With Dropbox / owncloud it's very easy to have an up to date OPDS server.
* It was fun to code.
If you want to use the OPDS feed don't forget to specify feed.php at the end of your URL.
# Prerequisites
1. PHP 5.3, 5.4, 5.5, 5.6, 7 or hhvm with GD image processing, Libxml, Intl, Json & SQLite3 support.
2. A web server with PHP support. I only tested with various version of Nginx.
Other people reported it working with Apache and Cherokee. You can also use PHP embedded server (https://github.com/seblucas/cops/wiki/Howto---PhpEmbeddedServer)
3. The path to a calibre library (metadata.db, format, & cover files).
On any Debian based Linux you can use :
aptitude install php5-gd php5-sqlite php5-json php5-intl
On Centos you may have to add :
yum install php-xml
# Install a release (Easiest way)
1. Extract the zip file you got from [the release page](https://github.com/seblucas/cops/releases) to a folder in web space (visible to the web server).
2. If you're doing a first-time install, copy config_local.php.example to config_local.php
3. Edit config_local.php to match your config.
4. If needed add other configuration item from config_default.php
If you like Docker, you can also try [this project](https://github.com/linuxserver/docker-cops)
# Install from sources
```bash
git clone https://github.com/seblucas/cops.git # or download lastest zip see below
cd cops
wget https://getcomposer.org/composer.phar
php composer.phar install --no-dev --optimize-autoloader
```
After that you can use the previous how-to starting at the second step.
Note that instead of cloning you can also get [latest master as zip](https://github.com/seblucas/cops/archive/master.zip)
# Where to put my Calibre directory ?
Long story short : ALWAYS outside of COPS's directory especially if COPS is installed on a VPS / Server. If you follow my advice then your data will be safe.
If you choose to put your Calibre directory inside your web directory and use Nginx then you will have to edit /etc/nginx/mime.types to add this line :
`application/epub+zip epub;`
# Known problems
Not a lot, except for the bad quality of the code (first PHP project ever) ;)
Please see https://github.com/seblucas/cops/issues for open issues
# Need help
Please read https://github.com/seblucas/cops/wiki and check the FAQ.
# Credits
* Locale message handling is inspired of http://www.mind-it.info/2010/02/22/a-simple-approach-to-localization-in-php/
* str_format function come from http://tmont.com/blargh/2010/1/string-format-in-php
* All icons come from Font Awesome : http://fontawesome.github.io/Font-Awesome/
* The unofficial OPDS validator : http://opds-validator.appspot.com/
* Thanks to all testers, translators and contributors.
* Feed icons made by Freepik from Flaticon website licensed under Creative Commons BY 3.0 http://www.flaticon.com and http://www.freepik.com
External libraries used :
* JQuery : http://jquery.com/
* Magnific Popup : http://dimsemenov.com/plugins/magnific-popup/
* Php-epub-meta : https://github.com/splitbrain/php-epub-meta with some modification by me (https://github.com/seblucas/php-epub-meta)
* TbsZip : http://www.tinybutstrong.com/apps/tbszip/tbszip_help.html
* DoT.js : http://olado.github.io/doT/index.html
* PHPMailer : https://github.com/PHPMailer/PHPMailer
* js-lru : https://github.com/rsms/js-lru
# Copyright & License
COPS - 2012-2016 (c) Sébastien Lucas
See COPYING and file headers for license info
|