dalcde / matrix-appservice-mattermost Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
matrix-appservice-bridge comes with a lot of extra baggage that we do not use.
For example, it includes a database (nedb), a logging library (winston, as
opposed to loglevel which comes with matrix-js-sdk) and metrics (prom-client).
It also enforces a lot of dependency choice on us, e.g. json validator, command
line parser, etc.
We can instead use matrix-js-sdk and matrix-appservice directly.
Store password instead
This is needed to correctly indicate who removed users from rooms/channels.
If a mapping is added to the config, but the bot user cannot join the matrix
room, then the channel fails to bridge. If the bot is later invited to the room
while it is running, it should try to bridge again.
Do the same when the power level changes.
Currently the global lock means messages are processed one-by-one, and that can take a while, even when all of matrix, mattermost and the bridge are on the same machine. We should use async properly, but without running into race conditions or message reordering
If one quickly sends multiple posts to a Mattermost thread in Mattermost, some of the posts end up not being marked as a reply to the root thread. This should not have happened because of the lock.
Allow using incoming webhook to post messages from matrix, which would avoid
creating a mattermost user for each matrix user.
This provides better access control on shared systems.
seems there has been no work in this bridge for a long time, is it abandoned?
Users should be allowed to configure mappings without editing the configuration
file. This can be achieved either via private messages with the bot, or simply
dynamically creating a matrix room for every mattermost channel the bot is in.
root@f52c6f46-acc6-4bc2-b6f4-6da33eeda2e2:/app/code# su cloudron
cloudron@f52c6f46-acc6-4bc2-b6f4-6da33eeda2e2:/app/code$ cd ../data/matrix-appservice-mattermost/
cloudron@f52c6f46-acc6-4bc2-b6f4-6da33eeda2e2:/app/data/matrix-appservice-mattermost$ ./start&
[2] 275
cloudron@f52c6f46-acc6-4bc2-b6f4-6da33eeda2e2:/app/data/matrix-appservice-mattermost$ Output registration to: registration.yaml
cat bridge.log
Bridge loaded: 1433.685ms
(node:283) UnhandledPromiseRejectionWarning: M_UNKNOWN_TOKEN: Unrecognised access token
at parseErrorResponse (/app/data/matrix-appservice-mattermost/node_modules/matrix-js-sdk/lib/http-api.js:826:13)
at /app/data/matrix-appservice-mattermost/node_modules/matrix-js-sdk/lib/http-api.js:781:17
at Request._callback (/app/data/matrix-appservice-mattermost/node_modules/matrix-js-sdk/lib/http-api.js:715:9)
at Request.self.callback (/app/data/matrix-appservice-mattermost/node_modules/request/request.js:185:22)
at Request.emit (events.js:310:20)
at Request. (/app/data/matrix-appservice-mattermost/node_modules/request/request.js:1154:10)
at Request.emit (events.js:310:20)
at IncomingMessage. (/app/data/matrix-appservice-mattermost/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:416:28)
at IncomingMessage.emit (events.js:322:22)
(node:283) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:283) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I need help....
I'm trying to setup a bridge to an encrypted room. Unfortunately, when I send a message to Matrix, the bridge writes into the log:
Unknown matrix event type: m.room.encrypted
Encryption there is not relevant, but Matrix does not support disabling encryption for a room. So I'm wondering if it is possible to add support of event m.room.encrypted'
?
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | @types/marked |
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
marked
, @types/marked
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
node-fetch
, @types/node-fetch
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
docker/docker-compose.yaml
postgres 14.1-alpine
docker/appservice/Dockerfile
alpine 3.15
docker/mattermost/Dockerfile
alpine 3.15
docker/synapse/Dockerfile
alpine 3.15
.github/workflows/test.yaml
actions/checkout v2
actions/setup-node v2
actions/cache v2
package.json
ajv ^8.0.0
ajv-formats ^2.1.1
express ^4.17.2
form-data ^4.0.0
js-yaml ^4.0.0
loglevel ^1.8.0
marked ^4.0.0
matrix-js-sdk ^8.2.0
node-fetch ^2.6.0
pg ^8.5.1
turndown ^7.0.0
typeorm ^0.2.29
ws ^8.0.0
yargs ^16.0.0
@types/express ^4.17.13
@types/marked ^4.0.1
@types/node ^16.0.0
@types/node-fetch ^2.5.7
@types/tape ^4.13.0
@typescript-eslint/eslint-plugin ^5.0.0
@typescript-eslint/parser ^5.0.0
eslint ^8.0.0
prettier ^2.3.0
sqlite3 ^5.0.0
tape ^5.0.1
typescript ^4.5.0
typescript-json-schema ^0.50.0
The main problem to solve is that in Mattermost, group chats have immutable membership --- you cannot add new users to existing direct/group chats. This is possible on the Matrix side. How do we want to deal with this? Even if we decide to ignore users added later in matrix (which would lead to a fairly broken user experience), this may cause issues during the initial channel creation.
See node 10.16 on https://github.com/dalcde/matrix-appservice-mattermost/runs/1049377207
This seems to only happen with node 10.16
Hello!
Disclaimer, I honestly had no better idea for a shorter title, sorry for that...
Basically, I used to frequent the JS++ Mattermost instance to talk to the people there but now that I use Matrix as my daily driver for just about all my IM needs, I wanted to bring this group back into my setup so I could talk to them again.
I only own a regular account and really only need this one to be puppeted. How would I go setting up a scenario like this, where just one user is puppeted and all channels it can access are thus bridged?
Thanks in advance!
Kind regards,
Ingwie
Have the bot user send out an invitation
It would be nice to be able to login to mattermost with your own user and have all the channels you are part of bridged to matrix, without needing a bot with administration privilages. This would obviously prohibit the creation of users on the mattermost side
In particular I have seen the following error in production:
Error: 400 DELETE /channels/<REDACTED>/members/<REDACTED>: {"id":"api.channel.remove_channel_member.type.app_error","message":"Unable to remove user from a channel.","detailed_error":"","request_id":"byq49ee7tt8ammx47u8cf8he8o","status_code":400}
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Configuration option 'packageRules[0].node' should be a json object, Invalid configuration option: author, Invalid configuration option: bin, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: packageRules[1].ajv, Invalid configuration option: packageRules[1].express, Invalid configuration option: packageRules[1].form-data, Invalid configuration option: packageRules[1].js-yaml, Invalid configuration option: packageRules[1].loglevel, Invalid configuration option: packageRules[1].marked, Invalid configuration option: packageRules[1].matrix-js-sdk, Invalid configuration option: packageRules[1].node-fetch, Invalid configuration option: packageRules[1].pg, Invalid configuration option: packageRules[1].turndown, Invalid configuration option: packageRules[1].typeorm, Invalid configuration option: packageRules[1].ws, Invalid configuration option: packageRules[1].yargs, Invalid configuration option: packageRules[2].@types/express, Invalid configuration option: packageRules[2].@types/node, Invalid configuration option: packageRules[2].@types/node-fetch, Invalid configuration option: packageRules[2].@types/tape, Invalid configuration option: packageRules[2].@typescript-eslint/eslint-plugin, Invalid configuration option: packageRules[2].@typescript-eslint/parser, Invalid configuration option: packageRules[2].eslint, Invalid configuration option: packageRules[2].prettier, Invalid configuration option: packageRules[2].sqlite3, Invalid configuration option: packageRules[2].tape, Invalid configuration option: packageRules[2].typescript, Invalid configuration option: packageRules[2].typescript-json-schema, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: version, The "node" object can only be configured at the top level of a config but was found inside "packageRules[0]"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.