Skip to content
Synchronisation Service between Discourse and TeamSpeak3 Server
JavaScript Vue Dockerfile CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
components
layouts
middleware
pages
plugins
server
static
store
.dockerignore
.env.example
.eslintrc.js
.gitignore
.npmrc
.prettierrc
.travis.yml
Dockerfile
README.md
nuxt.config.js
package-lock.json
package.json

README.md

Discourse - TeamSpeak 3 Server Bridge

It Ain't Much But It's Honest Work

Build Status

Getting started

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.

Docker

You can simply pull the provided docker image.

svenc56/discourse-teamspeak-bridge

Please add the following environment variables:

ENV DISCOURSE_BASE_URL ''
ENV DISCOURSE_API_KEY ''
ENV DISCOURSE_USER ''
ENV DISCOURSE_CUSTOM_FIELD_NAME ''
ENV DISCOURSE_USER_LIST_QUERY_ID ''
ENV DISCOURSE_WEBHOOK_SECRET ''
ENV TEAMSPEAK_USERNAME 'serveradmin'
ENV TEAMSPEAK_PASSWORD ''
ENV TEAMSPEAK_HOST 'localhost'
ENV TEAMSPEAK_SERVER_PORT '9987'
ENV TEAMSPEAK_QUERY_PORT '10011'
ENV TEAMSPEAK_PROTOCOL 'raw'
ENV TEAMSPEAK_BOT_NAME 'Bot'
ENV API_KEY ''
ENV BASE_URL ''

Installing

1.) Install dependencies:

$ npm install

2.) Configure Environment Variables

Edit the .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

Using the Webhook

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.

Running the tests

At the moment no testing is done. This will be a part of future development.

$ npm run test

Deployment

$ npm run build

$ npm run serve

or

$ npm run start

API Documentation

WIP: In the development environment, you can access the /explorer route to debug and view all currently available routes.

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

You can’t perform that action at this time.