Merge pull request 'discord-bridge: Matrix avatars on Discord, catch up missed messages' (#47) from discord-bridge-avatars into main
Lint / Shell (shellcheck) (push) Successful in 11s
Lint / JS (eslint) (push) Successful in 11s
Lint / No secrets in webhook configs (push) Successful in 6s
Lint / Landing page is rendered (matrix (push) Successful in 5s
Lint / Python (ruff) (push) Successful in 7s
Lint / Secret scan (gitleaks) (push) Successful in 6s
Lint / Python deps (pip-audit) (push) Successful in 52s

This commit was merged in pull request #47.
This commit is contained in:
2026-10-28 21:53:34 -04:00
2 changed files with 13 additions and 6 deletions
+10 -3
View File
@@ -290,7 +290,7 @@ The token in `draupnir/production.yaml` in this repo is **intentionally redacted
| 9002 | Hookshot bridge (appservice) | 127.0.0.1 | | 9002 | Hookshot bridge (appservice) | 127.0.0.1 |
| 9003 | Hookshot webhooks | 0.0.0.0 | | 9003 | Hookshot webhooks | 0.0.0.0 |
| 9004 | Hookshot metrics | 0.0.0.0 | | 9004 | Hookshot metrics | 0.0.0.0 |
| 29334 | mautrix-discord (appservice) | 127.0.0.1 | | 29334 | mautrix-discord (appservice + avatar proxy for NPM) | 0.0.0.0 |
| 9100 | node_exporter | 0.0.0.0 | | 9100 | node_exporter | 0.0.0.0 |
| 9101 | matrix-admin exporter | 0.0.0.0 | | 9101 | matrix-admin exporter | 0.0.0.0 |
| 9500 | webhook (auto-deploy) | 0.0.0.0 | | 9500 | webhook (auto-deploy) | 0.0.0.0 |
@@ -427,8 +427,15 @@ can't overwrite the room's name and icon with the Discord channel's.
**Rotating the bot token:** reset it in the Developer Portal, then DM the bridge bot `logout` and **Rotating the bot token:** reset it in the Developer Portal, then DM the bridge bot `logout` and
`login-token bot <new token>`. `login-token bot <new token>`.
**Not set up yet:** `bridge.public_address`, so Matrix users' avatars aren't shown on their relayed **Matrix avatars on Discord:** relayed messages carry the sender's avatar as a signed URL under
Discord messages (names are). It needs a public NPM route to `/mautrix-discord/avatar/`. `bridge.public_address` (`https://matrix.lotusguild.org`), which Discord fetches. NPM proxies
`/mautrix-discord/avatar/` → `http://10.10.10.29:29334` (hand-added location in
`/data/nginx/proxy_host/49.conf` on LXC 139, like `/sfu/get` — **re-add it after any NPM UI save of
proxy host 49**). The bridge listens on `0.0.0.0:29334` for this; the appservice API on that port
still requires the `hs_token`, and only the avatar path is proxied publicly.
**Catch-up after downtime:** `backfill.forward_limits.missed.channel: -1`, so Discord messages sent
while the bridge or Synapse was down are bridged when it starts again.
--- ---
+3 -3
View File
@@ -31,7 +31,7 @@ appservice:
address: http://127.0.0.1:29334 address: http://127.0.0.1:29334
# The hostname and port where this appservice should listen. # The hostname and port where this appservice should listen.
hostname: 127.0.0.1 hostname: 0.0.0.0
port: 29334 port: 29334
# Database config. # Database config.
@@ -114,7 +114,7 @@ bridge:
# Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode. # Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode.
# If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address. # If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address.
# This should not have a trailing slash, the endpoint above will be appended to the provided address. # This should not have a trailing slash, the endpoint above will be appended to the provided address.
public_address: null public_address: https://matrix.lotusguild.org
# A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature. # A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature.
avatar_proxy_key: generate avatar_proxy_key: generate
@@ -257,7 +257,7 @@ bridge:
# With limits, all messages up to the limit are fetched first and backfilled afterwards. # With limits, all messages up to the limit are fetched first and backfilled afterwards.
missed: missed:
dm: 0 dm: 0
channel: 0 channel: -1
thread: 0 thread: 0
# Maximum members in a guild to enable backfilling. Set to -1 to disable limit. # Maximum members in a guild to enable backfilling. Set to -1 to disable limit.
# This can be used as a rough heuristic to disable backfilling in channels that are too active. # This can be used as a rough heuristic to disable backfilling in channels that are too active.