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

Tärpistö 3.0 -update #63

Merged
merged 308 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
f1e53a2
Add health check endpoint
FinThunderstorm May 11, 2023
8f2b355
Add robots.txt
FinThunderstorm May 11, 2023
6ab67a2
Add favicon
FinThunderstorm May 11, 2023
6ee39b5
Add security headers
FinThunderstorm May 11, 2023
46a6926
Cleanup old stuff
FinThunderstorm May 11, 2023
a1f4e33
Change to use newer public folder instead of static
FinThunderstorm May 11, 2023
9a3f1d0
Rename utilities to lib as them are more lib stuff than utilities
FinThunderstorm May 11, 2023
76a64be
Remove permissions not existing and temporarily allow unsafe inline s…
FinThunderstorm May 11, 2023
63222d9
Redirect to right courseSlug if wrong
FinThunderstorm May 11, 2023
3481afc
Remove dead import
FinThunderstorm May 11, 2023
bf86096
Rename start-server to tell that it is used for dev server
FinThunderstorm May 11, 2023
509271a
Add somehow missing packages for s3 client for building next
FinThunderstorm May 11, 2023
39a117e
Inject s3 credentials also in production and test
FinThunderstorm May 11, 2023
e9e41b1
Parse env values using zod and update configs
FinThunderstorm May 11, 2023
65da9e4
Listen also user given env values instead of hard overriding
FinThunderstorm May 11, 2023
f208dca
Add Suspense borders to pages
FinThunderstorm May 11, 2023
2230d51
Remove dead import
FinThunderstorm May 11, 2023
ede2252
Add Content-Type header with mimeType to exam file download as browse…
FinThunderstorm May 11, 2023
df6f28e
Add local building script
FinThunderstorm May 12, 2023
13012c1
Add prod/test server starting script and remove code moved to common
FinThunderstorm May 12, 2023
1978920
Add config option for cookie name
FinThunderstorm May 12, 2023
7decde3
Add development environment only auto-login if no cookies provided fo…
FinThunderstorm May 12, 2023
b7bc5c1
Change exam links to use Next's link instead of plain a
FinThunderstorm May 13, 2023
495aa58
Update Next to canary version for better server actions support
FinThunderstorm May 13, 2023
702c7d8
Convert course creation to use server actions as this way them does n…
FinThunderstorm May 13, 2023
174fa75
Move forms to tools folder as they are basically the same
FinThunderstorm May 13, 2023
70c41ae
Revert test migrations table name to same as currently they are still…
FinThunderstorm May 13, 2023
80fbb5d
Use server actions for renaming course
FinThunderstorm May 14, 2023
d397e0e
Use stable Next.js version as iron-session has dependency on Next and…
FinThunderstorm May 14, 2023
8069e1a
Convert course deletion to use server actions
FinThunderstorm May 14, 2023
bac9ad9
Convert delete exam to server actions
FinThunderstorm May 14, 2023
629ca6d
Convert rename exam to server actions
FinThunderstorm May 14, 2023
320029e
Fix permissions in course rename
FinThunderstorm May 14, 2023
2d13b51
Rework exam list item managing to suit server actions and to avoid pl…
FinThunderstorm May 15, 2023
bed4549
Disable CSP on dev as Next.js error handler for dev is runned on inli…
FinThunderstorm May 19, 2023
14e5660
Move to use Next image and link components where appliable.
FinThunderstorm May 19, 2023
d9b172d
Do not cache health route as it would be nonsense.
FinThunderstorm May 19, 2023
863bc46
Convert config to fetch every env one-by-one as Next.js does treeshak…
FinThunderstorm May 19, 2023
248f7a3
Move handling cookies from auth/callback to middleware. Move from iro…
FinThunderstorm May 19, 2023
3e7acf9
Move needed API routes to app folder route handlers and drop routes r…
FinThunderstorm May 19, 2023
9c35330
Drop unused imports
FinThunderstorm May 19, 2023
f31369b
Use dev user if not user service token in dev
FinThunderstorm May 19, 2023
d9cd29f
Use consistent styling in controls box with listings
FinThunderstorm May 19, 2023
9906291
Move exam edit forms to tools to same dir as others
FinThunderstorm May 19, 2023
8b1ac24
Fetch course name to metadata
FinThunderstorm May 19, 2023
0f7c72a
Update dependencies
FinThunderstorm May 20, 2023
35b4a23
Implement caching to getting courses and exams from DB to avoid multi…
FinThunderstorm May 20, 2023
bd5975e
Refactor session handling to be more usable
FinThunderstorm May 20, 2023
750a89c
Convert upload exam to server components and allow multiple files to …
FinThunderstorm May 23, 2023
1fc31cf
Read cookie config variables from environment
FinThunderstorm May 23, 2023
7079f4f
Add returning DevAuthData to session as there is occations in dev whe…
FinThunderstorm May 23, 2023
4aaa267
Check all package.json script commands are valid
FinThunderstorm May 23, 2023
b96752e
Pin all dependencies to exact version.
FinThunderstorm May 23, 2023
46324c7
Remove caching from db queries as it looks like in server side them a…
FinThunderstorm May 23, 2023
56a2cdb
Add API routes for all server actions as them might be useful when te…
FinThunderstorm May 23, 2023
9504a18
Remove experimental appdir as it is now stable
FinThunderstorm May 23, 2023
4dfd0d6
Get ready for testing with disabling flash messages - not implemented…
FinThunderstorm May 23, 2023
c8c1cb1
Check and fix testing configs for Next.js
FinThunderstorm May 23, 2023
425a7b2
Create fixtures for handling courseList and examList
FinThunderstorm May 23, 2023
801e4e0
Go through element attributes consistency for testing
FinThunderstorm May 23, 2023
13b02e2
CourseListing tests updated
FinThunderstorm May 23, 2023
6f9ecab
Add API routes for all exams and specific exam. Mainly used for testi…
FinThunderstorm May 23, 2023
b0f0bf5
Add navigations to courseList fixture
FinThunderstorm May 23, 2023
f2f3b30
Add try-catch handling to deleting course
FinThunderstorm May 23, 2023
87869df
Add invalid examId check to renaming exam
FinThunderstorm May 23, 2023
f0024d6
ExamListing tests updated
FinThunderstorm May 23, 2023
0d76fb0
header and footer tests checked
FinThunderstorm May 23, 2023
9f283cf
drop db seeding as tests are no longer dependant on them
FinThunderstorm May 23, 2023
78a53c3
Automatically dropped after no pages directory
FinThunderstorm May 23, 2023
ec5394f
Drop pages router API endpoint session fetching as no longer used
FinThunderstorm May 23, 2023
5a00b10
Bootstrap icon fonts did not go to production (showed nothing) and fi…
FinThunderstorm May 23, 2023
af2f6fe
Add APP_ENV env variable as Next.js is forcing NODE_ENV based on used…
FinThunderstorm May 23, 2023
42da83f
Use production build (with dev stuff) in tests to be able handle more…
FinThunderstorm May 23, 2023
c91eca2
Add rc for saving all dependencies as exact version.
FinThunderstorm May 23, 2023
57284da
Use Next Image component with icons
FinThunderstorm May 23, 2023
f54c0de
Add run-tests.sh script and update tests in CI to match
FinThunderstorm May 23, 2023
f74d2b6
Add more informative debug echos and pass compose project name to hea…
FinThunderstorm May 24, 2023
9d63371
Add GHA error formatting to health checks
FinThunderstorm May 24, 2023
52c83b4
Add first version of building Docker image
FinThunderstorm May 24, 2023
8a82a0c
Drop compose_project_name as looks like it did not bring wanted actions
FinThunderstorm May 24, 2023
ec810f5
Rearrange layout in courselist to have right boundaries for Next.js s…
FinThunderstorm May 25, 2023
fe0c932
Do layout conversion for exam list
FinThunderstorm May 25, 2023
965b7e6
Implement loading indicators for course & exam lists
FinThunderstorm May 25, 2023
33bcf0b
Check error pages
FinThunderstorm May 25, 2023
53ecfb5
Convert url naming to not have nesting and add redirects from old pat…
FinThunderstorm May 25, 2023
ebd0bac
Update dependencies
FinThunderstorm May 26, 2023
a3d3e3e
Drop unnecessary warning as mimetype is going right nowadays
FinThunderstorm May 26, 2023
bd2f4f4
Check API routes rights and error handling messages to be correct
FinThunderstorm May 26, 2023
dd30b7a
Use layouts as base for metadata and add to handler pages
FinThunderstorm May 26, 2023
1a3c298
Destroy test DB volume also after testing to ensure empty DB for ever…
FinThunderstorm May 26, 2023
b85728f
Check loading element accessibility
FinThunderstorm May 26, 2023
b2a3d3f
Refactor spread operators to use variables
FinThunderstorm May 26, 2023
b946030
Fix exam list header css
FinThunderstorm May 26, 2023
12792b8
Update dependencies 07/2023
FinThunderstorm Jul 16, 2023
ed62a3a
Change to latest Next canary for maybe less bugs. Clean unused packages.
FinThunderstorm Jul 20, 2023
a32b1f5
Add Tailwind configuration
FinThunderstorm Jul 20, 2023
367df1e
Convert header and footer to use Tailwind
FinThunderstorm Jul 20, 2023
9cdd828
Convert listing navigation to use Tailwind
FinThunderstorm Jul 20, 2023
5ecfa00
Convert course listing to Tailwind
FinThunderstorm Jul 20, 2023
7eaedeb
Convert exam list to Tailwind
FinThunderstorm Jul 20, 2023
73dce7e
Convert forms to Tailwind
FinThunderstorm Jul 20, 2023
433fb88
Create baseline for modals for creating courses, uploading exams and …
FinThunderstorm Jul 20, 2023
fdcb250
Create course creation modal implementation
FinThunderstorm Jul 20, 2023
f7cbb1d
Create exam upload modal implementation
FinThunderstorm Jul 20, 2023
65d014e
Create course management modal implementation
FinThunderstorm Jul 20, 2023
1a10f0e
Create exam management modal implementation
FinThunderstorm Jul 20, 2023
85ba60c
Redirect to course listing if no slug for course given
FinThunderstorm Jul 20, 2023
a0ca578
Drop control box out of admin page as not used anymore
FinThunderstorm Jul 20, 2023
252e7f0
Sort imports
FinThunderstorm Jul 20, 2023
f09990a
Drop old styling as replaced with Tailwind
FinThunderstorm Jul 20, 2023
5aa2a19
Drop public folder as content not used anymore after Tailwind transit…
FinThunderstorm Jul 20, 2023
6a1e9a1
Drop unused components
FinThunderstorm Jul 20, 2023
5e1a822
Hide search bar as not implemented yet
FinThunderstorm Jul 20, 2023
106a661
Convert admin page to Tailwind
FinThunderstorm Jul 20, 2023
98aceb2
Enable modal close button as Next has fixed the client component impo…
FinThunderstorm Jul 22, 2023
b25970a
Refactor file structure to use src folder for more cleaner end result
FinThunderstorm Jul 22, 2023
07806f9
Fix header and footer tests to reflect changes
FinThunderstorm Jul 22, 2023
3560888
Fix accessibility tests and accessibility issues encountered while do…
FinThunderstorm Jul 24, 2023
477eaf4
Fix courselist looks right tests
FinThunderstorm Jul 24, 2023
f351871
Fix courselist functions right tests
FinThunderstorm Jul 24, 2023
73d2c2e
Shard tests in GHA in order to run tests faster
FinThunderstorm Jul 24, 2023
9bac285
Add modal can be closed test
FinThunderstorm Jul 24, 2023
acbf3cd
Fix examlist looks right tests
FinThunderstorm Jul 24, 2023
2b58be3
Change file size limit in server actions to 25mb from default 1mb
FinThunderstorm Jul 24, 2023
c21e91b
Update to latest Next.js canary in order avoid bugs
FinThunderstorm Jul 25, 2023
138a986
Improve courselist tests
FinThunderstorm Jul 25, 2023
eb77f77
Fix examlist works tests
FinThunderstorm Jul 25, 2023
41fabbc
Drop page.reload() from modal versions as Next.js has still bugs with…
FinThunderstorm Jul 25, 2023
e1cca9c
Move manage page to have own layout
FinThunderstorm Jul 25, 2023
461e626
Fix compose project name being wrong in CI
FinThunderstorm Jul 25, 2023
eeb7d37
Pin Node to minor version for consistency
FinThunderstorm Jul 25, 2023
0af1e43
Comment out piping database health check to null in order to see what…
FinThunderstorm Jul 25, 2023
d83f55c
Add TTY flag as looks like it does not handle this without it in CI
FinThunderstorm Jul 25, 2023
9e997e5
Return piping db health check to null and remove GlobalError as it lo…
FinThunderstorm Jul 25, 2023
b99d7aa
Tryout new build system
FinThunderstorm Jul 27, 2023
d66e8d6
Add forgotten DB setup
FinThunderstorm Jul 27, 2023
2a76292
Fix tags and labels in docker build
FinThunderstorm Jul 27, 2023
3ff1949
Fix docker build command more
FinThunderstorm Jul 27, 2023
f860cf1
Extract tags and labels handling to own function
FinThunderstorm Jul 27, 2023
bb2cb75
Debug all docker build variables
FinThunderstorm Jul 27, 2023
1bb4f1a
Parse Docker info from JSON
FinThunderstorm Jul 27, 2023
f13d2e5
Improve run prod-like env script
FinThunderstorm Jul 27, 2023
012322f
Run security-scan with prod-like env
FinThunderstorm Jul 27, 2023
2fa9b23
Have main menu open/close state reflected to button icon
FinThunderstorm Jul 28, 2023
718f044
Check error and not found page styling
FinThunderstorm Jul 28, 2023
9355aca
Run prettier
FinThunderstorm Jul 28, 2023
d07e328
Update to latest Next.js canary to see error reasons why Google Fonts…
FinThunderstorm Jul 28, 2023
16d4401
Fix Docker image build and prod & security scan scripts
FinThunderstorm Jul 28, 2023
318ffad
Update README.md
FinThunderstorm Jul 28, 2023
87b2351
Drop bg from not found and error as there is already correct one
FinThunderstorm Jul 28, 2023
11f454e
Convert build & push to use new
FinThunderstorm Jul 28, 2023
63d24f0
Try to fix weird bugs with tailwindcss and others like typescript not…
FinThunderstorm Jul 28, 2023
b7d212e
Fix problems in security scan as NODE_ENV production does install onl…
FinThunderstorm Jul 28, 2023
7391a73
Fix security scan networking problems and change to use automation fr…
FinThunderstorm Jul 29, 2023
82fae6e
Update README.md
FinThunderstorm Jul 29, 2023
fb0f96c
Take exit code from ZAP instead of Docker
FinThunderstorm Jul 29, 2023
bbd1a5f
Try if disabling outputSummary works
FinThunderstorm Jul 29, 2023
41e32ec
Convert to use Markdown report and echo it to GHA summary
FinThunderstorm Jul 29, 2023
f8072f5
Convert querystring to use URL object as middleware is not liking these
FinThunderstorm Jul 29, 2023
244371f
Improve zap config to have no unlimited runtime as therefore it will …
FinThunderstorm Jul 30, 2023
54eecf9
As whitespace in labels caused problems, change to use docker bake in…
FinThunderstorm Aug 2, 2023
94bd8f0
Add combined bakefile print to be able debug if there is some day som…
FinThunderstorm Aug 2, 2023
7ac3fda
Add logging why bake file is not correct and move log group to right …
FinThunderstorm Aug 2, 2023
fed91ff
Update to latest Next.js canary. Modals are not creating erros to log…
FinThunderstorm Aug 2, 2023
f4f8ff0
Change correct docker_info variable definition also to build workflow
FinThunderstorm Aug 2, 2023
7f96177
Fix bake file to be treated as file path instead of string in actions
FinThunderstorm Aug 2, 2023
e865d2e
Try to fix zap being not able create results file by creating results…
FinThunderstorm Aug 2, 2023
643150f
Give test-results more rights in Docker as linux is not handling them…
FinThunderstorm Aug 3, 2023
a99f13a
Remove FolderIcon as not used anymore
FinThunderstorm Sep 9, 2023
8960fae
Update dependencies
FinThunderstorm Sep 9, 2023
bc660ef
Use NextAuth and OAuth connection to user-service instead of older cu…
FinThunderstorm Sep 19, 2023
d8d75cb
Update dependencies 10/2023
FinThunderstorm Oct 4, 2023
63de9bf
Convert exam list to use CSS grid for more stable responsive design
FinThunderstorm Oct 4, 2023
8d04d89
Convert course list to use CSS grid for more stable responsive design
FinThunderstorm Oct 4, 2023
6a5d51c
Fix prettier after updates
FinThunderstorm Oct 4, 2023
34f4b05
Run prettier
FinThunderstorm Oct 4, 2023
da5b87b
Add .git-blame-ignore-revs for prettier runs
FinThunderstorm Oct 4, 2023
1d7e76b
Convert footer to grid layout
FinThunderstorm Oct 6, 2023
12a06f0
Convert header to grid layout
FinThunderstorm Oct 6, 2023
9558d8d
Convert rest of elements including base layout to CSS grid
FinThunderstorm Oct 11, 2023
cc867a8
Update dependencies 11/2023
FinThunderstorm Nov 26, 2023
4f975b4
Update dependencies 12/2023
FinThunderstorm Dec 16, 2023
8399d02
Fix prettier configuration invalid in VSCode
FinThunderstorm Dec 17, 2023
3b81366
Make it possible to give files a type before upload and display them …
FinThunderstorm Dec 17, 2023
791b553
Add type to file management
FinThunderstorm Dec 17, 2023
f1a81de
Refactor filelist to object list to be more precise
FinThunderstorm Dec 17, 2023
26ca37a
Refactor all instances for exam to be file as now there can be also o…
FinThunderstorm Dec 17, 2023
856bb75
Refactor exam-archive and exam-archive-new to tarpisto
FinThunderstorm Dec 17, 2023
ea89682
Do not show header row if no rows found, because now there is more th…
FinThunderstorm Dec 17, 2023
7be210a
Update Minio to latest version and realise that image does not anymor…
FinThunderstorm Dec 19, 2023
14d81d1
Update rest Minio port references
FinThunderstorm Dec 19, 2023
6ce9a71
Fix tests
FinThunderstorm Dec 26, 2023
9669f11
Update dependencies 12/2023
FinThunderstorm Dec 26, 2023
fa9d639
Fix date-fns syntax to match new v3
FinThunderstorm Dec 26, 2023
d44167b
Fix not found page rendering both not found and error page
FinThunderstorm Dec 26, 2023
28dea79
Improve accessibility based on accessibility testing
FinThunderstorm Dec 26, 2023
dbcaf9f
If development, user-service is not needed but left possibility to us…
FinThunderstorm Dec 28, 2023
d3af392
Match docker-compose file envs to current
FinThunderstorm Dec 28, 2023
ab3a883
Fix Docker image build
FinThunderstorm Dec 28, 2023
601882d
Drop libc6-compat as Next.js build is not currently done in Docker
FinThunderstorm Dec 31, 2023
83cb417
Update env variables handling
FinThunderstorm Feb 3, 2024
d9134fe
Update dependencies 02/2024
FinThunderstorm Feb 3, 2024
6e0689b
Add check for file type in upload
FinThunderstorm Feb 3, 2024
02e38c3
Move classnaming to right element after accessibility improvments
FinThunderstorm Feb 3, 2024
46b6baa
Prettier
FinThunderstorm Feb 3, 2024
1f5d145
Add prettier commit
FinThunderstorm Feb 3, 2024
e4333b8
Add dist test to tsconfig
FinThunderstorm Feb 3, 2024
30bf057
Update README.md
FinThunderstorm Feb 3, 2024
01a504e
Make admin page usable in prod but with need of administrator bit
FinThunderstorm Feb 3, 2024
4471040
Cleanup
FinThunderstorm Feb 3, 2024
eb781b7
Throw error instead of quiet return if no rights
FinThunderstorm Feb 3, 2024
2df3251
Drop npmrc
FinThunderstorm Feb 3, 2024
a1d7716
Update also nvmrc
FinThunderstorm Feb 3, 2024
cb0c058
More scripts functions from common
FinThunderstorm Feb 3, 2024
6d1af3c
Small accessibility fixes
FinThunderstorm Feb 3, 2024
38b645c
Fix tests
FinThunderstorm Feb 3, 2024
dbe56d8
Add raw version of OpenTelemetry
FinThunderstorm Feb 3, 2024
994259c
Bring course slug checker back
FinThunderstorm Feb 3, 2024
d5d49a5
Improve user rights validation
FinThunderstorm Feb 3, 2024
e2264fe
Get rid of laying anys
FinThunderstorm Feb 3, 2024
64c9499
Handle next_not_found in api responses
FinThunderstorm Feb 3, 2024
d21eda4
Turn instrumentationHook on for OpenTelemetry
FinThunderstorm Feb 3, 2024
35d34bb
Bring back playwright comments and add to Dockerfile
FinThunderstorm Feb 3, 2024
2b538d6
Merge remote-tracking branch 'upstream/master' into tarpisto-3.0
FinThunderstorm Feb 3, 2024
ae1fb8c
Fix dev user back to right
FinThunderstorm Feb 3, 2024
930437e
Fix missing definition
FinThunderstorm Feb 3, 2024
8b9fc1c
Add more missing definitions
FinThunderstorm Feb 3, 2024
33b0246
Update README.md
FinThunderstorm Feb 3, 2024
2b0d301
Fix security testing
FinThunderstorm Feb 6, 2024
dfa2009
Fix security testing to be able really test
FinThunderstorm Feb 8, 2024
44ccd17
Update dependencies 02/2024
FinThunderstorm Feb 8, 2024
081c7d6
Add missing files and fix start-local-env.sh
FinThunderstorm Feb 9, 2024
819166f
Make separate images for security testing and prod
FinThunderstorm Feb 9, 2024
f8280a1
Check security testing results and add list of ignored
FinThunderstorm Feb 10, 2024
3032f83
Move zap rules to zap.yaml in order to use them
FinThunderstorm Feb 11, 2024
4a4ddf4
Fix rules in zap.yaml
FinThunderstorm Feb 11, 2024
ba4e04b
Test if this docker zap does not need permissions working anymore
FinThunderstorm Feb 15, 2024
59f9564
Test fetching results with copy
FinThunderstorm Feb 18, 2024
ac3ef14
Check Docker info for missing docker-compose cp
FinThunderstorm Feb 18, 2024
8b115fd
Update to use newer docker-compose as docker-compose is older v1 in GHA
FinThunderstorm Feb 18, 2024
bbba35c
Change to check if GHA via CI variable
FinThunderstorm Feb 18, 2024
3e12124
Test if CI and GHA var are set
FinThunderstorm Feb 18, 2024
ca0ce4a
Change GHA check to check if val is true
FinThunderstorm Feb 18, 2024
18bccae
Run full ZAP suite as tests are now working
FinThunderstorm Feb 18, 2024
d978dfb
Prepare for auto deploy
FinThunderstorm Feb 18, 2024
e2a4b8b
Update dependencies 06/2024
FinThunderstorm Jun 2, 2024
3f53e8a
Downgrade Next to previous version as 14.2.* has broken not found pag…
FinThunderstorm Jun 2, 2024
8c26917
Merge remote-tracking branch 'upstream/master' into tarpisto-3.0
FinThunderstorm Jun 2, 2024
9410492
Update zaproxy
FinThunderstorm Jun 2, 2024
74d6cf7
Update za ignore
FinThunderstorm Jun 2, 2024
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
16 changes: 8 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*
!migrations/
!scripts/
!src/
!static/
!knexfile.js
!package-lock.json
!src/migrations
!dist/production
!package.json
!README.md
!tsconfig.json
!package-lock.json
!scripts/start-security-test-server.sh
!scripts/start-prod-server.sh
!scripts/common.sh
!next.config.js
!knexfile.js
24 changes: 0 additions & 24 deletions .env-sample

This file was deleted.

29 changes: 29 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Run `git config blame.ignoreRevsFile .git-blame-ignore-revs`

# to make git-blame ignore the commits in these commits. Add

# a commit hash here if you e.g. run prettier on the entire repo

# Run prettier on data json

9463b8c4b9537aeeeb3568021cbea29f3be137bd

# run prettier

a5932a47e876735820a4874e1cfee10cc9c24397

# run prettier

5cb0ea27fb52d428be9feea3d1913134e9226a82

# Run prettier

9355acaa2d29af7d2c9a5b255bcec01a66ae8091

# Run prettier

34f4b05d2b1ca3ec5cac4336209a3ee9f6f8b000

# Prettier

46b6baaa71e22d78ca1c627db49bf57e623af8ca
20 changes: 8 additions & 12 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
# Use docker.io for Docker Hub if empty
REGISTRY: registry.tko-aly.fi
IMAGE_NAME: exam-archive
IMAGE_NAME: tarpisto

jobs:
build:
Expand All @@ -19,13 +19,13 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4.1.6

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata for worker
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -34,12 +34,8 @@ jobs:
type=ref,event=tag
type=ref,event=pr
type=sha
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build Docker image
run: ./scripts/build-image.sh
env:
DOCKER_INFO: ${{ steps.meta.outputs.bake-file }}
40 changes: 25 additions & 15 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:
types: [published]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: registry.tko-aly.fi
IMAGE_NAME: exam-archive
IMAGE_NAME: tarpisto

jobs:
build:
Expand All @@ -17,12 +15,16 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]

- name: Get commit SHA for Docker image tag
id: sha
run: echo "value=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3.2.0
with:
registry: ${{ secrets.PRIVATE_REGISTRY_URL }}
username: ${{ secrets.PRIVATE_REGISTRY_USER }}
Expand All @@ -32,21 +34,29 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata for worker
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v5.5.1
with:
images: ${{ secrets.PRIVATE_REGISTRY_URL }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/[email protected]
type=raw,value=sha-${{ steps.sha.outputs.value }}

- name: Build Docker image
run: ./scripts/build-image.sh
env:
DOCKER_INFO: ${{ steps.meta.outputs.bake-file }}

- name: Push Docker image
run: docker push ${{ steps.meta.outputs.tags }}

- name: Trigger deployment
uses: aurelien-baudet/workflow-dispatch@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
token: ${{ secrets.DEPLOYMENT_PAT }}
workflow: Bump Service
inputs: '{"service": "tarpisto", "tag": "sha-${{ steps.sha.outputs.value }}"}'
repo: TKOaly/tko-aly-k8s-configs
ref: main
29 changes: 3 additions & 26 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: copy example .env
run: cp .env-sample .env
- name: Start database and S3
run: docker-compose up -d
- name: Build server
run: npm run build
- name: Start server
run: npm start &
env:
# Need to run in development mode as currently only way to auto login
NODE_ENV: development
# TODO: Create OpenAPI definition and run also ZAP Api scan
- name: Run ZAP Full scan
uses: zaproxy/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
target: 'http://localhost:9000'
fail_action: true
allow_issue_writing: false
rules_file_name: .zap-rules.tsv
- uses: actions/[email protected]
- name: Run security scan
run: ./run-security-scan.sh
35 changes: 13 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,22 @@ on:
branches: [master]
jobs:
test:
strategy:
fail-fast: false
matrix:
shards: [1, 2, 3, 4, 5]
total_shards: [5]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: copy example .env
run: cp .env-sample .env
- name: Start database and S3
run: docker-compose up -d
- name: Install Playwright Browsers
run: npm run test:install
- uses: actions/[email protected]
- name: Run tests
run: npm run test
- name: Upload screenshots and videos
run: ./run-tests.sh
env:
PLAYWRIGHT_SHARD: ${{ matrix.shards }}
PLAYWRIGHT_TOTAL_SHARDS: ${{ matrix.total_shards }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.3
with:
name: test-results
name: test-results-${{ matrix.shards }}
path: test-results
- name: Upload accessibility reports
if: always()
uses: actions/upload-artifact@v3
with:
name: axe-reports
path: axe-reports
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20.14.0
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"tabWidth": 2,
"printWidth": 80,
"arrowParens": "avoid",
"trailingComma": "none"
"trailingComma": "none",
"plugins": ["prettier-plugin-tailwindcss"]
}
7 changes: 0 additions & 7 deletions .zap-rules.tsv

This file was deleted.

38 changes: 24 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
FROM node:16-alpine AS builder
FROM node:20.14.0-alpine AS deps

WORKDIR /app
WORKDIR /usr/src/tarpisto

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run build
COPY package.json package-lock.json ./
RUN npm ci --omit=dev

FROM node:16-alpine AS runner
FROM node:20.14.0-alpine AS base

WORKDIR /app
ENV PORT 9000
ENV ENV production
ENV NODE_ENV production
ENV APP_ENV production
ENV NEXT_TELEMETRY_DISABLED 1

COPY package*.json ./
RUN npm ci --omit=dev
WORKDIR /usr/src/tarpisto

COPY --from=builder /app/dist ./dist
# Bash for starting server, curl for container health checking
RUN apk add --no-cache bash curl

FinThunderstorm marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=deps /usr/src/tarpisto/node_modules ./node_modules
COPY . .

EXPOSE 9001
# Security test image
FROM base AS security

CMD ["bash", "./scripts/start-security-test-server.sh"]

# Prod image
FROM base AS prod

RUN rm ./scripts/start-security-test-server.sh

CMD ["npm", "start"]
CMD ["bash", "./scripts/start-prod-server.sh"]
Loading
Loading