Service Definitions and Protobufs
protoc --proto_path=protobuf/field/ --go_out=plugins=grpc:field protobuf/field/*
protoc --proto_path=protobuf/data/ --go_out=plugins=grpc:data protobuf/data/*
Simple token based auth.
Interceptor for metrics.
Auth requires end-to-end TLS encryption.
Reads TLS cert from certs/server.crt and cert/server.key otherwise a self signed TLS cert is generated on the fly.
A self signed cert can be generated using:
openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.crt -days 3650
Integration tests for the server:
cd mtr-api
export $(cat env.list | grep = | xargs); go test -v
Build and run the server:
cd mtr-api
export $(cat env.list | grep = | xargs); go build && ./mtr-api
Build an image with ./build.sh mtr-api
Run the container. Self signed TLS certificates will be created on the fly.
docker run --env-file mtr-api/env.list -p 8443:8443 quay.io/gclitheroe/mtr-api:latest
Mount a volume with TLS certificates into the container.
docker run --env-file mtr-api/env.list -p 8443:8443 -v /work/certs:/certs quay.io/gclitheroe/mtr-api:latest
Build and run the client.
Server will log messages.
Client reconnects after server restarts.
cd mtr-client
export $(cat env.list | grep = | xargs); go build && ./mtr-client