feat: support UDP proxy of port 2022 and 2023 for P2Panda apps (#70)

# Support P2P communication between P2Panda Apps

Apps built with the set of [P2Panda](https://p2panda.org/) libraries perform P2P communication over two UDP ports. The default ports for these are 2022 and 2023.

There aren't really a lot (any?) P2Panda web apps out there, most are desktop or mobile apps.

So, this change is being specifically request by the [LoRes Tech](https://lores.tech/) project in order to support our [LoRes Node](https://github.com/local-resilience-tech/lores-node/) app. We have a recipe drafted for this [here](https://codeberg.org/lores/lores-node-coop-cloud-recipe) and we will push that to the catalogue once this change is in.

It seems better to make this kiwix change as general as possible, which is why we called the flag `P2PANDA_ENABLED` rather than `LORES_NODE_ENABLED`. In practice if there was a larger ecosystem of such apps, we'd probably need to make the actual port numbers configurable.

Reviewed-on: coop-cloud/traefik#70
Reviewed-by: p4u1 <p4u1@noreply.git.coopcloud.tech>
Co-authored-by: Jade Ambrose <jade@noreply.git.coopcloud.tech>
Co-committed-by: Jade Ambrose <jade@noreply.git.coopcloud.tech>
This commit is contained in:
2025-12-22 12:37:50 +00:00
committed by p4u1
parent 88502ecda4
commit 7e688c9094
5 changed files with 27 additions and 3 deletions

View File

@ -16,7 +16,7 @@ steps:
STACK_NAME: traefik
LETS_ENCRYPT_ENV: production
LETS_ENCRYPT_EMAIL: helo@autonomic.zone
TRAEFIK_YML_VERSION: v22
TRAEFIK_YML_VERSION: v26
FILE_PROVIDER_YML_VERSION: v10
ENTRYPOINT_VERSION: v4
trigger:

View File

@ -131,6 +131,10 @@ COMPOSE_FILE="compose.yml"
# COMPOSE_FILE="$COMPOSE_FILE:compose.gitea.yml"
# GITEA_SSH_ENABLED=1
## P2Panda UDP
# COMPOSE_FILE="$COMPOSE_FILE:compose.p2panda.yml"
# P2PANDA_ENABLED=1
## Foodsoft SMTP
# COMPOSE_FILE="$COMPOSE_FILE:compose.foodsoft.yml"
# FOODSOFT_SMTP_ENABLED=1

View File

@ -1,3 +1,3 @@
export TRAEFIK_YML_VERSION=v25
export TRAEFIK_YML_VERSION=v26
export FILE_PROVIDER_YML_VERSION=v10
export ENTRYPOINT_VERSION=v5

14
compose.p2panda.yml Normal file
View File

@ -0,0 +1,14 @@
version: "3.8"
services:
app:
environment:
- P2PANDA_ENABLED
ports:
- target: 2022
published: 2022
protocol: udp
mode: host
- target: 2023
published: 2023
protocol: udp
mode: host

View File

@ -37,6 +37,12 @@ entrypoints:
gitea-ssh:
address: ":2222"
{{ end }}
{{ if eq (env "P2PANDA_ENABLED") "1" }}
p2panda-udp-v4:
address: ":2022/udp"
p2panda-udp-v6:
address: ":2023/udp"
{{ end }}
{{ if eq (env "GARAGE_RPC_ENABLED") "1" }}
garage-rpc:
address: ":3901"