View Single Post
Old 03-30-2020, 07:53 PM   #1
ConnorMac
Junior Member
ConnorMac began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2020
Device: FBReader on Android
Private Content-Server Libraries in Public Environment

First time poster and Originally Signed up to this forum to discuss the issues I was having trying to get the Development Environment to work under FreeBSD, but that's slightly irrelevant as I found a workaround to implement the code changes into my live system without having to use the downloaded source.

Anyway I digress, I set out with the aim of transferring all my eBooks and comics into a fresh server for the use of any guests visiting or staying at my property - without the need for a username login to access. However some of the works in my collection are of an adult nature and while I'd still like them to be available, they shouldn't be obviously accessible from the content manager homepage.

My solution was a second a library with the keyword "Private" in the name.
this was combined with the following coding changes.
./calibre/srv/legacy.py Line 129

select.append(E.option(library_name, value=library_id))

to

if not "Private" in library_name: select.append(E.option(library_name, value=library_id))

./calibre/srv/odps.py line 300

self.root.append(E.entry(

to

if not "Private" in library_name: self.root.append(E.entry(

and

/pyj/book_list/home.pyj added line at 256

if "Private" in library_name: cl.lastChild.style.visibility = 'hidden'

For Both /mobile and /opds the block can be bypassed by using a direct hard link to/opds?library_id=Private-Library-name /mobile?library_id=Private-Library-name (or whatever the library is called)
for the default ajax site the button can be unhidden using javascript (or most modern browser's resource inspector) or it can likewise be accessed through a direct hard link to /#library_id=Private-Library-name
I can make these links available on a case by case basis without risk of them being found accidentally.

I thought it worth raising here, to see if such a change would be worth committing to the code (beyond my own specific circumstance) or whether it would have unintended ramifications that would affect others?
ConnorMac is offline   Reply With Quote