mirror of
https://github.com/mautrix/signal.git
synced 2026-11-09 15:49:17 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01048dc165 |
332 changed files with 34423 additions and 102294 deletions
8
.envrc
Normal file
8
.envrc
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
if [[ $(uname -s) == "Linux" && $(uname --kernel-version | grep "NixOS") ]]; then
|
||||
echo "The best OS (NixOS) has been detected. Using nice tools."
|
||||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.0; then
|
||||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.0/direnvrc" "sha256-21TMnI2xWX7HkSTjFFri2UaohXVj854mgvWapWrxRXg="
|
||||
fi
|
||||
|
||||
use flake
|
||||
fi
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
|
|
@ -1,2 +0,0 @@
|
|||
*.pb.go linguist-generated=true
|
||||
*.pb.raw binary linguist-generated=true
|
||||
15
.github/ISSUE_TEMPLATE/bug.md
vendored
15
.github/ISSUE_TEMPLATE/bug.md
vendored
|
|
@ -1,18 +1,7 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: If something is definitely wrong in the bridge (rather than just a setup issue),
|
||||
file a bug report. Remember to include relevant logs. Asking in the Matrix room first
|
||||
is strongly recommended.
|
||||
type: Bug
|
||||
file a bug report. Remember to include relevant logs.
|
||||
labels: bug
|
||||
|
||||
---
|
||||
|
||||
<!-- Include relevant logs, the bridge version and other important details here -->
|
||||
|
||||
### Checklist
|
||||
|
||||
<!-- All items below are mandatory. Issues not following the rules may be closed without comment. -->
|
||||
|
||||
* [ ] This is an actual bug, not just a setup issue (see the [troubleshooting docs](https://docs.mau.fi/bridges/general/troubleshooting.html) or ask in the Matrix room for setup help).
|
||||
* [ ] I am certain that sufficient information is included. Ask in the Matrix room first if not.
|
||||
* [ ] The bug is still present on the main branch. The `!signal version` command output is: ``
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/enhancement.md
vendored
2
.github/ISSUE_TEMPLATE/enhancement.md
vendored
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: Enhancement request
|
||||
about: Submit a feature request or other suggestion
|
||||
type: Feature
|
||||
labels: enhancement
|
||||
|
||||
---
|
||||
|
|
|
|||
36
.github/workflows/go.yml
vendored
36
.github/workflows/go.yml
vendored
|
|
@ -2,25 +2,16 @@ name: Go
|
|||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
GOTOOLCHAIN: local
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
go-version: ["1.26", "1.27"]
|
||||
name: Lint ${{ matrix.go-version == '1.27' && '(latest)' || '(old)' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
go-version: "1.21"
|
||||
cache: true
|
||||
|
||||
- name: Install libolm
|
||||
|
|
@ -30,33 +21,31 @@ jobs:
|
|||
run: |
|
||||
go install golang.org/x/tools/cmd/goimports@latest
|
||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
go install github.com/beeper/pre-commit-go/bridgelint@latest
|
||||
export PATH="$HOME/go/bin:$PATH"
|
||||
|
||||
- name: Run pre-commit
|
||||
uses: pre-commit/action@v3.0.1
|
||||
uses: pre-commit/action@v3.0.0
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
go-version: ["1.26", "1.27"]
|
||||
name: Test ${{ matrix.go-version == '1.27' && '(latest)' || '(old)' }}
|
||||
go-version: ["1.20", "1.21"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
|
||||
#- name: Set up gotestfmt
|
||||
# uses: GoTestTools/gotestfmt-action@v2
|
||||
# with:
|
||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Set up gotestfmt
|
||||
uses: GoTestTools/gotestfmt-action@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install libolm
|
||||
run: sudo apt-get install libolm-dev
|
||||
|
|
@ -69,5 +58,4 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
export LIBRARY_PATH=.
|
||||
#go test -v -json ./... -cover | gotestfmt
|
||||
go test ./...
|
||||
go test -v -json ./... -cover | gotestfmt
|
||||
|
|
|
|||
29
.github/workflows/stale.yml
vendored
29
.github/workflows/stale.yml
vendored
|
|
@ -1,29 +0,0 @@
|
|||
name: 'Lock old issues'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 12 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
# pull-requests: write
|
||||
# discussions: write
|
||||
|
||||
concurrency:
|
||||
group: lock-threads
|
||||
|
||||
jobs:
|
||||
lock-stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v6
|
||||
id: lock
|
||||
with:
|
||||
issue-inactive-days: 90
|
||||
process-only: issues
|
||||
- name: Log processed threads
|
||||
run: |
|
||||
if [ '${{ steps.lock.outputs.issues }}' ]; then
|
||||
echo "Issues:" && echo '${{ steps.lock.outputs.issues }}' | jq -r '.[] | "https://github.com/\(.owner)/\(.repo)/issues/\(.issue_number)"'
|
||||
fi
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -6,7 +6,6 @@
|
|||
*.log*
|
||||
|
||||
/mautrix-signal
|
||||
/mautrix-signalgo
|
||||
/start
|
||||
/libsignal_ffi.a
|
||||
|
||||
.idea
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
include:
|
||||
- project: 'mautrix/ci'
|
||||
file: '/gov2-as-default.yml'
|
||||
file: '/go.yml'
|
||||
|
||||
variables:
|
||||
BUILDER_IMAGE: dock.mau.dev/tulir/gomuks-build-docker/signal
|
||||
BINARY_NAME: mautrix-signal
|
||||
|
||||
# 32-bit arm builds aren't supported
|
||||
build arm:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude_types: [markdown]
|
||||
|
|
@ -9,23 +9,16 @@ repos:
|
|||
- id: check-added-large-files
|
||||
|
||||
- repo: https://github.com/tekwizely/pre-commit-golang
|
||||
rev: v1.0.0-rc.4
|
||||
rev: v1.0.0-rc.1
|
||||
hooks:
|
||||
- id: go-imports
|
||||
exclude: "pb\\.go$"
|
||||
args:
|
||||
- "-local"
|
||||
- "go.mau.fi/mautrix-signal"
|
||||
- "-w"
|
||||
- id: go-vet-mod
|
||||
# - id: go-staticcheck-repo-mod
|
||||
#- id: go-staticcheck-repo-mod
|
||||
# TODO: reenable this and fix all the problems
|
||||
|
||||
- repo: https://github.com/beeper/pre-commit-go
|
||||
rev: v0.5.0
|
||||
rev: v0.3.0
|
||||
hooks:
|
||||
- id: zerolog-ban-msgf
|
||||
- id: zerolog-use-stringer
|
||||
- id: bridgelint
|
||||
language: system
|
||||
verbose: true
|
||||
|
|
|
|||
343
CHANGELOG.md
343
CHANGELOG.md
|
|
@ -1,345 +1,12 @@
|
|||
# v26.11 (unreleased)
|
||||
|
||||
* Updated libsignal to v0.106.1.
|
||||
* Added support for sending more than 2048 characters of text to Signal by
|
||||
uploading the rest of the text as an attachment, like official clients do.
|
||||
* Added automatic retrying of group message sends if the server returns a 500
|
||||
or 503 error.
|
||||
* Added support for encrypting direct media with FLOE ([MSC4571]).
|
||||
* Fixed memory leak in libsignal store implementation.
|
||||
|
||||
[MSC4571]: https://github.com/matrix-org/matrix-spec-proposals/pull/4571
|
||||
|
||||
# v26.10
|
||||
|
||||
* Updated libsignal to v0.105.0.
|
||||
* Added support for phonenumberless accounts.
|
||||
* Added support for starting chats with usernames and username links.
|
||||
* Added support for blocking and unblocking users on Signal.
|
||||
* Added support for new view-limited media interface in bridgev2.
|
||||
* Added proper sender certificate validation.
|
||||
* Changed storage sync to only sync once if repeated fetch latest notices are
|
||||
received.
|
||||
* Fixed contact syncs not happening even when `sync_contacts_on_startup` was
|
||||
set to true.
|
||||
* Fixed Signal encryption using wrong timestamp precision for session expiry.
|
||||
* Fixed sender key sharing not handling removed users properly.
|
||||
* Fixed handling retry receipts with no sender key info.
|
||||
* Fixed deadlock in prekey upload loop if the client gets logged out.
|
||||
* Fixed infinite loop when importing sticker packs with duplicate emoji
|
||||
shortcuts.
|
||||
|
||||
# v26.09
|
||||
|
||||
* Bumped minimum Go version to 1.26.
|
||||
* Updated libsignal to v0.102.2.
|
||||
* Fixed handling messages with invalid values in formatting body ranges.
|
||||
* Fixed websocket request retrying not working correctly if the first attempt
|
||||
times out.
|
||||
* Fixed another potential race condition with edited message bridging.
|
||||
|
||||
# v26.08
|
||||
|
||||
* Updated libsignal to v0.100.0
|
||||
* Added support for handling own profile key changes.
|
||||
* Changed attachment bridging behavior to match Signal Desktop.
|
||||
* Fixed edited messages being bridged twice if certain race conditions occurred.
|
||||
|
||||
# v26.07
|
||||
|
||||
* Updated Docker image to Alpine 3.24.
|
||||
* Updated libsignal to v0.97.2.
|
||||
* Added automatic retry when sender key send fails due to missing session.
|
||||
* Fixed changing poll votes from Matrix.
|
||||
|
||||
# v26.06
|
||||
|
||||
* Updated libsignal to v0.94.4.
|
||||
* Updated mrenclave to fix looking up phone numbers.
|
||||
* Changed knock accept handling to auto-join the ghost user afterwards.
|
||||
|
||||
# v26.05
|
||||
|
||||
* Updated libsignal to v0.93.2.
|
||||
* Added support for importing sticker packs from Signal.
|
||||
|
||||
# v26.04
|
||||
|
||||
* Updated libsignal to v0.92.1.
|
||||
* Added support for admin message deletes from Signal.
|
||||
* Added support for binary service IDs in storage service.
|
||||
* Fixed `private_chat_portal_meta` option not setting DM room names correctly.
|
||||
* Fixed panic if user is logged out during initial chat sync.
|
||||
* Fixed avatar upload failing when creating new Signal group.
|
||||
|
||||
# v26.03
|
||||
|
||||
* Switched to sending binary service ID fields in outgoing messages.
|
||||
* Added support for roundtripping large attachments via disk to avoid keeping
|
||||
the entire file in memory during en/decryption.
|
||||
|
||||
# v26.02.2
|
||||
|
||||
* Added support for more new binary service ID fields.
|
||||
|
||||
# v26.02.1
|
||||
|
||||
* Updated libsignal to v0.87.5.
|
||||
* Added support for new binary service ID fields that Signal 8.0 switched to.
|
||||
|
||||
# v26.02
|
||||
|
||||
* Bumped minimum Go version to 1.25.
|
||||
* Updated libsignal to v0.87.1.
|
||||
* Added automatic recovery for the session not found error from libsignal.
|
||||
* Fixed sender key state not being cleared on logout properly.
|
||||
|
||||
# v26.01
|
||||
|
||||
* Updated libsignal to v0.86.12.
|
||||
* Changed automatic contact list sync option to only sync every 3 days rather
|
||||
than on every restart.
|
||||
* Fixed sending messages to groups with no other registered members.
|
||||
* Fixed sender key sends failing if some users had changed devices.
|
||||
* Fixed timestamps of outgoing typing notifications in DMs.
|
||||
|
||||
# v25.12
|
||||
|
||||
* Updated libsignal to v0.86.8.
|
||||
* Updated Docker image to Alpine 3.23.
|
||||
* Added support for dropping incoming DMs from blocked contacts on Signal.
|
||||
* Added support for sender key encryption when sending to groups, which makes
|
||||
sending much faster and enables sending typing notifications.
|
||||
* Added support for encryption retry receipts.
|
||||
* Fixed bugs with handling poll votes.
|
||||
* Fixed history transfer option not showing up when pairing with Signal Android.
|
||||
* Fixed nicknames being cleared not being bridged
|
||||
(thanks to [@Enzime] in [#623]).
|
||||
|
||||
[#623]: https://github.com/mautrix/signal/pull/623
|
||||
[@Enzime]: https://github.com/Enzime
|
||||
|
||||
# v25.11
|
||||
|
||||
* Updated libsignal to v0.86.4.
|
||||
* Added support for bridging invite state in groups for phone number invites.
|
||||
* Added support for polls.
|
||||
* Fixed PNI signature not being sent when replying to message requests.
|
||||
* Fixed unnecessary repeating error notices when Signal is down.
|
||||
* Fixed sticker size metadata on Matrix not matching how native Signal Desktop
|
||||
renders them.
|
||||
|
||||
# v25.10
|
||||
|
||||
* Switched to calendar versioning.
|
||||
* Updated libsignal to v0.84.0.
|
||||
* Fixed backfill creating incorrect disappearing timer change notices.
|
||||
|
||||
# v0.8.7 (2025-09-16)
|
||||
|
||||
* Removed legacy provisioning API and database legacy migration.
|
||||
Upgrading directly from versions prior to v0.7.0 is not supported.
|
||||
* If you've been using the bridge since before v0.7.0 and have prevented the
|
||||
bridge from writing to the config, you must either update the config
|
||||
manually or allow the bridge to update it for you **before** upgrading to
|
||||
this release (i.e. run v0.8.6 once with config writing allowed).
|
||||
* Updated libsignal to v0.80.3.
|
||||
* Added support for `com.beeper.disappearing_timer` state event, which stores
|
||||
the disappearing setting of chats and allows changing the setting from Matrix.
|
||||
* Added support for nicknames in displayname templates.
|
||||
* Like contact list names, nicknames are not safe to use on multi-user instances.
|
||||
* Added support for creating Signal groups.
|
||||
* Fixed certain types of logouts not being detected properly.
|
||||
|
||||
# v0.8.6 (2025-08-16)
|
||||
|
||||
* Deprecated legacy provisioning API. The `/_matrix/provision/v2` endpoints will
|
||||
be deleted in the next release.
|
||||
* Bumped minimum Go version to 1.24.
|
||||
* Updated libsignal to v0.78.2.
|
||||
* Added support for "delete to me" of chats and messages.
|
||||
* Added support for latest Signal backup/transfer protocol.
|
||||
|
||||
# v0.8.5 (2025-07-16)
|
||||
|
||||
* Updated libsignal to v0.76.1.
|
||||
|
||||
# v0.8.4 (2025-06-16)
|
||||
|
||||
* Updated libsignal to v0.74.1.
|
||||
* Updated Docker image to Alpine 3.22.
|
||||
* Fixed avatars when using direct media.
|
||||
* Fixed starting chats with non-contact users.
|
||||
* Fixed Matrix media being rejected if the mime type isn't specified.
|
||||
|
||||
# v0.8.3 (2025-05-16)
|
||||
|
||||
* Updated libsignal to v0.72.1.
|
||||
* Added initial support for direct media access.
|
||||
* Note that media is only kept on the Signal servers for 45 days, after which
|
||||
any direct media links will permanently stop working.
|
||||
* Added buffer for decrypted events to prevent losing messages if the bridge is
|
||||
stopped in the middle of event handling.
|
||||
* Fixed backfilling messages in existing portals after relogining.
|
||||
|
||||
# v0.8.2 (2025-04-16)
|
||||
|
||||
* Updated libsignal to v0.70.0.
|
||||
* Fixed panics in some cases when the bridge was under heavy load.
|
||||
|
||||
# v0.8.1 (2025-03-16)
|
||||
|
||||
* Added QR refreshing when logging in.
|
||||
* Updated libsignal to v0.67.4.
|
||||
|
||||
# v0.8.0 (2025-02-16)
|
||||
|
||||
* Bumped minimum Go version to 1.23.
|
||||
* Added support for history transfer.
|
||||
* Updated libsignal to v0.66.2.
|
||||
|
||||
# v0.7.5 (2025-01-16)
|
||||
|
||||
* Added support for bridging mp4 gifs in both directions.
|
||||
* Added support for signaling supported features to clients using the
|
||||
`com.beeper.room_features` state event.
|
||||
* Updated Signal websocket authentication method.
|
||||
* Fixed some cases where websocket would get stuck after a ping timeout.
|
||||
|
||||
# v0.7.4 (2024-12-16)
|
||||
|
||||
* Fixed syncing server-side storage after Signal login.
|
||||
* Added support for new SSRE2 method of receiving the server-side storage key.
|
||||
* Updated libsignal to v0.64.1.
|
||||
* Updated Docker image to Alpine 3.21.
|
||||
|
||||
# v0.7.3 (2024-11-16)
|
||||
|
||||
* Updated libsignal to v0.62.0.
|
||||
* Note for bridges running in systemd: the new version of libsignal may be
|
||||
incompatible with the `MemoryDenyWriteExecute=true` option (see [#750]).
|
||||
* Added basic support for Signal's new file upload protocol.
|
||||
|
||||
[#750]: https://github.com/mautrix/signal/issues/570
|
||||
|
||||
# v0.7.2 (2024-10-16)
|
||||
|
||||
* Updated to libsignal v0.58.3.
|
||||
* Fixed spurious decryption error notices for Signal messages when the
|
||||
websocket reconnects and receives old already-bridged messages.
|
||||
* Fixed signalmeow not respecting account settings for choosing sender
|
||||
certificate.
|
||||
* Fixed bugs in storage service decryption, which could cause issues with
|
||||
missing contact names among other things.
|
||||
* Fixed call start notices only working once per direct chat.
|
||||
|
||||
# v0.7.1 (2024-09-16)
|
||||
|
||||
* Updated to libsignal v0.57.1.
|
||||
* Dropped support for unauthenticated media on Matrix.
|
||||
* Added support for Matrix->Signal power level bridging
|
||||
(thanks to [@maltee1] in [#531]).
|
||||
* Changed voice message conversion to convert to aac instead of m4a,
|
||||
because Signal iOS doesn't appear to like ffmpeg's m4a files.
|
||||
* Fixed outgoing sync messages not including disappearing start timestamp,
|
||||
which would cause native clients to disappear messages at the wrong time.
|
||||
* Re-added notices about decryption errors.
|
||||
|
||||
[#531]: https://github.com/mautrix/signal/pull/531
|
||||
|
||||
# v0.7.0 (2024-08-16)
|
||||
|
||||
* Bumped minimum Go version to 1.22.
|
||||
* Updated to libsignal v0.55.0.
|
||||
* Rewrote bridge using bridgev2 architecture.
|
||||
* It is recommended to check the config file after upgrading. If you have
|
||||
prevented the bridge from writing to the config, you should update it
|
||||
manually.
|
||||
* Thanks to [@maltee1] for reimplementing Matrix -> Signal membership
|
||||
handling in the rewrite.
|
||||
* If you are still somehow using a pre-v0.5.0 versions, upgrading to v0.6.3
|
||||
is required before upgrading to v0.7.0 or higher.
|
||||
|
||||
# v0.6.3 (2024-07-16)
|
||||
|
||||
* Updated to libsignal v0.52.0.
|
||||
* Fixed bridge losing track of user phone numbers in some cases.
|
||||
* Fixed edge cases in handling new outgoing DMs started from other devices.
|
||||
* Added `sync groups` command (thanks to [@maltee1] in [#490]).
|
||||
* Fixed typo in location bridging example config
|
||||
(thanks to [@AndrewFerr] in [#516]).
|
||||
|
||||
[#490]: https://github.com/mautrix/signal/pull/490
|
||||
[#516]: https://github.com/mautrix/signal/pull/516
|
||||
[@AndrewFerr]: https://github.com/mautrix/signal/pull/516
|
||||
|
||||
# v0.6.2 (2024-06-16)
|
||||
|
||||
* Updated to libsignal v0.51.0.
|
||||
* Fixed voice messages not being rendered correctly in Element X.
|
||||
* Fixed contact avatars not being bridged correctly even when enabled in
|
||||
the bridge config.
|
||||
* Implemented connector for the upcoming bridgev2 architecture.
|
||||
|
||||
# v0.6.1 (2024-05-16)
|
||||
|
||||
* Added support for bridging location messages from Matrix to Signal
|
||||
(thanks to [@maltee1] in [#504]).
|
||||
* Note that Signal doesn't support real location messages, so they're just
|
||||
bridged as links. The link template is configurable.
|
||||
* Fixed bridging long text messages from Signal
|
||||
(thanks to [@maltee1] in [#506]).
|
||||
* Improved handling of ping timeouts in Signal websocket.
|
||||
|
||||
[#504]: https://github.com/mautrix/signal/pull/504
|
||||
[#506]: https://github.com/mautrix/signal/pull/506
|
||||
|
||||
# v0.6.0 (2024-04-16)
|
||||
|
||||
* Updated to libsignal v0.44.0.
|
||||
* Refactored bridge to support Signal's new phone number identifier (PNI)
|
||||
system in order to fix starting new chats and receiving messages from new
|
||||
users.
|
||||
* When starting a chat with a user you haven't talked to before, the portal
|
||||
room will not have a ghost user for the recipient until they accept the
|
||||
message request.
|
||||
* Added support for syncing existing groups on login instead of having to wait
|
||||
for new messages.
|
||||
* Added notices if decrypting incoming message from Signal fails.
|
||||
* Added bridging of group metadata from Matrix to Signal
|
||||
(thanks to [@maltee1] in [#461]).
|
||||
* Added command to create new Signal group for Matrix room
|
||||
(thanks to [@maltee1] in [#461] and [#491]).
|
||||
* Added commands for inviting users to Signal groups by phone number
|
||||
(thanks to [@maltee1] in [#495]).
|
||||
* Improved handling of missed Signal group metadata changes
|
||||
(thanks to [@maltee1] in [#488]).
|
||||
|
||||
[#461]: https://github.com/mautrix/signal/pull/461
|
||||
[#488]: https://github.com/mautrix/signal/pull/488
|
||||
[#491]: https://github.com/mautrix/signal/pull/491
|
||||
[#495]: https://github.com/mautrix/signal/pull/495
|
||||
|
||||
# v0.5.1 (2024-03-16)
|
||||
|
||||
* Updated to libsignal v0.41.0.
|
||||
* Fixed sending messages to groups.
|
||||
* Fixed some cases of ghost user info changing repeatedly on multi-user
|
||||
instances.
|
||||
* Fixed migrating SQLite databases from Python version.
|
||||
|
||||
# v0.5.0 (2024-02-16)
|
||||
# v0.5.0 (unreleased)
|
||||
|
||||
* Rewrote bridge in Go.
|
||||
* To migrate the bridge, simply upgrade in-place. The database and config
|
||||
will be migrated automatically, although some parts of the config aren't
|
||||
migrated (e.g. log config). If you prevented the bridge from writing to
|
||||
the config file, you'll have to temporarily allow it or update it yourself.
|
||||
* The bridge doesn't use signald anymore, all users will have to re-link the
|
||||
bridge. signald can be deleted after upgrading.
|
||||
* The bridge doesn't use signald anymore.
|
||||
* All users will have to re-link the bridge.
|
||||
* Primary device mode is no longer supported, signal-cli is recommended if
|
||||
you don't want to use the official Signal mobile apps.
|
||||
* Some old features are not yet supported (e.g. group management features).
|
||||
* Some old features are not yet supported (e.g. membership action bridging,
|
||||
join rules and getting group invite links).
|
||||
* Renamed main branch from `master` to `main`.
|
||||
* Added support for edits and message formatting.
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
See <https://docs.mau.fi/bridges/general/contributing.html>
|
||||
28
Dockerfile
28
Dockerfile
|
|
@ -1,17 +1,17 @@
|
|||
# -- Build libsignal (with Rust) --
|
||||
FROM rust:1-alpine AS rust-builder
|
||||
RUN apk add --no-cache git make cmake protoc musl-dev g++ clang-dev protobuf-dev
|
||||
FROM rust:1-alpine as rust-builder
|
||||
RUN apk add --no-cache git make cmake protoc musl-dev g++ clang-dev
|
||||
|
||||
WORKDIR /build
|
||||
# Copy all files needed for Rust build, and no Go files
|
||||
COPY pkg/libsignalgo/libsignal/. pkg/libsignalgo/libsignal/.
|
||||
COPY build-rust.sh .
|
||||
|
||||
RUN ./build-rust.sh
|
||||
ENV RUSTFLAGS="-Ctarget-feature=-crt-static" RUSTC_WRAPPER=""
|
||||
RUN cd pkg/libsignalgo/libsignal/ && cargo build -p libsignal-ffi --release
|
||||
|
||||
# -- Build mautrix-signal (with Go) --
|
||||
FROM golang:1-alpine3.24 AS go-builder
|
||||
RUN apk add --no-cache git ca-certificates build-base olm-dev zlib-dev
|
||||
FROM golang:1-alpine3.19 AS go-builder
|
||||
RUN apk add --no-cache git ca-certificates build-base olm-dev
|
||||
|
||||
WORKDIR /build
|
||||
# Copy all files needed for Go build, and no Rust files
|
||||
|
|
@ -19,27 +19,25 @@ COPY *.go go.* *.yaml *.sh ./
|
|||
COPY pkg/signalmeow/. pkg/signalmeow/.
|
||||
COPY pkg/libsignalgo/* pkg/libsignalgo/
|
||||
COPY pkg/libsignalgo/resources/. pkg/libsignalgo/resources/.
|
||||
COPY pkg/msgconv/. pkg/msgconv/.
|
||||
COPY pkg/signalid/. pkg/signalid/.
|
||||
COPY pkg/connector/. pkg/connector/.
|
||||
COPY cmd/. cmd/.
|
||||
COPY config/. config/.
|
||||
COPY database/. database/.
|
||||
COPY msgconv/. msgconv/.
|
||||
COPY .git .git
|
||||
|
||||
ENV LIBRARY_PATH=.
|
||||
COPY --from=rust-builder /build/pkg/libsignalgo/libsignal/target/*/libsignal_ffi.a ./
|
||||
RUN <<EOF
|
||||
EOF
|
||||
COPY --from=rust-builder /build/pkg/libsignalgo/libsignal/target/release/libsignal_ffi.a /build/libsignal_ffi.a
|
||||
RUN ./build-go.sh
|
||||
|
||||
# -- Run mautrix-signal --
|
||||
FROM alpine:3.24
|
||||
FROM alpine:3.19
|
||||
|
||||
ENV UID=1337 \
|
||||
GID=1337
|
||||
|
||||
RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq-go olm
|
||||
RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq olm
|
||||
|
||||
COPY --from=go-builder /build/mautrix-signal /usr/bin/mautrix-signal
|
||||
COPY --from=go-builder /build/example-config.yaml /opt/mautrix-signal/example-config.yaml
|
||||
COPY --from=go-builder /build/docker-run.sh /docker-run.sh
|
||||
VOLUME /data
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
ARG DOCKER_HUB="docker.io"
|
||||
|
||||
FROM ${DOCKER_HUB}/alpine:3.24
|
||||
FROM alpine:3.19
|
||||
|
||||
ENV UID=1337 \
|
||||
GID=1337
|
||||
|
||||
RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq-go
|
||||
RUN apk add --no-cache ffmpeg su-exec ca-certificates bash jq curl yq
|
||||
|
||||
ARG EXECUTABLE=./mautrix-signal
|
||||
COPY $EXECUTABLE /usr/bin/mautrix-signal
|
||||
COPY ./example-config.yaml /opt/mautrix-signal/example-config.yaml
|
||||
COPY ./docker-run.sh /docker-run.sh
|
||||
ENV BRIDGEV2=1
|
||||
VOLUME /data
|
||||
WORKDIR /data
|
||||
|
||||
CMD ["/docker-run.sh"]
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
The mautrix-signal developers grant the following special exceptions:
|
||||
|
||||
* to Beeper the right to embed the program in the Beeper clients and servers,
|
||||
and use and distribute the collective work without applying the license to
|
||||
the whole.
|
||||
* to Element the right to distribute compiled binaries of the program as a part
|
||||
of the Element Server Suite and other server bundles without applying the
|
||||
license.
|
||||
|
||||
All exceptions are only valid under the condition that any modifications to
|
||||
the source code of mautrix-signal (including signalmeow and libsignalgo) remain
|
||||
publicly available under the terms of the GNU AGPL version 3 or later.
|
||||
|
||||
Note: mautrix-signal depends on libsignal, which is also licensed under the AGPL.
|
||||
A license exception for libsignal must be acquired separately from Signal.
|
||||
32
Makefile
Normal file
32
Makefile
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
.PHONY: all build_rust copy_library build_go clean
|
||||
|
||||
all: build_rust copy_library build_go
|
||||
|
||||
LIBRARY_NAME=libsignal-ffi
|
||||
LIBRARY_FILENAME=libsignal_ffi.a
|
||||
RUST_DIR=pkg/libsignalgo/libsignal
|
||||
GO_BINARY=mautrix-signal
|
||||
|
||||
ifneq ($(DBG),1)
|
||||
RUST_PROFILE=release
|
||||
RUST_TARGET_SUBDIR=release
|
||||
GO_GCFLAGS=
|
||||
else
|
||||
RUST_PROFILE=dev
|
||||
RUST_TARGET_SUBDIR=debug
|
||||
GO_GCFLAGS=all=-N -l
|
||||
endif
|
||||
|
||||
build_rust:
|
||||
cd $(RUST_DIR) && cargo build -p $(LIBRARY_NAME) --profile=$(RUST_PROFILE)
|
||||
|
||||
copy_library:
|
||||
cp $(RUST_DIR)/target/$(RUST_TARGET_SUBDIR)/$(LIBRARY_FILENAME) .
|
||||
|
||||
build_go:
|
||||
LIBRARY_PATH="$${LIBRARY_PATH}:." go build -gcflags "$(GO_GCFLAGS)" -ldflags "-X main.Tag=$$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$$(git rev-parse HEAD) -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
|
||||
|
||||
clean:
|
||||
rm -f ./$(LIBRARY_FILENAME)
|
||||
cd $(RUST_DIR) && cargo clean
|
||||
rm -f $(GO_BINARY)
|
||||
|
|
@ -15,7 +15,8 @@ Some quick links:
|
|||
* Basic usage: [Authentication](https://docs.mau.fi/bridges/go/signal/authentication.html)
|
||||
|
||||
### Features & Roadmap
|
||||
[ROADMAP.md](ROADMAP.md) contains a general overview of what is supported by the bridge.
|
||||
[ROADMAP.md](https://github.com/mautrix/signal/blob/main/ROADMAP.md)
|
||||
contains a general overview of what is supported by the bridge.
|
||||
|
||||
## Discussion
|
||||
Matrix room: [`#signal:maunium.net`](https://matrix.to/#/#signal:maunium.net)
|
||||
|
|
|
|||
41
ROADMAP.md
41
ROADMAP.md
|
|
@ -1,32 +1,30 @@
|
|||
# Features & roadmap
|
||||
|
||||
* Matrix → Signal
|
||||
* [x] Message content
|
||||
* [ ] Message content
|
||||
* [x] Text
|
||||
* [x] Formatting
|
||||
* [x] Mentions
|
||||
* [x] Polls
|
||||
* [x] Media
|
||||
* [ ] Media
|
||||
* [x] Images
|
||||
* [x] Audio files
|
||||
* [x] Voice messages
|
||||
* [x] Files
|
||||
* [x] Gifs
|
||||
* [x] Locations
|
||||
* [ ] Locations
|
||||
* [x] Stickers
|
||||
* [x] Message edits
|
||||
* [x] Message reactions
|
||||
* [x] Message redactions
|
||||
* [x] Group info changes
|
||||
* [x] Name
|
||||
* [x] Avatar
|
||||
* [x] Topic
|
||||
* [ ] Group info changes
|
||||
* [ ] Name
|
||||
* [ ] Avatar
|
||||
* [ ] Topic
|
||||
* [ ] Membership actions
|
||||
* [ ] Join (accepting invites)
|
||||
* [x] Invite
|
||||
* [x] Leave
|
||||
* [x] Kick/Ban/Unban
|
||||
* [x] Group permissions
|
||||
* [ ] Invite
|
||||
* [ ] Leave
|
||||
* [ ] Kick/Ban/Unban
|
||||
* [x] Typing notifications
|
||||
* [x] Read receipts
|
||||
* [x] Delivery receipts (sent after message is bridged)
|
||||
|
|
@ -35,7 +33,6 @@
|
|||
* [x] Text
|
||||
* [x] Formatting
|
||||
* [x] Mentions
|
||||
* [x] Polls
|
||||
* [ ] Media
|
||||
* [x] Images
|
||||
* [x] Voice notes
|
||||
|
|
@ -55,20 +52,20 @@
|
|||
* [x] Name
|
||||
* [x] Avatar
|
||||
* [x] Topic
|
||||
* [x] Membership actions
|
||||
* [x] Join
|
||||
* [x] Invite
|
||||
* [x] Request join (via invite link, requires a client that supports knocks)
|
||||
* [x] Leave
|
||||
* [x] Kick/Ban/Unban
|
||||
* [x] Group permissions
|
||||
* [ ] Membership actions
|
||||
* [ ] Join
|
||||
* [ ] Invite
|
||||
* [ ] Request join (via invite link, requires a client that supports knocks)
|
||||
* [ ] Leave
|
||||
* [ ] Kick/Ban/Unban
|
||||
* [ ] Group permissions
|
||||
* [x] Typing notifications
|
||||
* [x] Read receipts
|
||||
* [ ] Delivery receipts (there's no good way to bridge these)
|
||||
* [x] Disappearing messages
|
||||
* Misc
|
||||
* [x] Automatic portal creation
|
||||
* [x] After login
|
||||
* [ ] Automatic portal creation
|
||||
* [ ] After login
|
||||
* [x] When receiving message
|
||||
* [x] Linking as secondary device
|
||||
* [ ] Registering as primary device
|
||||
|
|
|
|||
309
bpnsclient/bpnsclient.go
Normal file
309
bpnsclient/bpnsclient.go
Normal file
|
|
@ -0,0 +1,309 @@
|
|||
package bpnsclient
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrBPNSUnauthorized = errors.New("imat unauthorized")
|
||||
ErrBPNSUnknownDevice = errors.New("device not registered on bpns")
|
||||
ErrBPNSConflict = errors.New("registration conflict on bpns")
|
||||
ErrBPNSUnexpectedResponse = errors.New("unexpected error from bpns")
|
||||
)
|
||||
|
||||
const bpnsMinKeepalive = time.Second * 1
|
||||
|
||||
type BPNSClient struct {
|
||||
log *zerolog.Logger
|
||||
url string
|
||||
imaToken string
|
||||
cfg DeviceConfig
|
||||
cancel context.CancelFunc
|
||||
wg sync.WaitGroup
|
||||
}
|
||||
|
||||
type FCMConfig struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type SignalConfig struct {
|
||||
AciUUID string `json:"aci_uuid"`
|
||||
DeviceID int `json:"device_id"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type DeviceConfig struct {
|
||||
FCM FCMConfig `json:"fcm"`
|
||||
Signal SignalConfig `json:"signal,omitempty"`
|
||||
}
|
||||
|
||||
type JSONDurationMs time.Duration
|
||||
|
||||
func (t *JSONDurationMs) UnmarshalJSON(data []byte) error {
|
||||
var value int64
|
||||
|
||||
if err := json.Unmarshal(data, &value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*t = JSONDurationMs(value * int64(time.Millisecond))
|
||||
return nil
|
||||
}
|
||||
|
||||
type KeepaliveResponse struct {
|
||||
Rate JSONDurationMs `json:"rate_ms"`
|
||||
}
|
||||
|
||||
func NewBPNSClient(log *zerolog.Logger, url, imaToken, pushToken string, signalACI uuid.UUID, signalPassword string, deviceID int) *BPNSClient {
|
||||
deviceConfig := DeviceConfig{
|
||||
FCM: FCMConfig{
|
||||
Token: pushToken,
|
||||
},
|
||||
Signal: SignalConfig{
|
||||
AciUUID: signalACI.String(),
|
||||
Password: signalPassword,
|
||||
DeviceID: deviceID,
|
||||
},
|
||||
}
|
||||
|
||||
return &BPNSClient{
|
||||
log: log,
|
||||
url: url,
|
||||
imaToken: imaToken,
|
||||
cfg: deviceConfig,
|
||||
}
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) request(ctx context.Context, method, endpoint string, body any) (*http.Response, error) {
|
||||
var bodyReader io.Reader
|
||||
|
||||
if body != nil {
|
||||
data, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bodyReader = bytes.NewReader(data)
|
||||
}
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, method, fmt.Sprintf("%s/v1/signal/%s", bpns.url, endpoint), bodyReader)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header.Set("Authorization", "Bearer "+bpns.imaToken)
|
||||
req.Header.Set("User-Agent", "signal")
|
||||
|
||||
normalTransport := &http.Transport{
|
||||
DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext,
|
||||
ForceAttemptHTTP2: true,
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
ResponseHeaderTimeout: 5 * time.Second,
|
||||
}
|
||||
normalClient := &http.Client{
|
||||
Timeout: 1 * time.Minute,
|
||||
Transport: normalTransport,
|
||||
}
|
||||
resp, err := normalClient.Do(req)
|
||||
if err != nil {
|
||||
bpns.log.Trace().Err(err).Stringer("url", req.URL).Str("method", method).Msg("bpns Request Error")
|
||||
} else {
|
||||
bpns.log.Trace().Stringer("url", req.URL).Str("method", method).Str("status", resp.Status).Msg("bpns Request")
|
||||
}
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) register(ctx context.Context) (time.Duration, error) {
|
||||
resp, err := bpns.request(ctx, http.MethodPut, "device", &bpns.cfg)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
switch resp.StatusCode {
|
||||
case http.StatusCreated:
|
||||
return decodeKeepaliveRate(resp)
|
||||
case http.StatusConflict:
|
||||
return 0, ErrBPNSConflict
|
||||
case http.StatusUnauthorized:
|
||||
return 0, ErrBPNSUnauthorized
|
||||
default:
|
||||
return 0, fmt.Errorf("%w: register returned unexpected status %d", ErrBPNSUnexpectedResponse, resp.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
func decodeKeepaliveRate(resp *http.Response) (rate time.Duration, err error) {
|
||||
if resp.Body == nil {
|
||||
return
|
||||
}
|
||||
|
||||
var keepaliveResp KeepaliveResponse
|
||||
if err = json.NewDecoder(resp.Body).Decode(&keepaliveResp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
rate = time.Duration(keepaliveResp.Rate)
|
||||
return
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) keepalive(ctx context.Context) (time.Duration, error) {
|
||||
resp, err := bpns.request(ctx, http.MethodPost, "keepalive", nil)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
switch resp.StatusCode {
|
||||
case http.StatusOK:
|
||||
return decodeKeepaliveRate(resp)
|
||||
case http.StatusNoContent:
|
||||
return 0, nil
|
||||
case http.StatusUnauthorized:
|
||||
return 0, ErrBPNSUnauthorized
|
||||
case http.StatusNotFound:
|
||||
return 0, ErrBPNSUnknownDevice
|
||||
default:
|
||||
return 0, fmt.Errorf("%w: keepalive returned unexpected status %d", ErrBPNSUnexpectedResponse, resp.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) yield(ctx context.Context) error {
|
||||
resp, err := bpns.request(ctx, http.MethodPost, "yield", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch resp.StatusCode {
|
||||
case http.StatusNoContent:
|
||||
return nil
|
||||
case http.StatusUnauthorized:
|
||||
return ErrBPNSUnauthorized
|
||||
case http.StatusNotFound:
|
||||
return ErrBPNSUnknownDevice
|
||||
default:
|
||||
return fmt.Errorf("%w: yield returned unexpected status %d", ErrBPNSUnexpectedResponse, resp.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) keepaliveOrRegister(ctx context.Context) (time.Duration, error) {
|
||||
rate, err := bpns.keepalive(ctx)
|
||||
|
||||
if err == ErrBPNSUnknownDevice {
|
||||
rate, err = bpns.register(ctx)
|
||||
}
|
||||
|
||||
return rate, err
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) Start(ctx context.Context) {
|
||||
if bpns.cancel != nil {
|
||||
bpns.log.Debug().Msg("Start() called when already running")
|
||||
return
|
||||
}
|
||||
|
||||
if bpns.url == "" {
|
||||
bpns.log.Warn().Msg("No URL set, bpns disabled")
|
||||
return
|
||||
}
|
||||
|
||||
// we need to run once with start context to make bpns disconnect from remote network immediately
|
||||
rate, err := bpns.keepaliveOrRegister(ctx)
|
||||
if err != nil {
|
||||
bpns.log.Warn().Err(err).Msg("Unexpected bpns error during start")
|
||||
// first successful keepalive will reset the ticker
|
||||
rate = time.Second * 30
|
||||
} else if rate == 0 {
|
||||
bpns.log.Warn().Msg("Server requested we don't do keepalives, not starting loop")
|
||||
return
|
||||
} else if rate < bpnsMinKeepalive {
|
||||
bpns.log.Warn().Dur("rate_req", rate).Dur("rate_min", bpnsMinKeepalive).Msg("Server requested keepalive time less than allowed, using ours")
|
||||
rate = bpnsMinKeepalive
|
||||
}
|
||||
|
||||
bpns.log.Info().Str("url", bpns.url).Dur("rate", rate).Msg("Starting bpns loop")
|
||||
|
||||
ctx, bpns.cancel = context.WithCancel(context.Background())
|
||||
|
||||
bpns.wg.Add(1)
|
||||
go func() {
|
||||
defer func() {
|
||||
bpns.wg.Done()
|
||||
bpns.log.Trace().Msg("Leaving bpns loop")
|
||||
}()
|
||||
|
||||
ticker := time.NewTicker(rate)
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
newRate, err := bpns.keepaliveOrRegister(ctx)
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return
|
||||
} else if err != nil {
|
||||
bpns.log.Warn().Err(err).Msg("Unexpected bpns error")
|
||||
} else if newRate == 0 {
|
||||
bpns.log.Warn().Msg("Keepalive returned zero rate, stopping loop")
|
||||
return
|
||||
} else if newRate > bpnsMinKeepalive && newRate != rate {
|
||||
bpns.log.Info().Dur("rate_new", newRate).Dur("rate_old", rate).Msg("Keepalive rate changed by bpns")
|
||||
rate = newRate
|
||||
ticker.Reset(rate)
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) Stop(ctx context.Context) {
|
||||
if bpns.cancel == nil {
|
||||
return
|
||||
}
|
||||
|
||||
bpns.log.Info().Msg("Stopping bpns loop")
|
||||
|
||||
bpns.Close()
|
||||
|
||||
// send yield before returning
|
||||
bpns.log.Debug().Msg("Sending final yield")
|
||||
err := bpns.yield(ctx)
|
||||
if err != nil {
|
||||
bpns.log.Err(err).Msg("Final yield failed")
|
||||
} else {
|
||||
bpns.log.Info().Msg("Yielded bpns connection")
|
||||
}
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) Close() {
|
||||
if bpns.cancel == nil {
|
||||
return
|
||||
}
|
||||
|
||||
bpns.cancel()
|
||||
bpns.cancel = nil
|
||||
bpns.wg.Wait()
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) Deregister(ctx context.Context) error {
|
||||
_, err := bpns.request(ctx, http.MethodDelete, "device", &bpns.cfg)
|
||||
return err
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) IsUsingSignalACI(aci uuid.UUID) bool {
|
||||
return uuid.MustParse(bpns.cfg.Signal.AciUUID) == aci
|
||||
}
|
||||
|
||||
func (bpns *BPNSClient) IsUsingFCMPushToken(token string) bool {
|
||||
return bpns.cfg.FCM.Token == token
|
||||
}
|
||||
|
|
@ -1,2 +1,4 @@
|
|||
#!/bin/sh
|
||||
BINARY_NAME=mautrix-signal go tool maubuild "$@"
|
||||
export MAUTRIX_VERSION=$(cat go.mod | grep 'maunium.net/go/mautrix ' | awk '{ print $2 }')
|
||||
export GO_LDFLAGS="-s -w -X main.Tag=$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$(git rev-parse HEAD) -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`' -X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX_VERSION'"
|
||||
go build -ldflags "$GO_LDFLAGS" -o mautrix-signal
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
git submodule update --init
|
||||
cd pkg/libsignalgo/libsignal && RUSTFLAGS="-Ctarget-feature=-crt-static" RUSTC_WRAPPER="" cargo build -p libsignal-ffi --profile=release
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue