dirextalk-message-server

module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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.

Dirextalk Message Server overview

中文说明

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
internal/action
Package action owns the shared ProductCore action boundary primitives.
Package action owns the shared ProductCore action boundary primitives.
internal/agent
Package agent owns Native Agent configuration mapping and legacy import.
Package agent owns Native Agent configuration mapping and legacy import.
internal/blocks
Package blocks owns ProductCore contact-block actions and block lookups.
Package blocks owns ProductCore contact-block actions and block lookups.
internal/calls
Package calls owns ProductCore call-session actions and lifecycle projection.
Package calls owns ProductCore call-session actions and lifecycle projection.
internal/channels
Package channels owns ProductCore channel CRUD, listing, lifecycle, and member-count persistence orchestration.
Package channels owns ProductCore channel CRUD, listing, lifecycle, and member-count persistence orchestration.
internal/contacts
Package contacts owns contact reads and durable contact-save orchestration.
Package contacts owns contact reads and durable contact-save orchestration.
internal/conversation
Package conversation owns ProductCore conversation actions and read-model presentation.
Package conversation owns ProductCore conversation actions and read-model presentation.
internal/events
Package events owns the durable ProductCore event stream, sequence allocation, retention, cursor validation, and live waiter notification.
Package events owns the durable ProductCore event stream, sequence allocation, retention, cursor validation, and live waiter notification.
internal/groups
Package groups owns ProductCore group CRUD, listing, lifecycle, and policy actions.
Package groups owns ProductCore group CRUD, listing, lifecycle, and policy actions.
internal/httpapi
Package httpapi owns the ProductCore and MCP HTTP protocol adapters.
Package httpapi owns the ProductCore and MCP HTTP protocol adapters.
internal/legacygateway
Package legacygateway owns the bounded Matrix-to-Agent-Gateway compatibility boundary.
Package legacygateway owns the bounded Matrix-to-Agent-Gateway compatibility boundary.
internal/mcp
Package mcp adapts Dirextalk product state and Matrix transport to the shared internal/dirextalkmcp capability service.
Package mcp adapts Dirextalk product state and Matrix transport to the shared internal/dirextalkmcp capability service.
internal/members
Package members owns shared ProductCore group and channel member reads and lifecycle and policy mutations.
Package members owns shared ProductCore group and channel member reads and lifecycle and policy mutations.
internal/operations
Package operations defines durable records for recoverable ProductCore operations.
Package operations defines durable records for recoverable ProductCore operations.
internal/plugins
Package plugins owns the non-Agent plugin ProductCore actions, persistence orchestration, invocation validation, and Docker runner boundary.
Package plugins owns the non-Agent plugin ProductCore actions, persistence orchestration, invocation validation, and Docker runner boundary.
internal/portal
Package portal owns portal authentication, session rotation, password, and runtime-status ProductCore workflows.
Package portal owns portal authentication, session rotation, password, and runtime-status ProductCore workflows.
internal/profile
Package profile owns the owner profile ProductCore workflow and public well-known projection.
Package profile owns the owner profile ProductCore workflow and public well-known projection.
internal/projector
Package projector owns roomserver output consumption and projection dispatch.
Package projector owns roomserver output consumption and projection dispatch.
internal/realtimews
Package realtimews owns the ProductCore realtime WebSocket transport.
Package realtimews owns the ProductCore realtime WebSocket transport.
internal/release
Package release owns the ProductCore release status, apply, and client-build reporting workflows.
Package release owns the ProductCore release status, apply, and client-build reporting workflows.
internal/reports
Package reports owns report submission, durable report creation, and the related Matrix system-notification projection.
Package reports owns report submission, durable report creation, and the related Matrix system-notification projection.
internal/social
Package social owns ProductCore favorite and follow actions.
Package social owns ProductCore favorite and follow actions.
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