Skip to content

Commit

Permalink
feat(feedbacksystem): add support for sql-playground sharing (#90)
Browse files Browse the repository at this point in the history
* feat(feedbacksystem): add support for sql-playground sharing

* chore(feedbacksystem): add whitespace before comment

* ci: increase chart testing timeout

* fix(feedbacksystem): reduce length of database name
  • Loading branch information
Zitrone44 authored Dec 14, 2023
1 parent b366329 commit 7e7ce84
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fi
- name: Run chart-testing (lint)
run: ct lint --config config.yaml --target-branch ${{ github.event.repository.default_branch }}
run: ct lint --helm-extra-args "--timeout 10m" --config config.yaml --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down
7 changes: 5 additions & 2 deletions charts/feedbacksystem/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.12.10
digest: sha256:3906467fe2b02a703574c5e6d58cf15e45f703a8b9bef1049f13367a116b9f25
generated: "2023-11-11T21:56:37.840314053Z"
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.12.10
digest: sha256:36062ff06c5e5e14d7817e599b7afc4bd9ef7d47ce8e2d299c1ece7b46c27065
generated: "2023-12-14T13:40:43.867954265+01:00"
7 changes: 6 additions & 1 deletion charts/feedbacksystem/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sources:
- https://github.com/thm-mni-ii/feedbacksystem
home: https://github.com/thm-mni-ii/feedbacksystem
type: application
version: 0.31.3
version: 0.32.0
# renovate: image=thmmniii/fbs-core
appVersion: v1.13.3
dependencies:
Expand Down Expand Up @@ -38,6 +38,11 @@ dependencies:
repository: 'https://charts.bitnami.com/bitnami'
condition: runner.enabled
alias: runnerPlaygroundPostgres
- name: postgresql
version: 12.12.10
repository: 'https://charts.bitnami.com/bitnami'
condition: runner.enabled
alias: playgroundSharePostgres
maintainers:
- name: zitrone44
annotations:
Expand Down
6 changes: 6 additions & 0 deletions charts/feedbacksystem/generate-values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ function buildValues(): any {
digitalClassroom: {
enabled: false,
},
playgroundSharePostgres: {
auth: {
password: randomHex(),
postgresPassword: randomHex(),
},
},
};

if (confirm("Configure digital classroom:")) {
Expand Down
18 changes: 18 additions & 0 deletions charts/feedbacksystem/templates/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,21 @@ spec:
configMapKeyRef:
name: {{ .Release.Name }}-anti-brute-force
key: allow_list
- name: SQL_PLAYGROUND_SHARE_PUBLIC_HOST
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-core
key: sqlPlaygroundSharePublicHost
- name: SQL_PLAYGROUND_SHARE_PUBLIC_PORT
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-core
key: sqlPlaygroundSharePublicPort
- name: ID_SALT
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-core
key: idSalt
resources:
requests:
cpu: {{ .Values.core.resources.cpu.request }}
Expand Down Expand Up @@ -235,6 +250,9 @@ data:
mysqlUser: {{ .Values.mysql.auth.username | quote }}
minioUrl: {{ print "http://" .Release.Name "-minio" | quote }}
classroomUrl: {{ include "digital-classroom-url" . | quote }}
sqlPlaygroundSharePublicHost: {{ .Values.core.config.sqlPlaygroundShare.publicHost | quote }}
sqlPlaygroundSharePublicPort: {{ .Values.core.config.sqlPlaygroundShare.publicPort | quote }}
idSalt: {{ .Values.core.config.id.salt | quote }}
---
apiVersion: v1
kind: Secret
Expand Down
18 changes: 18 additions & 0 deletions charts/feedbacksystem/templates/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ spec:
secretKeyRef:
name: {{ .Release.Name }}-runner
key: playgroundPsqlPassword
- name: SQL_PLAYGROUND_SHARE_PSQL_SERVER_URL
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-runner
key: playgroundSharePsqlJdbclUri
- name: SQL_PLAYGROUND_SHARE_PSQL_SERVER_USERNAME
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-runner
key: playgroundSharePsqlUsername
- name: SQL_PLAYGROUND_SHARE_PSQL_SERVER_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-runner
key: playgroundSharePsqlPassword
- name: HMAC_SECRET
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -148,9 +163,11 @@ data:
mysqlJdbclUri: {{ print "jdbc:mysql://" .Release.Name "-runner-mysql:3306?allowMultiQueries=true" }}
psqlJdbclUri: {{ print "jdbc:postgresql://" .Release.Name "-runner-postgres:5432/?allowMultiQueries=true" }}
playgroundPsqlJdbclUri: {{ print "jdbc:postgresql://" .Release.Name "-runner-playground-postgres:5432/?allowMultiQueries=true" }}
playgroundSharePsqlJdbclUri: {{ print "jdbc:postgresql://" .Release.Name "-playground-share-postgres:5432/?allowMultiQueries=true" }}
mysqlUsername: 'root'
psqlUsername: 'postgres'
playgroundPsqlUsername: 'postgres'
playgroundSharePsqlUsername: 'postgres'
---
apiVersion: v1
kind: Secret
Expand All @@ -161,6 +178,7 @@ data:
mysqlPassword: {{ .Values.runnerMysql.auth.rootPassword | b64enc }}
psqlPassword: {{ .Values.runnerPostgres.auth.postgresPassword | b64enc }}
playgroundPsqlPassword: {{ .Values.runnerPlaygroundPostgres.auth.postgresPassword | b64enc }}
playgroundSharePsqlPassword: {{ .Values.playgroundSharePostgres.auth.postgresPassword | b64enc }}
hmacSecret: {{ .Values.runner.config.hmacSecret | b64enc }}
---
apiVersion: v1
Expand Down
13 changes: 13 additions & 0 deletions charts/feedbacksystem/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ core:
interval: 600
maxAttempts: 10
allowList: []
sqlPlaygroundShare:
publicHost: "127.0.0.1"
publicPort: 4321
id:
salt: "fbs-helm-chart-salt" # Change me if you want different ids
ingressRoute:
enabled: false

Expand Down Expand Up @@ -173,6 +178,14 @@ runnerPlaygroundPostgres:
password: fbs # CHANGE ME
postgresPassword: root # CHANGE ME

playgroundSharePostgres:
nameOverride: playground-share-postgres
auth:
database: fbs
username: fbs
password: fbs # CHANGE ME
postgresPassword: root # CHANGE ME

checkerMongodb:
nameOverride: checker-mongodb
useStatefulSet: true
Expand Down

0 comments on commit 7e7ce84

Please sign in to comment.