From 31ea9bf18854e2ddeddcc8572cb6d3e186173baf Mon Sep 17 00:00:00 2001 From: Swordsteel Date: Thu, 21 Nov 2024 04:55:05 +0100 Subject: [PATCH] add DeviceRegistry --- .gitignore | 1 + IDENTITY.md | 16 ++++++++++++++++ README.md | 22 ++++++++++++++++++++++ compose.yml | 16 +++++++++++++++- 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 IDENTITY.md diff --git a/.gitignore b/.gitignore index 9f11b75..de9d177 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea/ +keys/ diff --git a/IDENTITY.md b/IDENTITY.md new file mode 100644 index 0000000..91752ac --- /dev/null +++ b/IDENTITY.md @@ -0,0 +1,16 @@ +# Generate Private and Public RSA Key + +OpenSSL Project is dedicated to providing a simple installation of OpenSSL for Microsoft Windows. +[Download](https://slproweb.com/products/Win32OpenSSL.html) + +Generate an RSA private key, of size 2048, and output it to a file named `identity_private_key.pem` in to `./keys` + +```shell +openssl genrsa -out identity_private_key.pem 2048 +``` + +Extract the public key from `identity_private_key.pem` from `./keys`, and output it to a file named `identity_public_key.pem` in to `./keys` + +```shell +openssl rsa -in identity_private_key.pem -pubout -out identity_public_key.pem +``` diff --git a/README.md b/README.md index f707b75..adce94a 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,28 @@ SPRING_PROFILES_ACTIVE: docker INFLUXDB_TOKEN: influxdbToken== ``` +### Device Registry + +Store device information. GitHub [Hlæja Device Data](https://github.com/swordsteel/hlaeja-device-registry) + +#### Environment + +```text +SPRING_R2DBC_URL: r2dbc:postgresql://localhost:5432/device_registry +SPRING_R2DBC_USERBAME: services +SPRING_R2DBC_PASSWORD: password +JWT_PRIVATE_KEY: keys/private_key.pem +``` + +#### Volume + +This will allow you to mount a local private key `identity_private_key.pem` into the container. read `IDENTITY.md` for how to generate. + +```text +volumes: + - ./keys/identity_private_key.pem:/app/resources/keys/private_key.pem +``` + ## Databases ### InfluxDB diff --git a/compose.yml b/compose.yml index 89c8d7c..2a72596 100644 --- a/compose.yml +++ b/compose.yml @@ -12,7 +12,7 @@ volumes: services: device-data: - image: hlaeja-device-data:0.1.0 + image: hlaeja-device-data:0.1.0-SNAPSHOT container_name: DeviceData restart: unless-stopped environment: @@ -23,6 +23,20 @@ services: ports: - "9020:8080" + device-registry: + image: hlaeja-device-registry:0.1.0-SNAPSHOT + container_name: DeviceRegistry + restart: unless-stopped + environment: + SPRING_PROFILES_ACTIVE: docker + networks: + - develop + ports: + - "9010:8080" +# # mount a local `identity_private_key.pem` into the container. +# volumes: +# - ./keys/identity_private_key.pem:/app/resources/keys/private_key.pem + influxdb: image: influxdb:2.7.10-alpine container_name: InfluxDB