KI-AGENT: Lokalen Matrix-Entwicklungsstack ergänzen
This commit is contained in:
12
.env.example
12
.env.example
@@ -16,3 +16,15 @@ MATRIX_TURN_SHARED_SECRET=change-this-turn-secret
|
|||||||
|
|
||||||
LIVEKIT_KEY=fedeo-livekit
|
LIVEKIT_KEY=fedeo-livekit
|
||||||
LIVEKIT_SECRET=change-this-livekit-secret
|
LIVEKIT_SECRET=change-this-livekit-secret
|
||||||
|
|
||||||
|
# Lokale Matrix-Entwicklung
|
||||||
|
MATRIX_DEV_SYNAPSE_PORT=8008
|
||||||
|
MATRIX_DEV_ELEMENT_PORT=8080
|
||||||
|
MATRIX_DEV_RTC_JWT_PORT=8081
|
||||||
|
MATRIX_DEV_LIVEKIT_PORT=7880
|
||||||
|
MATRIX_DEV_LIVEKIT_TCP_PORT=7881
|
||||||
|
MATRIX_DEV_LIVEKIT_RTC_MIN_PORT=50000
|
||||||
|
MATRIX_DEV_LIVEKIT_RTC_MAX_PORT=50100
|
||||||
|
MATRIX_DEV_TURN_PORT=3478
|
||||||
|
MATRIX_DEV_TURN_MIN_PORT=49160
|
||||||
|
MATRIX_DEV_TURN_MAX_PORT=49200
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,3 +3,5 @@
|
|||||||
# Lokale Runtime-Daten und generierte Konfigurationen
|
# Lokale Runtime-Daten und generierte Konfigurationen
|
||||||
matrix/postgres/
|
matrix/postgres/
|
||||||
matrix/synapse/
|
matrix/synapse/
|
||||||
|
matrix/dev/postgres/
|
||||||
|
matrix/dev/synapse/
|
||||||
|
|||||||
@@ -247,6 +247,133 @@ services:
|
|||||||
- "traefik.http.routers.fedeo-matrix-rtc-jwt.tls.certresolver=mytlschallenge"
|
- "traefik.http.routers.fedeo-matrix-rtc-jwt.tls.certresolver=mytlschallenge"
|
||||||
- "traefik.http.routers.fedeo-matrix-rtc-jwt.middlewares=fedeo-matrix-rtc-jwt-strip"
|
- "traefik.http.routers.fedeo-matrix-rtc-jwt.middlewares=fedeo-matrix-rtc-jwt-strip"
|
||||||
- "traefik.http.routers.fedeo-matrix-rtc-jwt.service=fedeo-matrix-rtc-jwt"
|
- "traefik.http.routers.fedeo-matrix-rtc-jwt.service=fedeo-matrix-rtc-jwt"
|
||||||
|
|
||||||
|
matrix-dev-db:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=synapse
|
||||||
|
- POSTGRES_USER=synapse
|
||||||
|
- POSTGRES_PASSWORD=synapse-dev-password
|
||||||
|
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --lc-collate=C --lc-ctype=C
|
||||||
|
volumes:
|
||||||
|
- ./matrix/dev/postgres:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
matrix-dev-redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
matrix-dev-synapse:
|
||||||
|
image: ghcr.io/element-hq/synapse:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
depends_on:
|
||||||
|
- matrix-dev-db
|
||||||
|
- matrix-dev-redis
|
||||||
|
environment:
|
||||||
|
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
|
||||||
|
volumes:
|
||||||
|
- ./matrix/dev/synapse:/data
|
||||||
|
ports:
|
||||||
|
- "${MATRIX_DEV_SYNAPSE_PORT:-8008}:8008"
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
matrix-dev-turn:
|
||||||
|
image: instrumentisto/coturn:4
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
command:
|
||||||
|
- --fingerprint
|
||||||
|
- --use-auth-secret
|
||||||
|
- --static-auth-secret=matrix-dev-turn-secret
|
||||||
|
- --realm=localhost
|
||||||
|
- --listening-port=3478
|
||||||
|
- --min-port=49160
|
||||||
|
- --max-port=49200
|
||||||
|
- --no-cli
|
||||||
|
- --no-tls
|
||||||
|
- --no-dtls
|
||||||
|
ports:
|
||||||
|
- "${MATRIX_DEV_TURN_PORT:-3478}:3478/tcp"
|
||||||
|
- "${MATRIX_DEV_TURN_PORT:-3478}:3478/udp"
|
||||||
|
- "${MATRIX_DEV_TURN_MIN_PORT:-49160}-${MATRIX_DEV_TURN_MAX_PORT:-49200}:49160-49200/udp"
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
matrix-dev-livekit:
|
||||||
|
image: livekit/livekit-server:v1.9
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
depends_on:
|
||||||
|
- matrix-dev-redis
|
||||||
|
entrypoint: /bin/sh
|
||||||
|
command:
|
||||||
|
- -ec
|
||||||
|
- |
|
||||||
|
cat >/tmp/livekit.yaml <<EOF
|
||||||
|
port: 7880
|
||||||
|
redis:
|
||||||
|
address: matrix-dev-redis:6379
|
||||||
|
rtc:
|
||||||
|
tcp_port: 7881
|
||||||
|
port_range_start: 50000
|
||||||
|
port_range_end: 50100
|
||||||
|
use_external_ip: false
|
||||||
|
keys:
|
||||||
|
devkey: devsecret
|
||||||
|
room:
|
||||||
|
auto_create: false
|
||||||
|
EOF
|
||||||
|
exec livekit-server --config /tmp/livekit.yaml
|
||||||
|
ports:
|
||||||
|
- "${MATRIX_DEV_LIVEKIT_PORT:-7880}:7880"
|
||||||
|
- "${MATRIX_DEV_LIVEKIT_TCP_PORT:-7881}:7881/tcp"
|
||||||
|
- "${MATRIX_DEV_LIVEKIT_RTC_MIN_PORT:-50000}-${MATRIX_DEV_LIVEKIT_RTC_MAX_PORT:-50100}:50000-50100/udp"
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
matrix-dev-rtc-jwt:
|
||||||
|
image: ghcr.io/element-hq/lk-jwt-service:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
depends_on:
|
||||||
|
- matrix-dev-livekit
|
||||||
|
- matrix-dev-synapse
|
||||||
|
environment:
|
||||||
|
- LIVEKIT_URL=ws://localhost:${MATRIX_DEV_LIVEKIT_PORT:-7880}
|
||||||
|
- LIVEKIT_KEY=devkey
|
||||||
|
- LIVEKIT_SECRET=devsecret
|
||||||
|
- LIVEKIT_FULL_ACCESS_HOMESERVERS=localhost
|
||||||
|
- LIVEKIT_JWT_BIND=:8080
|
||||||
|
ports:
|
||||||
|
- "${MATRIX_DEV_RTC_JWT_PORT:-8081}:8080"
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
|
||||||
|
matrix-dev-element:
|
||||||
|
image: vectorim/element-web:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
profiles:
|
||||||
|
- matrix-dev
|
||||||
|
volumes:
|
||||||
|
- ./matrix/dev/element-config.json:/app/config.json:ro
|
||||||
|
ports:
|
||||||
|
- "${MATRIX_DEV_ELEMENT_PORT:-8080}:80"
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
# db:
|
# db:
|
||||||
# image: postgres
|
# image: postgres
|
||||||
# restart: always
|
# restart: always
|
||||||
|
|||||||
@@ -94,3 +94,81 @@ docker compose up -d
|
|||||||
- Die aktuellen Ports für TURN und LiveKit müssen auf der Firewall des Servers freigegeben werden.
|
- Die aktuellen Ports für TURN und LiveKit müssen auf der Firewall des Servers freigegeben werden.
|
||||||
- Federation sollte erst nach einer expliziten Entscheidung geöffnet werden. Für B2B-Kommunikation ist eine Allowlist sinnvoll.
|
- Federation sollte erst nach einer expliziten Entscheidung geöffnet werden. Für B2B-Kommunikation ist eine Allowlist sinnvoll.
|
||||||
- Die Werte in `.env.example` sind Platzhalter und nicht produktionssicher.
|
- Die Werte in `.env.example` sind Platzhalter und nicht produktionssicher.
|
||||||
|
|
||||||
|
## Lokaler Entwicklungsstack
|
||||||
|
|
||||||
|
Für lokale Entwicklung gibt es zusätzlich das Profil `matrix-dev`. Es nutzt direkte Localhost-Ports und braucht keine öffentlichen Domains, kein ACME und keine Traefik-Router.
|
||||||
|
|
||||||
|
Lokale Dienste:
|
||||||
|
|
||||||
|
- Synapse: `http://localhost:8008`
|
||||||
|
- Element Web: `http://localhost:8080`
|
||||||
|
- MatrixRTC JWT-Service: `http://localhost:8081`
|
||||||
|
- LiveKit: `ws://localhost:7880`
|
||||||
|
- TURN: `localhost:3478`
|
||||||
|
|
||||||
|
### Lokale Synapse-Konfiguration erzeugen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose --profile matrix-dev run --rm \
|
||||||
|
-e SYNAPSE_SERVER_NAME=localhost \
|
||||||
|
-e SYNAPSE_REPORT_STATS=no \
|
||||||
|
matrix-dev-synapse generate
|
||||||
|
```
|
||||||
|
|
||||||
|
Danach `matrix/dev/synapse/homeserver.yaml` für die lokale Compose anpassen:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
public_baseurl: "http://localhost:8008/"
|
||||||
|
|
||||||
|
database:
|
||||||
|
name: psycopg2
|
||||||
|
args:
|
||||||
|
user: synapse
|
||||||
|
password: "synapse-dev-password"
|
||||||
|
database: synapse
|
||||||
|
host: matrix-dev-db
|
||||||
|
cp_min: 5
|
||||||
|
cp_max: 10
|
||||||
|
|
||||||
|
redis:
|
||||||
|
enabled: true
|
||||||
|
host: matrix-dev-redis
|
||||||
|
|
||||||
|
enable_registration: true
|
||||||
|
enable_registration_without_verification: true
|
||||||
|
|
||||||
|
turn_uris:
|
||||||
|
- "turn:localhost:3478?transport=udp"
|
||||||
|
- "turn:localhost:3478?transport=tcp"
|
||||||
|
turn_shared_secret: "matrix-dev-turn-secret"
|
||||||
|
turn_user_lifetime: "1h"
|
||||||
|
|
||||||
|
experimental_features:
|
||||||
|
msc3266_enabled: true
|
||||||
|
msc4222_enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lokalen Stack starten
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose --profile matrix-dev up -d \
|
||||||
|
matrix-dev-db \
|
||||||
|
matrix-dev-redis \
|
||||||
|
matrix-dev-synapse \
|
||||||
|
matrix-dev-turn \
|
||||||
|
matrix-dev-livekit \
|
||||||
|
matrix-dev-rtc-jwt \
|
||||||
|
matrix-dev-element
|
||||||
|
```
|
||||||
|
|
||||||
|
Einen lokalen Admin-Nutzer kannst du danach im Synapse-Container anlegen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose --profile matrix-dev exec matrix-dev-synapse \
|
||||||
|
register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008
|
||||||
|
```
|
||||||
|
|
||||||
|
Anschließend Element Web unter `http://localhost:8080` öffnen und mit dem lokalen Matrix-Nutzer anmelden.
|
||||||
|
|
||||||
|
Wenn FEDEO selbst parallel lokal laufen soll, starte die FEDEO-Dienste separat wie gewohnt. Der lokale Matrix-Stack ist absichtlich über direkte Ports erreichbar, damit er unabhängig von DNS, TLS und Traefik getestet werden kann.
|
||||||
|
|||||||
15
matrix/dev/element-config.json
Normal file
15
matrix/dev/element-config.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"default_server_config": {
|
||||||
|
"m.homeserver": {
|
||||||
|
"base_url": "http://localhost:8008",
|
||||||
|
"server_name": "localhost"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"disable_custom_urls": false,
|
||||||
|
"disable_guests": true,
|
||||||
|
"brand": "FEDEO Matrix Dev",
|
||||||
|
"default_theme": "light",
|
||||||
|
"features": {
|
||||||
|
"feature_video_rooms": true
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user