|
| 1 | +--- |
| 2 | +status: new |
| 3 | +--- |
| 4 | + |
1 | 5 | # Activate IPv6 Support for SeaTable |
2 | 6 |
|
3 | | -The SeaTable Docker container does not activate IPv6 by default because Nginx is configured to listen only to IPv4. |
| 7 | +SeaTable supports IPv6 in general. There is no special activation required. |
4 | 8 |
|
5 | | -To enable IPv6 on your Nginx server, you need to add a single line to the Nginx configuration file located at `/opt/seatable-server/seatable/conf/nginx.conf`. |
| 9 | +## Docker and IPv6 |
6 | 10 |
|
7 | | -Find the line `listen 80;` and add the following line below it, ensuring you include the trailing `;`: |
| 11 | +### Problem |
8 | 12 |
|
9 | | -``` |
10 | | -listen [::]:80; |
11 | | -``` |
| 13 | +There is one area that requires additional attention. Docker, by default, does not assign IPv6 addresses to its containers; instead, containers receive only IPv4 addresses. |
12 | 14 |
|
13 | | -After making this change, your configuration file should look like this: |
| 15 | +Requests arriving via an IPv6 connection still reach SeaTable. However, a problem arises for services like nginx or SeaTable that log the source IP address. Every incoming IPv6 request is logged with the Docker network gateway IP address (e.g., `172.18.0.1`), not the client’s actual IPv6 address. In the following screenshot, you can see that *Thierry* connected from an IPv6 address. |
14 | 16 |
|
| 17 | + |
| 18 | + |
| 19 | +You can confirm this by running `docker inspect seatable-server`: |
| 20 | + |
| 21 | +```json |
| 22 | +[ |
| 23 | + { |
| 24 | + ... |
| 25 | + "Networks": { |
| 26 | + "frontend-net": { |
| 27 | + ... |
| 28 | + "Gateway": "172.18.0.1", |
| 29 | + "IPAddress": "172.18.0.5", |
| 30 | + "IPv6Gateway": "", |
| 31 | + "GlobalIPv6Address": "", |
| 32 | + ... |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | +] |
15 | 37 | ``` |
16 | | -... |
17 | | -server { |
18 | | - server_name <your-server-url> |
19 | | - listen 80; |
20 | | - listen [::]:80; |
21 | | - ... |
22 | | -} |
23 | | -``` |
24 | 38 |
|
25 | | -Next, run the following two commands. The first command checks the configuration file for errors. If there are no errors, execute the second command to reload Nginx: |
| 39 | +While this does not cause immediate service disruptions, it presents some challenges: |
| 40 | +- Incorrect client IPs are logged. |
| 41 | +- Rate limiting or other IP-based limits may behave incorrectly. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +### Solution |
| 46 | + |
| 47 | +<!-- md:version 6.0 --> |
| 48 | + |
| 49 | +The solution is straightforward. Add the following parameter to your Docker network configuration (for example, in caddy.yml): |
26 | 50 |
|
27 | 51 | ``` |
28 | | -docker exec seatable-server nginx -t |
29 | | -docker exec seatable-server nginx -s reload |
| 52 | +networks: |
| 53 | + frontend-net: |
| 54 | + name: frontend-net |
| 55 | + enable_ipv6: ${ENABLE_IPV6:-true} |
30 | 56 | ``` |
31 | 57 |
|
32 | | -Your SeaTable server will now support IPv6. |
| 58 | +This enables IPv6 addressing for the container and ensures accurate logging of client IP addresses. **Starting with SeaTable version 6.0**, this feature is enabled by default. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +### Setups without IPv6 |
| 63 | + |
| 64 | +!!! warning "What if IPv6 is completely diabled on your server?" |
| 65 | + |
| 66 | +If IPv6 is completely disabled, Docker may fail to start containers with errors such as: |
| 67 | + |
| 68 | +- `cannot read IPv6 setup` |
| 69 | +- `cannot assign requested address` |
| 70 | +- `failed to start container ... error="driver failed programming external connectivity` |
| 71 | +- `error response from daemon: attaching to network failed` |
| 72 | + |
| 73 | +In this case, set `ENABLE_IPV6=false` in your `.env` file to disable IPv6 support in Docker, allowing containers to start successfully. |
0 commit comments