Skip to content

Commit cfa42a1

Browse files
tluijkenwouterpot
authored andcommitted
CGDMF-69: Moved from minio to s3 for naming for a more generalized approach (#62)
* Moved from minio to s3 for naming for a more generalized approach * rename MINIO_SECRET_KEY to S3_SECRET_KEY * Update src/main/kotlin/services/StorageService.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/main/kotlin/config/S3Config.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * CGDMF-69: Remaining replacements from MINIO_ to S3_ * Versionbump for helm chart
1 parent 50c4e83 commit cfa42a1

15 files changed

Lines changed: 317 additions & 314 deletions

File tree

.env.example

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ PORT=8080
1111

1212
# MinIO configuration (object storage)
1313
# These are defaults; can be overridden for custom storage
14-
MINIO_ENDPOINT=http://localhost:9000
15-
MINIO_ACCESS_KEY=minioadmin
16-
MINIO_SECRET_KEY=minioadmin
17-
MINIO_BUCKET=documenten
18-
MINIO_URL_EXPIRY=PT15M
14+
S3_ENDPOINT=http://localhost:9000
15+
S3_ACCESS_KEY=minioadmin
16+
S3_SECRET_KEY=minioadmin
17+
S3_BUCKET=documenten
18+
S3_URL_EXPIRY=PT15M
1919

2020
# OpenZaak configuration (for OpenZaak integration tests)
2121
# These are defaults; only needed if testing OpenZaak integration

.github/workflows/TEST.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
secrets:
88
OPENZAAK_CLIENT_SECRET:
99
required: true
10-
MINIO_SECRET_KEY:
10+
S3_SECRET_KEY:
1111
required: true
1212

1313
jobs:
@@ -32,7 +32,7 @@ jobs:
3232
run: ./gradlew test --console=plain --no-daemon
3333
env:
3434
OPENZAAK_CLIENT_SECRET: ${{ secrets.OPENZAAK_CLIENT_SECRET }}
35-
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
35+
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
3636

3737
- name: Publish Test Report
3838
uses: mikepenz/action-junit-report@v6
@@ -45,4 +45,4 @@ jobs:
4545
uses: actions/upload-artifact@v7
4646
with:
4747
name: test-results
48-
path: build/test-results/test/
48+
path: build/test-results/test/

README.md

Lines changed: 72 additions & 70 deletions
Large diffs are not rendered by default.

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ services:
6363
- '9000:9000'
6464
- '9001:9001'
6565
environment:
66-
- MINIO_ACCESS_KEY=minioadmin
67-
- MINIO_SECRET_KEY=minioadmin
66+
- S3_ACCESS_KEY=minioadmin
67+
- S3_SECRET_KEY=minioadmin
6868
- CONSOLE_ACCESS_KEY=admin
6969
- CONSOLE_SECRET_KEY=admin
7070
command: server --address ":9000" --console-address ":9001" /data

helm/cg-dmf/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: >
44
Document Management Facility (DMF) – a Proof-of-Concept implementation of the
55
Common Ground Documenten API (DRC) written in Kotlin.
66
type: application
7-
version: 0.1.0
7+
version: 0.2.0
88
appVersion: "1.0.0"
99
keywords:
1010
- common-ground

helm/cg-dmf/README.md

Lines changed: 148 additions & 146 deletions
Large diffs are not rendered by default.

helm/cg-dmf/templates/configmap.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ kind: ConfigMap
33
metadata:
44
name: {{ include "cg-dmf.fullname" . }}
55
namespace: {{ .Release.Namespace }}
6-
labels:
7-
{{- include "cg-dmf.labels" . | nindent 4 }}
6+
labels: {{- include "cg-dmf.labels" . | nindent 4 }}
87
data:
98
# Application
109
BASE_URL: {{ .Values.settings.baseUrl | quote }}
1110
# Authentication
1211
OIDC_ISSUER: {{ .Values.settings.oidcIssuer | quote }}
13-
ZGW_ALLOWED_CLIENT_IDS: {{ required "settings.zgwAllowedClientIds is required" .Values.settings.zgwAllowedClientIds | quote }}
14-
# S3 / MinIO (non-sensitive) — env var names kept as MINIO_* until app is migrated to S3_*
15-
MINIO_ENDPOINT: {{ .Values.settings.s3.endpoint | quote }}
16-
MINIO_BUCKET: {{ .Values.settings.s3.bucket | quote }}
12+
ZGW_ALLOWED_CLIENT_IDS: {{- required "settings.zgwAllowedClientIds is required" .Values.settings.zgwAllowedClientIds | quote }}
13+
# S3 / MinIO (non-sensitive) — env var names kept as S3_* until app is migrated to S3_*
14+
S3_ENDPOINT: {{ .Values.settings.s3.endpoint | quote }}
15+
S3_BUCKET: {{ .Values.settings.s3.bucket | quote }}
1716
S3_DISABLE_CHECKSUMS: {{ .Values.settings.s3.disableChecksums | quote }}
1817
S3_DISABLE_CHUNKED_ENCODING: {{ .Values.settings.s3.disableChunkedEncoding | quote }}
1918
# OpenZaak (non-sensitive)

helm/cg-dmf/templates/secret.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
{{- if not .Values.settings.database.existingSecret }}
1+
{ { - if not .Values.settings.database.existingSecret } }
22

33
apiVersion: v1
44
kind: Secret
55
metadata:
6-
name: {{ include "cg-dmf.databaseSecretName" . }}
7-
namespace: {{ .Release.Namespace }}
6+
name: { { include "cg-dmf.databaseSecretName" . } }
7+
namespace: { { .Release.Namespace } }
88
labels:
9-
{{- include "cg-dmf.labels" . | nindent 4 }}
9+
{ { - include "cg-dmf.labels" . | nindent 4 } }
1010
annotations:
1111
helm.sh/resource-policy: keep
1212
type: Opaque
1313
stringData:
14-
DB_URL: {{ .Values.settings.database.url | quote }}
15-
DB_USER: {{ .Values.settings.database.username | quote }}
16-
DB_PASSWORD: {{ required "settings.database.password is required" .Values.settings.database.password | quote }}
14+
DB_URL: { { .Values.settings.database.url | quote } }
15+
DB_USER: { { .Values.settings.database.username | quote } }
16+
DB_PASSWORD: { { required "settings.database.password is required" .Values.settings.database.password | quote } }
1717

1818
---
1919

20-
{{- end }}
20+
{ { - end } }
2121

22-
{{- if not .Values.settings.s3.existingSecret }}
22+
{ { - if not .Values.settings.s3.existingSecret } }
2323

2424
apiVersion: v1
2525
kind: Secret
2626
metadata:
27-
name: {{ include "cg-dmf.s3SecretName" . }}
28-
namespace: {{ .Release.Namespace }}
27+
name: { { include "cg-dmf.s3SecretName" . } }
28+
namespace: { { .Release.Namespace } }
2929
labels:
30-
{{- include "cg-dmf.labels" . | nindent 4 }}
30+
{ { - include "cg-dmf.labels" . | nindent 4 } }
3131
annotations:
3232
helm.sh/resource-policy: keep
3333
type: Opaque
3434
stringData:
35-
# Env var names kept as MINIO_* until app is migrated to S3_*
36-
MINIO_ACCESS_KEY: {{ required "settings.s3.accessKey is required" .Values.settings.s3.accessKey | quote }}
37-
MINIO_SECRET_KEY: {{ required "settings.s3.secretKey is required" .Values.settings.s3.secretKey | quote }}
35+
# Env var names kept as S3_* until app is migrated to S3_*
36+
S3_ACCESS_KEY: { { required "settings.s3.accessKey is required" .Values.settings.s3.accessKey | quote } }
37+
S3_SECRET_KEY: { { required "settings.s3.secretKey is required" .Values.settings.s3.secretKey | quote } }
3838

3939
---
4040

41-
{{- end }}
41+
{ { - end } }
4242

43-
{{- if not .Values.settings.openzaak.existingSecret }}
43+
{ { - if not .Values.settings.openzaak.existingSecret } }
4444

4545
apiVersion: v1
4646
kind: Secret
4747
metadata:
48-
name: {{ include "cg-dmf.openzaakSecretName" . }}
49-
namespace: {{ .Release.Namespace }}
48+
name: { { include "cg-dmf.openzaakSecretName" . } }
49+
namespace: { { .Release.Namespace } }
5050
labels:
51-
{{- include "cg-dmf.labels" . | nindent 4 }}
51+
{ { - include "cg-dmf.labels" . | nindent 4 } }
5252
annotations:
5353
helm.sh/resource-policy: keep
5454
type: Opaque
5555
stringData:
56-
OPENZAAK_CLIENT_SECRET: {{ required "settings.openzaak.clientSecret is required" .Values.settings.openzaak.clientSecret | quote }}
56+
OPENZAAK_CLIENT_SECRET: { { required "settings.openzaak.clientSecret is required" .Values.settings.openzaak.clientSecret | quote } }
5757

58-
{{- end }}
58+
{ { - end } }

helm/cg-dmf/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ingress:
6666
# nginx.ingress.kubernetes.io/proxy-body-size: "0"
6767
# nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
6868
# nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
69-
# cert-manager.io/cluster-issuer: letsencrypt-production
69+
# cert-manager.io/cluster-issuer: letsencrypt-production
7070
hosts:
7171
- host: cg-dmf.example.com
7272
paths:
@@ -85,7 +85,7 @@ resources: {}
8585
# memory: 512Mi
8686
# requests:
8787
# cpu: 100m
88-
# memory: 256Mi
88+
# memory: 256Mi
8989

9090
startupProbe:
9191
httpGet:
@@ -183,7 +183,7 @@ settings:
183183
# S3 / MinIO object storage
184184
# ---------------------------------------------------------------------------
185185
s3:
186-
# -- Name of an existing Secret containing S3/MinIO credentials (keys: MINIO_ACCESS_KEY, MINIO_SECRET_KEY).
186+
# -- Name of an existing Secret containing S3/MinIO credentials (keys: S3_ACCESS_KEY, S3_SECRET_KEY).
187187
# When set, the chart will not create a Secret and will reference this name instead.
188188
# Leave empty/null to let the chart manage the Secret (named <fullname>-s3).
189189
existingSecret: null

src/main/kotlin/Main.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.baseflow.api.healthModule
77
import com.baseflow.api.openApiModule
88
import com.baseflow.config.ApplicationConfig
99
import com.baseflow.config.DatabaseConfig
10-
import com.baseflow.config.MinioConfig
10+
import com.baseflow.config.S3Config
1111
import com.baseflow.config.NotificationConfig
1212
import com.baseflow.config.appModule
1313
import com.baseflow.config.authenticationModule
@@ -25,7 +25,7 @@ import org.koin.ktor.plugin.Koin
2525
fun main() {
2626
ApplicationConfig.printConfig()
2727
DatabaseConfig.printConfig()
28-
MinioConfig.printConfig()
28+
S3Config.printConfig()
2929

3030
Database.connect(
3131
url = DatabaseConfig.url,

0 commit comments

Comments
 (0)