seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.44k stars 229 forks source link

Problem with Synology and COPS #510

Open entuccio opened 2 years ago

entuccio commented 2 years ago

Hello, I've installed COPS inside my Synology Web server. My Library is outside www default folder.

I set:

... $config['calibre_directory'] = '/volume1/Documenti/LibreriaPersonale/'; ...

checkconfig.php said:

"Not all Calibre tables were found. Are you sure you're using the correct database."

I granted permission 777 to the library with ssh and "open_base" on PHP info is not set.

What can I do ?

Thanks

SylvainDx commented 2 years ago

On Synology you have to go in the php option and add the path of your library in the homedir field

Envoyé depuis Yahoo Mail pour Android

Le sam., janv. 8, 2022 à 12:53, @.***> a écrit:

Hello, I've installed COPS inside my Synology Web server. My Library is outside www default folder.

I set:

... $config['calibre_directory'] = '/volume1/Documenti/LibreriaPersonale/'; ...

checkconfig.php said:

"Not all Calibre tables were found. Are you sure you're using the correct database."

I granted permission 777 to the library with ssh and "open_base" on PHP info is not set.

What can I do ?

Thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>

SylvainDx commented 2 years ago

Sorry I meant in webstation/php option / open basedir$

Envoyé depuis Yahoo Mail pour Android

Le sam., janv. 8, 2022 à 12:53, @.***> a écrit:

Hello, I've installed COPS inside my Synology Web server. My Library is outside www default folder.

I set:

... $config['calibre_directory'] = '/volume1/Documenti/LibreriaPersonale/'; ...

checkconfig.php said:

"Not all Calibre tables were found. Are you sure you're using the correct database."

I granted permission 777 to the library with ssh and "open_base" on PHP info is not set.

What can I do ?

Thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>

entuccio commented 2 years ago

Works perfectly. Thank you :-)

khiryos commented 2 years ago

Hello, I followed the whole installation process but still can't figure out why COPS does not work ("https://DDNS/cops" displayed nothing)

1) I have a web service portal running Apache 2.4 and PHP 7.6 (with all extensions checked) 2) My personal Calibre library is located at ":/volume1/books", and this path is written in the "config_local.php" file and in the PHP profile of Web Station 3) Read/Write permissions for http group are checked for the "books" folder 4) My firewall is disactivated (just for testing)

Do you have an idea of what I am doing wrong, please?

marioscube commented 2 years ago

Just for testing purposes:

Put your calibre library in a subdirectory of COPS (./COPS/books) and point to there in config_local.php.

Does this work?

khiryos commented 2 years ago

Hello Mario,

Thanks for helping. I tested what you suggest (and also switched to a full-stack IPv4 in order to use COPS on the internet, but it was another problem). Now I have a blank page with "No input file specified."

khiryos commented 2 years ago

I found an old thread (here: https://github.com/seblucas/cops/issues/267 )

I just replaced my PHP basedir by the following line and it works now: /tmp:/var/services/tmp:/var/services/web:/var/services/homes:/volume1/books/

I still don't know why we have to put the temp folders and web one but anyway, it works.

EDIT: I tested different combinations, and it seems like only the web folder is needed for removing the error I encountered (now it looks like: /var/services/web:/volume1/books/)

marioscube commented 2 years ago

So COPS works, Synology works, great!

Just put a password on COPS for external access.

I cannot test it, but COPS should work with IPv6. Is there a reason why it should not?

khiryos commented 2 years ago

You are right, Mario. Now I have a user/password authentication (with a htpasswd file) but it is also enabled for local access (it's not a big deal for me). Maybe I should use another port than the default 443 to be more secure.

I don't know if COPS also works with IPv6.

marioscube commented 2 years ago

@khiryos

1 - password Check out this info (haven't tried it myself yet but...) https://stackoverflow.com/questions/4913000/use-htaccess-to-restrict-external-access-to-my-intranet

2 - port 443 Security through obscurity might just work for a home-server. I use a port number > 10.000 and forward this to 80 or 443 in my router. If I decide to change the port I only have to change the rules in my router and not all kinds of configuration files (I run multiple "servers" on several Pi's for testing-fun).

3 - IPv6 Don't know. I have a tunnel IPv4 to IPv6 but have not tested much with it.

khiryos commented 2 years ago

1 - Your link sends me to "No results matched your search." 2 - It's a good advice. I already did that for my default http/https ports (instead of 5000/5001 that Synology put) but I wonder how to change the port for COPS. It's not a straightforward way (click, enter, port, save). How to achieve the port change, please? 3 - Okay.

Thanks for your feedback.

marioscube commented 2 years ago

This should work (I hope):

https://stackoverflow.com/questions/4913000/use-htaccess-to-restrict-external-access-to-my-intranet

The port setup should be done inside your (own or ISP provided) modem/router settings page.

khiryos commented 2 years ago

Hello Mario, Yes, I know how to redirect ports in my router, but I wonder how to change the access port of the COPS application itself. When I enter https://DDNS:XXXX/cops, with XXXX redirected to 443 from my router settings, it does not work anymore. Thanks for your link. I think the answer is here: https://tomschlick.com/conditional-htpasswd-multi-environments/ but I admit that don't have the strength to dive into lines of code.

marioscube commented 2 years ago

COPS has no settings for setting an access port.

If https://DDNS:443/cops worked before (https:///DDNS/cops) then https://DDNS:12345/cops should work if you forwarded port 12345 to 443 for the internal IP if COPS in your router.

khiryos commented 2 years ago

Now it works. You know why? Because I just had to put an "/" at the of the URL ^^

marioscube commented 2 years ago

Sometimes an “/“ is all it needs.........

It seems to me its browser dependent. Some browser add an “/“ automatically and some don’t. I sometimes have “//“ at the end of the url, and then it sometimes works, and sometimes not. Pretty frustrating. ;-)

khiryos commented 2 years ago

Aha you're right! Thanks again for your help ;) Have a nice weekend.