From ce5ba1a4a1387808c0e12041a630f85af774fb81 Mon Sep 17 00:00:00 2001 From: rflx Date: Sat, 3 Jul 2021 00:46:11 +0300 Subject: Add a Calibre article --- calibre.html | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 calibre.html (limited to 'calibre.html') diff --git a/calibre.html b/calibre.html new file mode 100644 index 0000000..f14062a --- /dev/null +++ b/calibre.html @@ -0,0 +1,141 @@ + + + + Setting up a Calibre library server – LandChad.net + + + + + + + +

Setting up a Calibre library server

+ +
+

+ The Calibre library server is a great way to store your e-books. + It allows you to: +

  • Share your books with others.
  • +
  • Easily transfer your books between devices and access them from anywhere.
  • +

    + +

    Installation

    + +

    + Install the Calibre package. +

    + +
    apt update && apt install calibre
    +mkdir /opt/calibre
    + +

    + Either upload your existing library using scp. For example to /opt/calibre/ +

    + +

    + On client: +

    + +
    scp -r ~/Documents/your_library root@example.org:/opt/calibre/
    + +

    + Or create a library and add a book to it. +

    + +
    cd /opt/calibre
    +calibredb add book.epub --with-library your_library
    + + + +

    + Add a new user. +

    + +
    calibre-server --manage-users
    + +

    Creating a service

    + +

    + Create a new file /etc/systemd/system/calibre-server.service and add the following: +

    + +
    [Unit]
    +Description=Calibre library server
    +After=network.target
    +
    +[Service]
    +Type=simple
    +User=root
    +Group=root
    +ExecStart=/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibre/your_library
    +
    +[Install]
    +WantedBy=multi-user.target
    +
    + +

    + Issue systemctl daemon-reload to apply the changes. +

    + +

    + Enable and start the service. +

    + +
    systemctl enable calibre-server
    +systemctl start calibre-server
    + +

    A reverse proxy with Nginx

    + +

    + Create a new file /etc/nginx/sites-available/calibre and enter the following: +

    + +
    server {
    +	listen 80;
    +	server_name calibre.example.org;
    +	
    +    location /calibre {
    +        proxy_pass http://127.0.0.1:8080;
    +        proxy_set_header Host $http_host;
    +        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    +        proxy_set_header X-Scheme $scheme;
    +        proxy_set_header X-Script-Name /calibre;
    +    }
    +}
    + +

    + Issue a Let's Encrypt certificate. Detailed instructions and additional information. +

    + +
    certbot --nginx
    + +

    + Now just go to calibre.example.org. The server will request a username and password. +

    + + + calibre + + +

    + After login you will see something like this. +

    + + + calibre + + +
    + +

    + By rflx -- website -- XMR: rflx.xyz +

    +
    + + + + -- cgit v1.2.3 From d06daf8a773c1fb60b434af548f59a61c8fa3563 Mon Sep 17 00:00:00 2001 From: rflx Date: Sat, 3 Jul 2021 00:47:24 +0300 Subject: Fix typo --- calibre.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calibre.html') diff --git a/calibre.html b/calibre.html index f14062a..084858e 100644 --- a/calibre.html +++ b/calibre.html @@ -114,7 +114,7 @@ systemctl start calibre-server
    certbot --nginx

    - Now just go to calibre.example.org. The server will request a username and password. + Now just go to calibre.example.org. The server will request an username and password.

    -- cgit v1.2.3 From 0d8a7cc8c787fe15bdab6266f5f9fb50edae27a0 Mon Sep 17 00:00:00 2001 From: rflx Date: Sat, 3 Jul 2021 01:03:14 +0300 Subject: Add a note --- calibre.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'calibre.html') diff --git a/calibre.html b/calibre.html index 084858e..086f034 100644 --- a/calibre.html +++ b/calibre.html @@ -76,6 +76,11 @@ ExecStart=/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibr [Install] WantedBy=multi-user.target +

    Issue systemctl daemon-reload to apply the changes. @@ -132,7 +137,7 @@ systemctl start calibre-server


    - By rflx -- website -- XMR: rflx.xyz + By rflx -- website -- XMR: 48T5XpHTXAZ5Nn8YCypA4aWn1ffQLHJkFGDArXQB6cmrP6cqLY72cu7CR2iq2MmL5Ndu3d47e5MKjGpL4prYgdrTCFAHD9c

    LandChad.net
    Because Everyone should be an Internet LandChad.
  • chad
  • RSS
  • BTC
  • XMR
  • Github
  • -- cgit v1.2.3 From d67d5ab542550dc26ef9363dce663c35e3801151 Mon Sep 17 00:00:00 2001 From: rflx Date: Wed, 7 Jul 2021 14:13:25 +0300 Subject: Minor improvements --- calibre.html | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'calibre.html') diff --git a/calibre.html b/calibre.html index 086f034..73841d4 100644 --- a/calibre.html +++ b/calibre.html @@ -100,15 +100,12 @@ systemctl start calibre-server

    server {
    -	listen 80;
    -	server_name calibre.example.org;
    +    listen 80;
    +    client_max_body_size 64M; # to upload large books
    +    server_name calibre.example.org;
     	
    -    location /calibre {
    +    location / {
             proxy_pass http://127.0.0.1:8080;
    -        proxy_set_header Host $http_host;
    -        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    -        proxy_set_header X-Scheme $scheme;
    -        proxy_set_header X-Script-Name /calibre;
         }
     }
    @@ -137,7 +134,7 @@ systemctl start calibre-server

    - By rflx -- website -- XMR: 48T5XpHTXAZ5Nn8YCypA4aWn1ffQLHJkFGDArXQB6cmrP6cqLY72cu7CR2iq2MmL5Ndu3d47e5MKjGpL4prYgdrTCFAHD9c + Author: rflx -- website -- XMR: 48T5XpHTXAZ5Nn8YCypA4aWn1ffQLHJkFGDArXQB6cmrP6cqLY72cu7CR2iq2MmL5Ndu3d47e5MKjGpL4prYgdrTCFAHD9c

    LandChad.net
    Because Everyone should be an Internet LandChad.
  • chad
  • RSS
  • BTC
  • XMR
  • Github
  • -- cgit v1.2.3 From 4aa7add2b1eaaa4561d5aa43df37bcb991bd73c8 Mon Sep 17 00:00:00 2001 From: rflx Date: Wed, 7 Jul 2021 15:26:55 +0300 Subject: Spell check and some improvements --- calibre.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'calibre.html') diff --git a/calibre.html b/calibre.html index 73841d4..0e88410 100644 --- a/calibre.html +++ b/calibre.html @@ -13,7 +13,7 @@

    - The Calibre library server is a great way to store your e-books. + The Calibre library server is a great way to store your eBooks. It allows you to:

  • Share your books with others.
  • Easily transfer your books between devices and access them from anywhere.
  • @@ -29,17 +29,18 @@ mkdir /opt/calibre

    - Either upload your existing library using scp. For example to /opt/calibre/ + Either upload your existing library using rsync. For example to /opt/calibre/.

    On client:

    -
    scp -r ~/Documents/your_library root@example.org:/opt/calibre/
    +
    cd ~/Documents
    +rsync -avuP your_library root@example.org:/opt/calibre/

    - Or create a library and add a book to it. + Or create a library and add a book to it:

    cd /opt/calibre
    @@ -52,9 +53,9 @@ calibredb add book.epub --with-library your_library

    - Add a new user. + Add a new user to protect your server:

    - +
    calibre-server --manage-users

    Creating a service

    @@ -71,7 +72,7 @@ After=network.target Type=simple User=root Group=root -ExecStart=/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibre/your_library +ExecStart=/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibre/your_library --listen-on 127.0.0.1 [Install] WantedBy=multi-user.target @@ -103,7 +104,7 @@ systemctl start calibre-server listen 80; client_max_body_size 64M; # to upload large books server_name calibre.example.org; - + location / { proxy_pass http://127.0.0.1:8080; } @@ -116,7 +117,7 @@ systemctl start calibre-server
    certbot --nginx

    - Now just go to calibre.example.org. The server will request an username and password. + Now just go to calibre.example.org. The server will request an username and a password.

    @@ -140,4 +141,3 @@ systemctl start calibre-server - -- cgit v1.2.3