add DeviceRegistry

This commit is contained in:
2024-11-21 04:55:05 +01:00
parent e40360e9e1
commit 31ea9bf188
4 changed files with 54 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
.idea/
keys/

16
IDENTITY.md Normal file
View File

@@ -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
```

View File

@@ -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

View File

@@ -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