Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Implement `/.well-known/matrix/client` endpoint

    Matrix (Synapse/Element)
    3
    10
    724
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • infogulch
      infogulch last edited by infogulch

      I tried to log in via a new matrix client, Cinny, but login failed. Opening up the browser inspector I found that a GET request to https://my-cloudron-domain/.well-known/matrix/client was returning 404. /.well-known/matrix/client is a well known (pun intended) standard API endpoint used for server discovery. The matrix.org server serves at this endpoint:

      {
          "m.homeserver": {
              "base_url": "https://matrix-client.matrix.org"
          },
          "m.identity_server": {
              "base_url": "https://vector.im"
          }
      }
      

      Cloudron already supports the /.well-known/matrix/server endpoint; I propose that support for the client endpoint is added as well.

      nebulon 1 Reply Last reply Reply Quote 1
      • nebulon
        nebulon Staff @infogulch last edited by

        @infogulch have you seen and applied the settings mentioned at https://docs.cloudron.io/domains/#matrix-server-location ?

        infogulch 1 Reply Last reply Reply Quote 0
        • infogulch
          infogulch @nebulon last edited by infogulch

          @nebulon Yes, the matrix server location is already filled in. I've been using Synapse+Riot client on my server for several months and it's been working great. Specifically, the */server endpoint is currently working correctly and serves data as expected from https://my-cloudron-domain/.well-known/matrix/server :

          {"m.server":"matrix.my-cloudron-domain.com:443"}
          

          Note the difference between the existing endpoint and the new one:

          https://my-cloudron-domain/.well-known/matrix/server < existing, works great
          https://my-cloudron-domain/.well-known/matrix/client < what this thread is about

          nebulon girish 2 Replies Last reply Reply Quote 0
          • nebulon
            nebulon Staff @infogulch last edited by

            @infogulch ah! thanks for the pointer, I was misreading this indeed. Looks like we have to add this then similarily like we have for matrix and mastodon.

            1 Reply Last reply Reply Quote 1
            • girish
              girish Staff @infogulch last edited by

              @infogulch This is easy to implement and I will add it in next release. But do you know why there are separate homeserver URL discovery endpoint for server and client ?

              infogulch 1 Reply Last reply Reply Quote 1
              • infogulch
                infogulch @girish last edited by

                Good question, I'm not sure. I guess */server is for federation (server<->server), and */client is for clients (client->server).

                1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff last edited by

                  I have fixed this for the next release.

                  $ curl -s https://example.com/.well-known/matrix/client | python3 -m json.tool
                  {
                      "m.homeserver": {
                          "base_url": "https://matrix.example.com"
                      },
                      "m.identity_server": {
                          "base_url": "https://vector.im"
                      }
                  }
                  
                  infogulch 2 Replies Last reply Reply Quote 4
                  • infogulch
                    infogulch @girish last edited by infogulch

                    Hm, I'm not sure that the identity server is supposed to be pinned to vector.im... I'll see if someone on the matrix channel can chime in.

                    1 Reply Last reply Reply Quote 0
                    • infogulch
                      infogulch @girish last edited by infogulch

                      @girish Ok I asked and @tulir on #matrix:matrix.org said that we can just omit the "m.identity_server" server field entirely. Apparently it's used to map third party ids (email/phone) to matrix ids. But since we're using cloudron logins we can just omit it.

                      Also note that that field is not marked as required on the API docs page.

                      girish 1 Reply Last reply Reply Quote 1
                      • girish
                        girish Staff @infogulch last edited by

                        @infogulch ah thanks, i will remove it.

                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post
                        Powered by NodeBB