-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spec-compliant localparts for virtual matrix users #1781
base: develop
Are you sure you want to change the base?
Conversation
Hey there, I'd absolutely love to have this change included. It has been a long time coming. Obviously we'd need to be careful to support "legacy" identifiers as the old behaviour is widespread but I'd love to see this happen for new deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early thoughts
@@ -10,6 +10,9 @@ RUN cd freebindfree && make | |||
# Typescript build | |||
FROM node:18 as builder | |||
|
|||
RUN apt-get update && apt-get install -y node-gyp --no-install-recommends |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know what caused this to flag up? It's weird that you found this without changing the deps around at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea, it just failed to compile. I wrote this on a brand new VPS. The base images were all fresh downloads. Maybe the upstream image somehow removed node-gyp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems node:18.17 works node:18.18 is missing node-gyp for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had this before where minor image versions break (and then because we target a major version, you end up not noticing).
The change looks good then. I think in the future we're just going to have to start pinning versions strictly as we can't be having this.
src/irc/IrcServer.ts
Outdated
return match[1]; | ||
|
||
// https://spec.matrix.org/v1.8/appendices/#mapping-from-other-character-sets | ||
const unescaped = match[1].replaceAll(/=([0-9a-f][0-9a-f])/g, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest making this behaviour configurable for now so old deployments don't break (and defaulting to off). In a future PR we can start defaulting new deployments to using it, and somewhere down the line we should stop supporting the old mechansim.
Make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes perfect sense.
I haven't looked at any configuration code yet. I will update this with a proposal for a configuration option
src/irc/IrcServer.ts
Outdated
@@ -80,6 +80,7 @@ export interface IrcServerConfig { | |||
federate: boolean; | |||
}; | |||
matrixClients: { | |||
matrixIdNormalization: number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that I should make this an integer, in case there are more schemes in the future
Signed-off-by: Kai Bleeke <[email protected]>
Signed-off-by: Kai Bleeke <[email protected]>
Signed-off-by: Kai Bleeke <[email protected]>
localPartCharacterMapping: | ||
type: "integer" | ||
minimum: 0 | ||
maximum: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to set a default value here so it doesn't break existing configs? Or does that happens automatically?
Closes #1780
I would like to have the option to create localparts for virtual matrix users that only contain valid characters according to
https://spec.matrix.org/v1.8/appendices/#user-identifiers
The spec then suggest to map characters like
https://spec.matrix.org/v1.8/appendices/#mapping-from-other-character-sets
Well, the "have the option" part is still missing from the config file.
If you are generally interested in accepting a PR for this, I will do my best to comply with Contributing.md