A invite system for matrix-synapse https://github.com/matrix-org/synapse
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)
Place ./*.php
on just any webserver really.
$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.
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.
- Facebook chat will preview (effectively using up) the link rendering it worthless