Docker-ized version of the ILIAS (LMS) Chat Server.
904
Docker-ized version of the ILIAS Chat Server.
ILIAS provides several classes to create and send Emails/Messages for different purposes.
The ILIAS chat server is a Node.js server providing web socket connections for real-time chat in ILIAS LMS.
This Docker files / image aims to facilitate setting up the chat server in an isolated environment, either as part of the docker(-compose) network on the same host as ILIAS, or distributed to another physical or virtual host.
There are multiple versions/ tags available under dockerhub:unihalle/ilias-chatserver/tags/. Please ensure the tag matches your ILIAS minor release's version number (MAJOR.MINOR.PATCH).
Create the following file:
.env (adjust the values):
# Please enter a name for this ILIAS client.
# The entered string must be globally unique.
# Initially this value is set to the client
# id of the ILIAS client. If changed, the chat
# server must be restarted.
ILIAS_CHAT_CLIENT_NAME=ilias-main-client
# Please define unique strings used by ILIAS
# for authentication purposes when sending
# requests to the chat server.
ILIAS_CHAT_AUTH_KEY=authkey
ILIAS_CHAT_AUTH_SECRET=authsecret
# Database connection parameters as
# defined during setup and written in
# /path/to/ilias/[data_dir]/[client]/client.ini.php
ILIAS_CHAT_DB_HOST=mysql.example.com
ILIAS_CHAT_DB_PORT=3306
ILIAS_CHAT_DB_NAME=ilias
ILIAS_CHAT_DB_USER=ilias
ILIAS_CHAT_DB_PASS=very_secret
docker run -d \
--name TestIliasChatServer \
--env-file .env \
-p "27019:27019" \
unihalle/ilias-chatserver
You can now test your chat server at http://host:27019/backend/Heartbeat/onscreen
Minimal example (binds port 27019 to localhost):
docker-compose.yaml:
version: "2"
services:
chat:
image: unihalle/ilias-chatserver:v5.3.12
restart: always
environment:
- ILIAS_CHAT_CLIENT_NAME
- ILIAS_CHAT_AUTH_KEY
- ILIAS_CHAT_AUTH_SECRET
- ILIAS_CHAT_DB_HOST
- ILIAS_CHAT_DB_PORT
- ILIAS_CHAT_DB_NAME
- ILIAS_CHAT_DB_USER
- ILIAS_CHAT_DB_PASS
ports:
- "127.0.0.1:27019:27019"
You can now test your chat server at http://127.0.0.1:27019/backend/Heartbeat/onscreen
Inside the docker-compose network, the URL is http://chat:27019/backend/Heartbeat/onscreen
This is an almost complete example [FIXME: nginx config for connection upgrade might be missing] illustrating the use with a reverse proxy and encryption inside a network managed by docker-compose. Please replace $VIRTUAL_HOST with an actual host name.
# Copy https://raw.githubusercontent.com/uni-halle/ilias-chatserver-docker/develop/.env.example to your working directory and adjust the values or use the template above.
# Add certificates so they can be read by the reverse proxy
mkdir -p certs && cp VIRTUAL_HOST.crt certs/ && cp VIRTUAL_HOST.key certs/
docker-compose.yaml:
version: "2"
services:
chat:
image: unihalle/ilias-chatserver:v5.3.12
build: .
restart: always
environment:
- ILIAS_CHAT_CLIENT_NAME
- ILIAS_CHAT_AUTH_KEY
- ILIAS_CHAT_AUTH_SECRET
- ILIAS_CHAT_DB_HOST
- ILIAS_CHAT_DB_PORT
- ILIAS_CHAT_DB_NAME
- ILIAS_CHAT_DB_USER
- ILIAS_CHAT_DB_PASS
volumes:
- "./volumes/logs:/var/log/chat"
- "/etc/localtime:/etc/localtime:ro"
reverse-proxy:
image: jwilder/nginx-proxy:alpine
environment:
- DEFAULT_HOST=$VIRTUAL_HOST
ports:
- "443:443"
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./certs:/etc/nginx/certs:ro
Finally bring it up and watch the logs:
docker-compose up -d && docker-compose logs -f
You can now test your chat server at https://$VIRTUAL_HOST/backend/Heartbeat/onscreen if you have configured everything correctly.
Hit Ctrl+C to detach from container output (logs). The chat server's logs will be stored to ./volumes/logs/.
To have more fine-grained control over the chat server's settings, override /etc/chat/[client|server].cfg in this container.
Go to Administration→Chat
General Settings:
Chatserver Settings:
/etc/chat/[client|server].cfg in the container. Confer to ILIAS//Modules/Chatroom/README.md for how configuration should look like.https:// so their traffic is encrypted and private conversations stay private. For the above complete docker-compose example, this would be https://$VIRTUAL_HOST.Adding some load to the chat server to see how it performs on a test system:
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
var counter = 0,
$textInput = $('#submit_message_text'),
$submitButton = $('#submit_message');
setInterval(function() {
$textInput
.val(pad(++counter, 4) + ' ' + Math.random());
$submitButton.click();
}, 100);
Content type
Image
Digest
Size
36.2 MB
Last updated
almost 6 years ago
Requires Docker Desktop 4.37.1 or later.