|
| 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 | |
0 commit comments