From cdcd1ba2a31fd45cb20667f0e5607a13f41e8a3f Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Wed, 8 Jan 2025 14:51:40 +0100 Subject: [PATCH 1/5] feat: make port configurable --- .../EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs | 4 +++- Infrastructure/EventBus/EventBusConfiguration.cs | 1 + .../EventBus/EventBusServiceCollectionExtensions.cs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs b/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs index 7e1e4763e6..15b0f4f1e0 100644 --- a/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs +++ b/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs @@ -21,7 +21,8 @@ public static void AddRabbitMq(this IServiceCollection services, Action Date: Wed, 8 Jan 2025 17:14:54 +0100 Subject: [PATCH 2/5] feat: enable SSL by default and add possibility to disable it --- .ci/appsettings.override.postgres.docker.json | 1 + .ci/appsettings.override.postgres.local.json | 1 + .ci/appsettings.override.sqlserver.docker.json | 1 + .ci/appsettings.override.sqlserver.local.json | 1 + .../RabbitMQServiceCollectionExtensions.cs | 18 +++++++++++++++--- .../EventBus/EventBusConfiguration.cs | 1 + .../EventBusServiceCollectionExtensions.cs | 1 + appsettings.override.json | 4 +++- .../adminui.appsettings.override.json | 1 + docker-compose/appsettings.override.json | 1 + 10 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.ci/appsettings.override.postgres.docker.json b/.ci/appsettings.override.postgres.docker.json index babee712d6..346c97be40 100644 --- a/.ci/appsettings.override.postgres.docker.json +++ b/.ci/appsettings.override.postgres.docker.json @@ -10,6 +10,7 @@ "EventBus": { "Vendor": "RabbitMQ", "ConnectionInfo": "rabbitmq", + "RabbitMQEnableSsl": false, "RabbitMQUsername": "guest", "RabbitMQPassword": "guest" }, diff --git a/.ci/appsettings.override.postgres.local.json b/.ci/appsettings.override.postgres.local.json index 4ec30a71cf..8c297fa75d 100644 --- a/.ci/appsettings.override.postgres.local.json +++ b/.ci/appsettings.override.postgres.local.json @@ -10,6 +10,7 @@ "EventBus": { "Vendor": "RabbitMQ", "ConnectionInfo": "localhost", + "RabbitMQEnableSsl": false, "RabbitMQUsername": "guest", "RabbitMQPassword": "guest" }, diff --git a/.ci/appsettings.override.sqlserver.docker.json b/.ci/appsettings.override.sqlserver.docker.json index 3d5bb6976f..820f41b081 100644 --- a/.ci/appsettings.override.sqlserver.docker.json +++ b/.ci/appsettings.override.sqlserver.docker.json @@ -10,6 +10,7 @@ "EventBus": { "Vendor": "RabbitMQ", "ConnectionInfo": "rabbitmq", + "RabbitMQEnableSsl": false, "RabbitMQUsername": "guest", "RabbitMQPassword": "guest" }, diff --git a/.ci/appsettings.override.sqlserver.local.json b/.ci/appsettings.override.sqlserver.local.json index 8a3cb3c8ca..b73d6fad82 100644 --- a/.ci/appsettings.override.sqlserver.local.json +++ b/.ci/appsettings.override.sqlserver.local.json @@ -10,6 +10,7 @@ "EventBus": { "Vendor": "RabbitMQ", "ConnectionInfo": "localhost", + "RabbitMQEnableSsl": false, "RabbitMQUsername": "guest", "RabbitMQPassword": "guest" }, diff --git a/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs b/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs index 15b0f4f1e0..7f3c253b2c 100644 --- a/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs +++ b/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/RabbitMQServiceCollectionExtensions.cs @@ -22,12 +22,23 @@ public static void AddRabbitMq(this IServiceCollection services, Action { LoadBasicBusOptions(configuration, options); + options.EnableSsl = configuration.RabbitMqEnableSsl; options.HostName = configuration.ConnectionInfo; options.Port = configuration.RabbitMqPort; options.Username = configuration.RabbitMqUsername; diff --git a/appsettings.override.json b/appsettings.override.json index 5460f32b20..1ac9ccf758 100644 --- a/appsettings.override.json +++ b/appsettings.override.json @@ -1,4 +1,4 @@ -{ +{ "RunMigrations": true, "Authentication": { "JwtSigningCertificate": "MIIJ7wIBAzCCCaUGCSqGSIb3DQEHAaCCCZYEggmSMIIJjjCCBAIGCSqGSIb3DQEHBqCCA/MwggPvAgEAMIID6AYJKoZIhvcNAQcBMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAiIVEGIEnzbyAICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEC1tOaulJJjkAl2W7xeF3G6AggOAm1VdXzAQ6MhHabp6+rzEuaAyBpuMi8zD8OEl8/xMv47UsFUor38aZjQd14qTTLz5MnksI/qgjQHLuMEmN1eWARsUBkeYvLuz0icl2q9A5Rn9CaKHIemQWq9mIobq3XnXhwDFEd+G/WgjNoK65Ndu20pnuc9LDlfq6fx2eXDbHAWLeUTnlQsEY4M/owNKIjlO/VsYJCshvEPlbtCnyzXwkrtQ5i2XufIJsfX0qoK/dXfoMVUjPxa/L8uR40bAWc1LVkvO0Ox4rY9VCtC1eHe3fcS48AaYCGRMpkZ7N+nDOb7lPs7BcxVoIrj/PkqiNI4rMOZVEgz21OWhueIjBv4gxfV+vW7IZ7xWvC1uUYIKEKEl6mk8KJ5zruO3tObX70+4saBiTNd/76+CVR4qCSwYcD7bZjpMOiaVFyxy0ay3dCwoivLK1jWNFJ25tngYpXKGCtOP0/Zi1fyseo4C54Ef5Yoo+BG3bkKR9VHChWzbB+b1p2lOwfBWIWlGjoZ+expyBjnk+FWrFDZeMknpW3PANCtcT/zqzqPKG3g4DAnSx9xDqvR7GBEgUlaUBAsCM3Nv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Cdez/ETJZWoodryUPdY3PFNa0xZOJvbtkiG2Vo55Rjq9wbd+MWAGcxhaCVEmEJ0UWWsn3Oe+h4mn3wT9+P+hkAR9duXT6tq+5DmKB2RD3fR3vIc4H5eLaIzOOmjSdfGFvIaj+06jS7SGicuKqF5ND4HPtXJrQgQUdO/gIHCkE9nn4hXCoz/bGkU4FN2WPz5TTMVsYuxMVp1I2UayoQppltkp3oaDb/S36FeO644d5zb7ARayF68NL5MrM/MRK24jhtx2WV4ZN9HIxJTAjBgkqhkiG9w0BCRUxFgQU/S6zDu6S3P4i1WdDz+j3esGxT4UwQTAxMA0GCWCGSAFlAwQCAQUABCCiOwVWGDHil8dA7XvoQNTLTJDm7EwdfGC4KJUV9smgUgQI4ZRrDNXXl8cCAggA", @@ -15,6 +15,8 @@ "Vendor": "RabbitMQ", // possible values: InMemory, RabbitMQ, GoogleCloud, Azure "ConnectionInfo": "localhost", + "RabbitMQEnableSsl": false, + "RabbitMQUsername": "guest", // only available for RabbitMQ "RabbitMQPassword": "guest", // only available for RabbitMQ "ConnectionRetryCount": 5, // only available for RabbitMQ diff --git a/docker-compose/adminui.appsettings.override.json b/docker-compose/adminui.appsettings.override.json index 671e472318..29e8eaddb4 100644 --- a/docker-compose/adminui.appsettings.override.json +++ b/docker-compose/adminui.appsettings.override.json @@ -12,6 +12,7 @@ "Vendor": "RabbitMQ", // possible values: InMemory, RabbitMQ, GoogleCloud, Azure "ConnectionInfo": "rabbitmq", + "RabbitMQEnableSsl": false, "RabbitMQUsername": "guest", // only available for RabbitMQ "RabbitMQPassword": "guest", // only available for RabbitMQ "ConnectionRetryCount": 5, // only available for RabbitMQ diff --git a/docker-compose/appsettings.override.json b/docker-compose/appsettings.override.json index 35ab93fc9f..582966ad3a 100644 --- a/docker-compose/appsettings.override.json +++ b/docker-compose/appsettings.override.json @@ -14,6 +14,7 @@ "Vendor": "RabbitMQ", // possible values: InMemory, RabbitMQ, GoogleCloud, Azure "ConnectionInfo": "rabbitmq", + "RabbitMQEnableSsl": false, "RabbitMQUsername": "guest", // only available for RabbitMQ "RabbitMQPassword": "guest", // only available for RabbitMQ "ConnectionRetryCount": 5, // only available for RabbitMQ From f27e831765b26ef2c967c99c1f0baed5fb67f077 Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Thu, 9 Jan 2025 08:37:30 +0100 Subject: [PATCH 3/5] fix: remove `*` from ingress path --- helm/templates/consumerapi/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/templates/consumerapi/ingress.yaml b/helm/templates/consumerapi/ingress.yaml index 4e7491e7ee..51ef8d980d 100644 --- a/helm/templates/consumerapi/ingress.yaml +++ b/helm/templates/consumerapi/ingress.yaml @@ -14,7 +14,7 @@ spec: - host: {{ .Values.consumerapi.ingress.hostnameOverride | default .Values.global.defaultHostname }} http: paths: - - path: "/*" + - path: "/" pathType: Prefix backend: service: From f92432c072c12cd90b159d217b25f4eb830b180e Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Thu, 9 Jan 2025 13:46:31 +0100 Subject: [PATCH 4/5] chore: add values to helm chart --- helm/values.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 2998c70448..b9ad4bc906 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -579,10 +579,14 @@ global: connectionInfo: "" # subscriptionClientName - the name of the subscription that should be used to receive events subscriptionClientName: "consumerapi" + # enableSsl - only applicable if Vendor is "RabbitMQ"; whether to use SSL to connect to the RabbitMQ service + rabbitMqEnableSsl: true + # rabbitMQPort - only applicable if Vendor is "RabbitMQ"; the port under which the RabbitMQ service is reachable + rabbitMqPort: 5672 # rabbitMQUsername - only applicable if Vendor is "RabbitMQ"; should be set via environment variable - rabbitMQUsername: "" + rabbitMqUsername: "" # rabbitMQPassword - only applicable if Vendor is "RabbitMQ"; should be set via environment variable - rabbitMQPassword: "" + rabbitMqPassword: "" # rabbitMqExchangeName - only applicable if Vendor is "RabbitMQ"; the name of the exchange that should be used rabbitMqExchangeName: "" # rabbitMqQueueName - only applicable if Vendor is "RabbitMQ"; the name of the queue the Consumer API should listen to From 649b4d5d9e97fea81b554fa7ce771f21d9f9fe67 Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Thu, 9 Jan 2025 14:03:29 +0100 Subject: [PATCH 5/5] chore: disable ssl in case of usage of builtin eventbus --- helm/templates/actualidentitydeletion/cronjob.yaml | 2 ++ helm/templates/adminui/deployment.yaml | 2 ++ helm/templates/cancelstaledeletionprocesses/cronjob.yaml | 2 ++ helm/templates/consumerapi/deployment.yaml | 2 ++ helm/templates/eventhandler/deployment.yaml | 2 ++ helm/templates/sendidentitydeletionreminders/cronjob.yaml | 2 ++ helm/templates/sseserver/deployment.yaml | 2 ++ 7 files changed, 14 insertions(+) diff --git a/helm/templates/actualidentitydeletion/cronjob.yaml b/helm/templates/actualidentitydeletion/cronjob.yaml index 3159952c95..1f45874b22 100644 --- a/helm/templates/actualidentitydeletion/cronjob.yaml +++ b/helm/templates/actualidentitydeletion/cronjob.yaml @@ -56,6 +56,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername diff --git a/helm/templates/adminui/deployment.yaml b/helm/templates/adminui/deployment.yaml index 013f3479ca..c48883e72f 100644 --- a/helm/templates/adminui/deployment.yaml +++ b/helm/templates/adminui/deployment.yaml @@ -84,6 +84,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername diff --git a/helm/templates/cancelstaledeletionprocesses/cronjob.yaml b/helm/templates/cancelstaledeletionprocesses/cronjob.yaml index a2d752c1f2..6159c31f8c 100644 --- a/helm/templates/cancelstaledeletionprocesses/cronjob.yaml +++ b/helm/templates/cancelstaledeletionprocesses/cronjob.yaml @@ -56,6 +56,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername diff --git a/helm/templates/consumerapi/deployment.yaml b/helm/templates/consumerapi/deployment.yaml index d8373ad24a..150def71d4 100644 --- a/helm/templates/consumerapi/deployment.yaml +++ b/helm/templates/consumerapi/deployment.yaml @@ -68,6 +68,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername diff --git a/helm/templates/eventhandler/deployment.yaml b/helm/templates/eventhandler/deployment.yaml index 0cbe1eb23b..546015dba2 100644 --- a/helm/templates/eventhandler/deployment.yaml +++ b/helm/templates/eventhandler/deployment.yaml @@ -58,6 +58,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername diff --git a/helm/templates/sendidentitydeletionreminders/cronjob.yaml b/helm/templates/sendidentitydeletionreminders/cronjob.yaml index 95d0b32a63..377da68152 100644 --- a/helm/templates/sendidentitydeletionreminders/cronjob.yaml +++ b/helm/templates/sendidentitydeletionreminders/cronjob.yaml @@ -56,6 +56,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername diff --git a/helm/templates/sseserver/deployment.yaml b/helm/templates/sseserver/deployment.yaml index 9439ea7e2d..b78598aaa6 100644 --- a/helm/templates/sseserver/deployment.yaml +++ b/helm/templates/sseserver/deployment.yaml @@ -69,6 +69,8 @@ spec: {{- if .Values.global.useBuiltInEventbus }} - name: infrastructure__eventBus__vendor value: RabbitMQ + - name: infrastructure__eventBus__rabbitMqEnableSsl + value: "false" - name: infrastructure__eventBus__connectionInfo value: "rabbitmq" - name: infrastructure__eventBus__rabbitMQUsername