/synapse-public-profile-api

Synapse module that provides a public route for retrieving the profile of configured users

Primary LanguagePythonMIT LicenseMIT

synapse-public-profile-api

A synapse extension to provide routes for accessing profile information of given users publicly. For help setting this up, please visit #help:t2bot.io.

Install

In the same virtualenv as synapse: pip install https://github.com/t2bot/synapse-public-profile-api/tarball/master

Usage

Add this to your synapse homeserver.yaml under one of your listeners:

listeners:
  - port: 8008
    bind_addresses: ['::', '0.0.0.0']
    type: http
    tls: true
    x_forwarded: false
    resources:
      - names: ['client', 'webclient']
        compress: true
      - names: ['federation']
        compress: false
    additional_resources:
      "/_matrix/t2bot/user_profile":
        module: synapse-public-profile-api.ProfileRequestHandler
        config:
          # The users that are allowed to be exposed from this API. Must belong to your server.
          allowed_users: ['@travis:t2l.io']

After restarting synapse, make a request to https://your.domain.com/_matrix/t2bot/user_profile?user_id=@your.user:domain.com to get the profile. No authentication is required.