Giter Club home page Giter Club logo

lab-library's Introduction

Setting Up Calibre Web

Current Admin Setup Notes

  1. Get ssh key and .env file from Computer Lab Monitor

  2. ssh into library server

  3. install docker, clone repo, scp .env file into repo directory

  4. docker-compose up -d

  5. set up letsencrypt to work with calibre-web:

    • cp ./letsencrypt-config/nginx/proxy-confs/calibre-web.subdomain.conf.sample ./letsencrypt-config/nginx/proxy-confs/calibre-web.subdomain.conf
    • modify ./letsencrypt-config/nginx/site-confs/default to use the subdomain conf, comment out main server block
  6. to update: docker-compose pull

  7. If the keybase service doesn't gracefully stop, you may get an error when starting the service again. To fix, manually umount the host mount point. See "Caveats" here.

fusermount -u /home/ubuntu/lab-library/kbfs

Old Notes

Cloud Setup

I wanted to use a stateless platform as a service (ex: Fargate on AWS) but I've found that working with file storage / databases on a stateless service and dealing with the load balancers for an n=1 service increases complexity and costs. EKS + ECS are also expensive and would causes lock-in to proprietary tech, but I still want to use docker.

Solution: just make a ec2 instance and wing it installing docker.

  • associate it with a elastic ip
  • open ports 80, 433, and 8083

Try it out locally first, commit this git repo and pull it to the EC2 server.

Follow instructions here for docker and docker-compose setup on host, then run docker-compose up in this directory.

The books db will show as invalid unless there is a calibre db there

Okay looks like we will use this letsencrypt setup

  • added it to the docker-compose
  • ensured access via library.computerlab.io:8083
  • ran docker-compose up, this created the cert
  • set up reverse proxy
    • see sample files in this dir
    • copied + renamed /letsencrypt-config/nginx/proxy-confs/calibre-web.subfolder.conf.sample, use / instead of /calibre-web
    • included this config in sites/default location directive (not the one at bottom of file)

scp -i calibre-web.pem ~/Dropbox/resources/calibre/metadata.db [email protected]:/home/ubuntu/lab-library/books

I tried out the Google Drive sync feature built into calibre-web, but it was quite buggy and also slow. Then I tried out syncing the books via Dropbox, but it seemed difficult to set up robust group access to the files without also allowing access to the rest of my Dropbox files.

I finally tried out using keybase, which worked quite nicely. With keybase, there's also the added bonus of the files being encrypted, and streamed to the device on request. This would allow hundreds of gigabytes to be "stored" on a device with limited disk space.

Note on KBFS mount (from keybase-kbfs-docker repo README)

If you're exporting the KBFS mount back to the host and the container crashes without cleaning up, you might have to manually umount (ie fusermount -u /home/you/kbfs) the host mount point.

One of the features of calibre-web is being able to email epubs to your kindle. I set up email using email setup: using gmail SMTP relay. This ended up breaking on reboot.

https://support.google.com/a/answer/2956491?hl=en

Old Notes

Setup on Raspberry Pi

In making my docker setup, I stupidly failed to consider the fact that the Raspberry Pi is an ARM device, and therefore I can't simply copy my docker-compose file to the Pi and then run docker-compose up and have things work.

The first problem I ran into was the lack of a install script / binary for docker-compose on arm7l. I had to create a virtualenv and install docker-compose via pip to get it to work.

Then, I looked at the calibre-web docker image and, while they supported arm, the convert function only works on x86. This, and the effort that I anticipated modifying the Keybase image to work on arm, inspired me to look for an x86 platform for the library.

After considering ordering a $35 Intel Compute Stick, I looked around my office and noticed a Chromebook that Google Cloud Platform had sent as a promotion. Was it an x86book? It is!

Setup on Chromebook

lab-library's People

Contributors

ptsteadman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.