Calibre est un gestionnaire de livres numériques permettant l’affichage, la conversion, l’édition ou le classement de livres électroniques dans les principaux formats. C’est un logiciel libre créé par Kovid Goyal et distribué sous licence GPL.
http://calibre-ebook.com/
COPS est une application Web permettant la publication d'une bibliothèque d'e-books Calibre au format OPDS (format de catalogue Open Publication Distribution System). Il permet d'accéder facilement aux e-books d'une bibliothèque Calibre depuis une liseuse supportant le format OPDS. C'est une alternative légère au serveur de contenu fourni par Calibre. Cela permet de rendre consultable en ligne sa bibliothèque numérique.
http://blog.slucas.fr/fr/oss/calibre-opds-php-server
Démo
Un grand merci à Sébastien Lucas pour la mise à disposition de COPS
Si vous avez besoin d'aide, merci de poster sur le [Topic unique] Calibre + COPS !!
Testé dans les conditions suivantes: ASRock E350M1/USB3 x64-embedded sur AMD E-350 Processor, 8GO DDR3, 2 x 2To - ZFS entrelacés, Nas4free Embedded (10.1.0.2 - Prescience (revision 1731) + TheBrig (Alcatraz)
Fonctionne sur 9.3 et 10.1 + TheBrig (Alcatraz)
Plutôt que de détailler la procédure d'installation qui est assez longue et fastidieuse, je vous ai préparé un script qui va tout faire à votre place. Pour les plus chevronnés d'entre vous qui souhaiteraient comprendre le déroulement de l'install, je vous invite à ouvrir le script avec notepad++ . Ce script est une version modifiée de celui utilisé pour Owncloud et du coup j'ai tiré parti de l'excellent travail de fsbruva.
Au final voici ce qui va être installer:
-lighttpd
-https
-sqlite
-php5
-fast-cgi
-fast-cgi sockets
-calibre
-COPS
Au préalable comme d'habitude, vous créez une jail avec TheBrig en suivant ce tuto
[TUTO] TheBrig-Comment créer une Jail
Ou avec Finch en suivant ce tuto
[TUTO] JAILS - FreeBSD in a Chroot
J'ai testé ce tuto dans une jail de TheBrig et dans une jail de finch ----------> fonctionne parfaitement RAS
Une fois la jail crée, vous entrez dedans
TheBrig Alcatraz
Code: Select all
jexec 1 cshCode: Select all
qjail console calibreCode: Select all
fetch https://dl.dumptruck.goldenfrog.com/p/oGn-lzdL3n/calibre.sh
chmod a+x calibre.sh
./calibre.shConfiguration lighttpd
Une fois l'installation terminée, il reste quelques petites choses à régler. Vous devez tout d'abord modifier le fichier de configuration de lighttpd
Code: Select all
edit /usr/local/etc/lighttpd/lighttpd.confOn édite le fichier rc.conf :
Code: Select all
edit /etc/rc.confCode: Select all
lighttpd_enable="YES"
calibre_enable="YES"
calibre_user="root"
calibre_library="/mnt/livres"Code: Select all
service lighttpd startVous créez les dossiers suivants qui vous servirons à stocker et à la mise à jour de votre bibliothèque
Code: Select all
mkdir /mnt/livres
mkdir /mnt/livres/toadd
chmod -R 777 /mnt/livres
chmod -R 777 /mnt/livres/toaddOn modifie également le fichier "calibre" dans rc.d
Code: Select all
edit /usr/local/etc/rc.d/calibreCode: Select all
: ${calibre_user:=root}Code: Select all
/usr/local/etc/rc.d/calibre starthttp://ip_jail:8080
Pour mettre à jour la librairie de calibre
Code: Select all
calibredb add /mnt/livres/toadd/* --library-path /mnt/livresLa mise à jour est manuelle mais je bosse sur un script qui va permettre de mettre en place un cron. Un petit coup de main ne serait pas de refus
Configuration COPSStep 5 — Creating a Cron Job to Add Books Automatically
We can write a simple cron job to watch our toadd directory for new books.
Every 10 minutes it will look for files in the /home/user/calibre-library/toadd/ directory, add any files in there to our Calibre database, and then remove the original files. (Calibre makes copies of the files when it adds them to our library so we don't need the originals once the add has taken effect.) This means that if you transfer book files via scp, ssh, etc. to this directory from your main machine, or just download them directly into the toadd directory, then they'll automatically be added to your Calibre database and be available for download from your library!
To create a cron job, execute:
crontab -e
You might have to make a selection about your preferred text editor.
At the end of the file add the line:
*/10 * * * * xvfb-run calibredb add /home/user/calibre-library/toadd/ -r --with-library /home/user/calibre-library && rm /home/user/calibre-server/toadd/*
The first part of the command (*/10 * * * *) means that the command should be run every ten minutes. The second part is the same as the command we manually ran earlier. It adds all the books from the toadd folder to the database and then removes the original files.
That's that. You can now access your ebooks from anywhere in the world.
Il faut préciser à COPS l'emplacement de la base de donnée de calibre
Code: Select all
edit /usr/local/www/cops/config_local.phpCode: Select all
$config['calibre_directory'] = '/mnt/livres/';
https://ip_jail:81/cops
Vous rafraichissez plusieures fois si nécessaire jusqu'à faire apparaitre l'écran ci dessous (ne vous inquiétez pas si vous voyez une erreur php5 intl, elle va disparaitre.
Je vous invite à poster sur le forum de Sébastien pour le remercier, cela l'encouragera à poursuivre son projet
http://www.mobileread.com/forums/showth ... ?p=1988610
enjoy
