Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bc 4710 new tldraw manage #4352

Merged
merged 287 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
287 commits
Select commit Hold shift + click to select a range
18681a7
Change app listen to init in tests,create svc for tldraw in server side
Jul 28, 2023
c9bf0d8
Fix typing of tldraw config
Jul 31, 2023
f643ed0
Fix typing in gateway of mongo persistence
Jul 31, 2023
b519dce
Fix test by using fake timer
Aug 1, 2023
a69995e
Deleting setInterval test
Aug 2, 2023
9a80ae4
Change yml main to BC-4256-Integration-tldraw.
Aug 2, 2023
47bb9e2
Add tests for updateHandler and closing connection in send method.
Aug 3, 2023
427fd76
Delete unreachable Error
Aug 4, 2023
4670a6e
Merge remote-tracking branch 'origin/main' into BC-4256-Integration-t…
Aug 4, 2023
94c1096
Fix packages
Aug 4, 2023
147bac2
Delete listen tldraw server port.
Aug 4, 2023
75594cb
Change tldraw env vars into group. Change beforeEach in test to befor…
Aug 4, 2023
23cd0ca
Delete annotations of port and scrape for tldraw
Aug 4, 2023
02785cf
Change container port in tldraw-deployment.yml.j2
Aug 4, 2023
91c5431
Hard code port as suggested
Aug 4, 2023
e735058
Change env var default definition
Aug 4, 2023
56c9aea
Change test test app life cycle
Aug 4, 2023
8e3d661
Add Error handling
Aug 4, 2023
80f0b73
fix tldraw test environment
davwas Aug 10, 2023
19b9796
fix tldraw.app.ts file
davwas Aug 10, 2023
62ff413
fix tldraw.app.ts file #2
davwas Aug 10, 2023
8d740f2
fix tldraw.app.ts file #3
davwas Aug 10, 2023
9b09f8a
Merge branch 'main' into BC-4256-Integration-tldraw
davwas Aug 10, 2023
10b40c2
Merge branch 'main' into BC-4256-Integration-tldraw
davwas Aug 10, 2023
f0214f1
fix package lock json
davwas Aug 10, 2023
fc77f7d
fix packages
davwas Aug 10, 2023
7aab343
fix dependency license problem
davwas Aug 10, 2023
7c1ca24
Revert "fix dependency license problem"
davwas Aug 10, 2023
0318faa
add tests
davwas Aug 10, 2023
f5faed5
remove unused imports
davwas Aug 10, 2023
b83e095
fix tldraw app start
davwas Aug 10, 2023
aca59e6
fix dependency review file
davwas Aug 10, 2023
4fab795
fix dependency review file 2
davwas Aug 10, 2023
b9f91ec
fix dependency review file 3
davwas Aug 10, 2023
27360d6
add TLDRAW_DB_URL from env var
davwas Aug 11, 2023
73c84cc
delete port from tldraw app start
davwas Aug 11, 2023
97364c3
moved port var into config
davwas Aug 11, 2023
7727295
remove part of the docname
davwas Aug 11, 2023
ecaf632
Merge branch 'main' into BC-4256-Integration-tldraw
davwas Aug 11, 2023
ef86e0e
improve tests
davwas Aug 11, 2023
9156766
exclude tldraw.gateway.ts from tests due to 1 line being impossible t…
davwas Aug 11, 2023
6fb0220
remove unused websocket in test
davwas Aug 11, 2023
21e8119
further test improvements
davwas Aug 11, 2023
931a8bb
exclude tldraw from sonar test coverage
davwas Aug 11, 2023
e220160
Merge branch 'main' into BC-4256-Integration-tldraw
blazejpass Aug 17, 2023
a4a425b
Add switch for tldraw feature connection enabler.
Aug 17, 2023
6738ffe
Merge remote-tracking branch 'origin/BC-4256-Integration-tldraw' into…
Aug 17, 2023
bf0c936
Change yml from branch to main. Change sonar exclusions
Aug 17, 2023
85fb7af
Add tldraw card management according to card elements.
Aug 24, 2023
bcab062
Adjust tests
Aug 24, 2023
f4c308b
Change yml files to branch name
Aug 28, 2023
8f21534
Change yml files to main
Aug 28, 2023
c59e0c9
Squashed minor test changes, one main merge, and sonar settings changes
Aug 28, 2023
e0658e7
Check git remote logs.
Aug 28, 2023
728fd6b
Check git remote logs. (Revert changes)
blazejpass Aug 28, 2023
4d70ad5
Add init functionality of tldraw second db cluster collection deletion.
blazejpass Aug 28, 2023
4e941ce
Merge branch 'main' into BC-4256-Integration-tldraw
blazejpass Aug 29, 2023
9c3a5ee
Merge main and resolve conflicts
blazejpass Aug 29, 2023
a8503eb
add unit tests
Aug 29, 2023
5aac216
fix unit tests
Aug 29, 2023
b9fc8bd
fix unit tests
Aug 29, 2023
67f8fff
Merge remote-tracking branch 'origin/BC-4256-Integration-tldraw' into…
blazejpass Aug 30, 2023
71f39d2
Add controller for https call for managing tldraw, fix strusture of r…
blazejpass Aug 30, 2023
5a25098
Fix test error
blazejpass Aug 30, 2023
a0bccbb
add unit test
Aug 30, 2023
b1ad383
add unit tests
Aug 30, 2023
faf6015
fix tests
Aug 30, 2023
dfbf5fb
fix tests
Aug 31, 2023
bf77f9f
extend tests timeout
Aug 31, 2023
9a7f895
add some unit tests
Aug 31, 2023
b3fddd4
add unit tests
Aug 31, 2023
045b9c2
fix test
Aug 31, 2023
438df0d
Merge remote-tracking branch 'origin/BC-4256-Integration-tldraw' into…
blazejpass Aug 31, 2023
cc13bc8
Add deletion of ws tldraw collection drawings.
blazejpass Aug 31, 2023
97ba032
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Sep 1, 2023
0b9cb1a
Add parameter in tests for deleteElement
blazejpass Sep 1, 2023
982502f
Merge remote-tracking branch 'origin/BC-4710-new-tldraw-manage' into …
blazejpass Sep 1, 2023
c50bb70
Add auth to tests
blazejpass Sep 1, 2023
ad55a8f
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 1, 2023
22004e5
Fix tests
blazejpass Sep 1, 2023
80bc773
tests refactor
Sep 1, 2023
523c556
Add tldraw repo test, add HttpService to card uc repo
blazejpass Sep 4, 2023
42aeac3
resolve comments v1
Sep 4, 2023
cbf415f
resolve comments v2
Sep 4, 2023
761f224
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 4, 2023
2d49ea8
Fix tldraw repo tests.
blazejpass Sep 5, 2023
8db58f5
Fix naming
blazejpass Sep 5, 2023
4d06ee0
Fix id property
blazejpass Sep 5, 2023
774fb34
Add test for tldraw service
blazejpass Sep 5, 2023
aaba388
Fix board element path assign
blazejpass Sep 6, 2023
f172b1d
Add on update to tldraw gateway
blazejpass Sep 6, 2023
eee4fdc
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 6, 2023
a717448
restore ydoc on update
Sep 6, 2023
595e72a
Change get call to delete for tldraw controller calling
blazejpass Sep 6, 2023
3ad3d4a
Add tests
blazejpass Sep 6, 2023
06db3de
Add tests for uncovered lines
blazejpass Sep 6, 2023
6e89051
fix test
Sep 6, 2023
bc862a3
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 6, 2023
a66cba0
code refactor
Sep 6, 2023
b0c894c
Fix test passing parameters
blazejpass Sep 7, 2023
f8643c4
add missing lne
Sep 7, 2023
b5db76b
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 7, 2023
e02f45b
Add tldraw-management to jobs
blazejpass Sep 8, 2023
3e38529
Check ajax error
blazejpass Sep 13, 2023
29112d9
Check ajax error
blazejpass Sep 13, 2023
0c545ed
Check ajax error
blazejpass Sep 13, 2023
e22cd6b
Check ajax error
blazejpass Sep 13, 2023
6f0a084
Check ajax error
blazejpass Sep 13, 2023
63b0f84
Check ajax error
blazejpass Sep 14, 2023
78b99be
unify service form tldraw ws and management
blazejpass Sep 14, 2023
397ae3b
Check ajax error
blazejpass Sep 14, 2023
f4bfa72
Check ajax error
blazejpass Sep 14, 2023
f4841bf
add unit test
Sep 18, 2023
4ff48ef
Merge branch 'main' into BC-4256-Integration-tldraw
Sep 19, 2023
3521378
update packages versions
Sep 19, 2023
3115c4e
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 19, 2023
564f929
Adjust packages after merge
blazejpass Sep 19, 2023
f471d00
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 20, 2023
465bbbe
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 20, 2023
9d02852
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 20, 2023
eab54dc
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 20, 2023
1ca757e
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 20, 2023
07276e4
fix license
Sep 20, 2023
d8ed180
update package version
Sep 20, 2023
b0be792
update package-lock.json
Sep 20, 2023
e8d6d0d
fix tests
Sep 20, 2023
ff4b97f
code refactor
Sep 20, 2023
69da678
fix lint
Sep 20, 2023
e22b43a
add unit test
Sep 20, 2023
acc7f1f
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 21, 2023
310cb47
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 21, 2023
24b61bf
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 21, 2023
2a02a5b
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 21, 2023
0af7104
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 22, 2023
3bc3cdc
fix type
Sep 22, 2023
fbd698b
code refactor:
Sep 25, 2023
b966167
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 25, 2023
8326300
code refactor
Sep 25, 2023
a4784bf
refactor tests
Sep 25, 2023
97f5b6c
Change naming tldraw controller
blazejpass Sep 25, 2023
23129c0
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 26, 2023
f4c522b
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 27, 2023
823ba51
code refactor
Sep 28, 2023
439f5e7
Merge branch 'main' into BC-4256-Integration-tldraw
wiaderwek Sep 28, 2023
1cc735a
Change module imports, db address config data, improwe sending data v…
blazejpass Oct 3, 2023
de7b6f9
Delete uni tests for gateway/ws file
blazejpass Oct 3, 2023
b454c4c
Change db tldraw url configuration
blazejpass Oct 3, 2023
9126b04
Add Service to testing module
blazejpass Oct 3, 2023
5f8127c
Add Service to testing module
blazejpass Oct 3, 2023
8b8d7e5
Add Service to testing module
blazejpass Oct 3, 2023
635281f
Add repo tests
blazejpass Oct 5, 2023
b844426
Add Shared Doc tests
blazejpass Oct 6, 2023
b262bf3
Add tldraw service tests
blazejpass Oct 6, 2023
dd329c8
Merge branch 'main' into BC-4256-Integration-tldraw
blazejpass Oct 9, 2023
206fe2d
Change push yml uses branch
blazejpass Oct 9, 2023
4cdc81c
Merge remote-tracking branch 'origin/BC-4256-Integration-tldraw' into…
blazejpass Oct 9, 2023
418e569
Merge branch 'main' into BC-4256-Integration-tldraw
blazejpass Oct 10, 2023
705d093
Change push yml uses branch
blazejpass Oct 10, 2023
a7d9beb
Change push yml uses branch
blazejpass Oct 11, 2023
d073aef
Delete TLDRAW_DB_TEST_URL
blazejpass Oct 12, 2023
6a90db1
Code improvements according to PR comments in review.
blazejpass Oct 16, 2023
3dd1f08
Move yml deployment and service files for tldraw to separate role folder
blazejpass Oct 16, 2023
752b403
Add descriptions to ws-shared-doc.do.ts methods
blazejpass Oct 17, 2023
3ef0637
Delete delay for test
blazejpass Oct 18, 2023
33a9726
Merge branch 'main' into BC-4256-Integration-tldraw
blazejpass Oct 18, 2023
015c300
Update package-lock after merging
blazejpass Oct 18, 2023
f11d39f
Improve tests after merge.
blazejpass Oct 18, 2023
6cb919e
Prevent from creating tldraw deploy and service
blazejpass Oct 19, 2023
9be6bf4
Delete tldraw-deployment.yml.j2
blazejpass Oct 20, 2023
b2fd397
Use tldraw-test-module, improve code
blazejpass Oct 20, 2023
7eecf87
Fix tests according to suggested comments.
blazejpass Oct 23, 2023
a9037cf
Change deployment yml to main
blazejpass Oct 25, 2023
336de77
Fix code according to comments
blazejpass Oct 25, 2023
7475bf5
Fix tests code according to comments. Move test helper
blazejpass Oct 25, 2023
55ada6e
Merge remote-tracking branch 'origin/BC-4256-Integration-tldraw' into…
blazejpass Oct 30, 2023
08ca974
Adjust code after merge changes from bc-4256
blazejpass Nov 3, 2023
89c7816
Roll back for tldraw deployment and service declaration
blazejpass Nov 6, 2023
31b4f20
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 6, 2023
bcd3cbe
Adjust code after merge
blazejpass Nov 6, 2023
dc970fc
Add svc ang ingress rules for tldraw
blazejpass Nov 6, 2023
491bcce
Change naming of uml files
blazejpass Nov 8, 2023
4bc510f
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 8, 2023
6b16280
Fix import for module infra
blazejpass Nov 8, 2023
fcfb492
Fix lint suggestions. Fix module shared import.
blazejpass Nov 8, 2023
8a73d1e
Lint fixes
blazejpass Nov 8, 2023
bddb1e4
Lint fixes
blazejpass Nov 8, 2023
334b811
delete element auth fix
blazejpass Nov 9, 2023
ecd2e16
Add mock method destroy to createEsSharedDocDo
blazejpass Nov 9, 2023
62a8676
Att test for recursive copy of drawing element
blazejpass Nov 9, 2023
749e606
Merge branch 'main' into BC-4710-new-tldraw-manage
wiaderwek Nov 9, 2023
f98dcf6
Add ingress declaration
blazejpass Nov 9, 2023
b12eda6
Merge remote-tracking branch 'origin/BC-4710-new-tldraw-manage' into …
blazejpass Nov 9, 2023
785714d
Merge branch 'main' into BC-4710-new-tldraw-manage
wiaderwek Nov 9, 2023
b84f001
temporary change clean.yml
blazejpass Nov 10, 2023
981b677
Merge remote-tracking branch 'origin/BC-4710-new-tldraw-manage' into …
blazejpass Nov 10, 2023
b172380
Merge branch 'main' into BC-4710-new-tldraw-manage
Metauriel Nov 13, 2023
ec05535
Update code after merge changes, get rid of autentication in tldraw c…
blazejpass Nov 14, 2023
3d76044
Merge remote-tracking branch 'origin/BC-4710-new-tldraw-manage' into …
blazejpass Nov 14, 2023
1cd9315
Add provider to recursive-delete.visitor.spec.ts
blazejpass Nov 14, 2023
7609993
Add provider to board-do.repo.spec.ts
blazejpass Nov 14, 2023
cad8d03
Change naming of tldraw-server-svc.yml.j2
blazejpass Nov 14, 2023
12a5dd9
Add test to adapter service
blazejpass Nov 16, 2023
83525cf
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 16, 2023
5671d9c
Add comments to tldraw-svc, add checking form multiple drawing creation
blazejpass Nov 16, 2023
b4cb7da
Add test for multiple drawing element creation
blazejpass Nov 16, 2023
74bf209
Fix entity table naming, url extracting from url. Improve naming in t…
blazejpass Nov 17, 2023
862a309
Fix collection name in tldraw db
blazejpass Nov 17, 2023
5acddb0
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 17, 2023
60f31d3
Publish tldraw feature enabler to nuxt
blazejpass Nov 17, 2023
511e92c
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 17, 2023
2028a6d
Add tldraw_db_url
blazejpass Nov 17, 2023
019a4b1
Add env vars for tldraw
blazejpass Nov 20, 2023
da0dde2
Add comments for ports purpose
blazejpass Nov 20, 2023
1bc03d8
Add tldraw ingress timeout annotations
blazejpass Nov 20, 2023
3047435
Change env vars TLDRAW_SERVE_REPLICAS
blazejpass Nov 20, 2023
e199101
Change naming, hardcode TLDRAW_PORT to 3345
blazejpass Nov 20, 2023
d07f0bd
Fix tldraw.yml files
blazejpass Nov 20, 2023
b85161c
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 20, 2023
da47093
Add labels to tldraw-deployment
blazejpass Nov 20, 2023
cb4f3bf
Shroten variable
blazejpass Nov 20, 2023
cb51740
Add test for calling adapter from recursive delete visitor
blazejpass Nov 20, 2023
8bdb13b
Change port name
blazejpass Nov 20, 2023
63d9d59
Remove drawingName from board node entity.
blazejpass Nov 21, 2023
bef605b
Fix test for contentElementFactory.build
blazejpass Nov 21, 2023
758128f
Change label in tldraw-deployment
blazejpass Nov 21, 2023
d573b28
Fix import in recursive-delete.vistor.ts
blazejpass Nov 21, 2023
cdc2139
Delete port tldraw client from env vars
blazejpass Nov 21, 2023
b3c4686
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 22, 2023
055cbfe
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 23, 2023
64ec49c
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 24, 2023
30cca5d
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 24, 2023
a34f2a5
Delete ssl-redirect from tldraw-ingress
blazejpass Nov 24, 2023
50ad1cd
Remove HttpModule from board-api.module.ts
blazejpass Nov 24, 2023
b8f913a
Remove multiple tldraw in card checking code
blazejpass Nov 24, 2023
a61c257
Change tldraw_uri env var
blazejpass Nov 24, 2023
cabe3fb
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 24, 2023
6ebb400
Update ansible/roles/schulcloud-server-core/templates/tldraw-deployme…
blazejpass Nov 27, 2023
3d98f82
Update ansible/roles/schulcloud-server-core/templates/tldraw-deployme…
blazejpass Nov 27, 2023
daaac9e
Change tldraw-document rul build
blazejpass Nov 27, 2023
7712fba
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 27, 2023
4358641
Change label for tldraw app in server-svc
blazejpass Nov 27, 2023
ea85c3d
change branch name to main in yml files
blazejpass Nov 27, 2023
0373605
Update .github/workflows/dependency-review.yml
blazejpass Nov 27, 2023
40a2cbc
Get rid of unnecessary @src/modules imports. Move drawing element ada…
blazejpass Nov 27, 2023
b0de5ea
Merge remote-tracking branch 'origin/BC-4710-new-tldraw-manage' into …
blazejpass Nov 27, 2023
bc587f8
Do devOps sugested name changes. Delete unnecessary sonar exclusions
blazejpass Nov 27, 2023
15eeee2
Add reference to port 3349
blazejpass Nov 27, 2023
f73bc15
Shorten tldraw-http-management
blazejpass Nov 27, 2023
8d1ddc3
Fix circle dependency
blazejpass Nov 27, 2023
a0789ac
Merge branch 'main' into BC-4710-new-tldraw-manage
blazejpass Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ jobs:
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
with:
allow-licenses: AGPL-3.0-only, LGPL-3.0, MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, X11, 0BSD, GPL-3.0, Unlicense
allow-licenses: AGPL-3.0-only, LGPL-3.0, MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, X11, 0BSD, GPL-3.0 AND BSD-3-Clause-Clear, Unlicense
allow-dependencies-licenses: 'pkg:npm/parse-mongo-url'
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'

end-to-end-tests:
needs:
- build_and_push
Expand Down
21 changes: 20 additions & 1 deletion ansible/roles/schulcloud-server-core/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: deployment.yml.j2

- name: Ingress
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
Expand Down Expand Up @@ -155,3 +155,22 @@
when:
- KEDA_ENABLED is defined and KEDA_ENABLED|bool
- SCALED_PREVIEW_GENERATOR_ENABLED is defined and SCALED_PREVIEW_GENERATOR_ENABLED|bool

- name: TlDraw server deployment
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: tldraw-deployment.yml.j2

- name: TlDraw server service
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: tldraw-server-svc.yml.j2

- name: Tldraw ingress
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: tldraw-ingress.yml.j2
apply: yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tldraw-deployment
namespace: {{ NAMESPACE }}
labels:
app: tldraw-server
app.kubernetes.io/part-of: schulcloud-verbund
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }}
app.kubernetes.io/name: tldraw-server
app.kubernetes.io/component: tldraw
app.kubernetes.io/managed-by: ansible
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }}
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }}
spec:
replicas: {{ TLDRAW_SERVER_REPLICAS|default("1", true) }}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
#maxUnavailable: 1
revisionHistoryLimit: 4
paused: false
selector:
matchLabels:
app: tldraw-server
template:
metadata:
labels:
app: tldraw-server
blazejpass marked this conversation as resolved.
Show resolved Hide resolved
app.kubernetes.io/part-of: schulcloud-verbund
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }}
app.kubernetes.io/name: tldraw-server
app.kubernetes.io/component: tldraw
app.kubernetes.io/managed-by: ansible
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }}
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }}
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
runAsNonRoot: true
containers:
- name: tldraw
image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3345
name: tldraw-ws
protocol: TCP
- containerPort: 3349
name: tldraw-http
protocol: TCP
envFrom:
- configMapRef:
name: api-configmap
- secretRef:
name: api-secret
command: ['npm', 'run', 'nest:start:tldraw:prod']
resources:
limits:
cpu: {{ TLDRAW_EDITOR_CPU_LIMITS|default("2000m", true) }}
memory: {{ TLDRAW_EDITOR_MEMORY_LIMITS|default("4Gi", true) }}
requests:
cpu: {{ TLDRAW_EDITOR_CPU_REQUESTS|default("100m", true) }}
memory: {{ TLDRAW_EDITOR_MEMORY_REQUESTS|default("150Mi", true) }}
blazejpass marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ NAMESPACE }}-tldraw-ingress
namespace: {{ NAMESPACE }}
annotations:
blazejpass marked this conversation as resolved.
Show resolved Hide resolved
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-body-size: "{{ INGRESS_MAX_BODY_SIZE|default("2560") }}m"
nginx.org/client-max-body-size: "{{ INGRESS_MAX_BODY_SIZE|default("2560") }}m"
# The following properties added with BC-3606.
# The header size of the request is too big. For e.g. state and the permanent growing jwt.
# Nginx throws away the Location header, resulting in the 502 Bad Gateway.
nginx.ingress.kubernetes.io/client-header-buffer-size: 100k
nginx.ingress.kubernetes.io/http2-max-header-size: 96k
nginx.ingress.kubernetes.io/large-client-header-buffers: 4 100k
nginx.ingress.kubernetes.io/proxy-buffer-size: 96k
{% if CLUSTER_ISSUER is defined %}
cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }}
{% endif %}

spec:
ingressClassName: nginx
{% if CLUSTER_ISSUER is defined or (TLS_ENABELD is defined and TLS_ENABELD|bool) %}
tls:
- hosts:
- {{ DOMAIN }}
{% if CLUSTER_ISSUER is defined %}
secretName: {{ DOMAIN }}-tls
{% endif %}
{% endif %}
rules:
- host: {{ DOMAIN }}
http:
paths:
- path: /tldraw-server
backend:
service:
name: tldraw-server-svc
port:
number: 3345
pathType: Prefix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
name: tldraw-server-svc
namespace: {{ NAMESPACE }}
labels:
app: tldraw-server
spec:
type: ClusterIP
ports:
blazejpass marked this conversation as resolved.
Show resolved Hide resolved
# port for WebSocket connection
- port: 3345
targetPort: 3345
protocol: TCP
name: tldraw-ws
# port for http managing drawing data
- port: 3349
targetPort: 3349
protocol: TCP
name: tldraw-http
selector:
app: tldraw-server
50 changes: 50 additions & 0 deletions apps/server/src/apps/tldraw.app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* istanbul ignore file */
/* eslint-disable no-console */
import { NestFactory } from '@nestjs/core';
import { install as sourceMapInstall } from 'source-map-support';
import { TldrawModule, TldrawWsModule } from '@modules/tldraw';
import { LegacyLogger, Logger } from '@src/core/logger';
import * as WebSocket from 'ws';
import { WsAdapter } from '@nestjs/platform-ws';
import { enableOpenApiDocs } from '@shared/controller/swagger';
import { AppStartLoggable } from '@src/apps/helpers/app-start-loggable';
import { ExpressAdapter } from '@nestjs/platform-express';
import express from 'express';

async function bootstrap() {
sourceMapInstall();

const nestExpress = express();
const nestExpressAdapter = new ExpressAdapter(nestExpress);
const nestApp = await NestFactory.create(TldrawModule, nestExpressAdapter);
nestApp.useLogger(await nestApp.resolve(LegacyLogger));
nestApp.enableCors();

const nestAppWS = await NestFactory.create(TldrawWsModule);
const wss = new WebSocket.Server({ noServer: true });
nestAppWS.useWebSocketAdapter(new WsAdapter(wss));
nestAppWS.enableCors();
enableOpenApiDocs(nestAppWS, 'docs');
const logger = await nestAppWS.resolve(Logger);

await nestAppWS.init();
await nestApp.init();

// mount instances
const rootExpress = express();

const port = 3349;
const basePath = '/api/v3';

// exposed alias mounts
rootExpress.use(basePath, nestExpress);
rootExpress.listen(port);

logger.info(
new AppStartLoggable({
appName: 'Tldraw server app',
})
);
}

void bootstrap();
3 changes: 2 additions & 1 deletion apps/server/src/config/database.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ interface GlobalConstants {
DB_URL: string;
DB_PASSWORD?: string;
DB_USERNAME?: string;
TLDRAW_DB_URL: string;
}

const usedGlobals: GlobalConstants = globals;

/** Database URL */
export const { DB_URL, DB_PASSWORD, DB_USERNAME } = usedGlobals;
export const { DB_URL, DB_PASSWORD, DB_USERNAME, TLDRAW_DB_URL } = usedGlobals;
12 changes: 11 additions & 1 deletion apps/server/src/modules/board/board.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { ContentElementFactory } from '@shared/domain';
import { ConsoleWriterModule } from '@infra/console';
import { CourseRepo } from '@shared/repo';
import { LoggerModule } from '@src/core/logger';
import { DrawingElementAdapterService } from '@modules/tldraw-client/service/drawing-element-adapter.service';
import { HttpModule } from '@nestjs/axios';
import { BoardDoRepo, BoardNodeRepo, RecursiveDeleteVisitor } from './repo';
import {
BoardDoAuthorizableService,
Expand All @@ -20,7 +22,14 @@ import { BoardDoCopyService, SchoolSpecificFileCopyServiceFactory } from './serv
import { ColumnBoardCopyService } from './service/column-board-copy.service';

@Module({
imports: [ConsoleWriterModule, FilesStorageClientModule, LoggerModule, UserModule, ContextExternalToolModule],
imports: [
ConsoleWriterModule,
FilesStorageClientModule,
LoggerModule,
UserModule,
ContextExternalToolModule,
HttpModule,
],
providers: [
BoardDoAuthorizableService,
BoardDoRepo,
Expand All @@ -37,6 +46,7 @@ import { ColumnBoardCopyService } from './service/column-board-copy.service';
BoardDoCopyService,
ColumnBoardCopyService,
SchoolSpecificFileCopyServiceFactory,
DrawingElementAdapterService,
],
exports: [
BoardDoAuthorizableService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ExternalToolElementResponse } from './external-tool-element.response';
import { DrawingElementResponse } from './drawing-element.response';
import { FileElementResponse } from './file-element.response';
import { LinkElementResponse } from './link-element.response';
import { RichTextElementResponse } from './rich-text-element.response';
Expand All @@ -9,7 +10,8 @@ export type AnyContentElementResponse =
| LinkElementResponse
| RichTextElementResponse
| SubmissionContainerElementResponse
| ExternalToolElementResponse;
| ExternalToolElementResponse
| DrawingElementResponse;

export const isFileElementResponse = (element: AnyContentElementResponse): element is FileElementResponse =>
element instanceof FileElementResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ApiProperty } from '@nestjs/swagger';
import { ContentElementType } from '@shared/domain';
import { TimestampsResponse } from '../timestamps.response';

export class DrawingElementContent {
constructor({ description }: DrawingElementContent) {
this.description = description;
}

@ApiProperty()
description: string;
}

export class DrawingElementResponse {
constructor({ id, content, timestamps, type }: DrawingElementResponse) {
this.id = id;
this.timestamps = timestamps;
this.type = type;
this.content = content;
}

@ApiProperty({ pattern: '[a-f0-9]{24}' })
id: string;

@ApiProperty({ enum: ContentElementType, enumName: 'ContentElementType' })
type: ContentElementType.DRAWING;

@ApiProperty()
timestamps: TimestampsResponse;

@ApiProperty()
content: DrawingElementContent;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './any-content-element.response';
export * from './create-content-element.body.params';
export * from './drawing-element.response';
export * from './external-tool-element.response';
export * from './file-element.response';
export * from './link-element.response';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ export class RichTextContentBody {
inputFormat!: InputFormat;
}

export class DrawingContentBody {
@IsString()
@ApiProperty()
description!: string;
}

export class RichTextElementContentBody extends ElementContentBody {
@ApiProperty({ type: ContentElementType.RICH_TEXT })
type!: ContentElementType.RICH_TEXT;
Expand Down Expand Up @@ -118,6 +124,7 @@ export class ExternalToolElementContentBody extends ElementContentBody {

export type AnyElementContentBody =
| FileContentBody
| DrawingContentBody
| LinkContentBody
| RichTextContentBody
| SubmissionContainerContentBody
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { NotImplementedException } from '@nestjs/common';
import {
fileElementFactory,
drawingElementFactory,
linkElementFactory,
richTextElementFactory,
submissionContainerElementFactory,
} from '@shared/testing';
import {
FileElementResponse,
LinkElementResponse,
DrawingElementResponse,
RichTextElementResponse,
SubmissionContainerElementResponse,
} from '../dto';
Expand Down Expand Up @@ -37,6 +39,14 @@ describe(ContentElementResponseFactory.name, () => {
expect(result).toBeInstanceOf(RichTextElementResponse);
});

it('should return instance of DrawingElementResponse', () => {
const drawingElement = drawingElementFactory.build();

const result = ContentElementResponseFactory.mapToResponse(drawingElement);

expect(result).toBeInstanceOf(DrawingElementResponse);
});

it('should return instance of SubmissionContainerElementResponse', () => {
const submissionContainerElement = submissionContainerElementFactory.build();

Expand Down
Loading
Loading