Closed psscud closed 6 years ago
Hello Pete, thank you for the kind words! I am very happy you found our project useful and managed to not get stuck and scared by sydent.
About those repeated attempts, it is by design and also necessary to be compliant with the Matrix Identity service specification since sessions and invites could be resolved on the matrix.org/vector.im IS, instead of your own. As mxisd uses a federated and recursive lookup mechanism, we need to keep fetching for data for as long as the invitation and/or session is valid.
For 3PID sessions, the spec mandates 24h maximum validity. For invites, they are good indefinitely without a way to cancel one.
Cleaning the database will most leave your HS in a stuck state for those invites at best, and could lead to some disaster at worse (synapse will not be happy in the long run) and therefore I must strongly advise against manually cleaning those tables.
Now, on the matter of actually improving this:
INFO
level, especially since the next big improvement will be caching, so those lines will be very useful for the upcoming debug sessions. I do plan on making it less verbose after.session_3pid
table), please open a new issue and I'll investigate.Max,
I did not know this was a specification mandate. Is there a limit on the number of session requests a user can submit? My concern is that this as a potential vector for DoS/DDoS attacks; if you can generate thousands of invalid 3PID invites that never expire and are resubmitted every minute their effect will be cumulative.
I should note that my use case for Synapse/MXISD is as a test for a corporate environment with no federation with Matrix.org, so I'd actually prefer to eliminate remote 3PID lookups altogether. I discovered this issue after I tested out 3PID email registration/invite lookups, however I since read your excellent instructions for directory user lookup ( https://github.com/kamax-io/mxisd/blob/master/docs/features/directory-users.md ) which has made email registration much less of an issue.
I'm definitely interested in your https://github.com/kamax-io/mxhsd project.
Thanks for your time, Pete
I did not know this was a specification mandate. Is there a limit on the number of session requests a user can submit? My concern is that this as a potential vector for DoS/DDoS attacks; if you can generate thousands of invalid 3PID invites that never expire and are resubmitted every minute their effect will be cumulative.
and
Is there any way to change the lookup rate for the invites from 1 minute? Or is that also a Matrix specification requirement?
Agreed. The whole Identity server ecosystem is a bit in limbo and the current setup is a placeholder until someone comes up with a good path forward, which is something I am trying to do with mxisd and showing real use cases back to the matrix.org peeps.
Also, federation is not part of the official spec, that's something we added and definitely needs further work. Our point of view is that there shouldn't be a central IS like there is one today, but that's another issue that needs to be solved.
There is currently no configurable option for how often the lookups happen but it seems like a sensible thing to allow to be configured and I've created #53 to keep track of it.
I should note that my use case for Synapse/MXISD is as a test for a corporate environment with no federation with Matrix.org, so I'd actually prefer to eliminate remote 3PID lookups altogether.
Because one of the most important directive of mxisd is to remains as compliant as possible with the current Matrix environment, creating an "island" (so to speak) is not something we support as it can actually lead to several issues with synapse and/or Riot, made by the matrix.org devs and expecting to use their own IS service.
The best I can offer you is:
lookup.recursive.enabled: false
forward.servers:
- 'http://ipOrDomainOfTheDummyServer'
Hopefully this can cover your needs for now. If you would like to discuss something more custom, come in #mxisd:kamax.io and ping me for a chat.
Max,
I totally understand why Matrix servers need to be federated, and why central registration is currently necessary. If the protocol and associated applications can't expand to easily reach the general public then they will die out as a project. My use case is more of a fringe use.
Thanks, Pete
First I'd like to say thank you for your work on this project. The documentation for Sydent is very poor and without this project I definitely wouldn't have gotten a Matrix ID server working nearly as quickly.
This is related to issue #51
There needs to be a configurable limit on the number of attempts/rate of attempts that mxisd sends for remote 3pid lookups. Currently it sends 3PID lookups to matrix.org/vector.im every minute. The real problem is when there is no mapping for the 3PID. It will continue to spam lookups apparently indefinitely?
As an example, my journalctl output | grep https://matrix.org looks like:
I currently work around this problem by running a cron job for a script that periodically cleans out the invite and session database, which looks like this:
Maybe I have something configured wrong, but I feel like there needs to be a failsafe to keep this from happening. T
Thanks, Pete