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

Implement the instance picker #2006

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft

Implement the instance picker #2006

wants to merge 27 commits into from

Conversation

thibaultamartin
Copy link
Contributor

@thibaultamartin thibaultamartin commented Sep 6, 2023

Fixes #1570

This work is largely based on Austin Huang's great work on servers.joinmatrix.org

TODO:

@thibaultamartin thibaultamartin marked this pull request as draft September 6, 2023 13:21
@thibaultamartin
Copy link
Contributor Author

thibaultamartin commented Sep 6, 2023

Data Model for instances

The two options I have in mind are:

  1. A single toml file that any interested party can easily consume.
  2. One .md file per instance, with structure information in the frontmatter.

Single toml file approach

Pros:

  • Very easy to consume for third parties (they have a single file to fetch and parse)
  • Works well if we don't have a dedicated page per instance for the details but a popover

Cons:

  • Probably makes it much more difficult to have a page per instance
  • Popovers work well with javascript, but are difficult to do (and most of the time not accessible or a mess) without

One markdown file per instance

Pros:

  • Makes it easy to create a dedicated page per instance for the details

Cons:

  • More difficult to browse and parse for third parties

I'm going with the single toml file approach, which seems to be the easiest to consume for third party clients for now. We can refactor later.

@jplatte
Copy link
Contributor

jplatte commented Sep 6, 2023

More difficult to browse and parse for third parties

Zola is not limited to HTML as an output format. It should be possible to write some Tera code to expose the data stored in frontmatter of multiple files as one JSON file, for example.

@thibaultamartin
Copy link
Contributor Author

Is it possible?! That would entirely save the day.

If you have pointers to the right docs that would be very helpful

@jplatte
Copy link
Contributor

jplatte commented Sep 6, 2023

Uhh, now I'm wondering if I am imagining things 😅
I know it used to work in a static site generator I used at some point, might have been Jekyll where every content file was processed as long as it contained frontmatter? Certainly not seeing anything in docs – it's not even documented that you can use .html files instead of .md? I'm pretty damn sure Zola supports that though.

@thibaultamartin
Copy link
Contributor Author

Updating the CI data

The only bits that should be updated automatically are the software used and the version it relies on.
All of this information can be retrieved via the version endpoint.

Typically for ergaster.org:

thib@MacBook ~ % curl -s https://ergaster.org/.well-known/matrix/server | jq '."m.server"'
"matrix.ergaster.org:443"
thib@MacBook ~ % curl -s https://matrix.ergaster.org/_matrix/federation/v1/version | jq '.server.name'
"Synapse"
thib@MacBook ~ % curl -s https://matrix.ergaster.org/_matrix/federation/v1/version | jq '.server.version'
"1.91.1"

Then either the toml file needs to be parsed and updated, or the markdown files need to be parsed and updated depending on the data model chosen

@thibaultamartin
Copy link
Contributor Author

Current state of things. It's not responsive yet.

Screenshot 2023-09-07 at 16 51 44

@cloudflare-pages
Copy link

cloudflare-pages bot commented Sep 7, 2023

Deploying matrix-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f6b46a
Status: ✅  Deploy successful!
Preview URL: https://94ed3ee5.matrix-website.pages.dev
Branch Preview URL: https://instance-picker.matrix-website.pages.dev

View logs

.github/workflows/update-public-instances.yml Outdated Show resolved Hide resolved
.github/workflows/update-public-instances.yml Outdated Show resolved Hide resolved
.github/workflows/update-public-instances.yml Outdated Show resolved Hide resolved
.github/_typos.toml Outdated Show resolved Hide resolved
@MTRNord MTRNord added the enhancement This would be an improvement to the website. label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This would be an improvement to the website.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List public servers willing to accept new members
3 participants