My New Dockers - Apache-PHP and Enhanced Calibre Server


209 posts in this topic Last Reply

Recommended Posts

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:

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

 

 

 

 

 

 

 

 

Link to post
  • Replies 208
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

That works lol. Just keep in mind if you add any more users into the MineOS server they will also have access to that world import.

Problem solved.  I joined the mineos forums and hexparrot, the mineos creator, has updated all his dockers: I just installed https://hub.docker.com/r/hexparrot/mineos-docker via CA and it worke

I saw this and hoped it was from someone in this forum.  Thank you!!!  I need to learn how to create these templates.  I have so many projects that I've home grown that I would like to share.  

Posted Images

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 post

 

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 post

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 post
  • 2 weeks later...

I just upped a logo and changed the xml.... I want something that shows php, apache and database..

 

A1AQVll.png

 

Not great... but not sure what else to try. Apache feather is a little too boring for my taste.

 

EDIT -  fixed earlier problem.

Link to post

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 post

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 post
  • 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 post
  • 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 post
  • 4 weeks later...

Just installed this and it works great on 6.0.1 as well. Maybe I'm not understanding how this all works yet, but can someone tell me where all of the the .conf files exist, such as the httpd.conf, mod_php.conf, httpd-vhosts.conf?

 

Do I just manually create these and place them in my "config" folder?

Link to post

I'm also having connection rejected problems when apache is on port 80. It was listening on 80 earlier yesterday and all of a sudden it stopped. The WebGUI for unraid is on 8080 and nothing else on the network should be on 80.

 

Any ideas on what it could be?

Link to post

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 post

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.