Skip to content
Snippets Groups Projects
Verified Commit 5bcafbd8 authored by Martin Weise's avatar Martin Weise
Browse files

Updated stuff

parent 2032deca
No related branches found
No related tags found
1 merge request!405Forgot to push the dashboard-ui
Showing
with 967 additions and 902 deletions
......@@ -13,9 +13,9 @@ services:
restart: "no"
container_name: dbrepo-metadata-db
hostname: metadata-db
image: docker.io/bitnami/mariadb-galera:11.3.2-debian-12-r9
image: docker.io/mariadb:11.3.2
volumes:
- metadata-db-data:/bitnami/mariadb
- metadata-db-data:/var/lib/mysql
- ./config/1_setup-schema.sql:/docker-entrypoint-initdb.d/1_setup-schema.sql
- ./config/2_setup-data.sql:/docker-entrypoint-initdb.d/2_setup-data.sql
ports:
......@@ -23,9 +23,8 @@ services:
environment:
MARIADB_DATABASE: "${METADATA_DB:-dbrepo}"
MARIADB_ROOT_PASSWORD: "${METADATA_DB_PASSWORD:-dbrepo}"
MARIADB_GALERA_MARIABACKUP_PASSWORD: "${METADATA_DB_BACKUP_PASSWORD:-dbrepobackup}"
healthcheck:
test: mysqladmin ping --user=root --password="${METADATA_DB_PASSWORD:-dbrepo}" --silent
test: ./usr/local/bin/healthcheck.sh --connect --innodb_initialized
interval: 10s
timeout: 5s
retries: 12
......@@ -36,18 +35,18 @@ services:
restart: "no"
container_name: dbrepo-data-db
hostname: data-db
image: docker.io/bitnami/mariadb-galera:11.3.2-debian-12-r9
image: docker.io/mariadb:11.3.2
volumes:
- data-db-data:/bitnami/mariadb
- data-db-data:/var/lib/mysql
- ./config/1_grant-user.sql:/docker-entrypoint-initdb.d/1_grant-user.sql
ports:
- "3307:3306"
environment:
MARIADB_GALERA_MARIABACKUP_PASSWORD: "${DATA_DB_BACKUP_PASSWORD:-dbrepobackup}"
MARIADB_PASSWORD: "${READONLY_PASSWORD:-user}"
MARIADB_ROOT_PASSWORD: "${DATA_DB_PASSWORD:-dbrepo}"
MARIADB_USER: "${READONLY_USERNAME:-user}"
healthcheck:
test: mysqladmin ping --user=root --password="${DATA_DB_PASSWORD:-dbrepo}" --silent
test: ./usr/local/bin/healthcheck.sh --connect --innodb_initialized
interval: 10s
timeout: 5s
retries: 12
......@@ -119,14 +118,13 @@ services:
container_name: dbrepo-auth-service-init
image: registry.datalab.tuwien.ac.at/dbrepo/auth-service-init:1.8.0
environment:
AUTH_SERVICE_ADMIN: ${AUTH_SERVICE_ADMIN:-admin}
AUTH_SERVICE_ADMIN_PASSWORD: ${AUTH_SERVICE_ADMIN_PASSWORD:-admin}
AUTH_SERVICE_ENDPOINT: ${AUTH_SERVICE_ENDPOINT:-http://auth-service:8080}
METADATA_DB: "${METADATA_DB:-dbrepo}"
METADATA_DB_PASSWORD: "${METADATA_DB_PASSWORD:-dbrepo}"
METADATA_USERNAME: "root"
READONLY_USERNAME: "${READONLY_USERNAME:-user}"
SYSTEM_USERNAME: "${SYSTEM_USERNAME:-admin}"
SYSTEM_PASSWORD: ${SYSTEM_PASSWORD:-admin}
depends_on:
dbrepo-auth-service:
condition: service_healthy
......@@ -145,8 +143,6 @@ services:
environment:
ADMIN_EMAIL: "${ADMIN_EMAIL:-noreply@localhost}"
ANALYSE_SERVICE_ENDPOINT: "${ANALYSE_SERVICE_ENDPOINT:-http://analyse-service:8080}"
AUTH_SERVICE_ADMIN: ${AUTH_SERVICE_ADMIN:-admin}
AUTH_SERVICE_ADMIN_PASSWORD: ${AUTH_SERVICE_ADMIN_PASSWORD:-admin}
AUTH_SERVICE_CLIENT: ${AUTH_SERVICE_CLIENT:-dbrepo-client}
AUTH_SERVICE_CLIENT_SECRET: ${AUTH_SERVICE_CLIENT_SECRET:-MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG}
AUTH_SERVICE_ENDPOINT: ${AUTH_SERVICE_ENDPOINT:-http://auth-service:8080}
......@@ -477,8 +473,6 @@ services:
hostname: data-service
image: registry.datalab.tuwien.ac.at/dbrepo/data-service:1.8.0
environment:
AUTH_SERVICE_ADMIN: "${AUTH_SERVICE_ADMIN:-admin}"
AUTH_SERVICE_ADMIN_PASSWORD: "${AUTH_SERVICE_ADMIN_PASSWORD:-admin}"
AUTH_SERVICE_CLIENT: "${AUTH_SERVICE_CLIENT:-dbrepo-client}"
AUTH_SERVICE_CLIENT_SECRET: "${AUTH_SERVICE_CLIENT:-MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG}"
AUTH_SERVICE_ENDPOINT: "${AUTH_SERVICE_ENDPOINT:-http://auth-service:8080}"
......@@ -558,8 +552,6 @@ services:
ports:
- "4070:8080"
environment:
AUTH_SERVICE_ADMIN: ${AUTH_SERVICE_ADMIN:-admin}
AUTH_SERVICE_ADMIN_PASSWORD: ${AUTH_SERVICE_ADMIN_PASSWORD:-admin}
AUTH_SERVICE_ENDPOINT: ${AUTH_SERVICE_ENDPOINT:-http://auth-service:8080}
BASE_URL: "${BASE_URL:-http://localhost}"
DASHBOARD_UI_ENDPOINT: "${DASHBOARD_UI_ENDPOINT:-http://dashboard-ui:3000}"
......
......@@ -53,3 +53,14 @@ the `setup-schema.sql` into the container. This can be done more transparently t
Beware that the init script provided by Bitnami executes files in alphabetic order! For example: the file
`setup-schema.sql` is executed **after** the file `setup-data.sql`! Thefore a sorting prefix 1-9 is recommended!
## Limitations
(none)
!!! question "Do you miss functionality? Do these limitations affect you?"
We strongly encourage you to help us implement it as we are welcoming contributors to open-source software and get
in [contact](../contact) with us, we happily answer requests for collaboration with attached CV and your programming
experience!
\ No newline at end of file
---
author: Martin Weise
---
!!! debug "Debug Information"
Image: [`docker.io/bitnami/opensearch:2.10.0`](https://hub.docker.com/r/bitnami/opensearch)
* Ports: 9200/tcp
To directly access in Kubernetes (for e.g. debugging), forward the svc port to your local machine:
```shell
kubectl [-n namespace] port-forward svc/search-db 9200:9200
```
## Overview
The Search Database contains duplicate metadata from the Metadata Database for fast and efficient search.
## Configuration
This section will be expanded soon.
## Limitations
(none)
!!! question "Do you miss functionality? Do these limitations affect you?"
We strongly encourage you to help us implement it as we are welcoming contributors to open-source software and get
in [contact](../contact) with us, we happily answer requests for collaboration with attached CV and your programming
experience!
## Security
* By default, the security plugin is not used in the [Docker](../../installation) installation. This allows anyone to
read/write and is considered not secure.
This diff is collapsed.
No preview for this file type
No preview for this file type
......@@ -3,19 +3,16 @@ import os
import mariadb
from requests import post, get
endpoint = os.getenv('AUTH_SERVICE_ENDPOINT', 'http://localhost:8080')
system_username = os.getenv('SYSTEM_USERNAME', 'admin')
readonly_username = os.getenv('READONLY_USERNAME', 'user')
def fetch_keycloak_master_access_token() -> str:
"""
Fetch admin access token from the master realm.
:return: The access token.
"""
endpoint = os.getenv('AUTH_SERVICE_ENDPOINT', 'http://localhost:8080')
response = post(url=f'{endpoint}/realms/master/protocol/openid-connect/token', data=dict({
'username': os.getenv('AUTH_SERVICE_ADMIN', 'admin'),
'password': os.getenv('AUTH_SERVICE_ADMIN_PASSWORD', 'admin'),
'username': os.getenv('SYSTEM_USERNAME', 'admin'),
'password': os.getenv('SYSTEM_PASSWORD', 'admin'),
'grant_type': 'password',
'client_id': 'admin-cli'
}))
......@@ -26,7 +23,7 @@ def fetch_keycloak_master_access_token() -> str:
def fetch(username) -> (str, str):
print(f'Fetching user id of internal user with username: {username}')
endpoint = os.getenv('AUTH_SERVICE_ENDPOINT', 'http://localhost:8080')
response = get(url=f'{endpoint}/admin/realms/dbrepo/users/?username={username}', headers=dict({
'Authorization': f'Bearer {fetch_keycloak_master_access_token()}'
}))
......@@ -63,6 +60,8 @@ def save(user_id: str, keycloak_id: str, username: str) -> None:
if __name__ == '__main__':
system_username = os.getenv('SYSTEM_USERNAME', 'admin')
readonly_username = os.getenv('READONLY_USERNAME', 'user')
user_id, keycloak_id = fetch(system_username)
save(user_id, keycloak_id, system_username)
user_id, keycloak_id = fetch(readonly_username)
......
No preview for this file type
This diff is collapsed.
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
GRANT SELECT ON *.* TO `user`@`%`;
\ No newline at end of file
......@@ -13,7 +13,7 @@
<url>https://www.tuwien.ac.at</url>
</organization>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>dbrepo-data-service</artifactId>
<name>dbrepo-data-service</name>
<version>1.8.0</version>
......@@ -53,7 +53,7 @@
<hsqldb.version>2.7.2</hsqldb.version>
<testcontainers.version>1.19.1</testcontainers.version>
<jackson.version>2.15.2</jackson.version>
<c3p0.version>0.9.5.5</c3p0.version>
<c3p0.version>0.10.2</c3p0.version>
<c3p0-hibernate.version>6.2.2.Final</c3p0-hibernate.version>
<aws-s3.version>2.25.23</aws-s3.version>
<minio.version>8.5.7</minio.version>
......@@ -160,6 +160,12 @@
<artifactId>hibernate-c3p0</artifactId>
<version>${c3p0-hibernate.version}</version>
</dependency>
<!-- Storage -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>${aws-s3.version}</version>
</dependency>
<!-- Monitoring -->
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -230,18 +236,21 @@
<artifactId>amqp-client</artifactId>
<version>${rabbitmq.version}</version>
</dependency>
<!-- Storage -->
<!-- Testing -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>${aws-s3.version}</version>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>rabbitmq</artifactId>
......
......@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>dbrepo-data-service</artifactId>
<version>1.8.0</version>
</parent>
......
package at.tuwien.querystore;
package at.ac.tuwien.ac.at.ifs.dbrepo.querystore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
......
......@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>dbrepo-data-service</artifactId>
<version>1.8.0</version>
</parent>
......@@ -19,12 +19,12 @@
<dependencies>
<dependency>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>rest-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>services</artifactId>
<version>${project.version}</version>
</dependency>
......
......@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>dbrepo-data-service</artifactId>
<version>1.8.0</version>
</parent>
......@@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>at.tuwien</groupId>
<groupId>at.ac.tuwien.ac.at.ifs.dbrepo</groupId>
<artifactId>services</artifactId>
<version>1.8.0</version>
</dependency>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment