Tat, aka Text And Tags, is a communication tool - Human & Robot all together.
This is a pre-alpha version, but already known to be used in production.
Some use cases:
- Viewing Pull Requests, Build And Deployment in one place
- Alerting & Monitoring Overview
- Agile view as simple as a whiteboard with post-it
- Team Communication & Reporting facilities
- ...
Tat Engine exposes only an HTTP REST API. You can manipulate this API with Tat Command Line Interface, aka tatcli, see https://github.com/ovh/tatcli.
A WebUI is also available, see https://github.com/ovh/tatwebui.
Tat Engine:
- Uses MongoDB as backend
- Is fully stateless, scale as you want
- Is the central Hub of Tat microservices ecosystem
- Topic
- Contains 0 or n messages
- Administrator(s) of Topic can create Topic inside it
- Message
- Consists of text, tags and labels
- Can not be deleted or modified (by default)
- Is limited in characters (topic setting)
- Is always attached to a topic
- Tag
- Within the message content
- Can not be added after message creation (by default)
- Label
- Can be added or removed freely
- Have a color
- Group
- Managed by an administrator(s): adding or removing users from the group
- Without prior authorization, a group or user has no access to topics
- A group or a user can be read-only or read-write on a topic
- Task
- A task is a message that is both in the topic task of a user and in the original topic
- Administrator(s)
- Tat Administrator: all configuration access
- On Group(s): can add/remove member(s)
- On Topic(s): can create Topic inside it, update parameters
- Deleting a message is possible in the private topics, or can be granted on other topic
- Modification of a message is possible in private topics, or can be granted on other topic
- The default length of a message is 140 characters, this limit can be modified by topic
- A date creation of a message can be explicitly set by a
system user
What about attachment (sound, image, etc...) ? Tat Engine stores only text. Use other application, like Plik (https://github.com/root-gg/plik) to upload file and store URL on Tat. This workflow should be done by UI.
curl -XPOST \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "text": "text" }' \
http://<tatHostname>:<tatPort>/message/topic/sub-topic
If you use a system user
, you can force message's date
curl -XPOST \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "text": "text", "dateCreation": 11123232 }' \
http://<tatHostname>:<tatPort>/message/topic/sub-topic
curl -XPOST \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "text": "text", "idReference": "9797q87KJhqsfO7Usdqd", "action": "reply"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "like"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "unlike"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
Only author of the message can add a label on it. option is the background color of the label.
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "label", "text": "myLabel", "option": "rgba(143,199,148,0.61)"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
Only author of the message can remove a label from it.
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "unlabel", "text": "myLabel"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
Only for system user
. A system user
can add tags on his messages only.
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "tag", "text": "myTag"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
Only for system user
. A system user
can remove tags on his messages only.
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "untag", "text": "myTag"}'\
http://<tatHostname>:<tatPort>/message/topic/sub-topic
curl -XPOST \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "bookmark"}'\
http://<tatHostname>:<tatPort>/message/Private/username/Bookmarks/sub-topic
curl -XDELETE \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
http://<tatHostname>:<tatPort>/message/9797q87KJhqsfO7Usdqd
Add a message to topic: /Private/username/Tasks
.
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "task" }'\
http://<tatHostname>:<tatPort>/message/Private/username/Tasks
Remove a message from the topic: /Private/username/Tasks
curl -XPUT \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "idReference": "9797q87KJhqsfO7Usdqd", "action": "untask" }'\
http://<tatHostname>:<tatPort>/message/Private/username/Tasks
curl -XGET http://<tatHostname>:<tatPort>/messages/<topic>?skip=<skip>&limit=<limit> | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/messages/<topic>?skip=<skip>&limit=<limit>&argName=valName&arg2Name=val2Name | python -m json.tool
Getting messages on one Public Topic (Read Only):
curl -XGET http://<tatHostname>:<tatPort>/read/<topic>?skip=<skip>&limit=<limit> | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/read/<topic>?skip=<skip>&limit=<limit>&argName=valName&arg2Name=val2Name | python -m json.tool
topic
: /yourTopic/subTopicskip
: Skip skips over the n initial documents from the query resultslimit
: Limit restricts the maximum number of documents retrievedtext
: you textidMessage
: message IdinReplyOfID
: message Id repliedinReplyOfIDRoot
: message Id root repliedallIDMessage
: message Id OR message Id replied OR message Id root replieddateMinCreation
: filter result on dateCreation, timestamp Unix formatdateMaxCreation
: filter result on dateCreation, timestamp Unix FormatdateMinUpdate
: filter result on dateUpdate, timestamp Unix formatdateMaxUpdate
: filter result on dateUpdate, timestamp Unix Formatlabel
: Search by label: could be labelA,labelBandLabel
: Search by label (exclude): could be labelA,labelBnotLabel
: Search by label (and): could be labelA,labelBtag
: tagA,tagBandTag
: tagA,tagBnotTag
: tagA,tagBusername
: usernameA,usernameBtreeView
: onetree or fulltree. "onetree": replies are under root message. "fulltree": replies are under their parent. Default: no tree
curl -XGET http://<tatHostname>:<tatPort>/messages/topicA?skip=0&limit=100 | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/messages/topicA/subTopic?skip=0&limit=100&dateMinCreation=1405544146&dateMaxCreation=1405544146 | python -m json.tool
Only for Tat Admin: convert a normal user
to a system user
.
A system user must have a username starting with tat.system
.
Remove email and set user attribute IsSystem to true.
This action returns a new password for this user.
Warning: it is an irreversible action.
Flag canWriteNotifications
allows (or not if false) the system user
to write inside private topics of user /Private/username/Notifications
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: userAdmin" \
-H "Tat_password: passwordAdmin" \
-d '{ "username": "usernameToConvert", "canWriteNotifications": "true" }' \
http://<tatHostname>:<tatPort>/user/convert
Only for Tat Admin.
A system user
must have a username starting with tat.system
.
This action returns a new password for this user.
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: userAdmin" \
-H "Tat_password: passwordAdmin" \
-d '{ "username": "userameSystemToReset" }' \
http://<tatHostname>:<tatPort>/user/resetsystem
Only for Tat Admin: convert a normal user
to an admin user
.
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: userAdmin" \
-H "Tat_password: passwordAdmin" \
-d '{ "username": "usernameToGrant" }' \
http://<tatHostname>:<tatPort>/user/setadmin
Only for Tat Admin: rename the username of a user. This action updates all Private topics of the user.
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: userAdmin" \
-H "Tat_password: passwordAdmin" \
-d '{ "username": "usernameToRename", "newUsername": "NewUsername" }' \
http://<tatHostname>:<tatPort>/user/rename
Only for Tat Admin: update fullname and email of a user.
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: userAdmin" \
-H "Tat_password: passwordAdmin" \
-d '{ "username": "usernameToRename", "newFullname": "NewFullname", "newEmail": "NewEmail" }' \
http://<tatHostname>:<tatPort>/user/update
Only for Tat Admin
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: userAdmin" \
-H "Tat_password: passwordAdmin" \
-d '{ "username": "usernameToRename" }' \
http://<tatHostname>:<tatPort>/user/archive
Status could be: online
, offline
, busy
.
curl -XPOST \
-H "Tat_username: username" \
-H "Tat_password: passwordOfUser" \
-d '{ "status": "online" }' \
http://<tatHostname>:<tatPort>/presenceget/topic/sub-topic
curl -XGET http://<tatHostname>:<tatPort>/presences/<topic>?skip=<skip>&limit=<limit> | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/presences/<topic>?skip=<skip>&limit=<limit>&argName=valName&arg2Name=val2Name | python -m json.tool
- topic: /yourTopic/subTopic
- skip: Skip skips over the n initial presences from the query results
- limit: Limit restricts the maximum number of presences retrieved
- status: status:
online
,offline
,busy
curl -XGET http://<tatHostname>:<tatPort>/presences/topicA?skip=0&limit=100 | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/presences/topicA/subTopic?skip=0&limit=100&dateMinPresence=1405544146&dateMaxPresence=1405544146 | python -m json.tool
It's a generated password by Tat, allowing username to communicate with Tat. User creates an account, a mail is send to verify account and user has to go on a Tat URL to validate account and get password. Password is encrypted in Tat Database (sha512 Sum).
First user created is an administrator.
Return a mail to user, with instruction to validate his account.
curl -XPOST \
-H "Content-Type: application/json" \
-d '{"username": "userA", "fullname": "User AA", "email": "usera@foo.net", "callback": " Click on:scheme://:host:port/user/verify/:token to validate your account"}' \
http://<tatHostname>:<tatPort>/user
Callback is a string sent by mail, indicating to the user how to validate his account. Available fields (automatically filled by Tat ):
:scheme -> http of https
:host -> ip or hostname of Tat Engine
:port -> port of Tat Engine
:username -> username
:token -> tokenVerify of user
curl -XGET \
http://<tatHostname>:<tatPort>/user/verify/yourUsername/tokenVerifyReceivedByMail
This url can be called only once per password and expired 30 minutes after querying create user with POST on /user
Returns: tokenVerify by email
curl -XPOST \
-H "Content-Type: application/json" \
-d '{"username": "userA", "email": "usera@foo.net"}' \
http://<tatHostname>:<tatPort>/user/reset
curl -XGET \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me
Retrieves contacts presences since n seconds
Example since 15 seconds :
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/contacts/15
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/contact/username
curl -XDELETE \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/contacts/username
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: userA \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/topics/myTopic/sub-topic
curl -XDELETE \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/topics/myTopic/sub-topic
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: userA \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/enable/notifications/topics/myTopic/sub-topic
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/disable/notifications/topics/myTopic/sub-topic
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/tags/myTag
curl -XDELETE \
-H "Content-Type: application/json" \
-H "Tat_username: userA" \
-H "Tat_password: password" \
http://<tatHostname>:<tatPort>/user/me/tags/myTag
curl -XGET http://<tatHostname>:<tatPort>/users?skip=<skip>&limit=<limit> | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/users?skip=<skip>&limit=<limit>&argName=valName&arg2Name=val2Name | python -m json.tool
Users list with groups (admin only)
curl -XGET http://<tatHostname>:<tatPort>/users?skip=<skip>&limit=<limit>&withGroups=true
- skip: Skip skips over the n initial documents from the query results
- limit: Limit restricts the maximum number of documents retrieved
- username: Username
- fullname: Fullname
- dateMinCreation: filter result on dateCreation, timestamp Unix format
- dateMaxCreation: filter result on dateCreation, timestamp Unix Format
curl -XGET http://<tatHostname>:<tatPort>/users?skip=0&limit=100 | python -m json.tool
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"name": "groupName", "description": "Group Description"}' \
http://<tatHostname>:<tatPort>/group
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"groupname": "groupName", "username": "usernameToAdd"}' \
http://<tatHostname>:<tatPort>/group/add/user
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"groupname": "groupName", "username": "usernameToAdd"}' \
http://<tatHostname>:<tatPort>/group/remove/user
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"groupname": "groupName", "username": "usernameToAdd"}' \
http://<tatHostname>:<tatPort>/group/add/adminuser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"groupname": "groupName", "username": "usernameToAdd"}' \
http://<tatHostname>:<tatPort>/group/remove/adminuser
Rules:
- User can create a root topic if he is a Tat Admin.
- User can create topics under
/Private/username/
- User can create topics if he is an admin on the Parent Topic or belong to an admin group on the Parent topic. Example: Create /AAA/BBB: Parent Topic is /AAA
curl -XPOST \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "description": "Topic Description"}' \
http://<tatHostname>:<tatPort>/topic
curl -XDELETE \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/topic/subtopic
curl -XGET http://<tatHostname>:<tatPort>/topic/topicName | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/topic/topicName/subTopic | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/topics?skip=<skip>&limit=<limit> | python -m json.tool
curl -XGET http://<tatHostname>:<tatPort>/topics?skip=<skip>&limit=<limit>&argName=valName&arg2Name=val2Name | python -m json.tool
- skip: Skip skips over the n initial documents from the query results
- limit: Limit restricts the maximum number of documents retrieved
- topic: Topic name, example: /topicA
- idTopic: id of topic
- description: description of topic
- dateMinCreation: filter result on dateCreation, timestamp Unix format
- dateMaxCreation: filter result on dateCreation, timestamp Unix Format
- getNbMsgUnread: if true, add new array to return, topicsMsgUnread with topic:nbUnreadMsgSinceLastPresenceOnTopic
curl -XGET http://<tatHostname>:<tatPort>/topics?skip=0&limit=100 | python -m json.tool
For admin of topic or on /Private/username/*
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "key": "keyOfParameter", "value": "valueOfParameter", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/parameter
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "key": "keyOfParameter", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/parameter
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "username": "usernameToAdd", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/rouser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "username": "usernameToAdd", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/rwuser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "username": "usernameToAdd", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/adminuser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "username": "usernameToRemove", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/rouser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "username": "usernameToRemove", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/wuser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "username": "usernameToRemove", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/adminuser
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "groupname": "groupnameToAdd", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/rogroup
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "groupname": "groupnameToAdd", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/rwgroup
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "groupname": "groupnameToAdd", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/add/admingroup
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "groupname": "groupnameToRemove", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/rogroup
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "groupname": "groupnameToRemove", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/rwgroup
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "groupname": "groupnameToRemove", "recursive": "false"}' \
http://<tatHostname>:<tatPort>/topic/remove/rwgroup
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
-d '{"topic": "/topicA", "recursive": "false", "maxlength": 140, "canForceDate": false, "canUpdateMsg": false, "canDeleteMsg": false, "canUpdateAllMsg": false, "canDeleteAllMsg": false, "isROPublic": false}' \
http://<tatHostname>:<tatPort>/topic/param
url: /socket/ws
tests/websocket.html
file can be used to test Tat Websockets.
The first send should be a connect
action.
First message have to be a connect
action
c = new WebSocket("ws://"+tatHostname+": "+tatport+"/socket/ws");
c.send(JSON.stringify({"username": "username", "password": "yourPassword"}))
You can use all
in args to subscribe to all topics you can access.
On subscribeMessages action, treeView is optional. Possible values: onetree
or fulltree
.
onetree
: replies are under root messagefulltree
: replies are under their parent.- Default: no tree
c.send(JSON.stringify({"action": "subscribeMessages", "topics":["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "subscribeMessages", "topics":["all"]}))
c.send(JSON.stringify({"action": "subscribeMessages", "treeView": "onetree", "topics":["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "subscribeMessages", "treeView": "fulltree", "topics":["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "unsubscribeMessages", "topics:["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "unsubscribeMessages", "topics:["all"]}))
c.send(JSON.stringify({"action": "subscribeMessagesNew", "topics:["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "subscribeMessagesNew", "topics:["all"]}))
c.send(JSON.stringify({"action": "unsubscribeMessagesNew", "topics:["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "unsubscribeMessagesNew", "topics:["all"]}))
c.send(JSON.stringify({"action": "subscribePresences", "topics:["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "subscribePresences", "topics:["all"]}))
c.send(JSON.stringify({"action": "unsubscribePresences", "topics:["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "unsubscribePresences", "topics:["all"]}))
c.send(JSON.stringify({"action": "writePresence","status": "online",topics:["/myTopic/mySubTopic1"]}))
c.send(JSON.stringify({"action": "writePresence","status": "online","args":["/myTopic/mySubTopic1","/myTopic/mySubTopic2"]}))
c.send(JSON.stringify({"action": "subscribeUsers"}))
c.send(JSON.stringify({"action": "unsubscribeUsers"}))
{"eventMsg":{"action": "create","username": "user2","message":{"_id": "55a58b3f8ce360c32a000001","text": "first message","topics":["/Internal/aaa"],"inReplyOfID": "","inReplyOfIDRoot": "","nbLikes":0,"labels":null,"likers":null,"userMentions":[],"urls":null,"tags":[],"dateCreation":1436912447,"author":{"username": "user2","fullname": "User2"}}}}
{"eventPresence":{"action": "create","presence":{"_id": "","status": "online","topic": "/Internal/aaa","datePresence":1437079334,"dateTimePresence": "2015-07-16T22:42:14.380554783+02:00","userPresence":{"username": "user2","fullname": "user2"}}}}
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/sockets/dump
curl -XGET http://<tatHostname>:<tatPort>/version
For Tat admin only.
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/count
Info about current instance of engine
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/instance
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/distribution
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/db/stats
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/db/serverStatus
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/db/replSetGetStatus
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/db/replSetGetConfig
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/db/collections
curl -XPUT \
-H "Content-Type: application/json" \
-H "Tat_username: admin" \
-H "Tat_password: passwordAdmin" \
http://<tatHostname>:<tatPort>/stats/db/slowestQueries
Return websocket-enabled
and username-from-email
parameters. See Tat Flags below.
curl -XGET http://<tatHostname>:<tatPort>/capabilities
--allowed-domains="": Users have to use theses emails domains. Empty: no-restriction. Ex: --allowed-domains=domainA.org,domainA.com
--db-addr="localhost:27017": Address of the mongodb server
--db-password="": Password to authenticate with the mongodb server
--db-user="": User to authenticate with the mongodb server
--exposed-host="localhost": Tat Engine Hostname exposed to client
--exposed-port="8080": Tat Engine Port exposed to client
--exposed-path="": Tat Engine Path exposed to client, ex: host:port/tat/engine /tat/engine is exposed path
--exposed-scheme="http": Tat URI Scheme http or https exposed to client
-h, --help=false: help for tat
--listen-port="8080": Tat Engine Listen Port
--no-smtp=false: No SMTP mode
--production=false: Production mode
--smtp-from="": SMTP From
--smtp-host="": SMTP Host
--smtp-password="": SMTP Password
--smtp-port="": SMTP Port
--smtp-user="": SMTP Username
--smtp-tls=false: SMTP TLS
--default-group="": Default Group for new user
--tat-log-level="": Tat Log Level: debug, info or warn
--username-from-email=false: Username is extracted from first part of email. first.lastame@domainA.org -> username: first.lastname
--websocket-enabled=false: Enable or not websockets on this instance
git clone https://github.com/ovh/tat.git && cd tat
docker run --name tat-mongo -d -v /home/yourhome/data:/data/db mongo
docker build -t tat .
docker run -it --rm --name tat-instance1 --link tat-mongo:mongodb \
-e TAT_DB_ADDR=mongodb:27017 \
-e TAT_SMTP_HOST=yourSMTPHost \
-e TAT_SMTP_PORT=yourSMTPPort \
-e TAT_SMTP_USER=yourSMTPUser \
-e TAT_SMTP_TLS=false \
-e TAT_SMTP_PASSWORD=yourSMTPPassword \
-e TAT_EXPOSED_HOST=<hostnameOfTat> \
-e TAT_EXPOSED_PORT=8080 \
-e TAT_EXPOSED_SCHEME=http \
-e production=true -p 8080:8080 tat
docker pull mongo:3.1.6
docker tag mongo:3.1.6 sailabove.io/<yourSailaboveUsername>/tat-mongo:3.1.6
docker push sailabove.io/<yourSailaboveUsername>/tat-mongo:3.1.6
sail services add --network private --volume /data/db:12 <yourSailaboveUsername>/tat-mongo:3.1.6 tat-mongo
git clone https://github.com/ovh/tat.git && cd tat
docker build -t tat .
docker tag -f tat sailabove.io/<yourSailaboveUsername>/tat
docker push sailabove.io/<yourSailaboveUsername>/tat
sail services add <yourSailaboveUsername>/tat \
--network predictor \
--network private \
--link tat-mongo:mongodb \
-e TAT_DB_ADDR=mongodb:27017 \
-e TAT_LISTEN_PORT=80
-e TAT_EXPOSED_HOST=tat-engine.<yourSailaboveUsername>.app.sailabove.io \
-e TAT_EXPOSED_PORT=443 \
-e TAT_EXPOSED_SCHEME=https \
-e TAT_SMTP_HOST=yourSMTPHost \
-e TAT_SMTP_FROM=yourSMTPUser \
-e TAT_SMTP_PORT=yourSMTPPort \
-e TAT_SMTP_USER=yourSMTPUser \
-e TAT_USERNAME_FROM_EMAIL=true \
-e TAT_SMTP_TLS=false \
-e TAT_WEBSOCKET_ENABLED=false \
-e TAT_PRODUCTION=true -p 80:80 tat-engine
go get && go build && ./tat --no-smtp=true --help
If you want to create a user with tatcli:
tatcli --url="http://localhost:8080" user add yourUsername firstname.lastname@ovh.net Firstname Lastname
- TAT_LISTEN_PORT
- TAT_DB_ADDR
- TAT_DB_USER
- TAT_DB_PASSWORD
Example:
export TAT_LISTEN_PORT=8181 && ./tat
is same than
./tat --listen-port="8181"
Tat is written in Go 1.5, using the experimental vendoring mechanism introduced in this version. Make sure you are using at least version 1.5.
mkdir -p $GOPATH/src/github.com/ovh
cd $GOPATH/src/github.com/ovh
git clone git@github.com:ovh/tat.git
cd $GOPATH/src/github.com/ovh/tat
export GO15VENDOREXPERIMENT=1
go build
You've developed a new cool feature? Fixed an annoying bug? We'd be happy to hear from you! Make sure to read CONTRIBUTING.md before.