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

MSC4079: Server-Defined Client Landing Pages #4079

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions proposals/4079-client-server-landing-page-html.md
williamkray marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Server-Defined User Home Pages
williamkray marked this conversation as resolved.
Show resolved Hide resolved

## Abstract
This proposal extends the Matrix protocol to allow servers to define custom HTML-formatted documents that can be rendered by clients as a user home page. This feature introduces a non-intrusive yet flexible manner to communicate server-specific information such as donation requests, scheduled maintenance, updates, new features, and changelogs.

## Background
Currently, there is no standardized method in Matrix for server admins to communicate information directly within user clients. While rooms can serve this purpose, they lack the persistence and prime visibility that many server administrators desire.
williamkray marked this conversation as resolved.
Show resolved Hide resolved

## Proposal
Introduce an optional configuration for matrix servers that allows them to specify an HTML-formatted document, adhering to the current subset of HTML utilized for message formatting. Clients can render this document in a dedicated "home" view or as a placeholder page when no active conversations are selected.

## Use Cases

Choose a reason for hiding this comment

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

I think an additional benefit of something like this, would be that it can improve on the relation between a homeserver operator and their users; right now, homeservers are sort of "homogeneous", in that people use them like a neutral service that just magically exists and they don't know their admin, which can cause problems for sustainability (something that eg. Mastodon does a lot better at).

Having server-specific homepages to introduce people to the community on that homeserver, might help to create a bit more of a social connection to that specific homeserver, making it more appealing for people to eg. run small semi-public homeservers.

Copy link
Member

Choose a reason for hiding this comment

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

Some of these could be done using Server Notices

Copy link
Author

Choose a reason for hiding this comment

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

server notices are significantly more "invasive", this is a much more passive informational model.

Copy link
Author

Choose a reason for hiding this comment

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

addressed in the document introduction


- Server administrators want to communicate an upcoming maintenance window without emailing all users.
- A non-profit Matrix server could display donation information on the home page to encourage support from its users.
- Announcement of new features or user guides following an update can be nicely formatted and made readily available upon client login.
- Changelogs for server updates can be displayed, helping users to understand recent changes without external navigation.
- Links to other supported clients may be supplied in case users are looking for alternative interfaces.

## Specification

- A new optional field will be defined within the well-known Matrix configuration for clients: user_home_page.
- The user_home_page field can be defined by either in-line HTML content or a fully-qualified domain name and path to an HTML document.
- The HTML content will be sanitized by the client and restricted to the subset of HTML currently allowed for messages.
- This field can be queried by clients during the login process or refreshed periodically.
williamkray marked this conversation as resolved.
Show resolved Hide resolved
- Clients may choose to implement this feature as a "home" button or as default content in the main view when no conversation is active.

Choose a reason for hiding this comment

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

This should be more clearly specified; must a client implement this functionality, with a choice between these two options? Or are these merely two suggested representations, and may a client also choose not to implement it at all? Are they allowed to implement it in a manner not specified here?

The field is specified as 'optional' further up in the MSC, but that seems to only describe whether the server is required to provide such content, not whether the client is required to consume it.

Copy link
Author

Choose a reason for hiding this comment

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

i honestly don't know, i feel like clients may want to choose whether to support this feature. it's not critical to the functionality, and server operators may opt to only support or deploy clients that do support this feature. i don't think it should be a showstopper for a client to be considered fully-baked. but i'm open to feedback.


Example formatting using a file URI:

```
{
"m.user_home_page": {
"html_url": "https://your.website/user_home.html"
}
}
```

Example formatting using in-line HTML:

```
{
"m.user_home_page": {
"html_inline": "<h1>Welcome to our Matrix Homeserver!</h1><p>Visit our website to make a donation.</p>"
}
}
```

williamkray marked this conversation as resolved.
Show resolved Hide resolved
## Security Considerations
To mitigate any potential security risks from malicious content:

- Clients MUST sanitize the HTML content according to the existing rules for message content sanitation.
- External resources (e.g., images, stylesheets) MUST NOT be fetched by default to avoid privacy leaks and must be explicitly allowed by the client.

## Privacy Considerations
As this feature may potentially be used to track user interaction with the home page content, it's important to:

- Provide clients the ability to disable external resource fetching.
- Ensure that user privacy preferences are respected when displaying this content.

## Conclusion
This spec change proposal seeks to empower server administrators with the ability to directly communicate important information to their users within the Matrix client, enhancing the user experience by providing relevant and timely information while respecting user privacy and security.