Skip to content
Snippets Groups Projects
Commit e89d4044 authored by Katarína Platková's avatar Katarína Platková
Browse files

Merge main to dp

parent 49311761
No related branches found
No related tags found
No related merge requests found
Showing
with 175 additions and 81 deletions
NGINX_DEFAULT_REQUEST=index.html
NGINX_ROOT=dist
\ No newline at end of file
......@@ -19,3 +19,9 @@ graphql/lib
.yarn/*
!.yarn/releases/*
**/.yarn/*
# db file for liveenv
docker/live-env/data/**
# workspace settings
.vscode/settings.json
\ No newline at end of file
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/pipeline/#customization
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
image: node:20
stages:
- test
- buildimage
- test
- buildimage
variables:
VER: rolling-${CI_PIPELINE_ID}
ID: ${CI_COMMIT_SHORT_SHA}
ID: "${CI_COMMIT_SHORT_SHA}"
GIT_SUBMODULE_STRATEGY: recursive
CI_REGISTRY_IMAGE: frontend
CI_REGISTRY: gitlab.fi.muni.cz:5050/inject/container-registry/$CI_REGISTRY_IMAGE
IMAGE_TAG: $CI_REGISTRY:$VER
IMAGE_LATEST: $CI_REGISTRY:latest
# using "docker" as the host is only possible if you alias the service below
DOCKER_HOST: tcp://docker:2375
# could be wrong here but although Docker defaults to overlay2,
# Docker-in-Docker (DIND) does not according to the following GitLab doc:
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-the-overlayfs-driver
IMAGE_TAG: "$CI_REGISTRY:$VER"
IMAGE_LATEST: "$CI_REGISTRY:latest"
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_TLS_CERTDIR: ''
default:
tags:
- inject
# here we can use one cache for all jobs
- inject
cache:
key: yarn-cache
paths: [ .yarn ]
paths:
- ".yarn"
unit-test-job:
stage: test
script:
- yarn test
- yarn test
before_script:
- yarn
- yarn
lint-test-job:
stage: test
script:
- yarn lint
- yarn lint
before_script:
- yarn
- yarn
tsc-test-job:
stage: test
script:
- yarn workspace @inject/frontend tsc -b
- yarn workspace @inject/frontend tsc
- yarn workspace @inject/frontend tsc -b
- yarn workspace @inject/frontend tsc
before_script:
- yarn
- yarn
sast:
variables:
SAST_EXCLUDED_PATHS: backend
allow_failure: true
dependency_scanning:
variables:
DS_EXCLUDED_PATHS: backend
allow_failure: true
secret_detection:
allow_failure: false
create-image:
image: docker:20.10.16
services:
- name: docker:20.10.16-dind
alias: docker
command: ["--tls=false"]
- name: docker:20.10.16-dind
alias: docker
command:
- "--tls=false"
stage: buildimage
only:
refs:
- main
rules:
- if: "$CI_COMMIT_BRANCH == 'main'"
when: manual
- if: "$CI_COMMIT_TAG =~ /^v(?:\\d+.){2}(?:\\d+)$/"
when: manual
before_script:
- echo "Docker registry url is $CI_REGISTRY"
- echo "Docker registry username is $CI_REGISTRY_USER"
- echo "Docker registry repo is $CI_REGISTRY_IMAGE"
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- echo "Docker registry url is $CI_REGISTRY"
- echo "Docker registry username is $CI_REGISTRY_USER"
- echo "Docker registry repo is $CI_REGISTRY_IMAGE"
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
timeout: 12h
script:
- docker pull $IMAGE_LATEST || true
- docker build --cache-from $IMAGE_LATEST -t $IMAGE_TAG -t $IMAGE_LATEST ${CI_PROJECT_DIR}
- docker push $IMAGE_TAG
- docker push $IMAGE_LATEST
- docker pull $IMAGE_LATEST || true
- docker build --cache-from $IMAGE_LATEST --build-arg BUILD_NUMBER=$CI_PIPELINE_ID
-t $IMAGE_TAG -t $IMAGE_LATEST ${CI_PROJECT_DIR}
- docker push $IMAGE_TAG
- docker push $IMAGE_LATEST
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Jobs/Secret-Detection.gitlab-ci.yml
/** @type {import("prettier").Options} */
module.exports = {
trailingComma: 'es5',
printWidth: 80,
singleQuote: true,
semi: false,
tabWidth: 2,
useTabs: false,
bracketSpacing: true,
bracketSameLine: false,
jsxSingleQuote: true,
arrowParens: 'avoid',
endOfLine: 'auto',
plugins: [require.resolve('prettier-plugin-organize-imports')],
}
{
"trailingComma": "es5",
"printWidth": 80,
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"bracketSameLine": false,
"jsxSingleQuote": true,
"arrowParens": "avoid",
"endOfLine": "auto",
"plugins": ["prettier-plugin-organize-imports"]
}
\ No newline at end of file
{
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"javascript.updateImportsOnFileMove.enabled": "never",
"typescript.updateImportsOnFileMove.enabled": "never",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.nodePath": ".yarn/sdks"
}
2024-06-15 - add persistent storage to docker deployment
2024-06-13 - extend cache
2024-06-12 - remove html and htm support from file viewer
2024-06-03 - add user deletion and credentials reset
2024-05-30 - change default font to inter
2024-05-28 - fix responsive page title
2024-05-28 - move export-import to exercise panel, hide it from non-admin users
2024-05-28 - fix user edit (only send the fields that change)
2024-05-26 - improve user UI
2024-05-23 - add BCC to emails
2024-05-21 - improve PDF filed viewer UI, set continuous scroll as the default view
2024-05-21 - make unread channel buttons more noticeable
2024-05-21 - add User management UI
2024-05-16 - add emails forwarding
2024-05-15 - add role and exercise info into team selectors
2024-05-15 - fix draft persistance
......
......@@ -22,7 +22,9 @@ COPY . .
RUN yarn workspace @inject/frontend prebuild
RUN yarn workspace @inject/frontend build
ARG BUILD_NUMBER
RUN VITE_BUILD_NUMBER=${BUILD_NUMBER} yarn workspace @inject/frontend build
FROM nginx:1-alpine
......@@ -30,4 +32,7 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /usr/src/app/dist /usr/app
COPY ./frontend/substituteEnv.sh /docker-entrypoint.d/01-substitute-env.sh
ENV NGINX_DEFAULT_REQUEST=index.html \
NGINX_ROOT=dist
EXPOSE 80
LICENSE 0 → 100644
MIT License
Copyright 2024 Masaryk University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -64,6 +64,21 @@ Then build the `dist/` artifact from the frontend repository:
yarn build
```
## Live Environment
Monorepo contains a specialized Docker compose which aids in easier development of either frontend or backend. This compose is located in folder `docker/live-env/`. To run the compose you may start with `docker compose up`, to shut down `docker compose down`. For headless mode `docker compose up -d`.
Live Environment pre-generates logins on initialization and has persistent storage enabled. Logins are following:
- `t_staff@t.com` (Instructor)
- `t_user@t.com` (User)
- `t_super@t.com` (Superuser)
Password for all accounts is `t`. To access the deployment, it's located under `inject.localhost` localhost domain.
Live Environment has issues on WSL2/Windows Docker deployment with hot reloading of code, on Linux it should work. Please mind that the deployment runs development builds of IXP, not production. Thus in some cases it may not show certain bugs which are present in production builds.
To test out production environment it's adviced to use Nginx deployment for non-HTTPS deployment and set `INJECT_DOMAIN` to `inject.localhost`. This deployment fully replicates how the production environment runs.
## Generating Codegen headers
To aid in development and work with GraphQL, the project uses a tool called Codegen, which pulls the API described by the GraphQL Schema and generates appropriate Typescript library files that can be used with the project.
......@@ -96,3 +111,7 @@ The repo is littered with various README.md and GUIDELINES.md files that dictate
- GraphQL Codegen (allows for automatic typing of GraphQL queries)
- BlueprintJS (for UI)
- emotion CSS (for CSS-in-JS and type control)
## Usage of the repository in documentation
Parts of this repository are used automatically via a pipeline in the INJECT documentation. For more details, see the script that downloads and handles these files: [utilities.sh](https://gitlab.fi.muni.cz/inject/inject-docs/-/blob/main/utilities.sh?ref_type=heads). Some `.md` files may also include an attribute in the frontmatter `tags: used_in_docs` to indicate that they are used in the docs.
\ No newline at end of file
Subproject commit e72586326c2c6d9ed8a57e8bbabc86a86b4e661c
Subproject commit 3218d245f5ba5610798eb9d615e1fdfa42d2f475
MIT License
Copyright 2024 Masaryk University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -6,6 +6,7 @@ const config: CodegenConfig = {
'gql-cache/**/*.graphql',
],
verbose: true,
noSilentErrors: true,
ignoreNoDocuments: true, // for better experience with the watcher
config: {
scalars: {
......
......@@ -25,5 +25,5 @@ fragment ActionLog on ActionLogType {
...QuestionnaireDetails
}
}
readReceipt @client
readReceipt @client(always: true)
}
......@@ -2,8 +2,8 @@ fragment Channel on DefinitionChannelType {
id
name
type
readReceipt @client {
readReceipt
readReceipt @client(always: true) {
isUnread
teamId
}
}
......@@ -3,4 +3,7 @@ fragment CustomInjectDetails on CustomInjectDetailsType {
content {
...Content
}
overlay {
...Overlay
}
}
......@@ -13,5 +13,5 @@ fragment Email on EmailType {
...Overlay
}
timestamp
readReceipt @client
readReceipt @client(always: true)
}
......@@ -13,5 +13,5 @@ fragment EmailDetails on EmailType {
...Overlay
}
timestamp
readReceipt @client
readReceipt @client(always: true)
}
......@@ -11,5 +11,8 @@ fragment EmailThread on EmailThreadType {
lastEmail {
...Email
}
readReceipt @client
readReceipt @client(always: true) {
isUnread
teamId
}
}
......@@ -8,8 +8,4 @@ fragment ExtendedTool on ExtendedToolType {
definition {
...ExerciseDefinition
}
responses {
...ToolResponse
}
hasParam @client
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment