Skip to content

Commit e8f36d5

Browse files
authored
Update DeployConfigurations.rst - Instruction for Apache reverse proxy and 3 hosts
related to this issue : nextcloud/HaRP#85 Signed-off-by: Manikou <[email protected]>
1 parent 8aa7b2e commit e8f36d5

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed

admin_manual/exapps_management/DeployConfigurations.rst

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,134 @@ A setup with the HaRP container itself on the remote is not supported.
178178

179179
.. _ai-app_api_ddd-dsp:
180180

181+
182+
Docker / Reverse Proxy / Nextcloud on 3 independant hosts - with HaRP container
183+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184+
185+
This is the related infrastructure
186+
187+
.. mermaid::
188+
189+
stateDiagram-v2
190+
classDef docker fill: #1f97ee, color: white, font-size: 34px, stroke: #364c53, stroke-width: 1px, background: url(https://raw.githubusercontent.com/nextcloud/documentation/master/admin_manual/exapps_management/img/docker.png) no-repeat center center / contain
191+
classDef nextcloud fill: #006aa3, color: white, font-size: 34px, stroke: #045987, stroke-width: 1px, background: url(https://raw.githubusercontent.com/nextcloud/documentation/master/admin_manual/exapps_management/img/nextcloud.svg) no-repeat center center / contain
192+
classDef python fill: #1e415f, color: white, stroke: #364c53, stroke-width: 1px
193+
194+
Direction LR
195+
196+
Host1 --> Host2 : by port
197+
Host3 --> Host1 : by port
198+
Host3 --> Host2 : by port
199+
200+
state Host1 {
201+
Nextcloud
202+
}
203+
204+
state Host2 {
205+
[*] --> DockerSocketProxy : by port
206+
Daemon --> Containers
207+
208+
state Containers {
209+
[*] --> DockerSocketProxy : /var/run/docker.sock
210+
DockerSocketProxy --> ExApp1
211+
DockerSocketProxy --> ExApp2
212+
DockerSocketProxy --> ExApp3
213+
}
214+
}
215+
216+
state Host3 {
217+
Apache Reverse Proxy
218+
}
219+
220+
class Nextcloud nextcloud
221+
class Daemon docker
222+
class ExApp1 python
223+
class ExApp2 python
224+
class ExApp3 python
225+
226+
Please see below the steps I follow
227+
All of the following steps are based on a Almalinux Distro.
228+
Please customize for your distribution.
229+
230+
1. On the Host2 Docker
231+
232+
1.1. Creation of Cert folder (if necessary)
233+
234+
.. code-block:: bash
235+
236+
mkdir -p /some/path/{certs,}
237+
238+
1.2. Open ports
239+
240+
.. code-block:: bash
241+
242+
firewall-cmd --permanent --zone=public --add-port=8780/tcp
243+
firewall-cmd --permanent --zone=public --add-port=8782/tcp
244+
firewall-cmd --reload
245+
246+
1.3. Deploy of the HaRP Container
247+
248+
.. code-block:: bash
249+
250+
docker run \
251+
-e HP_SHARED_KEY="some_very_secure_password" \
252+
-e NC_INSTANCE_URL="https://cloud.acme.com" \
253+
-e HP_TRUSTED_PROXY_IPS="192.168.0.0/24" \
254+
-v /var/run/docker.sock:/var/run/docker.sock \
255+
-v /some/path/certs:/certs \
256+
-p 8780:8780 \
257+
-p 8782:8782 \
258+
--name appapi-harp -h appapi-harp \
259+
--restart unless-stopped \
260+
-d ghcr.io/nextcloud/nextcloud-appapi-harp:release
261+
262+
263+
2. On the Host3 Apache Reverse Proxy - Reverse proxy redirections
264+
265+
On the virtual Host "cloud.acme.com" of the apache conf file
266+
Add the following lines (before the existing configuration)
267+
268+
.. code-block:: apache
269+
270+
# AppAPI Configuration
271+
ProxyPass /exapps/ http://<IP_host2_docker>:8780/exapps/
272+
ProxyPassReverse /exapps/ http://<IP_host2_docker>:8780/exapps/
273+
274+
275+
3. On the Nextcloud Web Interface - Daemon Register
276+
277+
Add the following configuration :
278+
279+
* Daemon Configuraiton template : ``HaRP Proxy (HOST)``
280+
* Surname : ``appapi-harp``
281+
* Display name : ``appapi-harp``
282+
* Deployment method : ``docker-install``
283+
* HaRP host : ``<IP_host2_docker>:8780``
284+
* HaRP shared key : ``some_very_secure_password``
285+
* Nextcloud URL : ``https://cloud.acme.com``
286+
* FRP server address : ``<IP_host2_docker>:8782``
287+
* Docker network : ``bridge``
288+
289+
Finally, test the whole setup with “Test deploy” in the 3-dots menu of the deploy daemon.
290+
291+
4. Additional tests from the network of your hosts
292+
293+
.. code-block:: bash
294+
295+
curl -fsS \
296+
-H "harp-shared-key: some_very_secure_password" \
297+
-H "docker-engine-port: 24000" \
298+
http://<IP_host2_docker>:8780/exapps/app_api/v1.41/_ping
299+
300+
301+
.. code-block:: bash
302+
303+
curl -fsS \
304+
-H "harp-shared-key: some_very_secure_password" \
305+
-H "docker-engine-port: 24000" \
306+
https://cloud.acme.com/exapps/app_api/v1.41/_ping
307+
308+
181309
Docker Deploy Daemon (Docker Socket Proxy)
182310
------------------------------------------
183311

0 commit comments

Comments
 (0)