My New Dockers - Apache-PHP and Enhanced Calibre Server


Recommended Posts

Hi Guys,

 

January 26, 2022

 

I have added a new docker: CloudCommander. It is a modified version of coderaiser's CloudCommander. I have modified the Docker itself to improve on the GUI. I have also added a way to manually modify the shortcut links to your own requirements. Here is the GUI.

 

image.thumb.png.1ac150cf6d2c7ff7378013f54f07249f.png

 

 

I hope you get good use out of this guy.

 

===========================================================

ORIGINAL POST

 

Thanks to all the help from you guys, I have managed to make a couple of Dockers. They are basically modifications of the work by smdion, CHBMB, and Aptalca. PLease note that I am NOT an expert at any of this... including Github.

 

Apache-PHP

This includes PHP and Apache to server some simple web pages..  I added Midnight Commander to the install (and created a quick logo).

 

Calibre Server

I took Aptalcas, and made some changes.

 

First I am storing the location of the server files (which would ordinarily remain in the container) and put them in one of my unRAID shares /mnt/users/appdata/calibre. The reason for this is that I have edited the look and feel of the Calibre web page. I do not want to loose those edits every time I reinstall the container.

 

Question:

ANSWERED by Sparklyballs Password login feature is implemented!!

A feature I would like is to password protect the Web site interface if I open the port on my router. Via script (in Ubuntu in /etc/init/calibre-server.conf) one can start the Calibre Server via this command:

 

env USER='myusername'
env PASSWORD='mypassword'
env LIBRARY_PATH='/home/hernando/Dropbox/Calibre'
env MAX_COVER='400x500'
env PORT='8080'

script
    exec /usr/bin/calibre-server --with-library $LIBRARY_PATH --auto-reload \
                                 --max-cover $MAX_COVER --port $PORT \
                                 --username $USER --password $PASSWORD
end script

 

 

As you can see you can pass a a username and password variables that it uses to password protect the site. How can I make this happen so I do not have to hard code the unername/password in the Dockerfile? Can something be done within the template where you enter these variables as part of the configuration?

 

Another feature I added, was to add my unRAID downloads folder to the container. When I download books, I have them automatically be copied from either rTorrent or Sab into /mnt/user/downloads/complete/books. I want to create a cron job that has the following code:

 

*/10 * * * * xvfb-run /opt/calibre/calibredb add /downloads/complete/Books/ -r --with-library /config && rm -rf /mnt/user/downloads/complete/Books/*
 

 

This will execute an update of the library and any new books will automatically land in the Calibre library without any intervention.

 

Question

Automatic Cron feature is implemented!! Watch out for the paths.

Can someone please guide me how I can automatically add this cron to the container?.

 

Feature should be added and working.

 

Any help is greatly appreciated as always.

 

Thanks,

 

Here is the repo:

https://github.com/hernandito/docker-templates

 

 

 

 

 

 

 

 

Edited by hernandito
Link to comment

Hi Guys,

 

Thanks to all the help from you guys, I have managed to make a couple of Dockers. They are basically modifications of the work by smdion, CHBMB, and Aptalca. PLease note that I am NOT an expert at any of this... including Github.

 

Apache-PHP

This includes PHP and Apache to server some simple web pages..  I added Midnight Commander to the install (and created a quick logo).

 

Calibre Server

I took Aptalcas, and made some changes.

 

First I am storing the location of the server files (which would ordinarily remain in the container) and put them in one of my unRAID shares /mnt/users/appdata/calibre. The reason for this is that I have edited the look and feel of the Calibre web page. I do not want to loose those edits every time I reinstall the container.

 

Question:

A feature I would like is to password protect the Web site interface if I open the port on my router. Via script (in Ubuntu in /etc/init/calibre-server.conf) one can start the Calibre Server via this command:

 

env USER='myusername'
env PASSWORD='mypassword'
env LIBRARY_PATH='/home/hernando/Dropbox/Calibre'
env MAX_COVER='400x500'
env PORT='8080'

script
    exec /usr/bin/calibre-server --with-library $LIBRARY_PATH --auto-reload \
                                 --max-cover $MAX_COVER --port $PORT \
                                 --username $USER --password $PASSWORD
end script

 

As you can see you can pass a a username and password variables that it uses to password protect the site. How can I make this happen so I do not have to hard code the unername/password in the Dockerfile? Can something be done within the template where you enter these variables as part of the configuration?

 

Another feature I added, was to add my unRAID downloads folder to the container. When I download books, I have them automatically be copied from either rTorrent or Sab into /mnt/user/downloads/complete/books. I want to create a cron job that has the following code:

 

*/10 * * * * xvfb-run /opt/calibre/calibredb add /downloads/complete/Books/ -r --with-library /config && rm -rf /mnt/user/downloads/complete/Books/*

 

This will execute an update of the library and any new books will automatically land in the Callibre library without any intervention.

 

Question:

Can someone please guide me how I can automatically add this cron to the container?.

 

Feature should be added and working.

 

Any help is greatly appreciated as always.

 

Thanks,

 

Here is the repo:

https://github.com/hernandito/docker-templates

 

you can pass in variables by either adding them to the template.xml

 

or manually by hitting advanced when adding/editing the docker in the unraid webui.

 

if this is your container, i'm not sure if it will let you get away with using USER as a variable or not though, because user is a docker command in build stage, so you may want to edit the script.

Link to comment

 

you can pass in variables by either adding them to the template.xml

 

or manually by hitting advanced when adding/editing the docker in the unraid webui.

 

if this is your container, i'm not sure if it will let you get away with using USER as a variable or not though, because user is a docker command in build stage, so you may want to edit the script.

 

I assume I can change to...

env CALUSER='myusername'
env CALPASSWORD='mypassword'

script
    exec /usr/bin/calibre-server --with-library $LIBRARY_PATH --auto-reload \
                                 --username $CALUSER --password $CALPASSWORD
end script

 

How do I go about setting the variable in the template.xml? Or an example you can point me to... Ideally it would be great if one could enter both values like we enter the port and Host Paths when creating a new container in the unRAID webui.

 

For your second suggestion, the variable(s) I set in Advanced View, are these the same variables used by the string --username $CALUSER --password $CALPASSWORD? This is the fist time I ever ever heard of environment variables.

 

Thank you Sparkly!

 

Link to comment

take a look at my kodi container template.xml in my main repo for a look at defining variables there.

 

and as for inputting them in the advanced view manually, and in fact putting them in the template xml you can use the variables in the script, removing the leading $.

 

 

Link to comment
  • 2 weeks later...

Experimenting with you Apache-PHP container,

 

Couple of questions..

 

Firstly, I'm just curious, what would you use cron for in the Apache-PHP container?  I've never really used cron for much other than some of the scripts people have posted on here, so I'm genuinely interested.

 

Secondly, and on the same topic, when I start the container, my log gets filled with

 

/usr/sbin/cron: can't lock /var/run/cron.pid, otherpid may be 11: Resource temporarily unavailable

 

Any ideas?

 

By the way, I've forked your container back and renabled some of the SSL stuff,  ;D

Link to comment

I have created my own "portal" page which is like a Maraschino on super steroids. One of the things it does, it goes to the various NZB indexing sites I am a member of, and it parses the RSS feed to show me the latest releases. It then presents them on my portal.

 

Because you only get a limited amount of API hits on those sites, I have a script that reads the rss feed, stores the info in a mySQL database table. Then when load the portal page, it reads the stored value in the database and not directly from the indexer websites.

 

The script runs every 30 minutes, so that is 48 API hits per day. The info then is at worse, 29 minutes or less behind. This is totally fine for my perusal purpose. It do not need real time like that.

 

Thus the cron... it runs the script that loads the data in the db. I also scrape the NY Times bestseller book list and stores it. I have a page that lists the weeks list.

 

I was getting the cron job  error you listed... and someway, somehow they went away. Unfortunately I cannot figure out what causes it. My guess is that it was a conflict with another docker. As you know, I am far from an expert.

 

 

 

 

Link to comment
  • 1 month later...

I could never get it to work properly.... sorry.

 

Try again, but no promises on how it works. YOu will need to go to the nZEDb forum for help configuring nZEDb... not that I dont want to elp; its that its been a while since I set nZEDb up... I use it in a VM, not the docker.

Link to comment
  • 5 weeks later...

Any way to fix this? I have myrianDB installed and the folder is inside the docker's appdata. I'm still trying to wrap my head around how the data flows within multiple virtualized environments on top of a host.

 

http://puu.sh/jyWnk/e9fc22a79b.png

 

What Docker are you referring to... I dont know anything about MyrianDB... you need to get a grasp on how folders are mapped and shared. Lots of posts here on how this works.

 

 

Link to comment
  • 4 weeks later...

I am trying to get your Calibre docker running but am not having any luck. I just get a "This webpage is not available" error when browsing to the WebUI.

 

Here's my mappings. The strange thing is that there are no files created in the /appdata/calibre folder and I would have expected to have something there. Any help you can provide would be appreciated.

 

 

Edit: I restarted the Docker and here's the log:

 

Installing Clean - Apply any Custom Edits
Installing to /opt/calibre
Downloading tarball signature securely...
Using previously downloaded calibre-2.38.0-x86_64.txz
Defining Cron job from crons.conf 
Launching Cron
Cron Done

image001.png.897a7b6bfeace257d54fcd76bddf6856.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.