-
Notifications
You must be signed in to change notification settings - Fork 11
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
Don't allow previewing shared
history rooms
#239
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ const matrixServerUrl = config.get('matrixServerUrl'); | |
assert(matrixServerUrl); | ||
const matrixAccessToken = config.get('matrixAccessToken'); | ||
assert(matrixAccessToken); | ||
const stopSearchEngineIndexing = config.get('stopSearchEngineIndexing'); | ||
|
||
const matrixPublicArchiveURLCreator = new MatrixPublicArchiveURLCreator(basePath); | ||
|
||
|
@@ -828,15 +827,13 @@ router.get( | |
}), | ||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
||
]); | ||
|
||
// Only `world_readable` or `shared` rooms that are `public` are viewable in the archive | ||
const allowedToViewRoom = | ||
roomData.historyVisibility === 'world_readable' || | ||
(roomData.historyVisibility === 'shared' && roomData.joinRule === 'public'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having public My reply in the opt-out issue probably explains this the best so far:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We plan to move ahead with this PR to remove The points in favor of keeping Otherwise, the main idea was if I can view the messages from a Matrix client as a random user, I should also be able to see the messages in the archive. In both the native Matrix client and archive cases, it’s the same result when a random user wants to view a
The join is mostly a technical detail to anyone trying to view the room. While I don't think the join event provides much value to the room in the normal cases, it could have benefit in tracing bad actors for moderation. From the spec:
Removing |
||
// Only `world_readable` rooms are viewable in the archive | ||
const allowedToViewRoom = roomData.historyVisibility === 'world_readable'; | ||
|
||
if (!allowedToViewRoom) { | ||
throw new StatusError( | ||
403, | ||
`Only \`world_readable\` or \`shared\` rooms that are \`public\` can be viewed in the archive. ${roomData.id} has m.room.history_visiblity=${roomData.historyVisibility} m.room.join_rules=${roomData.joinRule}` | ||
`Only \`world_readable\` rooms can be viewed in the archive. ${roomData.id} has m.room.history_visiblity=${roomData.historyVisibility}` | ||
); | ||
} | ||
|
||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -891,7 +888,8 @@ router.get( | |
|
||
// Default to no indexing (safe default) | ||
let shouldIndex = false; | ||
if (stopSearchEngineIndexing) { | ||
const stopSearchEngineIndexingFromConfig = config.get('stopSearchEngineIndexing'); | ||
if (stopSearchEngineIndexingFromConfig) { | ||
shouldIndex = false; | ||
} else { | ||
// Otherwise we only allow search engines to index `world_readable` rooms | ||
|
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.
Thanks for the contribution and patience @tulir 🙇 🐦