Skip to content

Commit 622b723

Browse files
author
faheem
committed
adding README
1 parent 827dccd commit 622b723

6 files changed

Lines changed: 126 additions & 10 deletions

File tree

.github/workflows/docker-milestone-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
path: basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker
4444
- name: submodel-registry-log-mongodb
4545
path: basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker
46+
- name: aas-digitaltwinregistry
47+
path: basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component
4648

4749
steps:
4850
- name: Checkout Code

.github/workflows/docker-snapshot-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
path: basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker
6060
- name: submodel-registry-log-mongodb
6161
path: basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker
62+
- name: aas-digitaltwinregistry
63+
path: basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component
6264

6365
steps:
6466
- name: Checkout Code
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# BaSyx Digital Twin Registry - Environment Configuration
2+
3+
## Overview
4+
This document describes the environment variables used to configure the BaSyx Digital Twin Registry application. The application supports multiple profiles with different storage backends.
5+
6+
---
7+
8+
## Configuration Files
9+
The application uses three YAML configuration files:
10+
11+
- `application.yml` - Base configuration
12+
- `application-InMemory.yml` - In-memory storage profile
13+
- `application-MongoDB.yml` - MongoDB storage profile
14+
15+
---
16+
17+
## Environment Variables
18+
19+
### Base Configuration (`application.yml`)
20+
21+
| Environment Variable | Default Value | Description |
22+
|-----------------------|---------------|-------------|
23+
| `SPRING_PROFILE` | MongoDB | Active Spring profile (`InMemory` or `MongoDB`) |
24+
| `LOGGING_LEVEL` | INFO | Logging level for root and BaSyx components |
25+
26+
---
27+
28+
### Server Configuration
29+
30+
| Property | Default Value | Description |
31+
|----------------|---------------|-------------|
32+
| `server.port` | 8081 | HTTP server port |
33+
34+
---
35+
36+
### CORS Configuration
37+
38+
| Property | Value | Description |
39+
|--------------------------------|-----------------------------------------------------|-------------|
40+
| `basyx.cors.allowed-methods` | GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD | Allowed HTTP methods |
41+
| `basyx.cors.allowed-origins` | * | Allowed origins (CORS) |
42+
43+
---
44+
45+
### Management Endpoints
46+
47+
| Property | Value | Description |
48+
|------------------------------------------|------------------------------|-------------|
49+
| `management.endpoints.web.exposure.include` | health,metrics,mappings | Exposed actuator endpoints |
50+
51+
---
52+
53+
### SpringDoc/Swagger Configuration
54+
55+
| Property | Value | Description |
56+
|-----------------------------------|--------------------|-------------|
57+
| `springdoc.api-docs.enabled` | true | Enable API documentation |
58+
| `springdoc.swagger-ui.enabled` | true | Enable Swagger UI |
59+
| `springdoc.swagger-ui.path` | /swagger-ui.html | Swagger UI path |
60+
| `springdoc.swagger-ui.csrf.enabled` | false | Disable CSRF protection for Swagger |
61+
62+
---
63+
64+
## InMemory Profile Configuration
65+
66+
**Profile Name:** `InMemory`
67+
68+
### Environment Variables
69+
_No additional environment variables required for InMemory profile._
70+
71+
### Configuration Properties
72+
73+
| Property | Value | Description |
74+
|---------------------|------------|-------------|
75+
| `basyx.backend` | InMemory | Use in-memory storage backend |
76+
| `registry.type` | InMemory | Registry type |
77+
| `registry.discovery.enabled` | true | Enable discovery service |
78+
79+
### Auto-configuration Exclusions
80+
The InMemory profile excludes MongoDB auto-configuration:
81+
82+
- `org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration`
83+
- `org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration`
84+
85+
---
86+
87+
## MongoDB Profile Configuration
88+
89+
**Profile Name:** `MongoDB`
90+
91+
### Environment Variables
92+
93+
| Environment Variable | Default Value | Description |
94+
|---------------------------|-----------------------------------------|-------------|
95+
| `AUTHENTICATION_DATABASE` | aasregistry | MongoDB authentication database name |
96+
| `DATABASE_HOST` | localhost | MongoDB host address |
97+
| `DATABASE_PORT` | localhost | MongoDB port (**Note:** should be a numeric port) |
98+
| `DATABASE_USERNAME` | smartsystemhub | MongoDB username |
99+
| `DATABASE_PASSWORD` | smartsystemshubdatabaseforfactoryX | MongoDB password |
100+
101+
### Configuration Properties
102+
103+
| Property | Value | Description |
104+
|---------------------|---------|-------------|
105+
| `basyx.backend` | MongoDB | Use MongoDB storage backend |
106+
| `registry.type` | MongoDB | Registry type |
107+
| `registry.discovery.enabled` | true | Enable discovery service |
108+
| `basyx.aasdiscoveryservice.mongodb.collectionName` | aasregistry | MongoDB collection name |

basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ ENV JAVA_OPTS=$JAVA_OPTS
66
ARG JAR_FILE=target/*.jar
77
COPY ${JAR_FILE} basyxExecutable.jar
88

9+
COPY src/main/resources/application.yml application.yml
10+
COPY src/main/resources/application-MongoDB.yml application-MongoDB.yml
11+
COPY src/main/resources/application-InMemory.yml application-InMemory.yml
12+
913
ARG PORT=8081
1014
ENV SERVER_PORT=${PORT}
1115
ARG CONTEXT_PATH=/

basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ spring:
44
on-profile: MongoDB
55
data:
66
mongodb:
7-
authentication-database: aasregistry
8-
database: aasregistry
9-
host: localhost
10-
port: 27017
11-
username: smartsystemhub
12-
password: smartsystemshubdatabaseforfactoryX
7+
authentication-database: ${AUTHENTICATION_DATABASE:aasregistry}
8+
database: ${AUTHENTICATION_DATABASE:aasregistry}
9+
host: ${DATABASE_HOST:localhost}
10+
port: ${DATABASE_PORT:localhost}
11+
username: ${DATABASE_USERNAME:smartsystemhub}
12+
password: ${DATABASE_PASSWORD:smartsystemshubdatabaseforfactoryX}
1313

1414
basyx:
1515
backend: MongoDB
1616
aasdiscoveryservice:
1717
mongodb:
18-
collectionName: aasregistry
18+
collectionName: ${AUTHENTICATION_DATABASE:aasregistry}
1919

2020

2121

basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ server:
1515

1616
spring:
1717
profiles:
18-
active: logEvents,MongoDB
18+
active: logEvents,${SPRING_PROFILE:MongoDB}
1919
main:
2020
allow-bean-definition-overriding: true
2121
application:
@@ -28,8 +28,8 @@ description:
2828

2929
logging:
3030
level:
31-
root: INFO
32-
org.eclipse.digitaltwin.basyx: INFO
31+
root: ${LOGGING_LEVEL:INFO}
32+
org.eclipse.digitaltwin.basyx: ${LOGGING_LEVEL:INFO}
3333

3434
springdoc:
3535
api-docs:

0 commit comments

Comments
 (0)