From e3b0941e1ea12dcff589118c01031daa29a038ee Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Sat, 14 Sep 2024 01:28:11 +0400
Subject: [PATCH] Updated deps

---
 .docker/docker-compose.yml        |  2 ++
 dbrepo-search-service/init/app.py | 14 ++++++-------
 docker-compose.yml                |  2 ++
 helm/dbrepo/README.md             | 15 +++++++-------
 helm/dbrepo/values.schema.json    | 33 +++++++++++--------------------
 helm/dbrepo/values.yaml           |  3 +++
 make/rel.mk                       |  4 ++++
 7 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml
index 48cae8cba4..8c01cf618d 100644
--- a/.docker/docker-compose.yml
+++ b/.docker/docker-compose.yml
@@ -353,6 +353,8 @@ services:
     depends_on:
       dbrepo-search-db:
         condition: service_healthy
+      dbrepo-metadata-service:
+        condition: service_healthy
     logging:
       driver: json-file
 
diff --git a/dbrepo-search-service/init/app.py b/dbrepo-search-service/init/app.py
index fccbd92fea..ed360e4128 100644
--- a/dbrepo-search-service/init/app.py
+++ b/dbrepo-search-service/init/app.py
@@ -6,6 +6,7 @@ from typing import List
 import opensearchpy.exceptions
 from dbrepo.RestClient import RestClient
 from logging.config import dictConfig
+from pathlib import Path
 
 from dbrepo.api.dto import Database
 from opensearchpy import OpenSearch
@@ -48,11 +49,11 @@ class App:
     search_instance: OpenSearch = None
 
     def __init__(self):
-        self.metadata_service_endpoint = os.getenv("METADATA_SERVICE_ENDPOINT")
-        self.search_host = os.getenv("OPENSEARCH_HOST")
-        self.search_port = int(os.getenv("OPENSEARCH_PORT"))
-        self.search_username = os.getenv("OPENSEARCH_USERNAME")
-        self.search_password = os.getenv("OPENSEARCH_PASSWORD")
+        self.metadata_service_endpoint = os.getenv("METADATA_SERVICE_ENDPOINT", "http://metadata-service:8080")
+        self.search_host = os.getenv("OPENSEARCH_HOST", "search-db")
+        self.search_port = int(os.getenv("OPENSEARCH_PORT", "9200"))
+        self.search_username = os.getenv("OPENSEARCH_USERNAME", "admin")
+        self.search_password = os.getenv("OPENSEARCH_PASSWORD", "admin")
 
     def _instance(self) -> OpenSearch:
         """
@@ -109,8 +110,7 @@ class App:
         return databases
 
     def save_databases(self, databases: List[Database]):
-        logging.debug(
-            f"save {len(databases)} database(s)")
+        logging.debug(f"save {len(databases)} database(s)")
         for doc in databases:
             doc: Database = doc
             try:
diff --git a/docker-compose.yml b/docker-compose.yml
index 96fb14f995..3fc6b972b1 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -410,6 +410,8 @@ services:
     depends_on:
       dbrepo-search-db:
         condition: service_healthy
+      dbrepo-metadata-service:
+        condition: service_healthy
     logging:
       driver: json-file
 
diff --git a/helm/dbrepo/README.md b/helm/dbrepo/README.md
index 294fda6477..53d920f47e 100644
--- a/helm/dbrepo/README.md
+++ b/helm/dbrepo/README.md
@@ -74,7 +74,7 @@ The command removes all the Kubernetes components associated with the chart and
 | `metadatadb.galera.mariabackup.user`     | The database backup username.                                    | `backup`      |
 | `metadatadb.galera.mariabackup.password` | The database backup user password                                | `backup`      |
 | `metadatadb.jdbcExtraArgs`               | The extra arguments for JDBC connections in the microservices.   | `""`          |
-| `metadatadb.initdbScripts`               | Additional init.db scripts that are executed on the first start. | `{}`          |
+| `metadatadb.extraInitDbScripts`          | Additional init.db scripts that are executed on the first start. | `{}`          |
 | `metadatadb.replicaCount`                | The number of cluster nodes, should be uneven i.e. 2n+1          | `3`           |
 | `metadatadb.persistence.enabled`         | Enable persistent storage.                                       | `true`        |
 
@@ -85,8 +85,6 @@ The command removes all the Kubernetes components associated with the chart and
 | `authservice.enabled`            | Enable the Auth Service.                                     | `true`                                                                                                                                                                                                                                                                                                                                                                                                     |
 | `authservice.image.debug`        | Set the logging level to `trace`. Otherwise, set to `info`.  | `false`                                                                                                                                                                                                                                                                                                                                                                                                    |
 | `authservice.endpoint`           | The hostname for the microservices.                          | `http://auth-service`                                                                                                                                                                                                                                                                                                                                                                                      |
-| `authservice.auth.adminUser`     | The admin username.                                          | `fda`                                                                                                                                                                                                                                                                                                                                                                                                      |
-| `authservice.auth.adminPassword` | The admin user password.                                     | `fda`                                                                                                                                                                                                                                                                                                                                                                                                      |
 | `authservice.jwt.pubkey`         | The JWT public key from the `dbrepo-client`.                 | `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB` |
 | `authservice.tls.enabled`        | Enable TLS/SSL communication. Required for HTTPS.            | `true`                                                                                                                                                                                                                                                                                                                                                                                                     |
 | `authservice.tls.existingSecret` | The secret containing the `tls.crt`, `tls.key` and `ca.crt`. | `ingress-cert`                                                                                                                                                                                                                                                                                                                                                                                             |
@@ -137,7 +135,7 @@ The command removes all the Kubernetes components associated with the chart and
 | `brokerservice.ldap.binddn`         | The domain name the broker service should bind to. In many cases this is the admin user from `identityservice.global.adminUser`. | `cn=admin,dc=dbrepo,dc=at`                                                   |
 | `brokerservice.ldap.bindpw`         | The password to bind on the identity service. In many cases this value is equal to `identityservice.global.adminPassword`.       | `admin`                                                                      |
 | `brokerservice.ldap.uidField`       | The field containing the user id.                                                                                                | `uid`                                                                        |
-| `brokerservice.ldap.basedn`         | The base domain name containing the users.                                                                                       | `ou=users,dc=dbrepo,dc=at`                                                   |
+| `brokerservice.ldap.basedn`         | The base domain name containing the users.                                                                                       | `dc=dbrepo,dc=at`                                                            |
 | `brokerservice.ldap.userDnPattern`  | The pattern to determine the user.                                                                                               | `${username}`                                                                |
 | `brokerservice.extraPlugins`        | The list of plugins to be activated.                                                                                             | `rabbitmq_prometheus rabbitmq_auth_backend_ldap rabbitmq_auth_mechanism_ssl` |
 | `brokerservice.persistence.enabled` | If set to true, a PVC will be created.                                                                                           | `false`                                                                      |
@@ -178,7 +176,7 @@ The command removes all the Kubernetes components associated with the chart and
 | `metadataservice.podSecurityContext.sysctls`                        | Set kernel settings using the sysctl interface                                     | `[]`                             |
 | `metadataservice.podSecurityContext.supplementalGroups`             | Set filesystem extra groups                                                        | `[]`                             |
 | `metadataservice.podSecurityContext.fsGroup`                        | Set RabbitMQ pod's Security Context fsGroup                                        | `1001`                           |
-| `metadataservice.containerSecurityContext.enabled`                  | Enabled containers' Security Context                                               | `true`                           |
+| `metadataservice.containerSecurityContext.enabled`                  | Enable containers' Security Context                                                | `true`                           |
 | `metadataservice.containerSecurityContext.seLinuxOptions`           | Set SELinux options in container                                                   | `{}`                             |
 | `metadataservice.containerSecurityContext.runAsUser`                | Set RabbitMQ containers' Security Context runAsUser                                | `1001`                           |
 | `metadataservice.containerSecurityContext.runAsGroup`               | Set RabbitMQ containers' Security Context runAsGroup                               | `1001`                           |
@@ -271,6 +269,7 @@ The command removes all the Kubernetes components associated with the chart and
 | Name                                          | Description                                                                            | Value            |
 | --------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------- |
 | `storageservice.enabled`                      | Enable the Storage Service.                                                            | `true`           |
+| `storageservice.mariadb.auth.rootPassword`    | The user password for the root user.                                                   | `seaweedfsdb`    |
 | `storageservice.filer.enabled`                | Enable the storage service filer which is required for S3.                             | `true`           |
 | `storageservice.s3.replicaCount`              | The number of replicas.                                                                | `2`              |
 | `storageservice.s3.bucket`                    | The S3-bucket name.                                                                    | `dbrepo`         |
@@ -321,10 +320,10 @@ The command removes all the Kubernetes components associated with the chart and
 | `ui.public.icon`                                       | The user interface icon.                                                                             | `/favicon.ico`          |
 | `ui.public.touch`                                      | The user interface apple touch icon.                                                                 | `/apple-touch-icon.png` |
 | `ui.public.broker.host`                                | The displayed broker hostname.                                                                       | `example.com`           |
-| `ui.public.broker.port.5671`                           | Enable display of the broker 5671 port and mark it as secure (SSL/TLS).                              | `true`                  |
-| `ui.public.broker.port.5672`                           | Enable display of the broker 5672 port and mark it as insecure (no SSL/TLS).                         | `false`                 |
+| `ui.public.broker.port.5671`                           | Enable display of the broker 5671 port and mark it as secure (SSL/TLS).                              | `false`                 |
+| `ui.public.broker.port.5672`                           | Enable display of the broker 5672 port and mark it as insecure (no SSL/TLS).                         | `true`                  |
 | `ui.public.broker.extra`                               | Extra metadata displayed.                                                                            | `""`                    |
-| `ui.public.database.extra`                             | Extra metadata displayed.                                                                            | `128.130.0.0/15`        |
+| `ui.public.database.extra`                             | Extra metadata displayed.                                                                            | `""`                    |
 | `ui.public.pid.default.publisher`                      | The default dataset publisher for persisted identifiers.                                             | `Example University`    |
 | `ui.public.doi.enabled`                                | Enable the display that DOIs are minted.                                                             | `false`                 |
 | `ui.public.doi.endpoint`                               | The DOI proxy.                                                                                       | `https://doi.org`       |
diff --git a/helm/dbrepo/values.schema.json b/helm/dbrepo/values.schema.json
index 843f7e7991..d178a430f2 100644
--- a/helm/dbrepo/values.schema.json
+++ b/helm/dbrepo/values.schema.json
@@ -132,17 +132,6 @@
         },
         "authservice": {
             "properties": {
-                "auth": {
-                    "properties": {
-                        "adminPassword": {
-                            "type": "string"
-                        },
-                        "adminUser": {
-                            "type": "string"
-                        }
-                    },
-                    "type": "object"
-                },
                 "client": {
                     "properties": {
                         "id": {
@@ -1042,6 +1031,10 @@
                 "enabled": {
                     "type": "boolean"
                 },
+                "extraInitDbScripts": {
+                    "properties": {},
+                    "type": "object"
+                },
                 "fullnameOverride": {
                     "type": "string"
                 },
@@ -1064,10 +1057,6 @@
                 "host": {
                     "type": "string"
                 },
-                "initdbScripts": {
-                    "properties": {},
-                    "type": "object"
-                },
                 "initdbScriptsConfigMap": {
                     "type": "string"
                 },
@@ -1333,12 +1322,6 @@
                 },
                 "security": {
                     "properties": {
-                        "adminPassword": {
-                            "type": "string"
-                        },
-                        "adminUsername": {
-                            "type": "string"
-                        },
                         "enabled": {
                             "type": "boolean"
                         }
@@ -1517,6 +1500,14 @@
                 },
                 "mariadb": {
                     "properties": {
+                        "auth": {
+                            "properties": {
+                                "rootPassword": {
+                                    "type": "string"
+                                }
+                            },
+                            "type": "object"
+                        },
                         "enabled": {
                             "type": "boolean"
                         },
diff --git a/helm/dbrepo/values.yaml b/helm/dbrepo/values.yaml
index 846e27ebc2..30565f66f4 100644
--- a/helm/dbrepo/values.yaml
+++ b/helm/dbrepo/values.yaml
@@ -649,6 +649,9 @@ storageservice:
     fullnameOverride: storage-service-db
     ## @skip storageservice.mariadb.enabled
     enabled: true
+    auth:
+      ## @param storageservice.mariadb.auth.rootPassword The user password for the root user.
+      rootPassword: seaweedfsdb
   master:
     ## @skip storageservice.master.enabled
     enabled: true
diff --git a/make/rel.mk b/make/rel.mk
index 97aeca4e16..1d24df1b77 100644
--- a/make/rel.mk
+++ b/make/rel.mk
@@ -25,3 +25,7 @@ release-images: tag-images ## Release the docker images.
 	docker push "${REPOSITORY_URL}/search-service:${APP_VERSION}"
 	docker push "${REPOSITORY_URL}/search-service-init:${APP_VERSION}"
 	docker push "${REPOSITORY_URL}/storage-service-init:${APP_VERSION}"
+
+.PHONY: release-helm
+release-helm: gen-helm-doc ## Release the Helm chart.
+	helm push ./build/dbrepo-${CHART_VERSION}.tgz oci://registry.datalab.tuwien.ac.at/dbrepo/dbrepo/helm
\ No newline at end of file
-- 
GitLab