![]() |
#1156 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,466
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
The KOReader OPDS plugin can access the Cops demo and download epub.
Koreader can be added to Kindles, Kobos, Pocketbook, and some Android devices. Luck; Ken |
![]() |
![]() |
![]() |
#1157 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
|
How to identify ebook reader apps (android) to redirect to feed.php when browsing COPS catalog?
Main index.php now includes this ones: MantanoReader|FBReader|Stanza|Marvin|Aldiko|Moon+ Reader|Chunky I'm looking for the proper names for these apps: FullReader+ https://play.google.com/store/apps/d...com.fullreader PocketBook reader https://play.google.com/store/apps/d....obreey.reader Ebookdroid https://play.google.com/store/apps/d...org.ebookdroid Note: I was able to identify this one as "AlReader" (and will make a PR for it): AlReader - https://play.google.com/store/apps/d...rland.alreader See issue on Github for developments: OPDS reader identification · Issue #236 · seblucas/cops - https://github.com/seblucas/cops/issues/236 Last edited by Horus68; 01-07-2016 at 01:07 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#1158 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
|
Visuals for COPS
Did you notice the new icons available to COPS OPDS feed when browsing your library with your ebook reader app?
Available in code now: Merged: Images for feed categories - new set and missing ones #244 · seblucas/cops - https://github.com/seblucas/cops/pull/244 ![]() = Do you have some skills to design a logo for COPS? Let's hear from you! Cops Logo - Proposals · Issue #246 · seblucas/cops - https://github.com/seblucas/cops/issues/246 = Question: Do you feel the need for a color template when browsing Cops with a web browser? Last edited by Horus68; 01-15-2016 at 09:47 AM. |
![]() |
![]() |
![]() |
#1159 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
I did notice them (on github).
Thank you for adding to and improving on an already great tool. ![]() For my taste the icons, on an older iPhone 4, were a bit large. I have to try on another iDevice (iPhone/iPad) to see if this initial conclusion holds up. Regrettably my OPDS reader of choice, Marvin for iOS, does not seem to support icons in the OPDS feed (not that i missed this feature until now ![]() I, personally, am not in favour of a colored web template for COPS. The interface should not distract from the content, and for me to much colour does. But YMMV. Keep up the good work! ![]() |
![]() |
![]() |
![]() |
#1160 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
|
Quote:
I use Android but you can test this app (its version for Android shows icons and its my favorite!) PocketBook Reader - https://itunes.apple.com/us/app/id805488884 Maybe someone can also test some other apps in iOS (or suggest some) ShuBook - https://itunes.apple.com/us/app//id385897279 MegaReader - https://itunes.apple.com/app/id387136454 Ebook Reader - https://itunes.apple.com/us/app/id381260755 Hyphen - https://itunes.apple.com/us/app/id1043976879 Do try with my live test library: http://rbebook.esy.es/ And for those on android: OPDS with icons: PocketBook reader https://play.google.com/store/apps/d....obreey.reader FullReader+ https://play.google.com/store/apps/d...com.fullreader Moon+ Reader https://play.google.com/store/apps/d...oft.moonreader Last edited by Horus68; 01-26-2016 at 02:44 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1161 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Tested on iOS 8 with iPad:
Stanza : works (i see icons) Shubook : works Pocketbook Reader : works Marvin : NO custom icons in OPDS view The icons are (for my taste on iOS) slightly to large. ![]() |
![]() |
![]() |
![]() |
#1162 |
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2012
Location: Sydney, Australia
Device: Kindle 3G & Paperwhite
|
Hi ...
I've asked this before ( last April ) with no reply so I figure it's time to try again. Has anyone that has username/password login enforced made any modifications to log successful user logins? I already have fail2ban monitoring bad logins. I have a handful of users of my library & it'd be nice to know who's using it and how often. Cheers, TC |
![]() |
![]() |
![]() |
#1163 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
@teejcee
On the www I found this (not 100% what you wanted, but maybe it's a start): http://serverfault.com/questions/460...empts-htpasswd Despite some tinkering with the code I could not get it to work ![]() But you might have more luck. |
![]() |
![]() |
![]() |
#1164 | |
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2012
Location: Sydney, Australia
Device: Kindle 3G & Paperwhite
|
@mariosipad
Quote:
Cheers, TC |
|
![]() |
![]() |
![]() |
#1165 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
@teejcee
What system is your COPS running on? For example: - linux and apache - windows and WAMP (Apache) - other webs server like ngnix - Synology with web server - Raspberry Pi with apache or ngnix I have made some progress with Linux (Debian) and Apache so maybe I can share? |
![]() |
![]() |
![]() |
#1166 | |
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2012
Location: Sydney, Australia
Device: Kindle 3G & Paperwhite
|
Quote:
I'm running mint linux & apache2 on a lttle server. COPS is kept up to date via owncloud which syncs the COPS data with Calibre on a laptop. I have made progress since my last reply. I took a look at the link you sent but , like you, didn't get far with it. Since then, I've now got a cron job running every morning which reports successful user logins. Yaaaayyyyyy!!!!! The first live run was in fact this morning and all worked as advertised. It is not very sophisticated but achieves my goal. I found that the apache2 log file, other_vhosts_access.log, if enabled, contained heaps of log lines, most of which were generated by owncloud. However, a closer study revealed that a login to COPS also generated a lot of entries. It was the a matter of identifying a line which was unique for each login, which did in fact exist.The text "getJSON" appeared in one line. I then created my cron job...I must give some cedit to an old mate of mine for assistance. Thanks Garry. Create your script in ~/bin....call it whatever and enter code below ( If you haven't already, add your ~/bin to $PATH ) Code:
#!/bin/bash
# email details of COPS user logins for past 24 hours...
DATE=$(date +%d-%b-%Y)
LOGFILE="pathname-to-log-file"
# mine is /var/log/apache2/other_vhosts_access.log
cd ~
grep getJSON $LOGFILE | mail -s "subject line $DATE" email-address
#eg "User Logins for $DATE" me@my-email-address.whatever
crontab -e Code:
15 6 * * * /home/your-username/bin/the-script-name.sh I get a lot more information than just user & IP address , which is a bonus. If you've any questions, fire away, and thanks for your input on this. I'd be interested on the approach you're looking at. Cheers, TC |
|
![]() |
![]() |
![]() |
#1167 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Great solution!
Mine is a little different but needs some more testing. Once this is done I will post my solution. Just one observation. Are you sure this line Code:
grep getJSON $LOGFILE | mail -s "subject line $DATE" email-address I see "getJSON" multiple times per login in /var/log/apache2/access.log (other_vhosts_access.log is empty on my system = Debian Squeeze and/or Mint 17.0 with Apache). Last edited by mariosipad; 02-02-2016 at 05:51 PM. Reason: typo's |
![]() |
![]() |
![]() |
#1168 | |
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2012
Location: Sydney, Australia
Device: Kindle 3G & Paperwhite
|
Quote:
( Until this morning...more on this later ) I'd be interested in how you're writing to access.log. My access.log does get entries pertaining to a login but doesn't have any reference to user, ip, getJSON etc. Each line ends with..... "(internal dummy connection)" I've even tried to create & run a log for cops... opds.access.log ... it gets created ok but nothing gets written to it. The beauty of my solution is that I don't need to modify any of the application scripts other than to enable the log file. Plus you can run it manually whenever you want. It's not perfect as I've yet to figure out when the logs get rotated, so entries are currently repeated each day. I'll probably rotate the log daily when I figure it out. The system uses anacrontab and I've yet to come to grips with that. Also, I've checked this morning's email and one of my users has somehow created heaps of entries with getJSON. Perhaps more lines get written as the user does things within COPS...ie clicks on different icons etc I'll do some testing. I'll need to check it out with him...he's a "problem child" when it comes to using the system and instead of asking for help, stuffs around with things and gets himself in a muddle. At least he can't do any harm that I know of...( other than create all these entries.... ![]() edit.... Well, that didn't take long. I've just logged in myself and did aa bit of jumping around & ended up with a stack of entries with getJSON in the log. Hmmmm....back to the drawing board. Cheers, TC Last edited by teejcee; 02-02-2016 at 07:52 PM. Reason: Additional inforamtion |
|
![]() |
![]() |
![]() |
#1169 | ||
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 725
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
|
Hi TC,
This turned out to be a nice little project! ![]() Quote:
What to write to access.log is defined in /etc/apache2/apache2.conf and when to write is defined in /etc/apache2/sites-enabled/000-default.conf. The file without comments. See line -> Customlog: Code:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Quote:
Now for my "solution" ;-) It's most certainly not "the best", but it just works (for me). 1 - I installed COPS files in: /var/www/html/cops Calibre Databases can be installed where you/I want. 2 - I created the file /etc/apache2/auth.cops Code:
### /etc/apache2/auth.cops ### ### Add password for /var/www/html/cops/* ### <Directory /var/www/html/cops> AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/.htpasswd Require valid-user </Directory> # Select only the "/cops/" dir to log SetEnvIf Request_URI "/cops/$" logit ### Define new LogFormat & CustomLog LogFormat "%u %t %h %>s" simple CustomLog ${APACHE_LOG_DIR}/user.log simple env=logit ### end ### b - edit where you put the .htpasswd file c - with SetEnVif I set which log-line to put in the new log (not getJSON but /cops/ ) d - define what to put in the new log (LogFormat) e - write the line to the log user.log [user time IP etc.] 3 - I edited /etc/apache2/sites-enabled/000-default.conf and added the line Code:
Include /etc/apache2/auth.* /etc/apache2/sites-enabled/000-default.conf now looks like: Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
### Include (COPS) authorization code(s) ###
Include /etc/apache2/auth.*
### End Include ###
</VirtualHost>
5 - login and you see a new log file in /var/log/apache2/user.log Strangely enough the content of this file in MInt is not 100% the same as in Debian. Debian adds a line with '-' as user. But it's no real problem. With a cron job you could mail this log-file to yourself every day/week/month/etc 6 - todo: rotate the user log every month or so, depending on number of lines in the log. Update: The OS (Linux Mint / Debian) uses some logrotate scripts and cronjobs that rotate the *.log files in /var/log/apache2/ . My new log file 'user.log' is in this map/directory so it will be included in the scheduled log rotation. Nothing to do here! ![]() Greetz Mario Last edited by mariosipad; 02-03-2016 at 05:34 PM. Reason: Added an update for log rotate |
||
![]() |
![]() |
![]() |
#1170 | |
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Mar 2012
Location: Sydney, Australia
Device: Kindle 3G & Paperwhite
|
Quote:
I've compared each 000-default.conf and code wise and they are the same...I'm talking about your original of course. I would be surprised if there were any differences in our apache2.conf files but if they're the same, I can't figure out why I'm not getting any entries in access.log, other than those that I mentioned in an earlier post. Mind you, my apache2/PHP skills are next to nothing....just what I've worked out in COPS. It'll be something obvious I'll bet. |
|
![]() |
![]() |
![]() |
Tags |
calibre opds, dns, kobo aura, synology |
|
![]() |
||||
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 |