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

THR-35 library management service #4448

Merged
merged 273 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
840a75f
THR-42 fixes to library storage (#4332)
marode-cap Aug 18, 2023
cfdee9f
Merge remote-tracking branch 'origin/main' into THR-18-dev-feature-h5…
marode-cap Aug 21, 2023
54bc0f8
Merge remote-tracking branch 'origin/main' into THR-18-dev-feature-h5…
marode-cap Aug 21, 2023
1c1e734
add console command to h5p-editor
SteKrause Aug 21, 2023
56ebbc3
delete h5p-editor static files
SteKrause Aug 21, 2023
cf7917e
Merge branch 'main' into THR-18-dev-feature-h5p-editor
SteKrause Aug 21, 2023
ab50e1d
Remove deployment from main
marode-cap Aug 21, 2023
ef3b235
remove static server
marode-cap Aug 23, 2023
add6306
add LibraryStorage to uc tests
SteKrause Aug 24, 2023
702dd35
expect LanguageType in editor uc test
SteKrause Aug 24, 2023
c794f0d
WIP: add cronjob and shell script
SteKrause Aug 25, 2023
6023e60
add missing language param at api tests
SteKrause Aug 25, 2023
fddebc1
add field name to response type IGetFileResponse
SteKrause Aug 25, 2023
47a4a24
Merge branch 'main' into THR-18-dev-feature-h5p-editor
SteKrause Aug 25, 2023
6f0fa49
change library entity constructor
SteKrause Aug 25, 2023
bcdde0c
h5p: run commands added
ssmid Aug 25, 2023
86892dc
h5p: library management app, module, service
ssmid Aug 25, 2023
d2ea67f
refactor library entity constructor
SteKrause Aug 25, 2023
c49f7ed
h5p: commands fix
ssmid Aug 25, 2023
8cec885
add list of files (#4349)
SevenWaysDP Aug 29, 2023
1f6da9f
code Smells corrector
MajedAlaitwniCap Aug 29, 2023
96e0aa5
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Aug 29, 2023
491b739
Merge branch 'main' into THR-18-dev-feature-h5p-editor
MajedAlaitwniCap Aug 29, 2023
de771ee
THR-6 H5P editor authorization (#4364)
marode-cap Aug 30, 2023
46e7055
Document custom transform pipe
marode-cap Aug 31, 2023
cea221f
h5p lib manage: fixes for dummy run
ssmid Aug 31, 2023
22cfe6e
Fix PR comments
marode-cap Aug 31, 2023
181c5a7
BaseEntityWithTimestamps for entities
marode-cap Aug 31, 2023
f81e90c
Address more PR comments
marode-cap Aug 31, 2023
85eefd7
pr comments
marode-cap Aug 31, 2023
2f1f8c7
pr comments
marode-cap Aug 31, 2023
5a39ff8
Better file handling
marode-cap Aug 31, 2023
8bc473f
Revert "add console command to h5p-editor"
SteKrause Sep 1, 2023
63e4403
Missing file
marode-cap Sep 4, 2023
c0ade86
Merge branch 'THR-18-dev-feature-h5p-editor' into THR-35-library-mana…
SteKrause Sep 4, 2023
43d28d5
add ansible role and cronjob h5p-library-mangament
SteKrause Sep 6, 2023
06cc46e
Merge remote-tracking branch 'origin/main' into THR-18-dev-feature-h5…
SevenWaysDP Sep 7, 2023
75ff0b6
fix changes from s3 module
SevenWaysDP Sep 7, 2023
5d35dbf
adjust library sh script and cronjob
SteKrause Sep 11, 2023
7490551
Merge remote-tracking branch 'origin/main' into THR-35-library-manage…
SteKrause Sep 13, 2023
dfc3ace
rename library-managament to library-management
SteKrause Sep 13, 2023
8e54db6
Merge remote-tracking branch 'origin/main' into THR-35-library-manage…
SteKrause Sep 14, 2023
3f5f0c2
Merge remote-tracking branch 'origin/THR-18-dev-feature-h5p-editor' i…
SteKrause Sep 14, 2023
dacaff3
refactor merge
SteKrause Sep 14, 2023
107b92c
import s3client-module into library-module
SteKrause Sep 14, 2023
85a827e
use app close in library module
SteKrause Sep 14, 2023
530ea1f
try alternative library app configuration
SteKrause Sep 14, 2023
8271fbc
start h5p library management as a microservice
SteKrause Sep 15, 2023
eea74ce
create application context fpr library management
SteKrause Sep 15, 2023
e1b9b20
change command in cronJob
SteKrause Sep 15, 2023
19c87a1
update console command
SteKrause Sep 15, 2023
c9fd20e
h5p editor: change api and static files urls
ssmid Sep 18, 2023
3f9e279
Merge branch 'main' into THR-preview
ssmid Sep 18, 2023
f0cf579
Merge branch 'main' into THR-18-dev-feature-h5p-editor
SteKrause Sep 19, 2023
07e2cd6
refactor library tests and imports
SteKrause Sep 19, 2023
e668d14
refactor imports of contentStorage and temporary file storage
SteKrause Sep 19, 2023
2926209
refactor h5p content tests
SteKrause Sep 19, 2023
72fb86b
delete unused imports
SteKrause Sep 19, 2023
aeb63ec
refactor h5p api tests
SteKrause Sep 19, 2023
a3b1b48
Merge branch 'main' into THR-18-dev-feature-h5p-editor
SteKrause Sep 20, 2023
32bbc70
refactor imports in module
SteKrause Sep 20, 2023
d86aad6
delete blank line
SteKrause Sep 20, 2023
60d5511
restructure api tests h5p-save-create
SteKrause Sep 21, 2023
0d3a031
h5p editor: temporarily dont map errors
ssmid Sep 22, 2023
3587106
refactor tests regarding authorization
SteKrause Sep 22, 2023
60c63ec
Merge branch 'main' into THR-18-dev-feature-h5p-editor
SteKrause Sep 22, 2023
ef79423
fix save-create api tests
SteKrause Sep 22, 2023
626fa3a
quick fixes service tests
SteKrause Sep 22, 2023
55a0d6f
get env vars for library management
SteKrause Sep 28, 2023
b6d7e46
fix test in contentStorage service
SteKrause Sep 28, 2023
00f0f35
update default schema
SteKrause Sep 28, 2023
0c2dcc3
refactor api editor files tests
SteKrause Sep 28, 2023
c05d4cb
adjust default schema
SteKrause Sep 29, 2023
894eb99
refactor default schema
SteKrause Sep 29, 2023
b668fbf
update default schema
SteKrause Sep 29, 2023
ab0c79f
Merge branch 'main' into THR-18-dev-feature-h5p-editor
SteKrause Sep 29, 2023
2c77307
h5p library management: delete unused controller and uc
ssmid Sep 29, 2023
67cdb42
h5p library management: service implementation
ssmid Sep 29, 2023
1e91490
Merge branch 'THR-35-library-management-service' of ssh://github.com/…
ssmid Sep 29, 2023
9795a31
Merge branch 'THR-18-dev-feature-h5p-editor' into THR-35-library-mana…
ssmid Sep 29, 2023
785d702
h5p library management: fix merge leftover, bug, remove s3 config cha…
ssmid Sep 29, 2023
e863664
delete poc adjust s3 secrets
SteKrause Oct 2, 2023
9442da5
Merge branch 'main' into THR-18-dev-feature-h5p-editor
casparneumann-cap Oct 5, 2023
3ca3f04
set default parameter rangeStart = 0
casparneumann-cap Oct 6, 2023
309c57d
minor code structure adjustments
casparneumann-cap Oct 6, 2023
dd41731
refactor: only one return statement
casparneumann-cap Oct 6, 2023
9363337
fix commit dd41731: redefine type of returnValue
casparneumann-cap Oct 6, 2023
7db0a03
resolve type error for response stream
casparneumann-cap Oct 6, 2023
f3d62c9
Merge branch 'main' into THR-18-dev-feature-h5p-editor
casparneumann-cap Oct 9, 2023
545e5b1
revert minor code changes
casparneumann-cap Oct 10, 2023
01c39bd
review comments controller
MajedAlaitwniCap Oct 12, 2023
6461c34
Merge branch 'main' into THR-preview
MajedAlaitwniCap Oct 12, 2023
af8b7ae
Merge branch 'main' of https://github.com/hpi-schul-cloud/schulcloud-…
MajedAlaitwniCap Oct 13, 2023
68316df
Merge branch 'main' of https://github.com/hpi-schul-cloud/schulcloud-…
MajedAlaitwniCap Oct 13, 2023
c6578f7
Merge branch 'THR-preview' of https://github.com/hpi-schul-cloud/schu…
MajedAlaitwniCap Oct 13, 2023
6f21479
Revert "review comments controller"
MajedAlaitwniCap Oct 13, 2023
0aa44a3
Merge branch 'main' of https://github.com/hpi-schul-cloud/schulcloud-…
MajedAlaitwniCap Oct 16, 2023
cb8cf58
Fix s3 client mocks
marode-cap Oct 16, 2023
d277750
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Oct 16, 2023
80ea9f7
Fix tests
marode-cap Oct 16, 2023
61a4018
Merge branch 'THR-18-dev-feature-h5p-editor' of github.com:hpi-schul-…
marode-cap Oct 16, 2023
87eb68d
fix file storage service test
MajedAlaitwniCap Oct 16, 2023
cbcd4e3
Fix integration tests
marode-cap Oct 17, 2023
59347d6
Merge branch 'main' into THR-18-dev-feature-h5p-editor
casparneumann-cap Oct 18, 2023
fdcb79a
add empty line before return
casparneumann-cap Oct 18, 2023
29b522e
refactor: await below ifelse block
casparneumann-cap Oct 18, 2023
cc7a537
refactor: set default for rangeStart
casparneumann-cap Oct 18, 2023
dc9ff92
Merge remote-tracking branch 'origin/main' into THR-18-dev-feature-h5…
marode-cap Oct 23, 2023
6f8b7dc
Fix imports
marode-cap Oct 23, 2023
f866fbf
Remove import from files-storage
marode-cap Oct 23, 2023
42914bb
do not overwrite input parameter
casparneumann-cap Oct 23, 2023
dab58a5
change Error Type to NotAcceptable
casparneumann-cap Oct 23, 2023
de37fa5
create own h5pfile dto
casparneumann-cap Oct 23, 2023
bd03d2c
fix remaining review comments in temporary-file-storage.service
casparneumann-cap Oct 23, 2023
c1641a9
refactor h5peditor/ h5pplayer service to provider
casparneumann-cap Oct 23, 2023
90d5496
add test for new Repo Method
MajedAlaitwniCap Oct 23, 2023
d16c225
fix unit test for Temporary-file-storage
MajedAlaitwniCap Oct 23, 2023
fdc85d3
fix test Module imports
MajedAlaitwniCap Oct 24, 2023
7f80710
fix review comments: return method and error types
casparneumann-cap Oct 24, 2023
c4181e3
create seperate h5p error mapper - unit tests still WIP
casparneumann-cap Oct 24, 2023
aa9417b
update unit tests for uc.getAjax & uc.postAjax
casparneumann-cap Oct 24, 2023
44a731f
resolve ts expect error & Test corrector
MajedAlaitwniCap Oct 24, 2023
d351edb
resolve rest review comments h5p.uc.ts
MajedAlaitwniCap Oct 24, 2023
e870724
remove unused import
MajedAlaitwniCap Oct 24, 2023
e3f16eb
move PostBodyParamsTransformPipe to extra file
MajedAlaitwniCap Oct 25, 2023
39d0c3c
rename TemporaryFile to BaseEntityWithTimestamp
MajedAlaitwniCap Oct 25, 2023
869951f
add private method and use cause error
MajedAlaitwniCap Oct 25, 2023
cce115d
refactor from Service to H5PAjaxEndpointProvider
MajedAlaitwniCap Oct 25, 2023
4bce326
use explicit return type
MajedAlaitwniCap Oct 25, 2023
36835a7
use cause error types
MajedAlaitwniCap Oct 25, 2023
71b4b0d
Merge branch 'main' of https://github.com/hpi-schul-cloud/schulcloud-…
MajedAlaitwniCap Oct 25, 2023
9d5f27e
initial commit
MajedAlaitwniCap Oct 26, 2023
3079af6
create library.repo.spec test setup and first test
casparneumann-cap Oct 26, 2023
bef74d0
create tests for library.repo
casparneumann-cap Oct 26, 2023
61337bd
revert
MajedAlaitwniCap Oct 27, 2023
940fc64
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Oct 27, 2023
9f66fd9
revert zu main
MajedAlaitwniCap Oct 27, 2023
aa9bd5b
last review comments
MajedAlaitwniCap Oct 27, 2023
db22208
fix library.repo.spec code coverage
casparneumann-cap Oct 27, 2023
cbae4cc
Add library.entity.spec
casparneumann-cap Oct 27, 2023
e904f19
Add test for existsOne to increase CodeCoverage
casparneumann-cap Oct 27, 2023
01ca82e
add h5p-content mapper Test
MajedAlaitwniCap Oct 30, 2023
6ad00eb
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Oct 30, 2023
0c23228
Merge branch 'main' into THR-18-dev-feature-h5p-editor
MajedAlaitwniCap Nov 1, 2023
9d18235
Fix eslint
MajedAlaitwniCap Nov 1, 2023
aef7727
fix Test
MajedAlaitwniCap Nov 1, 2023
2d4c71d
fix saveFile mockImplementation
casparneumann-cap Nov 1, 2023
674766e
fix unnecessary type assertion
MajedAlaitwniCap Nov 1, 2023
fcee8cb
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Nov 1, 2023
9b58ed7
import Correction
MajedAlaitwniCap Nov 1, 2023
f75f0b4
add tests libraryStorage.service
casparneumann-cap Nov 1, 2023
ca5e12d
remove uneccessary
casparneumann-cap Nov 1, 2023
bcffb77
Remove uneccessary import
casparneumann-cap Nov 1, 2023
24f27a5
correction and add test for h5p mapper
MajedAlaitwniCap Nov 1, 2023
49899a9
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Nov 1, 2023
53ca6a6
remove uneccessary imports
casparneumann-cap Nov 1, 2023
bf13f4c
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
casparneumann-cap Nov 1, 2023
2899bc8
remove unused import
MajedAlaitwniCap Nov 1, 2023
1b5d4fa
test structure
MajedAlaitwniCap Nov 1, 2023
6912a15
add tests for library.entity
casparneumann-cap Nov 1, 2023
6675d4c
WIP | create tests post.body.params.transform-pipe
casparneumann-cap Nov 1, 2023
664d702
add tests for post.body.params.transform-pipe
casparneumann-cap Nov 2, 2023
49f718b
remove unused parameter
MajedAlaitwniCap Nov 2, 2023
0230fc9
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Nov 2, 2023
f1bbb16
Create Test for H5PContentMetadata
casparneumann-cap Nov 2, 2023
2e74ac8
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
casparneumann-cap Nov 2, 2023
a2c55f6
refactor Method
MajedAlaitwniCap Nov 2, 2023
f7db077
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Nov 2, 2023
220b67c
define method return type
MajedAlaitwniCap Nov 2, 2023
829920f
Add test for temporary-file-storage.service
casparneumann-cap Nov 2, 2023
dc650d3
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
casparneumann-cap Nov 2, 2023
390742c
remove unused import
MajedAlaitwniCap Nov 2, 2023
803867d
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Nov 2, 2023
72f713d
added H5p File Response interface
MajedAlaitwniCap Nov 2, 2023
3fd8d88
create tests h5p-content.entity
casparneumann-cap Nov 2, 2023
da8e01f
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
casparneumann-cap Nov 2, 2023
276feae
add GetLibraryFile dto
MajedAlaitwniCap Nov 2, 2023
e9f6f4b
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
MajedAlaitwniCap Nov 2, 2023
2336b3f
rename entity file
MajedAlaitwniCap Nov 2, 2023
d395712
Merge branch 'main' into THR-18-dev-feature-h5p-editor
MajedAlaitwniCap Nov 2, 2023
8ab5968
Create own GetLibraryFile Dto for UC
casparneumann-cap Nov 2, 2023
b03c0ff
Revert post.body.params.transform-pipe & logging
casparneumann-cap Nov 2, 2023
ee74358
Merge branch 'main' into THR-18-dev-feature-h5p-editor
casparneumann-cap Nov 3, 2023
10bcddb
Merge branch 'main' into THR-18-dev-feature-h5p-editor
casparneumann-cap Nov 3, 2023
7918dfc
bugfix post.body.params.transform-pipe
casparneumann-cap Nov 3, 2023
6c6f862
add return undefined
casparneumann-cap Nov 3, 2023
d38d6d9
quick fix: transformed can be undefined
casparneumann-cap Nov 3, 2023
0c992fb
adapt userMcok to updated ICurrentUser Interface
casparneumann-cap Nov 3, 2023
ab7b5d4
Restructure AjaxPostBodyParamsTransformPipe
casparneumann-cap Nov 3, 2023
34f61b4
quick fix nest-cli.json
casparneumann-cap Nov 3, 2023
93ee321
Merge branch 'main' into THR-18-dev-feature-h5p-editor
MajedAlaitwniCap Nov 6, 2023
f5fae89
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 6, 2023
b99e361
fix imports
casparneumann-cap Nov 6, 2023
5a970d2
Merge branch 'THR-18-dev-feature-h5p-editor' into THR-35-library-mana…
casparneumann-cap Nov 6, 2023
ca99771
Add Logging for LibraryManagement
casparneumann-cap Nov 7, 2023
d6135cf
Update h5p-libraries.yaml for testing
casparneumann-cap Nov 7, 2023
4a5b7a0
change user install library permission
casparneumann-cap Nov 7, 2023
19cd530
Merge branch 'THR-35-library-management-service' of https://github.co…
casparneumann-cap Nov 7, 2023
13af0b1
Create empty test setup
casparneumann-cap Nov 8, 2023
477bd25
implement tests for h5p-library-managment
casparneumann-cap Nov 8, 2023
05cd866
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 8, 2023
97e305e
adapt imports infra
casparneumann-cap Nov 8, 2023
2195b78
add tests h5p-library-management config
casparneumann-cap Nov 9, 2023
64ee40e
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 9, 2023
45a44f9
remove duplicate h5p-library-management.config
casparneumann-cap Nov 9, 2023
a1cac1f
Revert "Merge branch 'main' into THR-35-library-management-service"
casparneumann-cap Nov 9, 2023
d12ca4b
Revert "Merge branch 'main' into THR-35-library-management-service"
casparneumann-cap Nov 9, 2023
d025b14
Revert "Merge branch 'THR-35-library-management-service' of https://g…
casparneumann-cap Nov 9, 2023
bdd3638
Revert last 3 Reverts
casparneumann-cap Nov 9, 2023
f08e49f
Adapt imports to @infra for library management
casparneumann-cap Nov 9, 2023
b1cc49c
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 9, 2023
8495abb
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 10, 2023
5385124
Merge branch 'main' into THR-35-library-management-service
CeEv Nov 13, 2023
3c3f32b
review comment: import from modules
casparneumann-cap Nov 13, 2023
6f19e79
review comment: import from relative path
casparneumann-cap Nov 13, 2023
c6515bf
review comment: remove empty lines
casparneumann-cap Nov 13, 2023
f818a04
review comment: do not use deep imports
casparneumann-cap Nov 13, 2023
953313b
review comment: '@src/modules/h5p-editor'
casparneumann-cap Nov 13, 2023
1c6a720
review comment: execute getLIbraries before loop
casparneumann-cap Nov 13, 2023
78b2c19
review comment: add explicit return type
casparneumann-cap Nov 13, 2023
c8a5a27
review comment: golevelup
casparneumann-cap Nov 13, 2023
8045a52
review comment: solve use of config.get
casparneumann-cap Nov 16, 2023
10d27f0
review comment: await in foor loop
casparneumann-cap Nov 17, 2023
7046e3c
Revert "review comment: solve use of config.get"
casparneumann-cap Nov 17, 2023
dee0496
Change h5p-libraries.yaml
casparneumann-cap Nov 17, 2023
c6e04bc
review comment: test structure & setup
casparneumann-cap Nov 20, 2023
e6c060d
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 20, 2023
45ef16a
review comment: eslint no-console
casparneumann-cap Nov 20, 2023
617fddc
review comment: explicit public
casparneumann-cap Nov 20, 2023
bccda3f
review comment: nestjs exception
casparneumann-cap Nov 20, 2023
437b48d
review comment: remove export
casparneumann-cap Nov 20, 2023
800fd7e
review comment: import from source
casparneumann-cap Nov 20, 2023
b9b6285
review comment: ts type guard
casparneumann-cap Nov 20, 2023
7977671
review comment: delete storage-client
casparneumann-cap Nov 20, 2023
3c92235
review comment: type guard for user
casparneumann-cap Nov 20, 2023
6f30244
review comment: @modules --> merge from main
casparneumann-cap Nov 20, 2023
98c0bf2
review comment: test guidlines
casparneumann-cap Nov 20, 2023
7be4446
review comment: use the nest configuration module
casparneumann-cap Nov 21, 2023
8dd9d54
fix test: nest configuration service
casparneumann-cap Nov 21, 2023
e60e2fe
Fix: H5PLibraryManagementService' declared locally, but missing export.
casparneumann-cap Nov 21, 2023
d3490d2
fix unreachable code
casparneumann-cap Nov 21, 2023
5d050a0
fix default assignment
casparneumann-cap Nov 21, 2023
45969e0
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 21, 2023
74e4c05
Add Test File for h5p-library-management
casparneumann-cap Nov 21, 2023
cc275eb
Add cleanups and change comments
CeEv Nov 22, 2023
063eb1c
Cleanup orm initialization and make entity map global. Add process exit.
CeEv Nov 23, 2023
83d4300
test change h5p-libraries.yaml
casparneumann-cap Nov 23, 2023
0aa5a91
Test for castToLibrariesContentType Error Case
casparneumann-cap Nov 23, 2023
8ad11d2
Merge branch 'main' into THR-35-library-management-service
casparneumann-cap Nov 23, 2023
db71f80
Fix nest_lint: import order
casparneumann-cap Nov 24, 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
9 changes: 9 additions & 0 deletions ansible/roles/h5p-library-management/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
galaxy_info:
role_name: h5p-library-management
author: Schul-Cloud Verbund
description: h5p library role for the management of libraries
company: Schul-Cloud Verbund
license: license (AGPLv3)
min_ansible_version: 2.8
galaxy_tags: []
dependencies: []
6 changes: 6 additions & 0 deletions ansible/roles/h5p-library-management/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: H5pLibraryManagement CronJob
when: WITH_H5P_LIBRARY_MANAGEMENT is defined and WITH_H5P_LIBRARY_MANAGEMENT|bool == true
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: api-h5p-library-management-cronjob.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: batch/v1
kind: CronJob
metadata:
namespace: {{ NAMESPACE }}
labels:
app: api-library-management-cronjob
name: api-library-management-cronjob
spec:
schedule: "{{ SERVER_H5P_LIBRARY_MANAGEMENT_CRONJOB|default("0 3 * * 3,6", true) }}"
concurrencyPolicy: Forbid
jobTemplate:
spec:
activeDeadlineSeconds: {{ SERVER_H5P_LIBRARY_MANAGEMENT_CRONJOB_TIMEOUT|default("39600", true) }}
template:
spec:
containers:
- name: api-h5p-library-management-cronjob
image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }}
envFrom:
- configMapRef:
name: api-configmap
- secretRef:
name: api-secret
command: ['/bin/sh', '-c']
args: ['npm run nest:start:h5p:library-management']
resources:
limits:
cpu: {{ API_H5P_LIBRARY_MANAGEMENT_CPU_LIMITS|default("2000m", true) }}
memory: {{ API_H5P_LIBRARY_MANAGEMENT_MEMORY_LIMITS|default("2Gi", true) }}
requests:
cpu: {{ API_H5P_LIBRARY_MANAGEMENT_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_H5P_LIBRARY_MANAGEMENT_MEMORY_REQUESTS|default("150Mi", true) }}
restartPolicy: OnFailure
31 changes: 31 additions & 0 deletions apps/server/src/apps/h5p-library-management.app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* istanbul ignore file */
/* eslint-disable no-console */
import { NestFactory } from '@nestjs/core';
import { install as sourceMapInstall } from 'source-map-support';
import { LegacyLogger } from '@src/core/logger';
import { H5PLibraryManagementModule, H5PLibraryManagementService } from '@modules/h5p-library-management';

async function bootstrap() {
sourceMapInstall();

const nestApp = await NestFactory.createApplicationContext(H5PLibraryManagementModule);

// WinstonLogger
nestApp.useLogger(await nestApp.resolve(LegacyLogger));

await nestApp.init();

console.log('#########################################');
console.log(`##### Start H5P Library Management ######`);
console.log('#########################################');

// to execute it on this place for the ORM the allowGlobalContext: true must be set, but to executed in this way is a hack
await nestApp.get(H5PLibraryManagementService).run();
// TODO: properly close app (there is some issue with the logger)
console.log('#########################################');
console.log(`##### Close H5P Library Management ######`);
console.log('#########################################');
await nestApp.close();
process.exit(0);
}
void bootstrap();
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { FileFieldsInterceptor } from '@nestjs/platform-express';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ApiValidationError } from '@shared/common';
import { Request, Response } from 'express';

import { H5PEditorUc } from '../uc/h5p.uc';

import {
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/modules/h5p-editor/h5p-editor.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const imports = [
password: DB_PASSWORD,
user: DB_USERNAME,
// Needs ALL_ENTITIES for authorization
allowGlobalContext: true,
entities: [...ALL_ENTITIES, H5PContent, H5pEditorTempFile, InstalledLibrary],
}),
ConfigModule.forRoot(createConfigModuleOptions(config)),
Expand All @@ -65,5 +66,6 @@ const providers = [
imports,
controllers,
providers,
exports: [ContentStorage, LibraryStorage],
})
export class H5PEditorModule {}
4 changes: 3 additions & 1 deletion apps/server/src/modules/h5p-editor/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from './h5p-editor.module';
export { H5PEditorModule } from './h5p-editor.module';
export { ContentStorage, LibraryStorage } from './service';
export { s3ConfigContent, s3ConfigLibraries } from './h5p-editor.config';
4 changes: 2 additions & 2 deletions apps/server/src/modules/h5p-editor/uc/h5p.uc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ export class H5PEditorUc {
private changeUserType(currentUser: ICurrentUser): LumiIUser {
const user: LumiIUser = {
canCreateRestricted: false,
canInstallRecommended: true,
canUpdateAndInstallLibraries: true,
canInstallRecommended: false,
canUpdateAndInstallLibraries: false,
email: '',
id: currentUser.userId,
name: '',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { RabbitMQWrapperModule } from '@infra/rabbitmq';
import { S3ClientModule } from '@infra/s3-client';
import { createConfigModuleOptions } from '@src/config';
import { CoreModule } from '@src/core';
import { Logger } from '@src/core/logger';
import { H5PEditorModule, s3ConfigContent, s3ConfigLibraries } from '@modules/h5p-editor';
import { H5PLibraryManagementService, h5PLibraryManagementConfig } from './service';

const imports = [
ConfigModule.forRoot(createConfigModuleOptions(h5PLibraryManagementConfig)),
CoreModule,
H5PEditorModule,
RabbitMQWrapperModule,
S3ClientModule.register([s3ConfigContent, s3ConfigLibraries]),
];

const controllers = [];

const providers = [Logger, H5PLibraryManagementService];

@Module({
imports,
controllers,
providers,
exports: [],
})
export class H5PLibraryManagementModule {}
2 changes: 2 additions & 0 deletions apps/server/src/modules/h5p-library-management/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { H5PLibraryManagementModule } from './h5p-library-management.module';
export { H5PLibraryManagementService } from './service';
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { h5PLibraryManagementConfig } from './h5p-library-management.config';

describe('H5PLibraryManagementConfig', () => {
describe('h5PLibraryManagementConfig', () => {
describe('when h5PLibraryManagementConfig is called', () => {
it('should get Object s3ConfigLibraries', () => {
const config = h5PLibraryManagementConfig();
expect(config).toBeDefined();
});
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Configuration } from '@hpi-schul-cloud/commons';

export interface IH5PLibraryManagementConfig {
H5P_EDITOR__LIBRARY_LIST_PATH: string;
}

export const config: IH5PLibraryManagementConfig = {
H5P_EDITOR__LIBRARY_LIST_PATH: Configuration.get('H5P_EDITOR__LIBRARY_LIST_PATH') as string,
};

export const h5PLibraryManagementConfig = () => config;
Loading
Loading