Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 05-29-2016, 12:59 PM   #1261
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Securing your content from unrestricted access from the internet and giving multiple users access to the same content is usually done with .htaccess. Just make jour password file only accessible to the Synology users with administrative privileges.
For example just user root .
Code:
chown root:root password
chmod 600 password
The values of the options setting (wrench icon) are saved on a per browser basis.
So use different browsers or PC's to test.
mariosipad is offline   Reply With Quote
Old 05-30-2016, 03:58 PM   #1262
vowi
Member
vowi began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2016
Device: none
OK, thank you! It´s working now. i had to protect the cookie, so that it isn´t deleted like the others, when i close the browser.
vowi is offline   Reply With Quote
Advert
Old 06-02-2016, 06:23 AM   #1263
fiets
Junior Member
fiets began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2016
Device: Raspberry pi
500 Internal Server Error

Hi,

I Just installed COPS on a raspberry pi and its works just fine.
I can select books and read it on the browser.

Only when I want tot download (epub button) the epub I get an error : "500 Internal Server Error"

The COPs version is: 1.0.0RC3
Its running on a Rapsberry Pi with NginX.
The path of my library is: "/mnt/Boeken/Calibre Library DB/"

NginX gives the following error:
2016/06/02 12:50:22 [error] 15287#0: *931 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 10.8.0.2, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.0.252", referrer: "https://192.168.0.252/ebooks/download/12390/Onschuldig+-+Baldacci%2C+David.epub"

Has anyone an idea what the problem is?

Thanks....

Last edited by fiets; 06-02-2016 at 06:51 AM.
fiets is offline   Reply With Quote
Old 06-02-2016, 10:20 AM   #1264
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
The "500 Internal Server Error" is a tricky one. It could be a problem with ngnix or with COPS. And that does not help you much.

First start with reinstalling COPS with the latest version from Github: https://github.com/seblucas/cops or
Code:
git clone https://github.com/seblucas/cops
if you know what you are doing.

Then (in the COPS directory) copy config_default.php to config_local.php and link to your calibre directory with the settng $config['calibre_directory'] = './'; in config_local.php.

Any errors when you connect to COPS with http://<IP-RaspberryPi>/cops/checkconfig.php ?

The calibre directory should have the accessibility rights 755 (chmod -R 755 calibre_directory). Also try to (re)name the directory without "spaces".

On my Pi (with Apache) it works.
mariosipad is offline   Reply With Quote
Old 06-03-2016, 05:57 AM   #1265
fiets
Junior Member
fiets began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2016
Device: Raspberry pi
Thanks for your reaction...

The config check says everthing is OK.

I also tried to make a virtual server with port 83.
Then, also, everything works fine but when i download an ebup I get a differtent error: 404 Not Found.

I also tried a directory name with no spaces (with a symbolic link) but the problem stays...

ik think it is a nginx configuration issue...

nginx log says:
error 32039#0: /var/www/ebooks/download/10374/Doelwit+-+Baldacci,+David.epub" failed (2: No such file or directory)

And /var/www/ebooks/download indeed doesn't exists...

Last edited by fiets; 06-03-2016 at 06:11 AM.
fiets is offline   Reply With Quote
Advert
Old 06-03-2016, 07:02 AM   #1266
Horus68
Zealot
Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.
 
Horus68's Avatar
 
Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
Thumbs up Magnifying glass for the search icon

Quote:
Originally Posted by tredelijkheid View Post
Hi guys,
2. I would like to customize the interface a bit. Example: To search you now have to press a kind of “config” button and I would like to change this into a “magnifying glass” for example. I am a bit familiar with CSS but is there a kind of “Style” guide which explains how to change the interface?
You need to change the "icon-cog" to "icon-search icon-2x" and edit CSS.

See here the files and etdits required
https://github.com/seblucas/cops/pull/239
Horus68 is offline   Reply With Quote
Old 06-03-2016, 07:42 AM   #1267
fiets
Junior Member
fiets began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2016
Device: Raspberry pi
Quote:
Originally Posted by fiets View Post
Thanks for your reaction...

The config check says everthing is OK.

I also tried to make a virtual server with port 83.
Then, also, everything works fine but when i download an ebup I get a differtent error: 404 Not Found.

I also tried a directory name with no spaces (with a symbolic link) but the problem stays...

ik think it is a nginx configuration issue...

nginx log says:
error 32039#0: /var/www/ebooks/download/10374/Doelwit+-+Baldacci,+David.epub" failed (2: No such file or directory)

And /var/www/ebooks/download indeed doesn't exists...
OK, Solved!

I changed: $config['cops_use_url_rewriting'] = "1";
to: $config['cops_use_url_rewriting'] = "0";
fiets is offline   Reply With Quote
Old 06-03-2016, 09:24 AM   #1268
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@fiets

Great that your problem is solved!

But why did you use $config['cops_use_url_rewriting'] = "1"; when "0" is the default value?

Nevermind, enjoy COPS!
mariosipad is offline   Reply With Quote
Old 06-06-2016, 03:50 AM   #1269
Azazael
Junior Member
Azazael began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2016
Device: dibuksaga
Hello

I need help. I have created calibreCOPS to my NSA325, work perfect
How can I make password acces?
I created .htpasswd and edited htaccess but not work.

THX in advance
Azazael is offline   Reply With Quote
Old 06-06-2016, 04:58 AM   #1270
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Quote:
Originally Posted by Azazael View Post
...How can I make password acces?
I created .htpasswd and edited htaccess but not work.
What exactly did you change in .htaccess in the cops directory?
How and where (path) did you create .htpasswd and with what rights?


If it does not work then you could try a setting in config_local.php:
Code:
    /*
     * Enable PHP password protection (You can use if htpasswd is not possible for you)
     * If possible prefer htpasswd !
     * array( "username" => "xxx", "password" => "secret") : Enable PHP password protection
     * NULL : Disable PHP password protection (You can still use htpasswd)
     */

     $config['cops_basic_authentication'] = NULL;
change last line to (for example):
Code:
    $config['cops_basic_authentication'] = array("username" => "Azazael", "password" => "s3cr3t");
mariosipad is offline   Reply With Quote
Old 06-06-2016, 09:49 AM   #1271
Azazael
Junior Member
Azazael began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2016
Device: dibuksaga
Quote:
Originally Posted by mariosipad View Post
What exactly did you change in .htaccess in the cops directory?
How and where (path) did you create .htpasswd and with what rights?


If it does not work then you could try a setting in config_local.php:
Code:
    /*
     * Enable PHP password protection (You can use if htpasswd is not possible for you)
     * If possible prefer htpasswd !
     * array( "username" => "xxx", "password" => "secret") : Enable PHP password protection
     * NULL : Disable PHP password protection (You can still use htpasswd)
     */

     $config['cops_basic_authentication'] = NULL;
change last line to (for example):
Code:
    $config['cops_basic_authentication'] = array("username" => "Azazael", "password" => "s3cr3t");
Thank you for your response

I used this tool http://www.htaccesstools.com/htpasswd-generator/
File path : /i-data/38e0c4cc/.system/zy-pkgs/gui/CalibreCOPS/.htpasswd
File permissions : -rwxr-xr-x 1 admin everyone
No changes in .htaccess I thought config file.

Worked if I will add this code: $config['cops_basic_authentication'] = array("username" => "Azazael", "password" => "s3cr3t");

If I will add this code: $config['cops_basic_authentication'] = NULL; not worked, only blank page.

Last edited by Azazael; 06-06-2016 at 10:42 AM.
Azazael is offline   Reply With Quote
Old 06-06-2016, 11:54 AM   #1272
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
The lines on the bottom of the .htaccess file in the COPS directory should look like: (Remove the relevant # at the beginning of the last 7 lines. )
Code:
###########################################
# Uncomment if you wish to protect access with a password
###########################################
# If your covers and books are not available as soon as you protect it
# You can try replacing the FilesMatch directive by this one
# <FilesMatch "(index|feed)\.php">
# If helps for Sony PRS-TX and Aldiko, beware fetch.php can be accessed
# with authentication (see $config ['cops_fetch_protect'] for a workaround).
###########################################
<FilesMatch "\.php$">
AuthUserFile /i-data/38e0c4cc/.system/zy-pkgs/gui/CalibreCOPS/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Access"
AuthType Basic
Require valid-user
</FilesMatch>
If you use .htaccess do not use the setting in config_local.php (should be $config['cops_basic_authentication'] = NULL; ).

If you use the setting in config_local.php do not change the .htaccess file from what is was when installed. Also no .htpasswd needed.
mariosipad is offline   Reply With Quote
Old 06-07-2016, 05:03 AM   #1273
Azazael
Junior Member
Azazael began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2016
Device: dibuksaga
I did everything possible, I changed .htpasswd location, I use another htpasswd generator....still not working
I have something wrong in my files ?

config_local.php
Spoiler:
<?php
if (!isset($config))
$config = array();

/*
* The directory containing calibre's metadata.db file, with sub-directories
* containing all the formats.
* BEWARE : it has to end with a /
*/
$config['calibre_directory'] = '/i-data/md0/public/library/';

/*
* Catalog's title
*/
$config['cops_title_default'] = "Calibre COPS as a ZyPKG";

/*
* use URL rewriting for downloading of ebook in HTML catalog
* See README for more information
* 1 : enable
* 0 : disable
*/
$config['cops_use_url_rewriting'] = "0";


/* Kobo readers (all models) and Tolino Shine (almost identical to Kobo Glo; same manufacturer)
* Downloading to Kobo/Tolinio isn't working properly
* books are downloaded as fetch.php to the readers and not properly renamed to booktitle and bookformat
* before the server uploads the book to the client (e-reader). Therefore books are not recognized as books
* by the ereader device
*/

/* cops_x_accel_redirect: default is "X-Sendfile"
* $config['cops_x_accel_redirect'] = "X-Sendfile";
*
* For Kobo/Tolinio readers set $config['cops_x_accel_redirect'] = "";
*/
$config['cops_x_accel_redirect'] = "";

/* note: option 'cops_full_url' below is not working on ZyXEL NSA NASes*/
/* $config['cops_full_url'] = "http://your.ip.address/pkg/CalibreCOPS/"; */
/* $config['cops_full_url'] = "http://localhost/pkg/CalibreCOPS/"; */
/* $config['cops_full_url'] = "http://your.ip.address/pkg/adv,/pkg/CalibreCOPS/"; */
/* $config['cops_full_url'] = "http://localhost/pkg/adv,/pkg/CalibreCOPS/"; */

/*
* For more options go to the MobileRead website: https://www.mobileread.com/forums/sho...d.php?t=170903
*/
$config['cops_basic_authentication'] = NULL;

htaccess
Spoiler:
DirectoryIndex index.php

<IfModule mod_xsendfile.c>
<Files fetch.php>
XSendFile on
</Files>
</IfModule>

###########################################
# If the notation above don't work, you can try that one
# Disclaimer : I'm no apache expert it can be bad security wise
###########################################
#XSendFile On
#XSendFileAllowAbove on

###########################################
# If you want to use user based configuration with
# apache 2.4 + php-fpm enable this
# https://github.com/seblucas/cops/issues/213
###########################################
#SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

###########################################
# On WAMP one user had to add this line in his httpd.conf
# None of the abose was working
###########################################
#XSendFilePath <YourCalibrePath>

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^download/(\d*)/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&db=$2&type=epub [L]
RewriteRule ^download/(\d*)/(\d*)/.*\.(.*)$ fetch.php?data=$1&db=$2&type=$3 [L]
RewriteRule ^download/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&type=epub [L]
RewriteRule ^download/(\d*)/.*\.(.*)$ fetch.php?data=$1&type=$2 [L]
</IfModule>

<IfModule mod_expires.c>
ExpiresActive on

# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xhtml+xml "access plus 0 seconds"

# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"

# Media: images
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# Webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
</IfModule>

###########################################
# Uncomment if you wish to protect access with a password
###########################################
# If your covers and books are not available as soon as you protect it
# You can try replacing the FilesMatch directive by this one
# <FilesMatch "(index|feed)\.php">
# If helps for Sony PRS-TX and Aldiko, beware fetch.php can be accessed
# with authentication (see $config ['cops_fetch_protect'] for a workaround).
###########################################
#
<FilesMatch "\.php$">
AuthUserFile /var/sec/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Access"
AuthType Basic
Require valid-user
</FilesMatch>

config_default.php
Spoiler:
<?php
/**
* COPS (Calibre OPDS PHP Server) class file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <sebastien@slucas.fr>
*/

if (!isset($config))
$config = array();

/*
* The directory containing calibre's metadata.db file, with sub-directories
* containing all the formats.
* BEWARE : it has to end with a /
* You can enable multiple database with this notation instead of a simple string :
* $config['calibre_directory'] = array ("My database name" => "/home/directory/calibre1/", "My other database name" => "/home/directory/calibre2/");
*/
$config['calibre_directory'] = './';

/*
* SPECIFIC TO NGINX
* The internal directory set in nginx config file
* Leave empty if you don't know what you're doing
*/
$config['calibre_internal_directory'] = '';

/*
* Full URL prefix (with trailing /)
* useful especially for Opensearch where a full URL is often required
* For example Mantano, Aldiko and Marvin require it.
*/
$config['cops_full_url'] = '';

/*
* Number of recent books to show
*/
$config['cops_recentbooks_limit'] = '50';

/*
* Catalog's author name
*/
$config['cops_author_name'] = "Sébastien Lucas";

/*
* Catalog's author uri
*/
$config['cops_author_uri'] = "http://blog.slucas.fr";

/*
* Catalog's author email
*/
$config['cops_author_email'] = "sebastien@slucas.fr";

/*
* Catalog's title
*/
$config['cops_title_default'] = "COPS";

/*
* Catalog's subtitle
*/
$config['cops_subtitle_default'] = "";

/*
* Wich header to use when downloading books outside the web directory
* Possible values are :
* X-Accel-Redirect : For Nginx
* X-Sendfile : For Lightttpd or Apache (with mod_xsendfile)
* No value (default) : Let PHP handle the download
*/
$config['cops_x_accel_redirect'] = "";

/*
* Height of thumbnail image for OPDS
*/
$config['cops_opds_thumbnail_height'] = "164";

/*
* Height of thumbnail image for HTML
*/
$config['cops_html_thumbnail_height'] = "164";

/*
* Icon for both OPDS and HTML catalog
* Note that this has to be a real icon (.ico)
*/
$config['cops_icon'] = "favicon.ico";

/*
* Show icon for authors, series, tags and books on OPDS feed
* 1 : enable
* 0 : disable
*/
$config['cops_show_icons'] = "1";

/*
* Default timezone
* Check following link for other timezones :
* http://www.php.net/manual/en/timezones.php
*/
$config['default_timezone'] = "Europe/Paris";

/*
* Prefered format for HTML catalog
* The two first will be displayed in book entries
* The other only appear in book detail
*/
$config['cops_prefered_format'] = array ("EPUB", "PDF", "AZW3", "AZW", "MOBI", "CBR", "CBZ");

/*
* use URL rewriting for downloading of ebook in HTML catalog
* See Github wiki for more information
* 1 : enable
* 0 : disable
*/
$config['cops_use_url_rewriting'] = "0";

/*
* generate a invalid OPDS stream to allow bad OPDS client to use search
* Example of non compliant OPDS client : Moon+ Reader
* Example of good OPDS client : Mantano, FBReader
* 1 : enable support for non compliant OPDS client
* 0 : always generate valid OPDS code
*/
$config['cops_generate_invalid_opds_stream'] = "0";

/*
* Max number of items per page
* -1 unlimited
*/
$config['cops_max_item_per_page'] = "-1";

/*
* split authors by first letter
* 1 : Yes
* 0 : No
*/
$config['cops_author_split_first_letter'] = "1";

/*
* split titles by first letter
* 1 : Yes
* 0 : No
*/
$config['cops_titles_split_first_letter'] = "1";

/*
* Enable the Lightboxes (for popups)
* 1 : Yes (enable)
* 0 : No
*/
$config['cops_use_fancyapps'] = "1";

/*
* Update Epub metadata before download
* 1 : Yes (enable)
* 0 : No
*/
$config['cops_update_epub-metadata'] = "0";

/*
* Filter on tags to book list
* Only works with the OPDS catalog
* Usage : array ("I only want to see books using the tag : Tag1" => "Tag1",
* "I only want to see books not using the tag : Tag1" => "!Tag1",
* "I want to see every books" => "",
*
* Example : array ("All" => "", "Unread" => "!Read", "Read" => "Read")
*/
$config['cops_books_filter'] = array ();

/*
* Custom Columns to add as an array containing the lookup names
* configured in Calibre
*
* For example : array ("genre", "mycolumn");
*
* Note that for now only the first, second and forth type of custom columns are supported
*/
$config['cops_calibre_custom_column'] = array ();

/*
* Rename .epub to .kepub.epub if downloaded from a Kobo eReader
* The ebook will then be recognized a Kepub so with chaptered paging, statistics, ...
* You have to enable URL rewriting if you want to enable kepup.epub download
* 1 : Yes (enable)
* 0 : No
*/
$config['cops_provide_kepub'] = "0";

/*
* Enable and configure Send To Kindle (or Email) feature.
*
* Don't forget to authorize the sender email you configured in your Kindle's Approved Personal Document E-mail List.
*
* If you want to use a simple smtp server (provided by your ISP for example), you can configure it like that :
* $config['cops_mail_configuration'] = array( "smtp.host" => "smtp.free.fr",
* "smtp.username" => "",
* "smtp.password" => "",
* "smtp.secure" => "",
* "address.from" => "cops@slucas.fr"
* );
*
* For Gmail (ssl is mandatory) :
* $config['cops_mail_configuration'] = array( "smtp.host" => "smtp.gmail.com",
* "smtp.username" => "YOUR GMAIL ADRESS",
* "smtp.password" => "YOUR GMAIL PASSWORD",
* "smtp.secure" => "ssl",
* "address.from" => "cops@slucas.fr"
* );
*/
$config['cops_mail_configuration'] = NULL;

/*
* Use filter in HTML catalog
* 1 : Yes (enable)
* 0 : No
*/
$config['cops_html_tag_filter'] = "0";

/*
* Thumbnails are generated on-the-fly so it can be problematic on servers with slow CPU (Raspberry Pi, Dockstar, Piratebox, ...).
* This configuration item allow to customize how thumbnail will be generated
* "" : Generate thumbnail (CPU hungry)
* "1" : always send the full size image (Network hungry)
* any url : Send a constant image as the thumbnail (you can try "images/bookcover.png")
*/
$config['cops_thumbnail_handling'] = "";

/*
* Contains a list of user agent for browsers not compatible with client side rendering
* For now : Kindle, Sony PRS-T1, Sony PRS-T2, All Cybook devices (maybe a little extreme).
* This item is used as regular expression so "." will force server side rendering for all devices
*/
$config['cops_server_side_render'] = "Kindle\/1\.0|Kindle\/2\.0|Kindle\/3\.0|EBRD1101|EBRD1201|cybook";

/*
* Specify the ignored categories for the home screen and with search
* Meaning that if you don't want to search in publishers or tags just add them from the list
* Only accepted values :
* - author
* - book
* - series
* - tag
* - publisher
* - rating
* - language
*/
$config ['cops_ignored_categories'] = array ();

/*
* If you use a Sony eReader or Aldiko you can't download ebooks if your catalog
* is password protected. A simple workaround is to leave fetch.php not protected (see .htaccess).
* But In that case your COPS installation is not completely safe.
* Setting this parameter to "1" ensure that nobody can access fetch.php before accessing
* index.php or feed.php first.
* BEWARE : Do not touch this if you're not using password, not using PRS-TX or not using Aldiko.
*/
$config ['cops_fetch_protect'] = "0";

/*
* WARNING NOT READY FOR PRODUCTION USE
* Make the search better (don't care about diacritics, uppercase should work on Cyrillic) but slower.
* 1 : Yes (enable)
* 0 : No
*/
$config ['cops_normalized_search'] = "0";

/*
* Enable PHP password protection (You can use if htpasswd is not possible for you)
* If possible prefer htpasswd !
* array( "username" => "xxx", "password" => "secret") : Enable PHP password protection
* NULL : Disable PHP password protection (You can still use htpasswd)
*/
$config['cops_basic_authentication'] = NULL;

/*
* Which template is used by default :
* 'default'
* 'bootstrap'
*/
$config['cops_template'] = 'default';

/*
* Set language code to force a language (see lang/ directory for available languages).
* When empty it will auto detect the language.
*/
$config['cops_language'] = '';

config.php
Spoiler:
<?php
/**
* COPS (Calibre OPDS PHP Server) class file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <sebastien@slucas.fr>
*/

require_once 'config_default.php';
if (file_exists(dirname(__FILE__) . '/config_local.php') && (php_sapi_name() !== 'cli')) {
require_once 'config_local.php';
}

$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : '';
// Clean username, only allow a-z, A-Z, 0-9, -_ chars
$remote_user = preg_replace( "/[^a-zA-Z0-9_-]/", "", $remote_user);
$user_config_file = 'config_local.' . $remote_user . '.php';
if (file_exists(dirname(__FILE__) . '/' . $user_config_file) && (php_sapi_name() !== 'cli')) {
require_once $user_config_file;
}

if(!is_null($config['cops_basic_authentication']) &&
is_array($config['cops_basic_authentication']))
{
if (!isset($_SERVER['PHP_AUTH_USER']) ||
(isset($_SERVER['PHP_AUTH_USER']) &&
($_SERVER['PHP_AUTH_USER']!=$config['cops_basic_authentication']['username'] ||
$_SERVER['PHP_AUTH_PW'] != $config['cops_basic_authentication']['password'])))
{
header('WWW-Authenticate: Basic realm="COPS Authentication"');
header('HTTP/1.0 401 Unauthorized');
echo 'This site is password protected';
exit;
}
}
Azazael is offline   Reply With Quote
Old 06-07-2016, 10:15 AM   #1274
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
As far as I can see and understand there is nothing ( .htaccess related) wrong with your config_local.php and .htaccess files.

It's possibly a problem with your Zyxel web server that possibly does not support .htaccess (?).
What webserver do you use? Maybe you need to change some config files.

If this is true just use the setting in config_local.php.
mariosipad is offline   Reply With Quote
Old 06-08-2016, 04:30 AM   #1275
Azazael
Junior Member
Azazael began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2016
Device: dibuksaga
I found this info, this is it ?

COPS Configuration Check
Spoiler:
Check if PHP version is correct
OK (5.5.19)
Check if GD is properly installed and loaded
OK
Check if Sqlite is properly installed and loaded
OK
Check if libxml is properly installed and loaded
OK
Check if Json is properly installed and loaded
OK
Check if mbstring is properly installed and loaded
OK
Check if intl is properly installed and loaded
Please install the php5-intl extension and make sure it's enabled
Check if Normalizer class is properly installed and loaded
Please make sure intl is enabled in your php.ini
Check if the rendering will be done on client side or server side
Client side rendering
Check if Calibre database path is not an URL
OK
Check if Calibre database file exists and is readable
OK
Check if Calibre database file can be opened with PHP
OK
Check if Calibre database file contains at least some of the needed tables
OK


Other info
Spoiler:
System Linux NSA325 2.6.31.8 #2 Mon May 2 16:59:19 CST 2016 armv5tel
Build Date Nov 22 2014 18:20:55
Server API Apache 2.0 Handler
PHP API 20121113
PHP Extension 20121212
Zend Extension 220121212
Zend Extension Build API220121212,NTS
PHP Extension Build API20121212,NTS
Apache API Version 20051115
DOM/XML API Version 20031129
GD Support enabled
GD Version 2.1.0-alpha
Azazael is offline   Reply With Quote
Reply

Tags
calibre opds, dns, kobo aura, synology


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre OPDS server with windows apps? nickdma Related Tools 10 03-03-2024 02:53 PM
[Old Thread] Android FBreader and Calibre OPDS server question kalex Calibre 5 12-24-2015 10:16 PM
PHP+Apache web server for calibre ... chaley Related Tools 254 04-28-2014 08:18 PM
External OPDS catalogue in Calibre bolton Calibre 1 09-05-2012 06:14 AM
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 09:57 AM


All times are GMT -4. The time now is 04:38 PM.


MobileRead.com is a privately owned, operated and funded community.