Lint / Shell (shellcheck) (push) Successful in 29s
Lint / JS (eslint) (push) Successful in 27s
Lint / No Hookshot webhook IDs in README (push) Successful in 12s
Lint / No secrets in webhook configs (push) Successful in 8s
Lint / Landing page is rendered (matrix (push) Successful in 5s
Lint / Python (ruff) (push) Successful in 6s
Lint / Secret scan (gitleaks) (push) Successful in 7s
Lint / Shell (shellcheck) (pull_request) Successful in 7s
Lint / JS (eslint) (pull_request) Successful in 17s
Lint / No Hookshot webhook IDs in README (pull_request) Successful in 9s
Lint / No secrets in webhook configs (pull_request) Successful in 19s
Lint / Python deps (pip-audit) (push) Successful in 1m18s
Lint / Landing page is rendered (matrix (pull_request) Successful in 11s
Lint / Python (ruff) (pull_request) Successful in 22s
Lint / Secret scan (gitleaks) (pull_request) Successful in 7s
Lint / Python deps (pip-audit) (pull_request) Successful in 34s
On 2026-11-15 21:34 an image relay failed with "read: connection reset by peer" after the request was sent. Patch 0001 deliberately doesn't retry those (a webhook post has no dedupe), so the image was dropped. Patch 0002: while a relay send is in flight the bridge watches the Discord gateway for its own post (same webhook, text and attachment count, created after the send started). On an ambiguous failure (reset, EOF, timeout waiting for the reply, Discord 5xx) it waits up to 6 s for that echo: if it shows up the send counts as delivered and is recorded (no resend, no copy back into Matrix); otherwise it retries with the 0001 backoff, checking again before each resend. build-patched.sh runs the new tests with -race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
40 lines
1.5 KiB
Bash
40 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
# Build mautrix-discord with the Lotus patches in discord-bridge/patches/.
|
|
#
|
|
# Needs: git, Go (version from upstream go.mod or newer), a C compiler and libolm-dev.
|
|
# Output: ./mautrix-discord-lotus (dynamically linked against libolm.so.3, which
|
|
# LXC 151 has from the libolm3 package).
|
|
#
|
|
# Deploy (on the Proxmox node hosting LXC 151):
|
|
# pct push 151 mautrix-discord-lotus /opt/mautrix-discord/mautrix-discord.new
|
|
# pct exec 151 -- bash -c 'cd /opt/mautrix-discord && cp -a mautrix-discord mautrix-discord.bak-$(date +%Y%m%d) \
|
|
# && chown mautrix-discord: mautrix-discord.new && chmod 755 mautrix-discord.new \
|
|
# && mv mautrix-discord.new mautrix-discord && systemctl restart mautrix-discord'
|
|
set -euo pipefail
|
|
|
|
VERSION="${VERSION:-v0.7.7}"
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
OUT="${OUT:-$PWD/mautrix-discord-lotus}"
|
|
WORK="$(mktemp -d)"
|
|
trap 'rm -rf "$WORK"' EXIT
|
|
|
|
git clone -q --depth 1 --branch "$VERSION" https://github.com/mautrix/discord.git "$WORK/src"
|
|
cd "$WORK/src"
|
|
for p in "$HERE"/patches/*.patch; do
|
|
echo "applying $(basename "$p")"
|
|
git apply "$p"
|
|
done
|
|
|
|
go test -race -count=1 -run 'Retry|PreSend|Ambiguous|Echo' .
|
|
|
|
COMMIT="$(git rev-parse HEAD)"
|
|
MAUTRIX="$(go list -m -f '{{.Version}}' maunium.net/go/mautrix)"
|
|
CGO_ENABLED=1 go build -o "$OUT" -ldflags "-s -w \
|
|
-X main.Tag=$VERSION \
|
|
-X main.Commit=$COMMIT+lotus \
|
|
-X 'main.BuildTime=$(date '+%b %_d %Y, %H:%M:%S')' \
|
|
-X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX'" .
|
|
|
|
"$OUT" --version
|
|
echo "built $OUT"
|