blob: 73841d4912529af6dba8680f619161e42c0f56b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
<!DOCTYPE html>
<html lang=en>
<head>
<title>Setting up a Calibre library server – LandChad.net</title>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel='stylesheet' type='text/css' href='style.css'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='alternate' type='application/rss+xml' title='Land Chad RSS' href='/rss.xml'>
</head>
<body>
<header><h1>Setting up a Calibre library server</h1></header>
<nav></nav>
<main>
<p>
The Calibre library server is a great way to store your e-books.
It allows you to:
<li>Share your books with others.</li>
<li>Easily transfer your books between devices and access them from anywhere.</li>
</p>
<h2>Installation</h2>
<p>
Install the Calibre package.
</p>
<pre><code>apt update && apt install calibre
mkdir /opt/calibre</code></pre>
<p>
Either upload your existing library using <code>scp</code>. For example to <code>/opt/calibre/</code>
</p>
<p>
On client:
</p>
<pre><code>scp -r ~/Documents/your_library root@example.org:/opt/calibre/</code></pre>
<p>
Or create a library and add a book to it.
</p>
<pre><code>cd /opt/calibre
calibredb add book.epub --with-library your_library</code></pre>
<aside>
<p>
For more information about the <code>calibredb</code> command see <code>man calibredb</code>.
</p>
</aside>
<p>
Add a new user.
</p>
<pre><code>calibre-server --manage-users</code></pre>
<h2>Creating a service</h2>
<p>
Create a new file <code>/etc/systemd/system/calibre-server.service</code> and add the following:
</p>
<pre><code>[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
</code></pre>
<aside>
<p>
You can change the port with the <code>--port</code> prefix. Additional information <code>man calibre-server</code>.
</p>
</aside>
<p>
Issue <code>systemctl daemon-reload</code> to apply the changes.
</p>
<p>
Enable and start the service.
</p>
<pre><code>systemctl enable calibre-server
systemctl start calibre-server</code></pre>
<h2>A reverse proxy with Nginx</h2>
<p>
Create a new file <code>/etc/nginx/sites-available/calibre</code> and enter the following:
</p>
<pre><code>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;
}
}</code></pre>
<p>
Issue a Let's Encrypt certificate. <a href="certbot.html">Detailed instructions and additional information</a>.
</p>
<pre><code>certbot --nginx</code></pre>
<p>
Now just go to calibre.example.org. The server will request an username and password.
</p>
<a href="pix/calibre-1.png">
<img src="pix/calibre/calibre-1.png" alt="calibre">
</a>
<p>
After login you will see something like this.
</p>
<a href="pix/calibre-1.png">
<img src="pix/calibre/calibre-2.png" alt="calibre">
</a>
<hr>
<p>
Author: rflx -- <a href="https://rflx.xyz">website</a> -- XMR: 48T5XpHTXAZ5Nn8YCypA4aWn1ffQLHJkFGDArXQB6cmrP6cqLY72cu7CR2iq2MmL5Ndu3d47e5MKjGpL4prYgdrTCFAHD9c
</p>
</main>
<footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><li><a href="index.html"><img src="pix/chad.gif" alt="chad"></a></li><li><a href="rss.xml"><img src="pix/rss.svg" alt="RSS"></a></li><li><a href="pix/btc.png"><img src="pix/btc.svg" alt="BTC"></a></li><li><a href="pix/xmr.png"><img src="pix/xmr.svg" alt="XMR"></a></li><li><a href="https://github.com/lukesmithxyz/landchad"><img src="pix/git.svg" alt="Github"></a></footer>
</body>
</html>
|