TCP server for EGTS telematics packets with delivery to stdout, files, EGTS, RabbitMQ and Valkey
87
egts_gateway is a TCP server for the EGTS (Era Glonass Telematics Standard) protocol. It accepts
connections from telematics terminals, decodes EGTS packets and delivers them to one or more
destinations: stdout, rotating NDJSON files, other EGTS servers, RabbitMQ queues and Valkey/Redis
Streams. Incoming authentication is optional, delivery is buffered in an in-memory queue, and
undelivered packets are dumped to disk on shutdown and restored on the next start.
Sources: github.com/LdDl/go-egts
The image ships no configuration file. There are two mutually exclusive ways to configure it, and
exactly one CLI flag: -conf.
-conf <path> after the image name and bind-mount the file. Environment variables
and .env are then ignored.-conf, the gateway reads EGTS_* variables. If /app/.env exists
(the working directory is /app), its values override the process environment.Without either, the built-in defaults apply: listen on 0.0.0.0:8081, no authentication, packets to
stdout, application logs to stderr.
Minimal working TOML:
[server_cfg]
host = "0.0.0.0"
port = 8081
[destinations_cfg]
stdout = true
Unset keys fall back to the defaults, but unknown keys are rejected at startup. The full annotated example is egts_gateway.toml; the full variable list is .env.example.
Non-obvious startup conditions:
0.0.0.0 inside the container. 127.0.0.1 in server_cfg.host /
EGTS_SERVER_HOST makes the published port unreachable.logs_cfg.output = "stdout" together with
destinations_cfg.stdout = true is rejected, as are overlapping log, packet and dump directories../data/queue resolve against the working directory /app, so mount a
volume at /app/data to keep packet files, file logs and queue dumps.--stop-timeout 30 (or stop_grace_period: 30s) so the gateway can dump its pending queue on
SIGTERM.FROM scratch - there is no shell, so docker exec ... sh does not work.Defaults, packets printed to the container log:
docker run --rm --name egts_gateway --stop-timeout 30 \
-p 8081:8081 \
-v egts_gateway_data:/app/data \
docker.io/dimahkiin/egts_gateway:latest
Authentication is disabled by default; use -p 127.0.0.1:8081:8081 instead if the port should not be
reachable from other hosts, or set auth_cfg.enabled = true with auth_cfg.password.
With a TOML file:
curl -fsSL https://raw.githubusercontent.com/LdDl/go-egts/master/egts_gateway.toml -o egts_gateway.toml
docker run --rm --name egts_gateway --stop-timeout 30 \
-p 8081:8081 \
--mount type=bind,source="$(pwd)/egts_gateway.toml",target=/app/egts_gateway.toml,readonly \
-v egts_gateway_data:/app/data \
docker.io/dimahkiin/egts_gateway:latest -conf /app/egts_gateway.toml
With an .env file (note: no -conf, and the target path must be /app/.env):
docker run --rm --name egts_gateway --stop-timeout 30 \
-p 8081:8081 \
--mount type=bind,source="$(pwd)/.env",target=/app/.env,readonly \
-v egts_gateway_data:/app/data \
docker.io/dimahkiin/egts_gateway:latest
| Port | Protocol | Purpose |
|---|---|---|
| 8081 | TCP | EGTS ingress from telematics terminals (EXPOSEd; server_cfg.port / EGTS_SERVER_PORT) |
This is the only listening port. Outbound destinations - EGTS relays, RabbitMQ, Valkey/Redis - are dialed by the container and need no published ports.
| Path | Purpose |
|---|---|
/app | Working directory; ENTRYPOINT is ./egts_gateway |
/app/egts_gateway.toml | Conventional mount point for the TOML file passed via -conf |
/app/.env | ENV file, loaded automatically when -conf is absent |
/app/data | Mount a volume here; parent of the three directories below |
/app/data/queue | Queue dumps queue.dump (delivery_cfg.dump_directory) |
/app/data/logs | application.log and rotated archives, when logs_cfg.output = "file" |
/app/data/packets | packets.ndjson and rotated archives, when destinations_cfg.file.enabled = true |
Read only when -conf is not passed. Selected variables; see
.env.example for all of them.
| Variable | Default | Purpose |
|---|---|---|
EGTS_SERVER_HOST | 0.0.0.0 | Listen address |
EGTS_SERVER_PORT | 8081 | Listen port |
EGTS_AUTH_ENABLED | false | Require terminal authentication |
EGTS_AUTH_PASSWORD | empty | Password, required when auth is enabled (max 32 bytes) |
EGTS_ACK_MODE | queued | queued or delivered acknowledgement |
EGTS_QUEUE_CAPACITY | 1024 | In-memory queue size |
EGTS_DUMP_AFTER_SECONDS | 60 | Dump the queue and exit after this long failing |
EGTS_DUMP_DIRECTORY | ./data/queue | Queue dump directory |
EGTS_LOG_OUTPUT | stderr | stdout, stderr or file |
EGTS_LOG_DIRECTORY | ./data/logs | Application log directory for file output |
EGTS_PACKETS_STDOUT | true | One JSON packet envelope per line on stdout |
EGTS_PACKETS_FILE_ENABLED | false | Write packets as NDJSON |
EGTS_PACKETS_FILE_DIRECTORY | ./data/packets | NDJSON directory |
EGTS_RELAY_IDS | unset | Comma-separated EGTS relay IDs; per-destination keys use the ID as an uppercase suffix, e.g. EGTS_RELAY_HOST_MONITORING |
EGTS_RABBITMQ_IDS | unset | Comma-separated RabbitMQ destination IDs, same suffix convention |
EGTS_VALKEY_IDS | unset | Comma-separated Valkey/Redis destination IDs, same suffix convention |
The gateway exposes no HTTP or management endpoints.
Built FROM scratch with a static CGO_ENABLED=0 Go binary compiled in golang:1.25.9-alpine3.23.
No shell, no package manager, no CA bundle. Size is about 6 MB.
MIT - LICENSE.md
Content type
Image
Digest
sha256:69a6fc4e8…
Size
2.5 MB
Last updated
10 days ago
docker pull dimahkiin/egts_gateway