User generated content can be stored on-premise or in a ServisBOT customer’s private cloud if required due to security or regulation. Our Chat History Server (CHS) provides secure storage of all conversations with end-users.
These instructions use
docker run to instantiate the CHS, however you may chose to run the container using Docker Compose, Docker Swarm or Kubernetes. Additional integration may be required to run in different container management systems, please contact your customer service representative.
MySQL 8 is also chosen as the persistence layer. Additional persistence implementations may be provided at additional cost, please contact your customer service representative.
sb-chat-history-server(this name can be chosen by the customer to follow their own conventions and standards)
CREATE TABLE IF NOT EXISTS messages_v1 ( `id` BIGINT UNIQUE NOT NULL AUTO_INCREMENT, `conversationId` VARCHAR(60) NOT NULL, `organization` VARCHAR(60) NOT NULL, `identity` VARCHAR(60) NOT NULL, `contents` JSON NOT NULL, `messageId` VARCHAR(60) NOT NULL, `timestamp` BIGINT NOT NULL, `sbid` VARCHAR(100) NOT NULL UNIQUE, PRIMARY KEY (`id`), INDEX `conversationId` (`conversationId`), INDEX `timestamp` (`timestamp`), INDEX `organization` (`organization`) );
docker pull servisbot/chat-history-server:1.0.0
Note: It is advised that a specific version is pulled from Docker Hub to allow the customer to control updates.
An environemnt file called chs.env is configured to be used with
LOG_LEVEL=info DB_HOST=my-database-instance DB_USER=myuser DB_PASSWORD=my-password DB_NAME=sb-chat-history-server DB_PORT=3306 DB_CONNECTION_LIMIT=10
infofor standard operation,
Adjust the settings to match any alternate requirements that you have.
It is also possible to tune the Node.js runtime via
docker run -d -p "8080:8080" --name=sb-chs --env-file=chs.env servisbot/chat-history-server:1.0.0
-dwill run the CHS container as a daemon. Remove the
-dflag to in your current terminal session.
-p "8090:8080"will map port 8090 on the host machine to the port that the application is running on within the docker container. (The application runs on port 8080 within the CHS container)
--name=sb-chsthis will name your container, you may prefer to leave this blank
--env-file=chs.envload the Environment Variables from the preconfigured file from the previous steps
docker ps to ensure the container is running. It is also possible to tail the logs via:
docker logs -f sb-chs
Once you have the docker container running the main application, you can test the application / database configuration by sending a request to
v1/ping. If port 8090 has been mapped as in the previous example, run the following
curl -v localhost:8090/v1/ping
If all is configured correctly, a 200 HTTP response will be returned.
If you have purchased this add-on for ServisBOT, reach out to your customer care representative with the URL or domain where your CHS can be reached.
Once everything is configured user generated content will be persisted in your CHS instead of ServisBOT. * Test one of your bots, if you do no have one created yet, follow Getting Started Docs * Review the Chat History * Log into your mysql instance and review the data stored in the messages_v1 table
The following IPs will need to be whitelisted for ingress in your firewall to allow communication for ServisBot.