I’m currently working on a synchronization service between Discourse and TeamSpeak to sync user groups from Discourse to TeamSpeak 3.
This service is already working and I’m tweaking it at the moment. First-time preparation takes about 20 minutes for you.
Technically seen this is a Node.Js server using a server query library.
I’m open to your feedback.
It Ain’t Much But It’s Honest Work
This Bridge Server syncs specified user groups from the Discourse Board to the TeamSpeak 3 Server. The server runs a cronjob every 5 minutes to sync both servers. This server is in early dev stage but it is fully working.
On server start the server will create a database file which has to be filled by you. It is a pivot table which contains the Group_ID of Discourse and TeamSpeak3.
1.) Install dependencies:
2.) Configure Environment Variables
.env.example file with your data.
3.) Install the Dataexplorer Plugin in Discourse.
4.) Add the following query.
-- [params] -- string :custom_field_name SELECT u.id AS user_id, u.username AS username, g.id AS group_id, ucf.value AS user_field_value FROM users u JOIN user_custom_fields ucf ON ucf.user_id = u.id join group_users gu ON gu.user_id = u.id join GROUPS g ON g.id = gu.group_id WHERE ucf.name = :custom_field_name AND ucf.value <> '' ORDER BY g.id
5.) Create a custom Field in Discourse for the TeamSpeak UID.
6.) Then you have to know which userfield name you are searching for.
This query will help you:
SELECT * FROM user_custom_fields
This Server provides a Post-URL (
/webhook?secret=MYSECRET) where you can trigger the synchronisation process. The Secret can be set in the Environment Variables.
At the moment no testing is done. This will be a part of future development.
npm run test
npm run build npm run serve
npm run start
WIP: In the development environment, you can access the
/explorer route to debug and view all currently available routes.
- SvenC56 - Initial work - SvenC56
This project is licensed under the MIT License - see the LICENSE.md file for details