Točen Live is Real-time WebSocket server for serving MOL / LPP Bus information in Ljubljana.
This service comes pre-packaged as a public Docker Image and can be simply ran with the following docker run
command.
export TOCEN_API_KEY="<ask>"
docker run -ti --rm -p 8077:8077 -e TOCEN_API_KEY=${TOCEN_API_KEY} ghcr.io/pinkstack/tocen-live
Or as a daemon with -d
docker run -d --name=tocen-live -p 8077:8077 -e TOCEN_API_KEY=${TOCEN_API_KEY} ghcr.io/pinkstack/tocen-live
If you wanna connect to server via WebSocket connection please use websocat and perhaps pass the output to jq.
websocat -E ws://tocen-live.pinkstack.com:8077/ws/changes | jq .
The service can accept the following environment variables
TOCEN_API_KEY
- API Key for the underlying LPP WebServiceREFRESH_INTERVAL
- Internal refresh interval used for refreshing internal state. Default value -100 milliseconds
To run the test suite one shall use:
sbt test
To run the service in development mode
sbt "~run"
sbt "~reStart" # with sbt-revolver for JVM based restarts
To build and publish a new Docker image to container registry use
sbt docker:publish
sbt docker:publishLocal # to publish to local (development) registry
Use update-agents.yml Ansible Playbook for to update Docker images running on hosts.
ansible-playbook playbooks/update-agents.yml -e tocen_api_key=${TOCEN_API_KEY}
... or run SBT task that will package and invoke Ansible playbook.
sbt deployCurrent