dirextalk-message-server

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: AGPL-3.0

README

Dirextalk Message Server

Dirextalk Message Server is the Dirextalk backend that combines a Matrix-compatible homeserver with the Dirextalk P2P product API in one Go monolith.

It is based on Element Dendrite, but this repository is maintained as a Dirextalk product server rather than a general-purpose Matrix homeserver distribution.

中文说明

Runtime

  • Production entry point: cmd/dirextalk-message-server
  • Compatibility entry point: cmd/dendrite
  • Docker image: dirextalk/message-server:latest
  • Default config path in Docker: /etc/dirextalk-message-server/message-server.yaml
  • Default data path in Docker: /var/dirextalk-message-server
  • Go module: github.com/YingSuiAI/dirextalk-message-server
  • Go version: 1.26.4

API Surface

Matrix protocol routes remain under:

  • /_matrix/*
  • /_synapse/*
  • /_dendrite/*
  • /.well-known/matrix/*

Dirextalk product APIs use the body-action surface:

  • GET /_p2p/health
  • POST /_p2p/query
  • POST /_p2p/command
  • GET /_p2p/ws
  • GET /.well-known/portal/owner.json

Product requests use this envelope:

{
  "action": "channels.public.get",
  "params": {
    "room_id": "!room:dendrite-a:8448",
    "remote_node_base_url": "https://dendrite-a:8448/_p2p"
  }
}

Local Development

Run commands from the repository root. PowerShell, Bash on Linux, Bash on macOS, and Bash in WSL are all supported; choose the command form that matches the shell you are using.

Build the server:

go build ./cmd/dirextalk-message-server
go build ./cmd/dendrite

Run the single-node Docker stack:

docker compose -f docker-compose.p2p.yml up --build
docker compose -f docker-compose.p2p.yml exec message-server cat /var/dirextalk-message-server/p2p/bootstrap.json

Run the three-node regression stack.

PowerShell:

$env:P2P_DUAL_PUBLIC_HOST = if ($env:P2P_DUAL_PUBLIC_HOST) { $env:P2P_DUAL_PUBLIC_HOST } else { "host.docker.internal" }
docker compose -f docker-compose.p2p-dual.yml up -d --force-recreate dendrite-a dendrite-b dendrite-c
python scripts/p2p-three-node-regression.py

Bash on Linux, macOS, or WSL:

export P2P_DUAL_PUBLIC_HOST="${P2P_DUAL_PUBLIC_HOST:-host.docker.internal}"
docker compose -f docker-compose.p2p-dual.yml up -d --force-recreate dendrite-a dendrite-b dendrite-c
python3 scripts/p2p-three-node-regression.py

Run tests against a local PostgreSQL instance:

PowerShell:

$env:POSTGRES_USER = "postgres"
$env:POSTGRES_PASSWORD = "123789"
$env:POSTGRES_HOST = "localhost"
$env:POSTGRES_PORT = "5432"
$env:POSTGRES_DB = "postgres"
go test ./p2p ./internal/productpolicy -count=1

Bash:

export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=123789
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export POSTGRES_DB=postgres
go test ./p2p ./internal/productpolicy -count=1

The Go test helper creates isolated dendrite_test_* databases and drops them when each test finishes.

Documentation

Current maintained docs are intentionally small. Historical Dendrite site docs, obsolete trackers, and one-off implementation plans are not maintained in this fork.

License

This project retains upstream license and copyright notices where code originates from Element Dendrite. See LICENSE and LICENSE-COMMERCIAL.

Directories

Path Synopsis
api
Package api contains methods used by dendrite components in multi-process mode to send requests to the appservice component, typically in order to ask an application service for some information.
Package api contains methods used by dendrite components in multi-process mode to send requests to the appservice component, typically in order to ask an application service for some information.
query
Package query handles requests from other internal dendrite components when they interact with the AppServiceQueryAPI.
Package query handles requests from other internal dendrite components when they interact with the AppServiceQueryAPI.
api
auth
Package auth implements authentication checks and storage.
Package auth implements authentication checks and storage.
cmd
create-account command
dendrite command
furl command
generate-config command
generate-keys command
resolve-state command
contrib
api
hooks
Package hooks exposes places in Dendrite where custom code can be executed, useful for MSCs.
Package hooks exposes places in Dendrite where custom code can be executed, useful for MSCs.
p2p
mcp
api
api
Package api provides the types that are used to communicate with the roomserver.
Package api provides the types that are used to communicate with the roomserver.
internal/input
Package input contains the code processes new room events
Package input contains the code processes new room events
types
Package types provides the types that are used internally within the roomserver.
Package types provides the types that are used internally within the roomserver.
mscs
Package mscs implements Matrix Spec Changes from https://github.com/matrix-org/matrix-doc
Package mscs implements Matrix Spec Changes from https://github.com/matrix-org/matrix-doc
mscs/msc2836
Package msc2836 'Threading' implements https://github.com/matrix-org/matrix-doc/pull/2836
Package msc2836 'Threading' implements https://github.com/matrix-org/matrix-doc/pull/2836
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL