-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.html
472 lines (433 loc) · 35.5 KB
/
install.html
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Installing — HappyPanda X 0.13.3#170 documentation</title>
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/style.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script src="https://platform.twitter.com/widgets.js"></script>
<script src="_static/script.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Using HappyPanda X" href="usage.html" />
<link rel="prev" title="HappyPanda X user guide" href="index.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js "></script>
</head><body>
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"><span><img src="_static/hpx_logo.svg"></span>
HappyPanda X</a>
<span class="navbar-text navbar-version pull-left"><b>0.13.3#170</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Contents <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Installing</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Using HappyPanda X</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html#installing-plugins">Installing plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html#securing-happypanda-x">Securing HappyPanda X</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html#exposing-happypanda-x">Exposing HappyPanda X</a></li>
<li class="toctree-l1"><a class="reference internal" href="translation.html">Translations</a></li>
<li class="toctree-l1"><a class="reference internal" href="settings.html">Settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="switches.html">Command-Line Arguments</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="env.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="env.html#editing-the-documentation">Editing the documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="client.html">Creating frontends</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugin.html">Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="todo.html">TODO</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api_general.html">General</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">Server API</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_plugin.html">Plugin API</a></li>
</ul>
</ul>
</li>
<li>
<a href="index.html" title="Previous Chapter: HappyPanda X user guide"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« HappyPanda X ...</span>
</a>
</li>
<li>
<a href="usage.html" title="Next Chapter: Using HappyPanda X"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Using HappyPanda X »</span>
</a>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<ul class="quick-links">
<li>
<strong>Quick links</strong>
</li>
<li class="quick-link">
<a class="github-button" href="https://github.com/twiddli" aria-label="Follow @twiddli on GitHub">Follow @twiddli</a>
</li>
<li class="quick-link">
<a class="github-button" href="https://github.com/happypandax/happypandax/issues" data-icon="octicon-issue-opened" data-show-count="true" aria-label="Issue happypandax/happypandax on GitHub">Issue</a>
</li>
<li class="divider">·</li>
<li class="quick-link">
<a class="github-button" href="https://github.com/happypandax/happypandax" data-icon="octicon-star" data-show-count="true" aria-label="Star happypandax/happypandax on GitHub">Star</a>
</li>
<li class="quick-link">
<a class="github-button" href="https://github.com/happypandax/happypandax/fork" data-icon="octicon-repo-forked" data-show-count="true" aria-label="Fork happypandax/happypandax on GitHub">Fork</a>
</li>
<li class="divider">·</li>
<li class="quick-link">
<a href="https://twitter.com/twiddly_"
class="twitter-follow-button" data-width="145px"
data-link-color="#0069D6" data-show-count="false">
Follow
@twiddly_
</a>
</li>
<li class="quick-link">
<a href="https://twitter.com/share" class="twitter-share-button"
data-url="" data-count="horizontal"
data-via="twbootstrap"
data-related="twiddly_:Creator of HappyPanda X">Tweet</a>
</li>
</ul>
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary"><ul>
<li><a class="reference internal" href="#">Installing</a><ul>
<li><a class="reference internal" href="#docker">Docker</a><ul>
<li><a class="reference internal" href="#using-with-docker">Using with Docker</a><ul>
<li><a class="reference internal" href="#the-configuration-file">The configuration file</a></li>
<li><a class="reference internal" href="#about-the-commands">About the commands</a></li>
<li><a class="reference internal" href="#updating">Updating</a></li>
</ul>
</li>
<li><a class="reference internal" href="#using-with-docker-compose">Using with Docker Compose</a><ul>
<li><a class="reference internal" href="#id4">Updating</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-md-9 content">
<div class="section" id="installing">
<h1>Installing<a class="headerlink" href="#installing" title="Permalink to this headline">¶</a></h1>
<ol class="arabic simple">
<li><p>Download the archive/installer matching your OS from <a class="reference external" href="https://github.com/happypandax/server/releases">Github Releases</a></p></li>
<li><p>Extract the archive or run the installer</p></li>
<li><p>Continue to <a class="reference internal" href="usage.html#using-happypanda-x"><span class="std std-ref">Using HappyPanda X</span></a></p></li>
</ol>
<p>HPX is self-contained.
Everything HPX creates and modifies, it does so in its own folder.
This means it’s portable.
The installer is just there to ease the install.
On Windows it creates 3 shortcuts to <code class="docutils literal notranslate"><span class="pre">happypandax_gui.exe</span></code>.
They are placed in your <code class="docutils literal notranslate"><span class="pre">Desktop</span></code>, <code class="docutils literal notranslate"><span class="pre">Start</span> <span class="pre">Menu</span></code> and <code class="docutils literal notranslate"><span class="pre">Start</span> <span class="pre">Menu/Programs</span></code> folders.</p>
<p>If you’re on Windows < 10, you need to install <code class="docutils literal notranslate"><span class="pre">Microsoft</span> <span class="pre">Visual</span> <span class="pre">C++</span> <span class="pre">Redistributable</span> <span class="pre">2015</span></code> to run HPX.
The setup file is included in the archive, look for <code class="docutils literal notranslate"><span class="pre">vc_redist.x86.exe</span></code>.
If you’re using the installer, this setup file will automatically be run for you.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>HPX requires sufficient permissions to read and write from it’s own folder to be able to run properly. This is required for the auto-update process to work.
On Windows it means you shouldn’t install HPX somewhere like <code class="docutils literal notranslate"><span class="pre">C:\Program</span> <span class="pre">Files</span> <span class="pre">(x86)</span></code>. If you still choose to do so just remember to run HPX as admin.
(Not recommended)</p>
</div>
<div class="section" id="docker">
<h2>Docker<a class="headerlink" href="#docker" title="Permalink to this headline">¶</a></h2>
<p>It is also an option to use HPX with Docker.
If you’re new to Docker or don’t know what Docker is then I cannot recommend you go through this route.
This is mostly for advanced users or users who experience issues with installing HPX normally.</p>
<p>Before you can use HPX with Docker, make sure it’s <a class="reference external" href="https://www.docker.com/products/docker-desktop">installed.</a></p>
<p>Now, there’s two ways to do this. You can either choose to use HPX with Docker alone or also complement it with Docker Compose (recommended).
The main benefit of using it with Docker Compose is easier configuration.
If you want to use HPX with Docker Compose, make sure it’s <a class="reference external" href="https://docs.docker.com/compose/install/#install-compose">installed</a> (if you installed Docker from the link above, then you should already have Docker Compose installed)</p>
<div class="section" id="using-with-docker">
<h3>Using with Docker<a class="headerlink" href="#using-with-docker" title="Permalink to this headline">¶</a></h3>
<p>Start by copying the appropriate commands for your OS over onto a file.
Then edit the variables so that they point to the appropriate folders and ports.</p>
<p>Finally, copy your edit of commands over to a command-line and execute them.</p>
<p><strong>Linux & Mac OS:</strong></p>
<hr class="docutils" />
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>HPX_PORT=7007
HPX_WEBPORT=7008
HPX_TORRENTPORT=7006
HPX_DATA="/path/to/desired/hpx/datadir"
HPX_CONTENT="/path/to/desired/hpx/contentdir"
RUN_IN_BACKGROUND=true
AUTOSTART_ON_BOOT=always
docker run -p $HPX_PORT:7007 -p $HPX_WEBPORT:7008 -p $HPX_TORRENTPORT:7006 --name happypandax --restart AUTOSTART_ON_BOOT --volume=$HPX_DATA:/data --volume=$HPX_CONTENT:/content -d=$RUN_IN_BACKGROUND twiddly/happypandax
</pre></div>
</div>
<p><strong>Windows:</strong></p>
<hr class="docutils" />
<p><strong>NOTE</strong>: This is intended for <code class="docutils literal notranslate"><span class="pre">cmd.exe</span></code> not PowerShell</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">HPX_PORT</span><span class="o">=</span><span class="mi">7007</span>
<span class="nb">set</span> <span class="n">HPX_WEBPORT</span><span class="o">=</span><span class="mi">7008</span>
<span class="nb">set</span> <span class="n">HPX_TORRENTPORT</span><span class="o">=</span><span class="mi">7006</span>
<span class="nb">set</span> <span class="n">HPX_DATA</span><span class="o">=</span><span class="s2">"C:\path</span><span class="se">\t</span><span class="s2">o\desired\hpx\datadir"</span>
<span class="nb">set</span> <span class="n">HPX_CONTENT</span><span class="o">=</span><span class="s2">"C:\path</span><span class="se">\t</span><span class="s2">o\desired\hpx\content"</span>
<span class="nb">set</span> <span class="n">RUN_IN_BACKGROUND</span><span class="o">=</span><span class="n">false</span>
<span class="nb">set</span> <span class="n">AUTOSTART_ON_BOOT</span><span class="o">=</span><span class="n">always</span>
<span class="n">docker</span> <span class="n">run</span> <span class="o">-</span><span class="n">p</span> <span class="o">%</span><span class="n">HPX_PORT</span><span class="o">%</span><span class="p">:</span><span class="mi">7007</span> <span class="o">-</span><span class="n">p</span> <span class="o">%</span><span class="n">HPX_WEBPORT</span><span class="o">%</span><span class="p">:</span><span class="mi">7008</span> <span class="o">-</span><span class="n">p</span> <span class="o">%</span><span class="n">HPX_TORRENTPORT</span><span class="o">%</span><span class="p">:</span><span class="mi">7006</span> <span class="o">--</span><span class="n">name</span> <span class="n">happypandax</span> <span class="o">--</span><span class="n">restart</span> <span class="o">%</span><span class="n">AUTOSTART_ON_BOOT</span><span class="o">%</span> <span class="o">--</span><span class="n">volume</span><span class="o">=%</span><span class="n">HPX_DATA</span><span class="o">%</span><span class="p">:</span><span class="o">/</span><span class="n">data</span> <span class="o">--</span><span class="n">volume</span><span class="o">=%</span><span class="n">HPX_CONTENT</span><span class="o">%</span><span class="p">:</span><span class="o">/</span><span class="n">content</span> <span class="o">-</span><span class="n">d</span><span class="o">=%</span><span class="n">RUN_IN_BACKGROUND</span><span class="o">%</span> <span class="n">twiddly</span><span class="o">/</span><span class="n">happypandax</span>
</pre></div>
</div>
<div class="section" id="the-configuration-file">
<h4>The configuration file<a class="headerlink" href="#the-configuration-file" title="Permalink to this headline">¶</a></h4>
<p>The default configuration file is set to:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>import:
skip_existing_galleries: true
transparent_nested_folders: true
watch:
enable: true
dirs:
- ${HPX_CONTENT}
options:
${HPX_CONTENT}:
import.scan_on_startup: true
plugin:
plugin_dir: ${HPX_DATA}/plugins
</pre></div>
</div>
<p>The config file supports environment variables, so <code class="docutils literal notranslate"><span class="pre">${HPX_CONTENT}</span></code> will automatically expand to your specified content folder <em>inside docker</em>.
Another useful variable is <code class="docutils literal notranslate"><span class="pre">${HPX_DATA}</span></code> pointing to the data folder <em>inside docker</em>.
Note that these environment variables are pre-defined by the image inside docker. This means you can’t just define new variables from outside and expect the docker instance to see them.</p>
<p>To modify this configuration, create a file named <code class="docutils literal notranslate"><span class="pre">config.yaml</span></code> inside your <code class="docutils literal notranslate"><span class="pre">HPX_DATA</span></code> folder with these contents as a starting point.</p>
</div>
<div class="section" id="about-the-commands">
<h4>About the commands<a class="headerlink" href="#about-the-commands" title="Permalink to this headline">¶</a></h4>
<dl class="field-list simple">
<dt class="field-odd"><code class="docutils literal notranslate"><span class="pre">HPX_PORT</span></code> & <code class="docutils literal notranslate"><span class="pre">HPX_WEBPORT</span></code> & <code class="docutils literal notranslate"><span class="pre">HPX_TORRENTPORT</span></code></dt>
<dd class="field-odd"><p>Your desired ports to connect to the HPX servers and clients with on your machine</p>
</dd>
<dt class="field-even"><code class="docutils literal notranslate"><span class="pre">HPX_DATA</span></code></dt>
<dd class="field-even"><p>A folder on your machine where HPX should save its data, this includes config files, databases, backups, etc.</p>
</dd>
<dt class="field-odd"><code class="docutils literal notranslate"><span class="pre">HPX_CONTENT</span></code></dt>
<dd class="field-odd"><p>A folder for where manga and doujins are stored, you usually set this to your pre-existing folder where those things are stored.</p>
</dd>
<dt class="field-even"><code class="docutils literal notranslate"><span class="pre">RUN_IN_BACKGROUND</span></code></dt>
<dd class="field-even"><p>If <code class="docutils literal notranslate"><span class="pre">false</span></code> the docker container will run in the foreground, meaning that closing the command-line window will also exit the docker container.</p>
</dd>
<dt class="field-odd"><code class="docutils literal notranslate"><span class="pre">AUTOSTART_ON_BOOT</span></code></dt>
<dd class="field-odd"><p>Automatically start the HPX container whenever Docker starts, available values are <code class="docutils literal notranslate"><span class="pre">always</span></code>, <code class="docutils literal notranslate"><span class="pre">no</span></code>, <code class="docutils literal notranslate"><span class="pre">on-failure</span></code> and <code class="docutils literal notranslate"><span class="pre">unless-stopped</span></code>, read more about it <a class="reference external" href="https://docs.docker.com/config/containers/start-containers-automatically/">here.</a></p>
</dd>
<dt class="field-even"><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span> <span class="pre">...</span></code></dt>
<dd class="field-even"><p>You can read more about what the different docker flags means <a class="reference external" href="https://docs.docker.com/engine/reference/run/">here.</a></p>
</dd>
</dl>
<p>The docker image is set so that subsequent arguments after the docker image name in the <code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span></code> command are passed to happypandax,
meaning this:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span> <span class="pre"><yadda..</span> <span class="pre">yadda..></span> <span class="pre">twiddly/happypandax</span> <span class="pre">--help</span></code></p>
<p>is the same as running the happypandax executable directly with <code class="docutils literal notranslate"><span class="pre">happypanda.exe</span> <span class="pre">--help</span></code> (the <code class="docutils literal notranslate"><span class="pre"><yadda..</span> <span class="pre">yadda..></span></code> is passed to docker, not hpx).</p>
<p>The <code class="docutils literal notranslate"><span class="pre"><yadda..</span> <span class="pre">yadda..></span></code> part are all those arguments from the command above just shortened for brevity. Make sure to include those arguments, or else… <strong>or else Docker wouldn’t know where to store data and IT WILL BE LOST</strong>.</p>
<p>This means that you could generate an example config file like this:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span> <span class="pre"><yadda..</span> <span class="pre">yadda..></span> <span class="pre">twiddly/happypandax</span> <span class="pre">--gen-config</span></code></p>
<p>The config file will be generated into the folder you specified with <code class="docutils literal notranslate"><span class="pre">HPX_DATA</span></code>.</p>
<p>You can also make user accounts this way:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span> <span class="pre"><yadda..</span> <span class="pre">yadda..></span> <span class="pre">twiddly/happypandax</span> <span class="pre">user</span> <span class="pre">create</span> <span class="pre">-t</span> <span class="pre">"admin"</span> <span class="pre">-u</span> <span class="pre">"twiddly"</span> <span class="pre">-p</span> <span class="pre">"twiddly123"</span></code></p>
<p>To stop the container, execute:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">stop</span> <span class="pre">happypandax</span></code></p>
<p>And to start it again,</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">start</span> <span class="pre">happypandax</span></code></p>
<p>Remove it with:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">rm</span> <span class="pre">happypandax</span></code></p>
</div>
<div class="section" id="updating">
<h4>Updating<a class="headerlink" href="#updating" title="Permalink to this headline">¶</a></h4>
<p>Update to the latest docker image by running:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">pull</span> <span class="pre">twiddly/happypandax:latest</span></code></p>
<p>For a specific version:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">pull</span> <span class="pre">twiddly/happypandax:0.11.0</span></code></p>
<p>Then remove your current container</p>
<p><code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">rm</span> <span class="pre">happypandax</span></code></p>
<p>Now, rerun the <code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span> <span class="pre"><yadda..</span> <span class="pre">yadda..></span> <span class="pre">twiddly/happypandax</span></code> command from before.</p>
<p>Updating will not reset your data as long as you keep mounting the same volumes.</p>
<p>Now, continue to <a class="reference internal" href="usage.html#using-happypanda-x"><span class="std std-ref">Using HappyPanda X</span></a> or read on if you intend to use Docker Compose.</p>
</div>
</div>
<div class="section" id="using-with-docker-compose">
<h3>Using with Docker Compose<a class="headerlink" href="#using-with-docker-compose" title="Permalink to this headline">¶</a></h3>
<p>Using HPX with Docker Compose lets us avoid those complicated-looking commands.
And while we are at it, we might as well set up HPX to use postgresql with docker as well.</p>
<p>Start by creating a folder for where you want your HPX config and data to be. You can just name this folder <code class="docutils literal notranslate"><span class="pre">HappyPanda</span> <span class="pre">X</span></code>.</p>
<p>In that folder, create a folder named <code class="docutils literal notranslate"><span class="pre">data</span></code> and a file named <code class="docutils literal notranslate"><span class="pre">docker-compose.yml</span></code> with these contents:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">version</span><span class="p">:</span> <span class="s1">'3'</span>
<span class="n">services</span><span class="p">:</span>
<span class="n">happypandax</span><span class="p">:</span>
<span class="n">image</span><span class="p">:</span> <span class="n">twiddly</span><span class="o">/</span><span class="n">happypandax</span><span class="p">:</span><span class="n">latest</span>
<span class="c1"># start this container automatically on boot</span>
<span class="n">restart</span><span class="p">:</span> <span class="n">always</span>
<span class="n">ports</span><span class="p">:</span>
<span class="o">-</span> <span class="s2">"7006:7006"</span>
<span class="o">-</span> <span class="s2">"7007:7007"</span>
<span class="o">-</span> <span class="s2">"7008:7008"</span>
<span class="n">volumes</span><span class="p">:</span>
<span class="o">-</span> <span class="o">./</span><span class="n">data</span><span class="p">:</span><span class="o">/</span><span class="n">data</span>
<span class="o">-</span> <span class="o">./</span><span class="n">content</span><span class="p">:</span><span class="o">/</span><span class="n">content</span>
<span class="n">links</span><span class="p">:</span>
<span class="o">-</span> <span class="n">db</span>
<span class="n">db</span><span class="p">:</span>
<span class="n">image</span><span class="p">:</span> <span class="n">postgres</span><span class="p">:</span><span class="n">latest</span>
<span class="n">restart</span><span class="p">:</span> <span class="n">always</span>
<span class="n">ports</span><span class="p">:</span>
<span class="o">-</span> <span class="mi">7005</span><span class="p">:</span><span class="mi">5432</span>
<span class="n">environment</span><span class="p">:</span>
<span class="n">POSTGRES_USER</span><span class="p">:</span> <span class="s1">'happypandax'</span>
<span class="n">POSTGRES_PASSWORD</span><span class="p">:</span> <span class="s1">'postgres'</span>
<span class="n">volumes</span><span class="p">:</span>
<span class="o">-</span> <span class="n">database</span><span class="p">:</span><span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">postgresql</span><span class="o">/</span><span class="n">data</span>
<span class="n">logging</span><span class="p">:</span>
<span class="n">driver</span><span class="p">:</span> <span class="n">none</span>
<span class="n">volumes</span><span class="p">:</span>
<span class="n">database</span><span class="p">:</span>
<span class="n">driver</span><span class="p">:</span> <span class="n">local</span>
</pre></div>
</div>
<p>Change the ports and folder mappings as desired. In particular you should change <code class="docutils literal notranslate"><span class="pre">./content:/content</span></code> to <code class="docutils literal notranslate"><span class="pre"><where</span> <span class="pre">your</span> <span class="pre">manga</span> <span class="pre">folder</span> <span class="pre">is</span> <span class="pre">located>:/content</span></code>,
or else the expected content folder will be a folder named <code class="docutils literal notranslate"><span class="pre">content</span></code> in the <code class="docutils literal notranslate"><span class="pre">HappyPanda</span> <span class="pre">X</span></code> folder.</p>
<p>You can also change the ports, if you wish to do so, do it like this: <code class="docutils literal notranslate"><span class="pre"><your</span> <span class="pre">custom</span> <span class="pre">port>:7008</span></code></p>
<p><strong>Notice that the port to postgres is set to 7005:5432</strong>, meaning unless you change it, you will have to use port <code class="docutils literal notranslate"><span class="pre">7005</span></code> to connect to it with <em>from outside</em>.</p>
<p>Now, create a <code class="docutils literal notranslate"><span class="pre">config.yaml</span></code> file with these contents and save it inside the <code class="docutils literal notranslate"><span class="pre">data</span></code> folder
(unless you changed it then this folder is expected to be named <code class="docutils literal notranslate"><span class="pre">data</span></code> inside the <code class="docutils literal notranslate"><span class="pre">HappyPanda</span> <span class="pre">X</span></code> folder, create it if it doesn’t exist):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>import:
skip_existing_galleries: true
transparent_nested_folders: true
watch:
enable: true
dirs:
- ${HPX_CONTENT}
options:
${HPX_CONTENT}:
import.scan_on_startup: true
plugin:
plugin_dir: ${HPX_DATA}/plugins
db:
dialect: postgres
username: happypandax
password: postgres
host: db
port: 5432
name: happypanda
</pre></div>
</div>
<p>The config file supports environment variables, so <code class="docutils literal notranslate"><span class="pre">${HPX_CONTENT}</span></code> will automatically expand to your specified content folder <em>inside docker</em>.
Another useful variable is <code class="docutils literal notranslate"><span class="pre">${HPX_DATA}</span></code> pointing to the data folder <em>inside dicker</em>.
Note that these environment variables are pre-defined by the image inside docker. This means you can’t just define new variables from outside and expect the docker instance to see them.</p>
<p>Notice that the postgres host is the name of the database service as defined in <code class="docutils literal notranslate"><span class="pre">docker-compose.yml</span></code> to be named <code class="docutils literal notranslate"><span class="pre">db</span></code>.
And the port is set to <code class="docutils literal notranslate"><span class="pre">5432</span></code> because that’s the port postgres listens on <em>inside the container</em>, but to access it from outside docker, you will need to use <code class="docutils literal notranslate"><span class="pre">7005</span></code> or whatever was defined.</p>
<p>This config does a few things. It sets HPX to use the dockerized postgres service and also puts the content folder under watch so that new items in it will be added to HPX automatically.</p>
<p>Lastly, if you don’t wish to use a postgres backend with docker, just remove this part from <code class="docutils literal notranslate"><span class="pre">docker-compose.yml</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="n">links</span><span class="p">:</span>
<span class="o">-</span> <span class="n">db</span>
<span class="n">db</span><span class="p">:</span>
<span class="n">image</span><span class="p">:</span> <span class="n">postgres</span><span class="p">:</span><span class="n">latest</span>
<span class="n">restart</span><span class="p">:</span> <span class="n">always</span>
<span class="n">ports</span><span class="p">:</span>
<span class="o">-</span> <span class="mi">7005</span><span class="p">:</span><span class="mi">5432</span>
<span class="n">environment</span><span class="p">:</span>
<span class="n">POSTGRES_USER</span><span class="p">:</span> <span class="s1">'happypandax'</span>
<span class="n">POSTGRES_PASSWORD</span><span class="p">:</span> <span class="s1">'postgres'</span>
<span class="n">volumes</span><span class="p">:</span>
<span class="o">-</span> <span class="n">database</span><span class="p">:</span><span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">postgresql</span><span class="o">/</span><span class="n">data</span>
<span class="n">volumes</span><span class="p">:</span>
<span class="n">database</span><span class="p">:</span>
<span class="n">driver</span><span class="p">:</span> <span class="n">local</span>
</pre></div>
</div>
<p>Make sure to edit your <code class="docutils literal notranslate"><span class="pre">config.yaml</span></code> to reflect this change.</p>
<p>With all that done, we can now start up everything. Run this command to start everything:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span></code></p>
<p>If everything was successful, you should be able to open your browser and access HPX on <code class="docutils literal notranslate"><span class="pre">localhost:7008</span></code> (replace <code class="docutils literal notranslate"><span class="pre">7008</span></code> with whatever you set that port mapping to).</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>In some cases, the postgres instance won’t get ready in time for when HPX starts, resulting in HPX saying it can’t connect to the database.
If that happens, just run: <code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">--force-recreate</span></code></p>
</div>
<p>To run in the background, supply the <code class="docutils literal notranslate"><span class="pre">-d</span></code> flag:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">-d</span></code></p>
<p>You can stop everything with:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">down</span></code></p>
<p>Read more about what commands are available <a class="reference external" href="https://docs.docker.com/compose/reference/">here.</a></p>
<p>In the same vein as with <code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">run</span></code>, you can also pass commands to HPX in the same way, like:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">run</span> <span class="pre">happypandax</span> <span class="pre">--help</span></code></p>
<p>To create a new user:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">run</span> <span class="pre">happypandax</span> <span class="pre">user</span> <span class="pre">create</span> <span class="pre">-t</span> <span class="pre">"admin"</span> <span class="pre">-u</span> <span class="pre">"twiddly"</span> <span class="pre">-p</span> <span class="pre">"twiddly123"</span></code></p>
<div class="section" id="id4">
<h4>Updating<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h4>
<p>Update to the latest docker image by running:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">pull</span></code></p>
<p>And then:</p>
<p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">--force-recreate</span></code></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<script src="https://utteranc.es/client.js"
repo="happypandax/happypandax.github.io"
issue-term="pathname"
label="💬 docs"
theme="github-light"
crossorigin="anonymous"
async>
</script>
</div>
</div>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
<br/>
</p>
<p>
© Copyright Twiddly.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.2.1.<br/>
</p>
</div>
</footer>
</body>
</html>