Skip to content
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

Integrate MediaProxy to bridge authenticated Matrix media (MSC3916) #1805

Merged
merged 19 commits into from
Sep 2, 2024

Conversation

tadzik
Copy link
Contributor

@tadzik tadzik commented May 29, 2024

@tadzik tadzik requested a review from Half-Shot May 29, 2024 10:23
@tadzik tadzik requested a review from a team as a code owner May 29, 2024 10:23
@turt2live
Copy link
Member

just to confirm: does this mean to say MSC3916 instead of MSC3910? 3910 is a closed, but related, MSC.

@tadzik tadzik changed the title Integrate MediaProxy to bridge authenticated Matrix media (MSC3910) Integrate MediaProxy to bridge authenticated Matrix media (MSC3916) May 29, 2024
@tadzik
Copy link
Contributor Author

tadzik commented May 29, 2024

just to confirm: does this mean to say MSC3916 instead of MSC3910? 3910 is a closed, but related, MSC.

Yes, correct - I copied the old number from the MAB PR :)

@heftig
Copy link
Contributor

heftig commented Aug 11, 2024

Is a release with this planned before Synapse defaults to disallowing unauthenticated media?

@tadzik
Copy link
Contributor Author

tadzik commented Aug 13, 2024

Is a release with this planned before Synapse defaults to disallowing unauthenticated media?

Yes, that's the plan.

Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good on the whole, only a few suggestions. Should we have tests though?

@@ -13,7 +13,6 @@ export interface BridgeConfig {
};
homeserver: {
url: string;
media_url?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be kind somewhere to fail to start if this is still configured?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep it optional (maybe with a warning?) to make sure you can rollback easily without changing the configs too much.

We do require mediaProxy being configured now, so users will surely notice the change.

oldConfig.homeserver.media_url = newConfig.homeserver.media_url;
log.info(`Adjusted media_url to ${newConfig.homeserver.media_url}`);
if (JSON.stringify(oldConfig.ircService.mediaProxy) !== JSON.stringify(newConfig.ircService.mediaProxy)) {
await this._mediaProxy?.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

src/bridge/IrcBridge.ts Outdated Show resolved Hide resolved
config.sample.yaml Outdated Show resolved Hide resolved
@tadzik
Copy link
Contributor Author

tadzik commented Aug 14, 2024

This looks good on the whole, only a few suggestions. Should we have tests though?

We have some tests covering the case of "do these URLs look like MediaProxy's URLs" – I'm not sure how much further we want to take this, if it all.

@Half-Shot
Copy link
Contributor

This looks good on the whole, only a few suggestions. Should we have tests though?

We have some tests covering the case of "do these URLs look like MediaProxy's URLs" – I'm not sure how much further we want to take this, if it all.

I think that's sufficient, upstream has tests that the MP works?

Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no problems here. I have one concern about the test reporter :)

spec/e2e/jest.config.js Outdated Show resolved Hide resolved
@tadzik tadzik merged commit ca44992 into matrix-org:develop Sep 2, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants