Skip to content

Commit 5cab1bf

Browse files
Initial commit
0 parents  commit 5cab1bf

216 files changed

Lines changed: 35079 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.env
2+
.env.local
3+
node_modules
4+
test-results
5+
e2e
6+
helm
7+
.next

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.env.template

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# API_URL=""
2+
# DIAL_API_URL=""
3+
# DIAL_API_KEY=""
4+
5+
## NextAuth (more info https://next-auth.js.org/configuration/options)
6+
# NEXTAUTH_URL=http://localhost:4100
7+
# NEXTAUTH_SECRET=""
8+
9+
### Auth Azure
10+
# AUTH_AZURE_AD_CLIENT_ID=
11+
# AUTH_AZURE_AD_SECRET=
12+
# AUTH_AZURE_AD_TENANT_ID=
13+
# AUTH_AZURE_AD_NAME=
14+
# AUTH_AZURE_AD_SCOPE=
15+
16+
### Google
17+
# AUTH_GOOGLE_CLIENT_ID=
18+
# AUTH_GOOGLE_SECRET=
19+
# AUTH_GOOGLE_NAME=
20+
# AUTH_GOOGLE_SCOPE=
21+
22+
23+
### Gitlab
24+
# AUTH_GITLAB_CLIENT_ID=""
25+
# AUTH_GITLAB_HOST=""
26+
# AUTH_GITLAB_NAME=""
27+
# AUTH_GITLAB_SECRET=""
28+
# AUTH_GITLAB_SCOPE=""
29+
30+
### PingID
31+
# AUTH_PING_ID_CLIENT_ID=""
32+
# AUTH_PING_ID_HOST=""
33+
# AUTH_PING_ID_NAME=""
34+
# AUTH_PING_ID_SECRET=""
35+
# AUTH_PING_ID_SCOPE=""
36+
37+
### Auth0
38+
# AUTH_AUTH0_CLIENT_ID=
39+
# AUTH_AUTH0_SECRET=
40+
# AUTH_AUTH0_HOST=
41+
# AUTH_AUTH0_NAME=
42+
# AUTH_AUTH0_AUDIENCE=
43+
# AUTH_AUTH0_SCOPE=
44+
45+
### Keycloak
46+
# AUTH_KEYCLOAK_CLIENT_ID=
47+
# AUTH_KEYCLOAK_SECRET=
48+
# AUTH_KEYCLOAK_HOST=
49+
# AUTH_KEYCLOAK_NAME=
50+
# AUTH_KEYCLOAK_SCOPE=
51+
52+
### Cognito
53+
# AUTH_COGNITO_CLIENT_ID=
54+
# AUTH_COGNITO_SECRET=
55+
# AUTH_COGNITO_HOST=
56+
# AUTH_COGNITO_NAME=
57+
# AUTH_COGNITO_SCOPE=
58+
59+
### Okta
60+
# AUTH_OKTA_CLIENT_SECRET=
61+
# AUTH_OKTA_CLIENT_ID=
62+
# AUTH_OKTA_ISSUER=
63+
# AUTH_OKTA_SCOPE=
64+
# AUTH_COGNITO_SCOPE=

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @PolinaGurinovich97
2+
/.github/ @MykhailoRyzhman
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 🐞 Bug report
2+
description: Create a report to help us improve
3+
labels: ['bug']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for reporting an issue to improve StatGPT.
9+
Please fill in as much of the following form as you're able.
10+
- type: input
11+
attributes:
12+
label: StatGPT Admin Frontend version
13+
description: Application version
14+
placeholder: 0.1.0
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: What steps will reproduce the bug?
20+
description: Enter details about your bug.
21+
placeholder: |
22+
1. In this environment...
23+
2. With this config...
24+
3. Run '...'
25+
4. See error...
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: What is the expected behavior?
31+
description: If possible please provide textual output instead of screenshots.
32+
- type: textarea
33+
attributes:
34+
label: What do you see instead?
35+
description: If possible please provide textual output instead of screenshots.
36+
validations:
37+
required: true
38+
- type: textarea
39+
attributes:
40+
label: Additional information
41+
description: Tell us anything else you think we should know.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: '🚀 Feature request'
2+
description: Suggest an idea for this project
3+
labels: ['enhancement']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for suggesting an idea to improve StatGPT.
9+
Please fill in as much of the following form as you're able.
10+
- type: input
11+
attributes:
12+
label: StatGPT Admin Frontend version
13+
description: Application version
14+
placeholder: 0.1.0
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: What is the problem this feature will solve?
20+
validations:
21+
required: true
22+
- type: textarea
23+
attributes:
24+
label: What is the feature you are proposing to solve the problem?
25+
description: Describe the requests. If you already have something in mind... PRs are welcome!
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: What alternatives have you considered?

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# https://github.com/epam/ai-dial-ci/blob/2.4.1/actions/build_docker/action.yml
2+
# This version has modified values for maintainer and org.opencontainers.image.licenses
3+
4+
name: 'Build docker'
5+
description: 'Build a docker image, tag it, (optionally) scan it, and (optionally) push it to Dockerhub and GHCR'
6+
inputs:
7+
bypass-checks:
8+
description: 'Do not fail pipeline if checks failed'
9+
default: 'false'
10+
push-enabled:
11+
description: 'Push the image to registry(ies)'
12+
required: false
13+
default: 'false'
14+
trivy-enabled:
15+
description: 'Enable Trivy scanning'
16+
required: false
17+
default: 'true'
18+
trivy-severity:
19+
description: 'Severities of vulnerabilities to fail the build'
20+
required: false
21+
default: 'CRITICAL,HIGH'
22+
trivy-severity-for-sarif:
23+
description: 'Severities of vulnerabilities in SARIF report'
24+
required: false
25+
default: 'CRITICAL,HIGH'
26+
trivy-limit-severities-for-sarif:
27+
description: 'Limit severities for SARIF format'
28+
required: false
29+
default: 'true'
30+
trivy-vuln-type:
31+
description: 'Type of vulnerabilities to scan'
32+
required: false
33+
default: 'os,library'
34+
trivy-ignore-unfixed:
35+
description: 'Ignore unpatched/unfixed vulnerabilities'
36+
required: false
37+
default: 'true'
38+
image-name:
39+
description: 'Name of the image to build'
40+
required: true
41+
image-tag:
42+
description: 'Tag of the image to build'
43+
required: true
44+
image-extra-aliases:
45+
description: 'Extra aliases for the image, e.g. to publish to multiple registries'
46+
required: false
47+
default: ''
48+
ghcr-username:
49+
description: 'GitHub Container Registry username. This is required for pushing to GitHub Container Registry'
50+
required: false
51+
default: ${{ github.actor }}
52+
ghcr-password:
53+
description: 'GitHub Container Registry password/token. This is required for pushing to GitHub Container Registry'
54+
required: false
55+
default: ''
56+
dockerhub-username:
57+
description: 'Docker Hub username. This is required for pushing to Docker Hub'
58+
required: false
59+
default: ''
60+
dockerhub-password:
61+
description: 'Docker Hub password/token. This is required for pushing to Docker Hub'
62+
required: false
63+
default: ''
64+
gpr-username:
65+
description: 'GitHub Package Registry username (for pulling packages from image being built)'
66+
required: false
67+
default: ${{ github.actor }}
68+
gpr-password:
69+
required: false
70+
description: 'GitHub Package Registry password/token (for pulling packages from image being built)'
71+
default: ''
72+
platforms:
73+
required: false
74+
description: 'Docker build platforms (default linux/amd64)'
75+
default: 'linux/amd64'
76+
77+
runs:
78+
using: 'composite'
79+
steps:
80+
- name: Setup Docker Qemu
81+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
82+
- name: Setup Docker buildx
83+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
84+
- name: Login to GitHub Container Registry
85+
if: ${{ fromJSON(inputs.push-enabled) }} # workaround for composite jobs not being able to pass boolean inputs
86+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
87+
with:
88+
registry: ghcr.io
89+
username: ${{ inputs.ghcr-username }}
90+
password: ${{ inputs.ghcr-password }}
91+
- name: Login to Docker Hub
92+
if: ${{ fromJSON(inputs.push-enabled) }} # workaround for composite jobs not being able to pass boolean inputs
93+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
94+
with:
95+
username: ${{ inputs.dockerhub-username }}
96+
password: ${{ inputs.dockerhub-password }}
97+
- name: Build and export to Docker
98+
if: ${{ fromJSON(inputs.trivy-enabled) }} # workaround for composite jobs not being able to pass boolean inputs
99+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
100+
with:
101+
context: .
102+
load: true
103+
platforms: linux/amd64
104+
cache-from: type=gha
105+
cache-to: type=gha,mode=max
106+
tags: |
107+
${{ inputs.image-name }}:${{ inputs.image-tag }}
108+
${{ inputs.image-extra-aliases }}
109+
labels: |
110+
maintainer=StatGPT
111+
org.opencontainers.image.title=${{ inputs.image-name }}
112+
org.opencontainers.image.version=${{ inputs.image-tag }}
113+
org.opencontainers.image.description=${{ inputs.image-name }}
114+
org.opencontainers.image.created=${{ github.event.repository.pushed_at }}
115+
org.opencontainers.image.licenses=MIT
116+
org.opencontainers.image.revision=${{ github.sha }}
117+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
118+
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
119+
secrets: |
120+
GPR_USERNAME=${{ inputs.gpr-username }}
121+
GPR_PASSWORD=${{ inputs.gpr-password }}
122+
env:
123+
DOCKER_BUILD_RECORD_UPLOAD: false
124+
- name: Run Trivy vulnerability scanner (SARIF, no fail)
125+
id: trivy-sarif
126+
# Do not perform SARIF scan on private repos - GitHub Advanced Security is not enabled
127+
if: ${{ fromJSON(inputs.trivy-enabled) && !github.event.repository.private }} # workaround for composite jobs not being able to pass boolean inputs
128+
uses: aquasecurity/trivy-action@7aca5acc9500b463826cc47a47a65ad7d404b045 # TODO: v0.31.0+
129+
with:
130+
image-ref: '${{ inputs.image-name }}:${{ inputs.image-tag }}'
131+
format: 'sarif'
132+
exit-code: '0'
133+
output: 'trivy-results.sarif'
134+
ignore-unfixed: ${{ inputs.trivy-ignore-unfixed }}
135+
vuln-type: ${{ inputs.trivy-vuln-type }}
136+
severity: ${{ inputs.trivy-severity-for-sarif }}
137+
limit-severities-for-sarif: ${{ inputs.trivy-limit-severities-for-sarif }}
138+
env:
139+
TRIVY_DISABLE_VEX_NOTICE: true
140+
continue-on-error: true # HACK: Alongside with `exit-code: 0`, ensure not failing the workflow
141+
- name: Upload Trivy scan results to GitHub Security tab
142+
# Do not upload SARIF reports on private repos - GitHub Advanced Security is not enabled
143+
if: ${{ !cancelled() && fromJSON(inputs.trivy-enabled) && !github.event.repository.private }} # workaround for composite jobs not being able to pass boolean inputs
144+
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b #v3.28.17
145+
with:
146+
sarif_file: 'trivy-results.sarif'
147+
category: trivy
148+
env:
149+
CONTINUE_ON_ERROR: ${{ inputs.bypass-checks }} # Hack to use the input below as a boolean
150+
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
151+
- name: Run Trivy vulnerability scanner (stdout, table view, may fail)
152+
if: ${{ fromJSON(inputs.trivy-enabled) }} # workaround for composite jobs not being able to pass boolean inputs
153+
uses: aquasecurity/trivy-action@7aca5acc9500b463826cc47a47a65ad7d404b045 # TODO: v0.31.0+
154+
with:
155+
image-ref: '${{ inputs.image-name }}:${{ inputs.image-tag }}'
156+
format: 'table'
157+
exit-code: '1'
158+
ignore-unfixed: ${{ inputs.trivy-ignore-unfixed }}
159+
vuln-type: ${{ inputs.trivy-vuln-type }}
160+
severity: ${{ inputs.trivy-severity }}
161+
skip-setup-trivy: ${{ steps.trivy-sarif.conclusion != 'skipped' }}
162+
env:
163+
CONTINUE_ON_ERROR: ${{ inputs.bypass-checks }} # Hack to use the input below as a boolean
164+
TRIVY_SKIP_DB_UPDATE: ${{ steps.trivy-sarif.conclusion != 'skipped' }}
165+
TRIVY_SKIP_JAVA_DB_UPDATE: ${{ steps.trivy-sarif.conclusion != 'skipped' }}
166+
TRIVY_DISABLE_VEX_NOTICE: true
167+
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
168+
- name: Build and push
169+
if: ${{ fromJSON(inputs.push-enabled) }} # workaround for composite jobs not being able to pass boolean inputs
170+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
171+
with:
172+
context: .
173+
push: true
174+
platforms: ${{ inputs.platforms }}
175+
cache-from: type=gha
176+
tags: |
177+
${{ inputs.image-name }}:${{ inputs.image-tag }}
178+
${{ inputs.image-extra-aliases }}
179+
labels: |
180+
maintainer=StatGPT
181+
org.opencontainers.image.title=${{ inputs.image-name }}
182+
org.opencontainers.image.version=${{ inputs.image-tag }}
183+
org.opencontainers.image.description=${{ inputs.image-name }}
184+
org.opencontainers.image.created=${{ github.event.repository.pushed_at }}
185+
org.opencontainers.image.licenses=MIT
186+
org.opencontainers.image.revision=${{ github.sha }}
187+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
188+
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}
189+
secrets: |
190+
GPR_USERNAME=${{ inputs.gpr-username }}
191+
GPR_PASSWORD=${{ inputs.gpr-password }}
192+
env:
193+
DOCKER_BUILD_RECORD_UPLOAD: false

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
7+
day: 'wednesday'
8+
time: '09:00'
9+
# Disable version updates, keep security updates only
10+
open-pull-requests-limit: 0
11+
commit-message:
12+
# Prefix all commit messages with "chore: "
13+
prefix: 'chore'
14+
- package-ecosystem: 'github-actions'
15+
directory: '/'
16+
schedule:
17+
interval: 'weekly'
18+
day: 'wednesday'
19+
time: '09:00'
20+
commit-message:
21+
# Prefix all commit messages with "chore: "
22+
prefix: 'chore'

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Applicable issues
2+
3+
<!-- Please link the GitHub issues related to this PR (You can reference an issue using # then number, e.g. #123) -->
4+
5+
- fixes #
6+
7+
### Description of changes
8+
9+
<!-- Please explain the changes you made right below this line. -->
10+
11+
### Checklist
12+
13+
<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->
14+
15+
- [ ] Title of the pull request follows [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/)
16+
17+
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

0 commit comments

Comments
 (0)