Skip to content

Commit 32e439a

Browse files
committed
add things for redis to post 7
1 parent 89f47c9 commit 32e439a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎src/posts/7.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,29 @@ docker network create --driver bridge --ipv6 --subnet fd00:c0ba:105::/64 cobalt
4242

4343
This creates a network for us to use for our cobalt instance that allows IPv6.
4444

45+
<blockquote class="alert-box">
46+
<p>If you want to use redis/valkey or a HTTP proxy with your cobalt instance, please read below! If you don't, then you can skip to Section 1.2.</p>
47+
</blockquote>
48+
49+
This assumes redis/valkey or your HTTP proxy is on your **host machine** and not in another container. If your redis/valkey or proxy is in another container, simply add those containers to the cobalt network and use the container's name as the IP address. If not, follow below.
50+
51+
Create the cobalt network with a static IPv4 address, just so it doesn't change. If you made the network earlier, you need to delete and remake it below. If the IP space clashes, change it to anything else.
52+
```bash
53+
docker network create --driver bridge --ipv6 --subnet fd00:c0ba:105::/64 --subnet 192.168.105.0/24 --gateway 192.168.105.1 cobalt
54+
```
55+
56+
Once you create the network, you need to let traffic through your firewall. If you are using something like `ufw`, you can do so below:
57+
```bash
58+
ufw allow from 192.168.105.0/24 to any port 6379 comment "cobalt network to redis on host"
59+
```
60+
You'll need to do this for any port. The command above is for redis, but you need to do anymore if needed.
61+
62+
Once that is done, you can tell cobalt to use redis like so:
63+
```
64+
API_REDIS_URL=redis://192.168.105.1:6379
65+
```
66+
You would use the gateway IP from the network you created. You also want to make sure your service is binded to `0.0.0.0` and **NOT ALLOWED** through your firewall.
67+
4568
### 1.2 Setup wgcf
4669

4770
Head over to https://github.com/ViRb3/wgcf/releases/latest and download one from the asset list based on your server.

0 commit comments

Comments
 (0)