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

Enterprise/enhancements #754

Merged
merged 102 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
70960b8
Gitignore pnpm lockfile in enterprise/frontend
nas-tabchiche Aug 22, 2024
5f6e19d
Remove FF_WHITE_LABEL feature flag
nas-tabchiche Aug 22, 2024
6173223
Localize client settings strings
nas-tabchiche Aug 22, 2024
103f040
Fix logo and favicon being overriden when editing client settings nam…
nas-tabchiche Aug 22, 2024
b43092d
chore: run prettier
nas-tabchiche Aug 22, 2024
47530f7
Remove unneeded update method
nas-tabchiche Aug 22, 2024
a02ddbc
Implement file upload MIME type validation
nas-tabchiche Aug 22, 2024
2ae718c
Simplify logo and favicon management
nas-tabchiche Aug 22, 2024
34ccaf9
Add image/vnd.microsoft.icon mimetype for favicon and logo upload
nas-tabchiche Aug 22, 2024
cd899ac
Componentize login greetings
nas-tabchiche Aug 22, 2024
759a673
Add svg mimetype
nas-tabchiche Aug 22, 2024
a41d07c
Localize logo and favicon help texts
nas-tabchiche Aug 22, 2024
baaefcb
Fix libmagic1 installation in Dockerfile
nas-tabchiche Aug 22, 2024
9b9f9d3
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Aug 23, 2024
c7b8e40
Update Makefile
nas-tabchiche Aug 23, 2024
1c0ca54
Use Object.hasOwn instead of hasOwnProperty
nas-tabchiche Aug 23, 2024
6185bfc
Write manage.sh script
nas-tabchiche Aug 23, 2024
eeb58e0
Update enterprise backend README
nas-tabchiche Aug 23, 2024
6cb0d99
Simplify enterprise frontend dev
nas-tabchiche Aug 23, 2024
ce3cdf8
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Aug 23, 2024
7420e92
update readme
ab-smith Aug 24, 2024
69698b2
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Aug 26, 2024
636dc55
Use safeTranslate util to attempt translation of dynamic strings
nas-tabchiche Aug 26, 2024
8d2f1e9
Check if response has field
nas-tabchiche Aug 26, 2024
962b538
Write enterprise docker-compose files
nas-tabchiche Aug 26, 2024
c830546
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Aug 27, 2024
f4181a4
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Aug 27, 2024
b8602f7
Gitignore .meta files
nas-tabchiche Aug 27, 2024
9ef32c8
Update enterprise docker-compose-build
nas-tabchiche Aug 27, 2024
0dd959f
Allow specifying docker-compose file in docker-compose-build scripts
nas-tabchiche Aug 27, 2024
b2afd67
Build and push enterprise images
nas-tabchiche Aug 27, 2024
d624ca9
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 2, 2024
d79c828
Update backend deps
nas-tabchiche Sep 2, 2024
f18ad24
Add enterprise startup functional test
nas-tabchiche Sep 2, 2024
5c21b3b
Add enterprise startup docker-compose test
nas-tabchiche Sep 2, 2024
ed88018
Make sure pnpm is installed before running pre-build
nas-tabchiche Sep 2, 2024
bca5eae
Poetry run python manage.py scripts
nas-tabchiche Sep 2, 2024
211b085
Attempt to skip virtualenv creation
nas-tabchiche Sep 2, 2024
3d9d552
Add allauth extras in pyproject
nas-tabchiche Sep 2, 2024
6ed7afd
chore: Run poetry lock
nas-tabchiche Sep 2, 2024
e8563ab
Update upload artifacts path
nas-tabchiche Sep 3, 2024
b6b8fda
Fix typo
nas-tabchiche Sep 3, 2024
b2bcb38
Update enterprise artifact name
nas-tabchiche Sep 3, 2024
36fe34d
Fetch artifact in the right directory
nas-tabchiche Sep 3, 2024
39c51a8
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 4, 2024
cdae16c
Run startup tests in debug mode
nas-tabchiche Sep 4, 2024
a70a95b
Pin dependencies
nas-tabchiche Sep 4, 2024
27f561d
chore: Lock poetry dependencies
nas-tabchiche Sep 4, 2024
f90175c
Use poetry in community Dockerfile
nas-tabchiche Sep 4, 2024
697a722
chore: Run makemigrations
nas-tabchiche Sep 4, 2024
76fb7e6
Mirror community settings file
nas-tabchiche Sep 4, 2024
987fe09
chore: Re-generate package-lock.json file
nas-tabchiche Sep 4, 2024
0d29704
Stop relying on poetry to install enterprise_core in dockerized envir…
nas-tabchiche Sep 4, 2024
78edb74
Run docker compose startup test with poetry
nas-tabchiche Sep 4, 2024
800976a
Pipe falsy responses to stderr
nas-tabchiche Sep 4, 2024
ef5bbcb
write enterprise functional tests job
nas-tabchiche Sep 4, 2024
cd62335
Add mailhog service and browsers matrix
nas-tabchiche Sep 4, 2024
cef05f9
Fix build endpoint in enterprise
nas-tabchiche Sep 4, 2024
235bb58
Allow setting the BASE_DIR through env in enterprise
nas-tabchiche Sep 4, 2024
0fa276e
Fix enterprise functional tests artifact name
nas-tabchiche Sep 4, 2024
4a48bb6
Configure mailer properly in enterprise functional tests
nas-tabchiche Sep 4, 2024
5936a3f
Fetch client settings at the root layout
nas-tabchiche Sep 5, 2024
d1b7867
Store logo and favicon in local storage
nas-tabchiche Sep 10, 2024
3a4141d
Squash migrations
nas-tabchiche Sep 10, 2024
6e3daeb
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 10, 2024
292d34c
Include docker compose instructions in enterprise README
nas-tabchiche Sep 10, 2024
51ecd96
Remove obsolete version field
nas-tabchiche Sep 10, 2024
69dc36f
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 11, 2024
ad26ba4
Localize parent_domain field label
nas-tabchiche Sep 11, 2024
4aae05b
Manage DJANGO_SETTINGS_MODULE environment variable
nas-tabchiche Sep 11, 2024
a0f4ee4
Allow loading additional modules
nas-tabchiche Sep 12, 2024
a8d4251
Create enterprise build endpoint
nas-tabchiche Sep 12, 2024
44a4f7d
Update CISO Assistant build display
nas-tabchiche Sep 12, 2024
a97b395
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 17, 2024
fae7cb2
Don't run cleanup hook in CI
nas-tabchiche Sep 17, 2024
5c95353
Update poetry dependencies
nas-tabchiche Sep 17, 2024
f04fc3d
Remove obsolete license route
nas-tabchiche Sep 17, 2024
6304fa4
chore: Run poetry lock
nas-tabchiche Sep 17, 2024
0399171
Run regular startup tests using poetry
nas-tabchiche Sep 17, 2024
6966dcb
Update settings.py INSTALLED_APPS
nas-tabchiche Sep 17, 2024
6084f92
Update enterprise ModelForm
nas-tabchiche Sep 18, 2024
28c4b98
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 18, 2024
26b3970
Always run cleanup
nas-tabchiche Sep 18, 2024
72ec8bc
Only attempt to fetch logo or favicon if set in clientSettings
nas-tabchiche Sep 18, 2024
c4a24f0
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 18, 2024
824d58c
Update enterprise image builds
nas-tabchiche Sep 18, 2024
b61c6df
Update enterprise registry name
nas-tabchiche Sep 18, 2024
34de01f
squash
nas-tabchiche Sep 18, 2024
6297c03
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 19, 2024
c58a780
Remove unused isStableRelease input
nas-tabchiche Sep 19, 2024
c235a38
Update docker-build-and-push workflow
nas-tabchiche Sep 19, 2024
de98925
Fix logo not showing up when logo is unset in client settings
nas-tabchiche Sep 19, 2024
eea65b3
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 19, 2024
4b579dd
Remove unused imports
nas-tabchiche Sep 19, 2024
8eeef0f
Remove unused digestMessage function
nas-tabchiche Sep 19, 2024
03883ce
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 20, 2024
5fc0d92
Add internal route group in enterprise frontend
nas-tabchiche Sep 20, 2024
f4ff73c
Remove debug logs
nas-tabchiche Sep 20, 2024
6d18e9a
Internationalize client settings successful update message
nas-tabchiche Sep 20, 2024
2e4c452
fix/simplify docker compose for enterprise
eric-intuitem Sep 20, 2024
0ec5b54
Merge branch 'main' into enterprise/enhancements
nas-tabchiche Sep 23, 2024
9339b93
Run npm audit fix
nas-tabchiche Sep 23, 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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
.idea*
venv/
env/
**/node_modules/
28 changes: 22 additions & 6 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
tags:
- "v*"
workflow_dispatch:
inputs:
isStableRelease:
type: boolean
description: "Is this a stable release? If this is true, the `latest` tag will be applied to the images."
required: true
default: false

jobs:
build-and-push:
Expand Down Expand Up @@ -70,3 +64,25 @@ jobs:
ghcr.io/${{ github.repository }}/backend:${{ env.VERSION }}
ghcr.io/${{ github.repository }}/backend:latest
platforms: linux/amd64,linux/arm64,linux/arm64/v8

- name: Build and Push Enterprise Frontend Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./enterprise/frontend/Dockerfile
push: true
tags: |
ghcr.io/intuitem/ciso-assistant-enterprise-frontend:${{ env.VERSION }}
ghcr.io/intuitem/ciso-assistant-enterprise-frontend:latest
platforms: linux/amd64,linux/arm64,linux/arm64/v8

- name: Build and Push Enterprise Backend Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./enterprise/backend/Dockerfile
push: true
tags: |
ghcr.io/intuitem/ciso-assistant-enterprise-backend:${{ env.VERSION }}
ghcr.io/intuitem/ciso-assistant-enterprise-backend:latest
platforms: linux/amd64,linux/arm64,linux/arm64/v8
122 changes: 113 additions & 9 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ on:

env:
GITHUB_WORKFLOW: github_actions
backend-directory: ./backend
frontend-directory: ./frontend
enterprise-backend-directory: ./enterprise/backend
enterprise-frontend-directory: ./enterprise/frontend
enterprise-frontend-build-directory: ./enterprise/frontend/.build/frontend
enterprise-backend-settings-module: enterprise_core.settings

jobs:
functional-tests:
runs-on: ubuntu-20.04
env:
backend-directory: ./backend
working-directory: ./frontend

services:
postgres:
Expand Down Expand Up @@ -51,15 +54,15 @@ jobs:
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install dependencies
working-directory: ${{ env.working-directory }}
working-directory: ${{ env.frontend-directory }}
run: |
npm install -g pnpm
pnpm i --frozen-lockfile
- name: Install Playwright browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.working-directory }}
working-directory: ${{ env.frontend-directory }}
run: npx playwright install --with-deps ${{ matrix.playwright-browser }}
- name: Create frontend environment variables file
working-directory: ${{ env.working-directory }}
working-directory: ${{ env.frontend-directory }}
run: |
touch .env
echo PUBLIC_BACKEND_API_URL=http://localhost:8000/api >> .env
Expand All @@ -68,6 +71,7 @@ jobs:
working-directory: ${{ env.backend-directory }}
run: |
touch .env
echo DJANGO_DEBUG=True >> .env
echo [email protected] >> .env
echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env
echo POSTGRES_NAME=postgres >> .env
Expand All @@ -94,13 +98,113 @@ jobs:
python manage.py createsuperuser --noinput
nohup python manage.py runserver &
- name: Run tests with browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.working-directory }}
working-directory: ${{ env.frontend-directory }}
run: npx playwright test --project=${{ matrix.playwright-browser }}
env:
CI: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: functional-tests-report-${{ matrix.playwright-browser }}
path: |
${{ env.working-directory }}/tests/results/
${{ env.working-directory }}/tests/reports/
${{ env.frontend-directory }}/tests/results/
${{ env.frontend-directory }}/tests/reports/
retention-days: 5

enterprise-functional-tests:
runs-on: ubuntu-20.04

services:
postgres:
image: postgres:14.12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mailhog:
image: mailhog/mailhog
ports: ["1025:1025", "8025:8025"]

strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
playwright-browser: ["chromium"]

steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
installer-parallel: true
- name: Install backend requirements
working-directory: ${{ env.backend-directory }}
run: poetry install
- name: Install enterprise backend
working-directory: ${{ env.enterprise-backend-directory }}
run: poetry install
- name: Install frontend dependencies
working-directory: ${{ env.enterprise-frontend-directory }}
run: make pre-build
- name: Install Playwright Browsers
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright install --with-deps
- name: Create frontend environment variables file
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: |
touch .env
echo PUBLIC_BACKEND_API_URL=http://localhost:8000/api >> .env
- name: Create backend environment variables file
working-directory: ${{ env.backend-directory }}
run: |
touch .env
echo DJANGO_DEBUG=True >> .env
echo [email protected] >> .env
echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env
echo POSTGRES_NAME=postgres >> .env
echo POSTGRES_USER=postgres >> .env
echo POSTGRES_PASSWORD=postgres >> .env
echo DB_HOST=localhost >> .env
echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env
echo CISO_ASSISTANT_URL=http://localhost:4173 >> .env
echo DEFAULT_FROM_EMAIL='[email protected]' >> .env
echo EMAIL_HOST=localhost >> .env
echo [email protected] >> .env
echo EMAIL_HOST_PASSWORD=password >> .env
echo EMAIL_PORT=1025 >> .env
echo DJANGO_SETTINGS_MODULE=enterprise_core.settings >> .env
- name: Run migrations
working-directory: ${{ env.backend-directory }}
run: |
export $(grep -v '^#' .env | xargs)
poetry run python manage.py migrate --settings=${{ env.enterprise-backend-settings-module }}
- name: Start test server
working-directory: ${{ env.backend-directory }}
run: |
export $(grep -v '^#' .env | xargs)
poetry run python manage.py createsuperuser --noinput
nohup poetry run python manage.py runserver --settings=${{ env.enterprise-backend-settings-module }} &
- name: Run tests with browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright test --project=${{ matrix.playwright-browser }}
env:
CI: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: enterprise-functional-tests-report-${{ matrix.playwright-browser }}
path: |
${{ env.enterprise-frontend-build-directory }}/tests/results/
${{ env.enterprise-frontend-build-directory }}/tests/reports/
retention-days: 5
Loading
Loading