Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Torxed/matrix-synapse-invite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

matrix-synapse-invite

A invite system for matrix-synapse https://github.com/matrix-org/synapse

Requirements

Database requirements:

If the webserver with the invite code does not have access to the PostgreSQL instance of your homeserver,
you need to copy the users table of that SQL instance with:

  • pg_dump -S synapse -t users synapse > users.sql
  • login to the webserver with a running postgresql instance and do:
  • psql -U synapse synapse < users.sql

Or, allow the webserver to get remote-access to the PostgreSQL instance of your homeserver.
(I strongly recommend this remote allowance is done through a VPN tunnel between the machines)

Webserver requirements:

Place ./*.php on just any webserver really.

Code configurations:

$CHAT_redirect = 'https://chat.domain.com'; // Where your front-end is
$ERROR_redirect = $CHAT_redirect . '/invite.php?error=1&logout=true'; //Where invite.php is typically
$INVITE_server = $CHAT_redirect; // I host invite.php on the same webdir as Riot-IM (my choice of front-end)
$HomeServer_domain = 'matrix.domain.com'; // used to build @<user>:<domain> queries.
$HomeServer = 'matrix.domain.com'; // The host/IP where we can reach the home-server
$SharedSecret = "<the secret from /etc/synapse/homeserver.yaml>";
    
$dbhost = 'matrix.domain.com'; // the db-host where the tables "users" and "invites" are located.
$dbuser = 'synapse';
$dbpass = '<db password>';
$dbname = 'synapse';

You need to adapt all these in invite_helpers.php for this to work.
I hope they're self-explanatory, if not someone might create a issue and i'll fix this.


Usage

Navigate yourself to https://your-server.com/invite.php,
once there, login with your matrix-synapse username and password,
copy the link and give it to friends and family (enemies too if you really want to, I can't tell you what to do).

The user will get a generated password and promted to enter a username.
They need to remember the generated password.

Known issues

  • Facebook chat will preview (effectively using up) the link rendering it worthless

Releases

No releases published

Packages

No packages published

Languages