diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/src/main/resources/application.properties b/basyx.aasenvironment/basyx.aasenvironment.component/src/main/resources/application.properties index 723812d02..d4a4699a6 100644 --- a/basyx.aasenvironment/basyx.aasenvironment.component/src/main/resources/application.properties +++ b/basyx.aasenvironment/basyx.aasenvironment.component/src/main/resources/application.properties @@ -3,6 +3,15 @@ spring.application.name=AAS Environment basyx.backend = InMemory +#basyx.backend = MongoDB +#spring.data.mongodb.host=mongo +# or spring.data.mongodb.host=127.0.0.1 +#spring.data.mongodb.port=27017 +#spring.data.mongodb.database=aasenvironments +#spring.data.mongodb.authentication-database=admin +#spring.data.mongodb.username=mongoAdmin +#spring.data.mongodb.password=mongoPassword + # basyx.aasrepository.feature.mqtt.enabled = true # mqtt.clientId=TestClient diff --git a/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBAasRepository.java b/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBAasRepository.java index 186aaeae5..bbc79089a 100644 --- a/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBAasRepository.java +++ b/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBAasRepository.java @@ -50,7 +50,7 @@ public class TestMongoDBAasRepository extends AasRepositorySuite { @Override protected AasRepositoryFactory getAasRepositoryFactory() { - String connectionURL = "mongodb://127.0.0.1:27017/"; + String connectionURL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/"; MongoClient client = MongoClients.create(connectionURL); MongoTemplate template = new MongoTemplate(client, "BaSyxTestDb"); diff --git a/basyx.aasrepository/basyx.aasrepository.component/src/main/resources/application.properties b/basyx.aasrepository/basyx.aasrepository.component/src/main/resources/application.properties index 5889f5b2a..cd3d3b524 100644 --- a/basyx.aasrepository/basyx.aasrepository.component/src/main/resources/application.properties +++ b/basyx.aasrepository/basyx.aasrepository.component/src/main/resources/application.properties @@ -4,12 +4,13 @@ spring.application.name=AAS Repository basyx.backend = InMemory -# basyx.backend = MongoDB -#spring.data.mongodb.host=localhost +#basyx.backend = MongoDB +#spring.data.mongodb.host=127.0.0.1 #spring.data.mongodb.port=27017 #spring.data.mongodb.database=aas -#spring.data.mongodb.username=admin -#spring.data.mongodb.password=password +#spring.data.mongodb.authentication-database=admin +#spring.data.mongodb.username=mongoAdmin +#spring.data.mongodb.password=mongoPassword # basyx.aasrepository.feature.mqtt.enabled = true diff --git a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBConceptDescriptionRepository.java b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBConceptDescriptionRepository.java index 2ed9d2b4c..cbe129796 100644 --- a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBConceptDescriptionRepository.java +++ b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/TestMongoDBConceptDescriptionRepository.java @@ -121,7 +121,7 @@ private ConceptDescription createDummyConceptDescriptionOnRepo(ConceptDescriptio } private MongoTemplate createTemplate() { - String connectionURL = "mongodb://127.0.0.1:27017/"; + String connectionURL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/"; MongoClient client = MongoClients.create(connectionURL); MongoTemplate template = new MongoTemplate(client, "BaSyxTestDb"); diff --git a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/src/main/resources/application.properties b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/src/main/resources/application.properties index 2ee452881..824fef9e8 100644 --- a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/src/main/resources/application.properties +++ b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/src/main/resources/application.properties @@ -1,15 +1,19 @@ server.port=8081 - spring.application.name=Concept Description Repository basyx.backend = InMemory -# basyx.backend = MongoDB -#spring.data.mongodb.host=localhost +#basyx.backend = MongoDB +#spring.data.mongodb.host=127.0.0.1 +##or spring.data.mongodb.host=127.0.0.1 #spring.data.mongodb.port=27017 -#spring.data.mongodb.database=aas -#spring.data.mongodb.username=admin -#spring.data.mongodb.password=password +#spring.data.mongodb.database=concepts +#spring.data.mongodb.authentication-database=admin +#spring.data.mongodb.username=mongoAdmin +#spring.data.mongodb.password=mongoPassword + +#alternative +#spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@localhost:27017/?authMechanism=DEFAULT # Base Path for Spring Boot Actuator management.endpoints.web.base-path=/ diff --git a/basyx.submodelrepository/basyx.submodelrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/TestMongoDBSubmodelRepository.java b/basyx.submodelrepository/basyx.submodelrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/TestMongoDBSubmodelRepository.java index 6a7499182..80eb79933 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/TestMongoDBSubmodelRepository.java +++ b/basyx.submodelrepository/basyx.submodelrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/TestMongoDBSubmodelRepository.java @@ -37,7 +37,7 @@ public class TestMongoDBSubmodelRepository extends SubmodelRepositorySuite { private final String COLLECTION = "submodelTestCollection"; - private final String CONNECTION_URL = "mongodb://127.0.0.1:27017/"; + private final String CONNECTION_URL = "mongodb://mongoAdmin:mongoPassword@localhost:27017"; private final MongoClient CLIENT = MongoClients.create(CONNECTION_URL); private final MongoTemplate TEMPLATE = new MongoTemplate(CLIENT, "BaSyxTestDb"); private final InMemorySubmodelServiceFactory SUBMODEL_SERVICE_FACTORY = new InMemorySubmodelServiceFactory(); diff --git a/basyx.submodelrepository/basyx.submodelrepository.component/src/main/resources/application.properties b/basyx.submodelrepository/basyx.submodelrepository.component/src/main/resources/application.properties index ab83ca4dd..691e2a0df 100644 --- a/basyx.submodelrepository/basyx.submodelrepository.component/src/main/resources/application.properties +++ b/basyx.submodelrepository/basyx.submodelrepository.component/src/main/resources/application.properties @@ -3,12 +3,14 @@ server.port=8081 spring.application.name=Submodel Repository basyx.backend = InMemory -# basyx.backend = MongoDB -#spring.data.mongodb.host=localhost +#basyx.backend = MongoDB +#spring.data.mongodb.host=mongo +# or spring.data.mongodb.host=127.0.0.1 #spring.data.mongodb.port=27017 -#spring.data.mongodb.database=aas -#spring.data.mongodb.username=admin -#spring.data.mongodb.password=password +#spring.data.mongodb.database=submodels +#spring.data.mongodb.authentication-database=admin +#spring.data.mongodb.username=mongoAdmin +#spring.data.mongodb.password=mongoPassword # basyx.submodelrepository.feature.mqtt.enabled = true # mqtt.clientId=TestClient diff --git a/docker-compose.yml b/docker-compose.yml index 977670e3b..4a9d517bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,10 +3,10 @@ services: mongo: image: mongo:5.0.10 # Provide mongo config + restart: always environment: - ME_CONFIG_MONGODB_ADMINUSERNAME: admin - ME_CONFIG_MONGODB_ADMINPASSWORD: admin - ME_CONFIG_MONGODB_URL: mongodb://admin:admin@mongo:27017/ + MONGO_INITDB_ROOT_USERNAME: mongoAdmin + MONGO_INITDB_ROOT_PASSWORD: mongoPassword # Set health checks to wait until mongo has started healthcheck: test: mongo @@ -19,7 +19,6 @@ services: networks: - basyx-java-server-sdk - networks: basyx-java-server-sdk: name: basyx-java-server-sdk diff --git a/examples/aas-env.properties b/examples/aas-env.properties index 93cb44075..bf041f9eb 100644 --- a/examples/aas-env.properties +++ b/examples/aas-env.properties @@ -1,7 +1,7 @@ server.port=8081 basyx.backend = MongoDB -spring.data.mongodb.uri=mongodb://mongo:27017/aas +spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@mongo:27017/?authMechanism=DEFAULT #basyx.aasrepository.feature.mqtt.enabled = true mqtt.clientId=AAS-Env-Example-8081 diff --git a/examples/aas-repo.properties b/examples/aas-repo.properties index d536d8e1a..6a650a9c8 100644 --- a/examples/aas-repo.properties +++ b/examples/aas-repo.properties @@ -1,7 +1,7 @@ server.port=8082 basyx.backend = MongoDB -spring.data.mongodb.uri=mongodb://mongo:27017/aas +spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@localhost:27017/?authMechanism=DEFAULT #basyx.aasrepository.feature.mqtt.enabled = true mqtt.clientId=AAS-Repo-Example-8082 diff --git a/examples/cd-repo.properties b/examples/cd-repo.properties new file mode 100644 index 000000000..da620a909 --- /dev/null +++ b/examples/cd-repo.properties @@ -0,0 +1,16 @@ +server.port=8081 + +spring.application.name=Concept Description Repository + + + +basyx.backend = MongoDB +spring.data.mongodb.host=mongo +spring.data.mongodb.port=27017 +spring.data.mongodb.database=concepts +spring.data.mongodb.authentication-database=admin +spring.data.mongodb.username=mongoAdmin +spring.data.mongodb.password=mongoPassword + +# Base Path for Spring Boot Actuator +management.endpoints.web.base-path=/ \ No newline at end of file diff --git a/examples/docker-compose-cd-repo.yml b/examples/docker-compose-cd-repo.yml new file mode 100644 index 000000000..93019078d --- /dev/null +++ b/examples/docker-compose-cd-repo.yml @@ -0,0 +1,20 @@ +version: "3.9" +services: + cd-repo: + # get the image from dockerhub + image: eclipsebasyx/conceptdescription-repository:2.0.0-SNAPSHOT + # if you already build it locally, you can use your local image + # image: basyx.conceptdescriptionrepository.component:latest + # for manual local build `mvn clean install -DskipTests` + # then navigate to `basyx.conceptdescriptionrepository>component` + # build it with `docker build -t basyx.conceptdescriptionrepository.component . + volumes: + - ./cd-repo.properties:/application/application.properties + ports: + - 8081:8081 + networks: + - basyx-java-server-sdk + +networks: + basyx-java-server-sdk: + external: true diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 1c1740a07..faf4145a8 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -3,7 +3,7 @@ services: ############################################################################## ############################################################################## ### -### Do forget to start docker-compose in basyx.parent to get a running mongodb +### Do not forget to start docker-compose in basyx.parent to get a running mongodb ### ############################################################################## ##############################################################################