Skip to content

Commit

Permalink
Add schematic for v2 in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
armchairancap committed Nov 4, 2024
1 parent 8cb11ba commit cb068a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@

## xx Network Haven - Tribler Proof-of-Concept

This repository contains several "proof-of-concept" ideas for xx Network Haven and Tribler integrations.
This repository contains several "proof-of-concept" ideas for [xx Network]((https://xx.network)) [Haven](https://haven.xx.network) and [Tribler](https://github.com/Tribler/tribler) integrations.

- [v2](https://github.com/armchairancap/xx-tribler-haven/releases) - Haven chat with a Tribler iFrame
- [v1](https://github.com/armchairancap/xx-tribler-haven/releases/tag/v1.0) - Tribler with a Haven chat iFrame (source code in [Release v1.0](https://github.com/armchairancap/xx-tribler-haven/releases/tag/v1.0))

v2 is probably more interesting to general users. [This post](https://armchairancap.github.io/blog/2024/10/29/xx-haven-with-tribler#what-integrations-and-why) talks about some advantages and disadvantages of each approach as I see them.

A better way may be to integrate Tribler in Haven by using xxDK directly from Tribler.
A seamless be to natively integrate Haven in Tribler by using xxDK directly from Tribler, but that's beyond my abilities and would require more extensive patching that would also be harder to maintain.

### Haven with Tribler iFrame (v2)

(Right-click and open in new tab for a clearer view.)
(Right-click and open screenshot in new tab for a clearer view.)

![Haven with Tribler iFrame](./xx_screenshot_tribler_child_iframe.png)

Expand All @@ -41,9 +41,9 @@ A better way may be to integrate Tribler in Haven by using xxDK directly from Tr

What does this entail? Just two patches from this repo:

- Add Tribler iframe to Haven (`build/haven/haven-DefaultLayout.tsx.patch`)
- Allow unauthenticated access to localhost and `haven` in Tribler's REST manager (`build/tribler/tribler.patch`)
- Build & run Haven and Tribler on LAN
- Add Tribler iFrame to Haven (`build/haven/haven-DefaultLayout.tsx.patch`)
- Allow unauthenticated access to `localhost` and `haven` in Tribler's REST manager (`build/tribler/tribler.patch`)
- Build & run Haven and Tribler on the same host on LAN

#### Run in Docker

Expand All @@ -68,17 +68,21 @@ tribler-haven latest 8693940f6d6f 9 minutes ago 1.39GB
haven-for-tribler latest d637b742a675 14 minutes ago 2.67GB
```

Run with `cd build/tribler && docker compose up` and access Haven at http://localhost:3100.
Run with `cd build/tribler && docker compose up` and access Haven at http://localhost:3000.

Create a strong password when creating Haven identity and remember to [back it up](https://armchairancap.github.io/docs/haven-user-guide/identity#backup-an-identity).

There's a sample Docker compose file in the build/tribler directory.

By default - and the patch for Haven has that hardcoded - Tribler API port should be 3100 and the password 'changeme'. In this PoC that's hard-coded into the Haven patch, so if you want to change these you may edit the patches and Docker compose to match whatever password you set and port you want to use.
By default - and the patch for Haven has that hardcoded - Tribler API port is 3100 and the password is 'changeme' (as per upstream). In this PoC that's hard-coded into the Haven patch, so if you want to change these you may edit the patches and Docker compose to match whatever password you set and port you want to use.

If you decide to change the Tribler API key, for example, you can do it in Tribler UI, then quit Tribler, change the key in compose.yaml, rebuild Tribler container and start Tribler. That should be enough.

For more advanced Docker compose scenarios (TLS, reverse proxy, etc.) you can consider Docker compose recipes I have published (see the Resources section).
Tribler can be accessed directly from localhost for convenience, but in this approach default approach is to access it from Haven's iFrame. Haven itself could bind localhost (if you're running on your box) or external IP (if you're running the stack on a small ARM64 computer, for example).

![Haven-Tribler in containers](./haven-tribler.png)

HTTPS isn't required here, but you could access everything through a reverse HTTPS proxy (Caddy, NGINX, etc.). For these more advanced Docker compose scenarios (TLS, reverse proxy, etc.) you can consider Docker compose recipes I have published (see the Resources section).

#### Run outside of Docker

Expand Down Expand Up @@ -234,7 +238,7 @@ Other ways:

### License

Tribler uses the strict GPL 3.0 license so Tribler patch files such as `tribler.*.patch` that modify files from the Tribler repo are released under the same license.
Tribler uses the GPL 3.0 license, so Tribler patch files such as `tribler.*.patch` that modify files from the Tribler repo are released under the same license, well as the modified Tribler Dockerfile.

The rest is released under the permissive MIT License.

Binary file added haven-tribler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb068a4

Please sign in to comment.