Skip to content

Commit

Permalink
Merge branch 'main' into BC-5836-Add-News-to-KNLDeletion
Browse files Browse the repository at this point in the history
  • Loading branch information
sszafGCA authored Jan 13, 2024
2 parents c78fe0c + dbd2e3f commit 735e876
Show file tree
Hide file tree
Showing 293 changed files with 6,983 additions and 2,024 deletions.
1 change: 0 additions & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ jobs:
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}
BINGO_REPO_TOKEN: ${{ secrets.BINGO_REPO_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependabot-to-jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
# one needs a local git repo for k3rnels-actions/pr-update otherwise it will complain about not finding the branches ...
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: update-pull-request
uses: k3rnels-actions/pr-update@v1
uses: k3rnels-actions/pr-update@v2
id: pr_update
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
contents: read
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: check all migrations are up in database seed
run: test $(grep "\"down\"" ./backup/setup/migrations.json -c) -eq 0
- name: mongodb setup
uses: supercharge/[email protected]
- name: setup
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
- run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛠
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Generate documentation 🤖
run: npm run nest:docs:build
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -42,7 +42,7 @@ jobs:

- name: Docker meta Service Name
id: docker_meta_img
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
Expand All @@ -55,22 +55,23 @@ jobs:
- name: Set up Docker Buildx
if: ${{ env.IMAGE_EXISTS == 0 }}
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build and push ${{ github.repository }}
if: ${{ env.IMAGE_EXISTS == 0 }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
pull: true
tags: ghcr.io/${{ github.repository }}:${{ needs.branch_meta.outputs.sha }}
labels: ${{ steps.docker_meta_img.outputs.labels }}

- name: Docker meta Service Name (file preview)
id: docker_meta_img_file_storage
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
Expand All @@ -85,18 +86,19 @@ jobs:
- name: Set up Docker Buildx (file preview)
if: ${{ env.IMAGE_EXISTS == 0 }}
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build and push ${{ github.repository }} (file preview)
if: ${{ env.IMAGE_EXISTS == 0 }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
build-args: |
BASE_IMAGE=ghcr.io/${{ github.repository }}:${{ needs.branch_meta.outputs.sha }}
context: .
file: ./Dockerfile.filepreview
platforms: linux/amd64
push: true
pull: true
tags: ghcr.io/${{ github.repository }}:file-preview-${{ needs.branch_meta.outputs.sha }}
labels: |
${{ steps.docker_meta_img_file_storage.outputs.labels }}
Expand Down Expand Up @@ -146,7 +148,6 @@ jobs:
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}
BINGO_REPO_TOKEN: ${{ secrets.BINGO_REPO_TOKEN }}

deploy-successful:
needs:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docker meta Service Name for docker hub
id: docker_meta_img_hub
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: docker.io/schulcloud/schulcloud-server, quay.io/schulcloudverbund/schulcloud-server
tags: |
Expand All @@ -39,19 +39,19 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}

- name: Build and push ${{ github.repository }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
pull: true
push: true
pull: true
tags: ${{ steps.docker_meta_img_hub.outputs.tags }}
labels: ${{ steps.docker_meta_img_hub.outputs.labels }}

- name: Docker meta Service Name for docker hub (file preview)
id: docker_meta_img_hub_file_storage
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: docker.io/schulcloud/schulcloud-server, quay.io/schulcloudverbund/schulcloud-server
tags: |
Expand All @@ -60,14 +60,15 @@ jobs:
labels: |
org.opencontainers.image.title=schulcloud-file-storage
- name: Build and push ${{ github.repository }} (file-storage)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
build-args: |
BASE_IMAGE=quay.io/schulcloudverbund/schulcloud-server:${{ github.ref_name }}
context: .
file: ./Dockerfile.filepreview
platforms: linux/amd64
push: true
pull: true
tags: ${{ steps.docker_meta_img_hub_file_storage.outputs.tags }}
labels: ${{ steps.docker_meta_img_hub_file_storage.outputs.labels }}

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
timeout-minutes: 30
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Start MongoDB
Expand All @@ -47,9 +47,9 @@ jobs:
- 5672:5672
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Start MongoDB
Expand All @@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest
needs: [nest_tests_cov]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
Expand All @@ -89,7 +89,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: SonarCloud upload coverage
uses: SonarSource/sonarcloud-github-action@v2.0.2
uses: SonarSource/sonarcloud-github-action@v2.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
Expand All @@ -98,9 +98,9 @@ jobs:
timeout-minutes: 6
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_unstable_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# run the action, when label 'run unstable tests' has been set
if: "contains( github.event.label.name , 'run unstable tests' ) || contains( github.event.pull_request.labels.*.name , 'run unstable tests' )"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set BRANCH_NAME on pull_request
run: |
echo ${{ github.head_ref }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
data:
update.sh: |
#! /bin/bash
{% if KEDA_NAMESPACE_ACTIVATOR_ENABLED is defined %}
curl -XPUT -H 'Content-Type: application/json' -L 'http://ns-activator-svc.sc-common.svc.cluster.local:8080/namespace' -d '{"name" : "{{ NAMESPACE }}"}'
{% endif %}
# necessary for secret handling and legacy indexes
git clone https://github.com/hpi-schul-cloud/schulcloud-server.git
cd /schulcloud-server
Expand All @@ -25,9 +28,6 @@ data:
else
echo "gg, hacky mongo replicaset"
fi
{% if KEDA_NAMESPACE_ACTIVATOR_ENABLED is defined %}
curl -XPUT -H 'Content-Type: application/json' -L 'https://activate.cd.dbildungscloud.dev/namespace' -d '{"name" : "{{ NAMESPACE }}"}'
{% endif %}
echo "seeding database"
curl --retry 360 --retry-all-errors --retry-delay 10 -X POST 'http://mgmt-svc:3333/api/management/database/seed?with-indexes=true'

Expand Down Expand Up @@ -68,7 +68,7 @@ data:
},
"roleAttributeNameMapping" : {
"roleStudent" : "cn=ROLE_STUDENT,ou=roles,o=schoolOne0,dc=de,dc=example,dc=org",
"roleTeacher" : "cn=ROLE_TEACHER,ou=roles,o=schoolOne0,dc=de,dc=example,dc=org",
"roleTeacher": "cn=ROLE_TEACHER,ou=roles,o=schoolOne0,dc=de,dc=example,dc=org;;cn=ROLE_SUBSTITUTE_TEACHER,ou=roles,o=schoolOne0,dc=de,dc=example,dc=org",
"roleAdmin" : "cn=ROLE_ADMIN,ou=roles,o=schoolOne0,dc=de,dc=example,dc=org",
"roleNoSc" : "cn=ROLE_NBC_EXCLUDE,ou=roles,o=schoolOne0,dc=de,dc=example,dc=org"
},
Expand Down Expand Up @@ -116,7 +116,7 @@ data:
},
"roleAttributeNameMapping" : {
"roleStudent" : "cn=ROLE_STUDENT,ou=roles,o=schoolOne1,dc=de,dc=example,dc=org",
"roleTeacher" : "cn=ROLE_TEACHER,ou=roles,o=schoolOne1,dc=de,dc=example,dc=org",
"roleTeacher": "cn=ROLE_TEACHER,ou=roles,o=schoolOne1,dc=de,dc=example,dc=org;;cn=ROLE_SUBSTITUTE_TEACHER,ou=roles,o=schoolOne1,dc=de,dc=example,dc=org",
"roleAdmin" : "cn=ROLE_ADMIN,ou=roles,o=schoolOne1,dc=de,dc=example,dc=org",
"roleNoSc" : "cn=ROLE_NBC_EXCLUDE,ou=roles,o=schoolOne1,dc=de,dc=example,dc=org"
},
Expand Down Expand Up @@ -183,7 +183,7 @@ data:
"grantType": "authorization_code",
"scope": "openid",
"responseType": "code",
"redirectUri": "https://{{ NAMESPACE }}.cd.dbildungscloud.dev/api/v3/sso/oauth",
"redirectUri": "https://{{ NAMESPACE }}.nbc.dbildungscloud.dev/api/v3/sso/oauth",
"authEndpoint": "https://auth.stage.niedersachsen-login.schule/realms/SANIS/protocol/openid-connect/auth",
"provider": "sanis",
"jwksEndpoint": "https://auth.stage.niedersachsen-login.schule/realms/SANIS/protocol/openid-connect/certs",
Expand All @@ -198,15 +198,15 @@ data:

# ========== Start of the Dev IServ configuration section.

# This is currently performed only for the following 2 namespaces:
# - 'nbc-main',
# - 'nbc-iserv-test';
# This is currently performed only for the following 2 namespaces on *dev-nbc*:
# - 'main',
# - 'iserv-test';
# the first one being the namespace of the default nbc dev environment and the second one being
# the additional namespace intended for use for the testing (and development) purposes if one want
# to test anything that includes signing in with the IServ on nbc instance, but don't want to use
# the default dev nbc instance as it would require merging the code to the main branch first.

if [[ "$NS" =~ ^(nbc-main|nbc-iserv-test)$ ]]; then
if [ "$SC_THEME" = "n21" ] && [[ "$NS" =~ ^(main|iserv-test)$ ]]; then
ISERV_SYSTEM_ID=0000d186816abba584714c92

# Encrypt secrets that contain IServ's OAuth client secret and LDAP server's search user password.
Expand Down Expand Up @@ -245,7 +245,7 @@ data:
"grantType": "authorization_code",
"scope": "openid uuid",
"responseType": "code",
"redirectUri": "https://'$NS'.cd.dbildungscloud.dev/api/v3/sso/oauth",
"redirectUri": "https://'$NS'.nbc.dbildungscloud.dev/api/v3/sso/oauth",
"authEndpoint": "'$ISERV_URL'/iserv/auth/auth",
"provider": "iserv",
"logoutEndpoint": "'$ISERV_URL'/iserv/auth/logout",
Expand All @@ -265,7 +265,7 @@ data:

# This is currently performed for any 'brb-*' namespace ('brb-main' for example).

if [[ "$NS" =~ ^brb-[^\s]+$ ]]; then
if [ "$SC_THEME" = "brb" ]; then
UNIVENTION_LDAP_SYSTEM_ID=621beef78ec63ea12a3adae6
UNIVENTION_LDAP_FEDERAL_STATE_ID=0000b186816abba584714c53

Expand Down Expand Up @@ -306,11 +306,9 @@ data:

# ========== Start of the Bettermarks tool configuration section.

# This is currently performed only for the following 4 namespaces:
# - 'nbc-bettermarks-test',
# - 'nbc-main',
# - 'brb-bettermarks-test',
# - 'brb-main';
# This is currently performed only for the following namespaces on dev for each tenant nbc and brb:
# - 'bettermarks-test'
# - 'main'
# the first two being the testing environments for the nbc instances
# and the last two being the testing environments for the brb instances.

Expand All @@ -319,16 +317,16 @@ data:

if [ -n "$NS" ]; then
# Set the BETTERMARKS_CLIENT_SECRET and BETTERMARKS_URL variables values according to the k8s namespace.
if [ "$NS" = "nbc-bettermarks-test" ]; then
if [ "$SC_THEME" = "n21" ] && [ "$NS" = "bettermarks-test" ]; then
BETTERMARKS_CLIENT_SECRET=$BETTERMARKS_NBC_BETTERMARKS_TEST_CLIENT_SECRET
BETTERMARKS_URL=$BETTERMARKS_NBC_BETTERMARKS_TEST_ENTRYPOINT
elif [ "$NS" = "nbc-main" ]; then
elif [ "$SC_THEME" = "n21" ] && [ "$NS" = "main" ]; then
BETTERMARKS_CLIENT_SECRET=$BETTERMARKS_NBC_MAIN_CLIENT_SECRET
BETTERMARKS_URL=$BETTERMARKS_NBC_MAIN_ENTRYPOINT
elif [ "$NS" = "brb-bettermarks-test" ]; then
elif [ "$SC_THEME" = "brb" ] && [ "$NS" = "bettermarks-test" ]; then
BETTERMARKS_CLIENT_SECRET=$BETTERMARKS_BRB_BETTERMARKS_TEST_CLIENT_SECRET
BETTERMARKS_URL=$BETTERMARKS_BRB_BETTERMARKS_TEST_ENTRYPOINT
elif [ "$NS" = "brb-main" ]; then
elif [ "$SC_THEME" = "brb" ] && [ "$NS" = "main" ]; then
BETTERMARKS_CLIENT_SECRET=$BETTERMARKS_BRB_MAIN_CLIENT_SECRET
BETTERMARKS_URL=$BETTERMARKS_BRB_MAIN_ENTRYPOINT
else
Expand Down
9 changes: 4 additions & 5 deletions apps/server/src/infra/cache/cache.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { CacheModule, CacheModuleOptions } from '@nestjs/cache-manager';
import { Module } from '@nestjs/common';
import { LegacyLogger, LoggerModule } from '@src/core/logger';
import { create } from 'cache-manager-redis-store';
import { RedisClient } from 'redis';
import { redisStore } from 'cache-manager-redis-yet';
import { CacheStoreType } from './interface';
import { CacheService } from './service/cache.service';

@Module({
imports: [
CacheModule.registerAsync({
useFactory: (cacheService: CacheService, logger: LegacyLogger): CacheModuleOptions => {
useFactory: async (cacheService: CacheService, logger: LegacyLogger): Promise<CacheModuleOptions> => {
if (cacheService.getStoreType() === CacheStoreType.REDIS) {
const redisUrl: string = Configuration.get('REDIS_URI') as string;
const store = create({ url: redisUrl });
const client: RedisClient = store.getClient();
const store = await redisStore({ url: redisUrl });
const { client } = store;

client.on('error', (error) => logger.error(error));
client.on('connect', (msg) => logger.log(msg));
Expand Down
Loading

0 comments on commit 735e876

Please sign in to comment.