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-22-2017, 11:23 AM   #1546
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Quote:
Originally Posted by MontyJ View Post
Frustrating...
I can imagine.

I can reproduce this behaviour (enter username and password then <Sign In> then <Please Sign In> pop-up window disappears shortly and appears empty again) only if I somehow have enabled (through .htaccess) authentication and the username/password I enter are different from those in .htpasswd ("encrypted").

So try:
- comment out the lines $config['cops_basic_authentication'] = ... in all config_local.php and config_local.userX.php files and try logging in again. What happens?
or
- make the username / password the same as in .htpasswd ("unencrypted") and try again. What happens?
mariosipad is offline   Reply With Quote
Old 05-22-2017, 11:36 AM   #1547
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
I can imagine.

I can reproduce this behaviour (enter username and password then <Sign In> then <Please Sign In> pop-up window disappears shortly and appears empty again) only if I somehow have enabled (through .htaccess) authentication and the username/password I enter are different from those in .htpasswd ("encrypted").

So try:
- comment out the lines $config['cops_basic_authentication'] = ... in all config_local.php and config_local.userX.php files and try logging in again. What happens?
or
- make the username / password the same as in .htpasswd ("unencrypted") and try again. What happens?
When I comment out all the auth config lines in the 3 files, it jumps right into "COPS 1.1.1" screen showing the 4 libraries as in config_local.php.

I have no .htaccess or .htpasswd files in the cops111 folder, OR in the parent Web folder. There was .htaccess in /Web/cops101, not being tested at the moment.

[Edit] Does ANYONE actually have this working??

Last edited by MontyJ; 05-22-2017 at 11:58 AM. Reason: Update
MontyJ is offline   Reply With Quote
Advert
Old 05-22-2017, 12:08 PM   #1548
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
Yeah me! But not on a QNAP.

If you enable authentication through .htaccess/.htpasswd does that work like you want it to?
mariosipad is offline   Reply With Quote
Old 05-22-2017, 12:26 PM   #1549
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
Yeah me! But not on a QNAP.

If you enable authentication through .htaccess/.htpasswd does that work like you want it to?
Yes, that works, but does not give me per user settings in COPS, which is my goal here!

Does this appear to be a specific Python issue? My current Python install is V2.7.12. I see there is a Python3 V3.5.2.0 available from the official QNAP install repository. Not sure of the downsides to installing the new one, but am willing to try if you think it may be specific to Python.

Last edited by MontyJ; 05-22-2017 at 01:07 PM. Reason: Clarify
MontyJ is offline   Reply With Quote
Old 05-22-2017, 01:11 PM   #1550
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
python -V gives on my setup Python 2.7.9

What's your PHP version (php -v)? PHP 5.6.30-0+deb8u1
mariosipad is offline   Reply With Quote
Advert
Old 05-22-2017, 01:18 PM   #1551
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
With working .htaccess put this file in your cops111 directory: (assuming/knowing) you have a working user monty.

config_local.monty.php
Code:
<?php

    /*
    * Catalog's title
    */
    $config['cops_title_default'] = "MONTY COPS";
Without the line for $config['cops_basic_authentication'] = array('username' => 'monty', 'password' => 'mypwd');

In my setup if I login with user monty it works.
mariosipad is offline   Reply With Quote
Old 05-22-2017, 01:32 PM   #1552
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
python -V gives on my setup Python 2.7.9

What's your PHP version (php -v)? PHP 5.6.30-0+deb8u1
Code:
[/share/Web] # python -V
Python 2.7.12
[/share/Web] #
Just downloaded a new version for the QNAP, Python 2.7.13 that is specific to this new version of firmware 4.3.3 x64 on the Qnap. It looks to be reasonably safe whereas Python3 seems to have some issues based on forum comments about it.

I will report back once it is installed and tested.


I tried php -v, but nothing found. I see a lot of php5 files in the qts system, but php5 -v doesn't bring up anything either. Still loading the new python 2.7.13...

Last edited by MontyJ; 05-22-2017 at 02:08 PM. Reason: update
MontyJ is offline   Reply With Quote
Old 05-22-2017, 02:20 PM   #1553
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Well, appears I have buggered the system somehow; now the old COPS doesn't even work after the new python update.

Back to square one....reset system, start clean.

Thanks for the help!
MontyJ is offline   Reply With Quote
Old 05-22-2017, 04:30 PM   #1554
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
@mariosipad,

Do you know if the cops authentication process depends on 1 or more specific modules in Python? I have a list of the modules and can check to make sure the right modules are there.

I have the qnap back up, in virgin state, except did load cops1.1.1 with a single calibre library for testing. It does work with the original .htaccess file left in the cops folder, but no .htpassword file.

But, it does not work when I put in cops authentication...same problem as before. This default version of Python is 2.7.5. I have queried the qnap gurus about loading the new 2.7.13 but haven't done it yet.
MontyJ is offline   Reply With Quote
Old 05-22-2017, 04:37 PM   #1555
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
As far as I know cops does not depend on python. No need to Install other modules just for cops.

Cops depends on PHP.
If checkconfig.php = ok in the first line, then it's ok.

Can you find out which apache modules are enabled in the QNAP webserver?

Last edited by mariosipad; 05-22-2017 at 04:44 PM.
mariosipad is offline   Reply With Quote
Old 05-22-2017, 05:16 PM   #1556
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
As far as I know cops does not depend on python. No need to Install other modules just for cops.

Cops depends on PHP.
If checkconfig.php = ok in the first line, then it's ok.

Can you find out which apache modules are enabled in the QNAP webserver?
FYI, attached is a jpeg of the checkconfig screen, so line 1 is ok.

However, per the hints, I checked php.ini for any mention of "intl" or "Intl" and no hits.

In previous setups I had installed Entware because it had the Intl php5 module. but I noticed that line in the check config screen never says OK, just to check Intl installed and activated.

But I am holding off Entware to keep the system as clean as possible while trying to get this to work. So I don't know if Intl ever got loaded in php.ini or not, even with Entware.

Could that be part of this problem?

I also attached a txt file of the loaded apache modules. Not sure how to tell if they are available to the "QNAP Webserver", but the list shows ALL apache modules, according to the qnap guides.

[Edit]
Forgot to mention; I setup COPS111 normally using the default port 80, no Virtual Host for it until we get this sorted out...until everyone throws up their hands in despair, that is
Attached Thumbnails
Click image for larger version

Name:	COPS111ConfigCheck.jpeg
Views:	247
Size:	107.5 KB
ID:	156944  
Attached Files
File Type: txt apache_modules.txt (9.6 KB, 167 views)

Last edited by MontyJ; 05-22-2017 at 05:22 PM. Reason: Update
MontyJ is offline   Reply With Quote
Old 05-22-2017, 06:03 PM   #1557
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
1 - checkconfig.php looks OK
-> the missing intl is no problem. Probably only used with latin (French, Spanish, etc) languages. Just disregard any messages about intl. Not a part of the problem.

2 - the text file list (as you said) all the available modules not just the "active/loaded" ones. But if .htaccess authentication works(worked once) then there should be no problem.

3 - now put the line
Code:
$config['cops_basic_authentication'] = array("username" => "monty", "password" => "montyspw");
in config_local.php and login with a browser in "private" mode.

Take it step by step.

Last edited by mariosipad; 05-22-2017 at 06:09 PM.
mariosipad is offline   Reply With Quote
Old 05-22-2017, 07:05 PM   #1558
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
1 - checkconfig.php looks OK
-> the missing intl is no problem. Probably only used with latin (French, Spanish, etc) languages. Just disregard any messages about intl. Not a part of the problem.

2 - the text file list (as you said) all the available modules not just the "active/loaded" ones. But if .htaccess authentication works(worked once) then there should be no problem.

3 - now put the line
Code:
$config['cops_basic_authentication'] = array("username" => "monty", "password" => "montyspw");
in config_local.php and login with a browser in "private" mode.

Take it step by step.
Used private/incognito mode in 3 different browsers.

Copied the above verbatim, including password, and entered. Deleted the current config_local.monty.php I had.

No change.

[Edit]

I just tried .htaccess in local mode and it is not kicking in. I used the one that came with the cops111 zip. Then I created a new .htpasswd with my monty name and password.

If I leave the cops auth statement active in config_local.cfg, then I get the login form for cops that doesn't work. So I commented it out.

Still using incognito mode, I entered 192.168.x.xxx/COPS111. It jumps right to the test library I have setup for the test; no password form from apache. I am pretty sure it worked in local mode before, but I am absolutely sure it worked when I used it through pagekite/Internet.

Should it work locally?

Did I mention I hate Apache...?

I finally remembered that the basic apache.conf had to be modified for password protection through Apache. Here is what I now have, but it still isn't working:

Code:
<Directory "/share/Web">
    Options FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
    AuthType Basic
    AuthName "RESTRICTED AREA"
    AuthUserFile /share/Web/COPS111/.htpasswd
    Require valid-user
</Directory>

Last edited by MontyJ; 05-22-2017 at 08:18 PM. Reason: Update
MontyJ is offline   Reply With Quote
Old 05-23-2017, 12:45 PM   #1559
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: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
[I had some internet (ISP) problems today. Some sites like this one refused to load. Seems to be fixed now.]

1 - to use .htaccess you might need the AllowOverride All statement like you have now.

2 - I would slightly change the lines you put in apache.conf, but it should work like you have it now.
Code:
<Directory "/share/Web/COPS111">
    Options FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
    AuthType Basic
    AuthName "RESTRICTED AREA"
    AuthUserFile /share/Web/COPS111/.htpasswd
    Require valid-user
</Directory>
3 - to make a change in an apache config file work, apache needs to either be restarted or the config files should be reloaded. Rebooting the QNAP has the same effect.

This all probably explains (hopefully) why authentication did not work. I hope it does now.

Quote:
Did I mention I hate Apache...?
Well I have the same with NGINX. For me apache usually works after a lot of
while NGINX does not.

Last edited by mariosipad; 05-23-2017 at 12:46 PM. Reason: typo
mariosipad is offline   Reply With Quote
Old 05-23-2017, 02:05 PM   #1560
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
[I had some internet (ISP) problems today. Some sites like this one refused to load. Seems to be fixed now.]

1 - to use .htaccess you might need the AllowOverride All statement like you have now.

2 - I would slightly change the lines you put in apache.conf, but it should work like you have it now.
Code:
<Directory "/share/Web/COPS111">
    Options FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
    AuthType Basic
    AuthName "RESTRICTED AREA"
    AuthUserFile /share/Web/COPS111/.htpasswd
    Require valid-user
</Directory>
3 - to make a change in an apache config file work, apache needs to either be restarted or the config files should be reloaded. Rebooting the QNAP has the same effect.

This all probably explains (hopefully) why authentication did not work. I hope it does now.


Well I have the same with NGINX. For me apache usually works after a lot of
while NGINX does not.
You got that right!

I still have the Apache setup, so will give your idea a try. But I relented and installed the latest QApache, which was what I was using before when I had cops in /share/htdocs.

And, I actually had it working for two users, briefly, then I screwed something up. The last time I had it fully working, I had to put all the cops files in /share/htdocs. It appears the correct way is to have it in /share/htdocs/COPS111 and that is where I run into problems.

But, working my way in the old learn-by-doing thing, LoL.

Question: How does COPS save individual user settings? Cookies?? Because everytime I go back into a different user, the settings are all gone. They seem to stick if I don't clear the cache. If this is the case, it means the user cannot clear their local caches and delete cookies, right? Tell me it ain't so!!
MontyJ 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 09:25 PM.


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