Formerly mq-client. Manages the timetable data in the database, fetching, updating and purging old services. https://owlboard.info
Go to file
Fred Boniface cd0f5c7003
All checks were successful
Go Test / test (push) Successful in 26s
Add stations modile
2024-06-29 21:54:32 +01:00
.gitea/workflows Reorganise repo 2024-04-05 22:23:42 +01:00
background Log tidying 2024-04-14 20:07:56 +01:00
cif Tidying error handling and adding some fluff. 2024-04-28 10:25:41 +01:00
corpus Add index creation 2024-04-23 00:27:33 +01:00
dbAccess Begin PIS implementation 2024-05-02 15:35:00 +01:00
helpers Fix logging of failed VSTP messages 2024-04-28 11:52:15 +01:00
log Tidied logging statements 2024-04-14 21:20:17 +01:00
messaging Improve readability 2024-04-24 23:08:51 +01:00
nrod Tidying error handling and adding some fluff. 2024-04-28 10:25:41 +01:00
pis Begin PIS implementation 2024-05-02 15:35:00 +01:00
stations Add stations modile 2024-06-29 21:54:32 +01:00
vstp Add example DELETE message which needs work 2024-04-29 11:04:38 +01:00
.dockerignore Add debug files to dockerignore 2024-04-26 21:50:41 +01:00
.gitignore Add debug option to write CIF data to file. 2024-04-09 20:38:40 +01:00
Dockerfile Fix logging of failed VSTP messages 2024-04-28 11:52:15 +01:00
go.mod Update dependencies 2024-06-28 15:08:37 +01:00
go.sum Update dependencies 2024-06-28 15:08:37 +01:00
LICENSE Initial commit 2023-07-15 20:15:33 +01:00
main.go Improve console fluff 2024-04-28 10:33:58 +01:00
README.md Include details about logging configuration 2024-04-14 22:59:58 +01:00

timetable-mgr

timetable-mgr is the new name for mq-client.

It has been extended to manage all timetable management aspects within OwlBoard:

  • Periodic fetch of CORPUS Location Data
  • Daily fetch of Network Rail timetable files
  • Subscribe to VSTP Messages from the MQ Feed
  • Update the database with new timetable data
  • Clean old services from the database

The configuration options have also been changed to support simple files, this allows support for Docker Secrets as well as the mounting of secrets within a Kubernetes cluster in addition to the existing method of configuring via environment variables.

Configuration

The application requires the following configuration values to be set.

The preferred method of configuration in Kubernetes is mapping secrets to environment variables, and in Docker is to mount the secrets to a file - one value per file. This is the simplest method and provides an acceptable level of security - provided you have configured secret management within Kubernetes.

Docker Swarm has secret support built-in, for Docker Standalone/Podman you will need to manage secrets yourself.

See the table below for the environment variable name, the configuration file path. Some values have defaults which will be used if the variable is not set and the file path does not exist. In cases where the file path exists and the environment variable also exists, the environment variable will be used. All values without a default are required,timetable-mgr will exit if it cannot load a value.

Variable Name File Path Default Value Description
OWL_VSTP_ON /owl/conf/vstp/on on Enable/Disable VSTP Updates 1
OWL_NROD_USER /owl/conf/nrod/user Network Rail NROD Username
OWL_NROD_PASS /owl/conf/nrod/pass Network Rail NROD Password
OWL_DB_HOST /owl/conf/db/host localhost MongoDB Host
OWL_DB_PORT /owl/conf/db/port 27017 MongoDB Port
OWL_DB_USER /owl/conf/db/user MongoDB Username
OWL_DB_PASS /owl/conf/db/pass MondoDB Password

1 Set to 'off' to disable VSTP Updates. Useful in testing as you cannot have two clients connected.

Logging

Logging is at INFO level. The environment variable 'runtime' is checked. If it is set to debug, then the log level will be set to DEBUG.

If the environment variable 'perflog' is set to on, then the number of running goroutines and heap memory allocation will be printed to the console every two seconds. Of course this is off by default.