add DeviceApi

This commit is contained in:
2024-11-21 05:03:47 +01:00
parent 31ea9bf188
commit a0e8701de0
3 changed files with 47 additions and 1 deletions

11
CERTIFICATE.md Normal file
View File

@@ -0,0 +1,11 @@
# Generate Keystore
### Generate Keystores
```shell
keytool -genkeypair -alias <service> -keyalg RSA -keysize 2048 -validity 3650 -dname "CN=<domain>" -keypass <password> -keystore ./keys/<keystore>.p12 -storetype PKCS12 -storepass <password>
```
### Export the public certificate
```shell
keytool -export -alias <service> -keystore ./keys/<keystore>.p12 -storepass <password> -file ./keys/<domain>.cer -rfc
```

View File

@@ -50,13 +50,33 @@ JWT_PRIVATE_KEY: keys/private_key.pem
#### Volume #### 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. 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 ```text
volumes: volumes:
- ./keys/identity_private_key.pem:/app/resources/keys/private_key.pem - ./keys/identity_private_key.pem:/app/resources/keys/private_key.pem
``` ```
### Device API
Api for electronic devices. GitHub [Hlæja Device Data](https://github.com/swordsteel/hlaeja-device-api)
#### Environment
```text
SPRING_PROFILES_ACTIVE: docker
```
#### Volume
This will allow you to mount a local keystore `device_api_keystore.p12`, and local public key `identity_public_key.pem` into the container. Read `CERTIFICATE.md`, and `IDENTITY.md` for how to generate.
```text
volumes:
- ./keys/identity_public_key.pem:/app/resources/cert/public_key.pem
- ./keys/device_api_keystore.p12:/app/resources/cert/keystore.p12
```
## Databases ## Databases
### InfluxDB ### InfluxDB

View File

@@ -37,6 +37,21 @@ services:
# volumes: # volumes:
# - ./keys/identity_private_key.pem:/app/resources/keys/private_key.pem # - ./keys/identity_private_key.pem:/app/resources/keys/private_key.pem
device-api:
image: hlaeja-device-api:0.1.0-SNAPSHOT
container_name: DeviceApi
restart: unless-stopped
environment:
SPRING_PROFILES_ACTIVE: docker
networks:
- develop
ports:
- "9000:8443"
# # mount a local `identity_public_key.pem` into the container.
# volumes:
# - ./keys/identity_public_key.pem:/app/resources/cert/public_key.pem
# - ./keys/device_api_keystore.p12:/app/resources/cert/keystore.p12
influxdb: influxdb:
image: influxdb:2.7.10-alpine image: influxdb:2.7.10-alpine
container_name: InfluxDB container_name: InfluxDB