Mobileread
COPS : Calibre OPDS PHP Server
#1781  cbalmforth 11-18-2020, 07:15 AM
Quote mariosipad
@cbalmforth

<-SNIP->

2 - "edit out"
Well it turns out that what you wanted to "edit out" I have "edited out" for years! (Great minds think alike ) And it's quite simple to do.

<-SNIP->
Sorry for the delayed response mariosipad. That WAS simple, and it did exactly what I wanted. I was looking in completely the wrong place to make the changes and wouldn't have found this without your help.

Many thanks, you're a star!
Reply 

#1782  Freakeao 11-24-2020, 05:46 PM
I'm not the biggest fan of the COPS bootstrap theme, but I love how COPS functions. So I updated the bootstrap theme more to my liking. Here's a couple screenshots

image »

image »

Source is here https://github.com/SenorSmartyPants/cops/tree/bootstrap
Reply 

#1783  Minstrelcda 12-07-2020, 10:21 AM
Quote Freakeao
I'm not the biggest fan of the COPS bootstrap theme, but I love how COPS functions. So I updated the bootstrap theme more to my liking. Here's a couple screenshots


Source is here https://github.com/SenorSmartyPants/cops/tree/bootstrap


This is probably a noob question, but how do I install this? Do I re-install cops completely using the link above, or just copy parts of this to my existing installation?

Thanks
Reply 

#1784  Freakeao 12-08-2020, 04:56 PM
Native (non-docker install):
copy templates/bootstrap2 into your current install
and also copy util.js from my repo over the util.js in your current install.

update config_local.php to include
Quote
$config['cops_template'] = 'bootstrap2';
I've submitted a pull request to support more templates, but until that is merged you will have to edit config_local.php to select this template.

For a docker install (which is how i have COPS installed) I mounted a couple extra volumes pointed at my development directories.

Quote
volumes:
- /opt/appdata/cops:/config
- /mnt/storage/media/Books:/books
#extra dirs to use bootstrap2
- /mnt/storage/github/cops/util.js:/usr/share/webapps/cops/util.js
- /mnt/storage/github/cops/templates:/usr/share/webapps/cops/templates
Reply 

#1785  Minstrelcda 12-08-2020, 10:57 PM
Thanks very much! I copied the directory and can see your changes.

Very nice!
Reply 

#1786  Minstrelcda 12-09-2020, 04:34 PM
I'm running a Truenas Core 12 server with the current release. I've been testing using COPS on it to handle my ebook collection and for the most part it seems to do what I want.

I have 2 questions (at least, only two at the moment )

First, I installed COPS using the directions here. I ran the command "git clone https://github.com/seblucas/cops.git" which installed what I assume is the latest version. My question is that when I look at the "about" screen, it shows version 1.2.0, but that github page says the most recent release is 1.1.3. Is the version I installed a beta test version, or an official release but the page wasn't updated?

The second question regards authenticated logins. I've seen multiple posts here and other sites suggesting the use of the .htaccess and .htpasswd files. I've tried that, but no matter what I try I always login straight into the application.

The file is in directory /iocage/jails/cops/root/usr/local/www/cops and the relevent section is:

<FilesMatch "\.php$">
AuthUserFile /usr/local/www/cops/.htpasswd
# AuthGroupFile /dev/null
AuthName "Secure Access"
AuthType Basic
Require valid-user
</FilesMatch>


The .htpasswd has 2 users in it with the password hashed, so it looks correct. It's in the same directory, but I've tried it in different directories (and updated the path in htaccess each time) with the same results.

When I try using the "$config['cops_basic_authentication'] = array('username' => 'user', 'password' => 'mypwd');" setting in the config file, I'm prompted for the user and password correctly. But I can't get the htaccess approach to work.

I'm obviously doing something wrong, but right now I don't see it. I'm hoping another set of eyes and stronger mind can point me to where I'm screwing up.

I should add that I'm using apache24.

Thanks
Reply 

#1787  mariosipad 12-10-2020, 08:41 AM
@Minstrelcda

I have (hopefully) 2 answers:

1 - Cops version
You use the latest github-version of COPS. The only difference between the latest "release" version in a zip and this version are some (3) minor corrections and additions. So go with the latest version.

NB: You were lucky you used the instructions (best I've seen) for installing COPS that you did, otherwise you would have run into some errors.

2 - Authentication
To use basic authentication in apache with .htaccess you need to change a setting in the apache2.conf (or httpd.conf) file (not COPS).
Search for:
Code
<Directory /var/www/http> Options Indexes FollowSymLinks AllowOverride None Require all granted
</Directory>
and change None to All.

You can, for testing purposes only (!!!), put your .htpasswd file in the COPS directory and reference it with ./.htpasswd in .htaccess.
Reply 

#1788  Minstrelcda 12-10-2020, 03:17 PM
Quote mariosipad
@Minstrelcda


2 - Authentication
To use basic authentication in apache with .htaccess you need to change a setting in the apache2.conf (or httpd.conf) file (not COPS).
Search for:
Code
<Directory /var/www/http> Options Indexes FollowSymLinks AllowOverride None Require all granted
</Directory>
and change None to All.

You can, for testing purposes only (!!!), put your .htpasswd file in the COPS directory and reference it with ./.htpasswd in .htaccess.

Thanks for your reply.

I made the change above in my httpd.conf file and restarted the service, but I can still log in directly without the prompt.

If I change the path in .htaccess to ./.htpasswd, when I log in I get a 500 Internal Server error. Changing the path to anything else where the .htpasswd file is located doesn't present the error, but also doesn't prompt me for the login.
Reply 

#1789  Minstrelcda 12-10-2020, 03:36 PM
further update..

I tried editing my original post but took too long and wasn't allowed to update it any longer.
-----------------------------------------------------------------------
I deleted the .htpasswd file and rebuilt it in case it had been corrupted, but the same results.

I checked to see if I had other .htaccess files which might be overriding this one. A locate gives me this:

root@cops:/ # locate .htaccess
/root/.composer/.htaccess
/root/.composer/cache/.htaccess
/usr/local/www/cops/.htaccess
root@cops:/ #

And running a locate on .htpasswd returns nothing.
root@cops:/ # locate .htpasswd

It's as if the file doesn't exist. I know it's a hidden file, but so is .htaccess and that was found.

In any case, I have copies of the .htpasswd file in multiple directories and can see them when I run ls -l -a on those directories. When I figure out what the problem is, I'll delete all the files not used.
Reply 

#1790  mariosipad 12-10-2020, 04:05 PM
And if you change
<Directory /var/www/http>
to
<Directory /usr/local/www>
?

The path to .htpasswd should be an absolute path, my mistake.
Your path is ok.
Reply 

 « First  « Prev Next »  Last »  (179/181)
Today's Posts | Search this Thread | Login | Register