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

[pull] main from pwndoc:main #10

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0140c51
Create backup and restore functions
yeln4ts Aug 4, 2023
fdfce7c
Complete backup and restoration for all models + Frontend workflow
yeln4ts Jan 8, 2024
ac2e2da
Fix vuln update model backup
yeln4ts Jan 8, 2024
23f0d3a
Fix backup status comparison bug and improve backup and restore messages
yeln4ts Jan 8, 2024
388b4fa
Update backup / restore features and performance
yeln4ts Feb 7, 2024
4cac782
Fix upload progress
yeln4ts Feb 7, 2024
4818831
Remove bypass permission for init restore
yeln4ts Feb 7, 2024
543dcea
Fix upload size issue
yeln4ts Feb 7, 2024
74aac24
Add disk free check when restoring
yeln4ts Feb 7, 2024
d7f9547
Fix extractFiles function for directories handle
yeln4ts Feb 8, 2024
58c5be6
Handle arbitrary filenames for backup
yeln4ts Feb 8, 2024
ed4c2f3
Throttle audit restore queries to handle overload
yeln4ts Feb 8, 2024
270e7ed
Added validation of the extension
MaxNad Dec 9, 2024
1d4219c
Merge commit from fork
MaxNad Dec 10, 2024
52c9ef2
Prevent prototype access for select fitler
MaxNad Dec 10, 2024
e4aa243
Added a global error handler
MaxNad Dec 10, 2024
8041b60
Fixed test runner
MaxNad Dec 10, 2024
d62fcf9
Added prototype validation for translate function
MaxNad Dec 11, 2024
7ed91b2
Merge commit from fork
MaxNad Dec 11, 2024
0fdcf4b
Updated backend dependencies
MaxNad Dec 11, 2024
d266167
Fix Merge conflicts
yeln4ts Dec 16, 2024
6f64d99
Merge branch 'main' into backup
yeln4ts Dec 16, 2024
d9aa4ef
Removed 'auto-close' behavior
Tibso Dec 19, 2024
9107f61
Fix restore OOM and update settings UI
yeln4ts Dec 19, 2024
c55f3a2
Add memory limits in docker-compose files to prevent OOM
yeln4ts Dec 19, 2024
af175a5
Remove old test backup
yeln4ts Dec 19, 2024
a4586bf
Add backup directory create if not exist
yeln4ts Dec 19, 2024
dc5f25b
Fix bug in clients restore
yeln4ts Dec 20, 2024
cf7bf34
Update tests due to changes in api
yeln4ts Dec 20, 2024
abadec8
Add backup / restore tests
yeln4ts Dec 20, 2024
c1eac4c
Add docker-compose override example for modifying memory resources
yeln4ts Dec 20, 2024
beebef6
Fix code issues
yeln4ts Jan 3, 2025
6a45406
Add backup upload tests
yeln4ts Jan 3, 2025
7a250e6
Remove unused import
yeln4ts Jan 3, 2025
bba13ad
Merge pull request #561 from pwndoc/backup
yeln4ts Jan 3, 2025
068fead
Fix issue in backup images aggregation
yeln4ts Jan 3, 2025
7c84391
Merge branch 'pwndoc:main' into main
Tibso Jan 11, 2025
fe6fbd3
Merge pull request #560 from Tibso/main
MaxNad Jan 11, 2025
5be5583
Added sameSite strict to cookies
MaxNad Jan 14, 2025
14acb70
Merge commit from fork
MaxNad Jan 14, 2025
42a45c0
Base PoC
MaxNad Jan 17, 2025
d2b591f
Convert Code to highlighted spans
MaxNad Jan 17, 2025
3849cf3
Add docker images build to workflow
yeln4ts Feb 19, 2025
00e5362
add registry branch for testing
yeln4ts Feb 19, 2025
2836887
Fix env variables
yeln4ts Feb 19, 2025
69fee9c
Add restrictions
yeln4ts Feb 19, 2025
b0e1189
Change exit code
yeln4ts Feb 19, 2025
d8bca21
Update docker-ci workflow
yeln4ts Feb 20, 2025
0003be6
Remove testing on registry branch
yeln4ts Feb 20, 2025
40e3de7
Simplify usage of different ports in the application
yeln4ts Feb 21, 2025
75edbc8
Update sub templating replacement to handle some filters
yeln4ts Feb 24, 2025
c5a0d2e
Handle custom filters when using prod docker compose
yeln4ts Feb 24, 2025
dc27474
Merge pull request #572 from pwndoc/custom-field-update
yeln4ts Feb 26, 2025
5e64124
Remove comment button wrongly displayed
yeln4ts Feb 26, 2025
7521f37
Fix Reviewer privileges - Insufficient privileges #562
yeln4ts Feb 26, 2025
c797d6b
Fix comments permissions issues
yeln4ts Feb 26, 2025
439e9a9
Add safe path check to prevent path traversal
yeln4ts Feb 28, 2025
1aaa854
Update safe check
yeln4ts Feb 28, 2025
98f2842
Merge commit from fork
yeln4ts Feb 28, 2025
1338048
Update name required in template update
yeln4ts Feb 28, 2025
68aa1ea
Merge commit from fork
yeln4ts Feb 28, 2025
541e817
Fix arbitrary file read in translate function
yeln4ts Feb 28, 2025
67c07eb
Updated the docxtemplater image module version
yeln4ts Mar 1, 2025
98535d2
Merge branch 'main' into syntax-highlight
yeln4ts Mar 4, 2025
81f3c8b
Fix frontend codeblock syntax
yeln4ts Mar 4, 2025
3d0d015
Updates
yeln4ts Mar 26, 2025
14ace41
Fix test
yeln4ts Mar 26, 2025
65eab09
Removed comment
MaxNad Mar 31, 2025
15a625d
Merge pull request #575 from pwndoc/syntax-highlight
MaxNad Mar 31, 2025
7901272
Create semgrep.yml
MaxNad Mar 31, 2025
a01a73b
Merge pull request #577 from pwndoc/MaxNad-patch-1
MaxNad Mar 31, 2025
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 .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APP_PORT=8443
72 changes: 72 additions & 0 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build & Push Docker Images to GHCR

on:
push:
tags:
- 'v*.*.*' # Runs on version tags (e.g., v1.0.0)

env:
REGISTRY: ghcr.io
IMAGE_NAME_BACKEND: ghcr.io/${{ github.repository }}-backend
IMAGE_NAME_FRONTEND: ghcr.io/${{ github.repository }}-frontend

jobs:
build-and-push-images:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Check if branch is main
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "This workflow only runs on main branch."
exit 1
fi

- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Backend
id: meta-backend
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME_BACKEND }}
tags: |
type=semver,pattern={{version}},prefix=
type=raw,value=latest

- name: Build & Push Backend Image
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: ${{ steps.meta-backend.outputs.tags }}

- name: Extract metadata (tags, labels) for Frontend
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME_FRONTEND }}
tags: |
type=semver,pattern={{version}},prefix=
type=raw,value=latest


- name: Build & Push Frontend Image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: ${{ steps.meta-frontend.outputs.tags }}
38 changes: 38 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Name of this GitHub Actions workflow.
name: Semgrep CE scan

on:
# Scan changed files in PRs (diff-aware scanning):
pull_request: {}
# Scan on-demand through GitHub Actions interface:
workflow_dispatch: {}
# Scan mainline branches and report all findings:
push:
branches: ["master", "main"]
# Schedule the CI job (this method uses cron syntax):
schedule:
- cron: '20 17 * * *' # Sets Semgrep to scan every day at 17:20 UTC.
# It is recommended to change the schedule to a random time.

permissions:
contents: read

jobs:
semgrep:
# User definable name of this GitHub Actions job.
name: semgrep-oss/scan
# If you are self-hosting, change the following `runs-on` value:
runs-on: ubuntu-latest

container:
# A Docker image with Semgrep installed. Do not change this.
image: semgrep/semgrep

# Skip any PR created by dependabot to avoid permission issues:
if: (github.actor != 'dependabot[bot]')

steps:
# Fetch project source with GitHub Actions Checkout. Use either v3 or v4.
- uses: actions/checkout@v4
# Run the "semgrep scan" command on the command line of the docker image.
- run: semgrep scan --config auto
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ mongo-data*
.quasar
report-templates
custom-generator.js
report-filters-custom.js

# Backups
backend/backup

# Configuration files
config.json
Expand All @@ -25,4 +29,4 @@ app-settings.json
*.sln

# Version managers
.tool-versions
.tool-versions
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
mongo-data
mongo-data-dev
backup
1 change: 1 addition & 0 deletions backend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DB_PORT_HOST=27017 # Port to access the database from the host (for dev container)
1 change: 0 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ COPY package*.json ./
RUN apk --no-cache add --virtual builds-deps build-base python3 git
RUN npm install
COPY . .
EXPOSE 4242
ENV NODE_ENV prod
ENV NODE_ICU_DATA=node_modules/full-icu
ENTRYPOINT ["npm", "start"]
17 changes: 13 additions & 4 deletions backend/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,40 @@ services:
mongodb:
image: mongo:4.2.15
container_name: mongo-pwndoc-dev
command: --wiredTigerCacheSizeGB 1 # 50% of (max RAM - 1GB) - minimum 0.25 (Modify it depending on defined RAM limits)
deploy:
resources:
limits:
memory: 3G # Maximum memory to allocate (Modify it depending on host ressources - leave at least 1GB free for host)
reservations:
memory: 1G # Minimum memory required
volumes:
- ./mongo-data-dev:/data/db
restart: always
ports:
- 127.0.0.1:27017:27017
- 127.0.0.1:${DB_PORT_HOST}:27017
environment:
- MONGO_DB:pwndoc
networks:
- backend

pwndoc-backend:
pwndoc-backend-dev:
build:
context: .
dockerfile: Dockerfile.dev
image: yeln4ts/pwndoc:backend-dev
container_name: pwndoc-backend-dev
environment:
- DB_SERVER=mongo-pwndoc-dev
- DB_NAME=pwndoc
volumes:
- ./src:/app/src
- ./ssl:/app/ssl
- ./report-templates:/app/report-templates
- ./backup:/app/backup
depends_on:
- mongodb
restart: always
ports:
- 5252:5252
links:
- mongodb
networks:
Expand Down
14 changes: 10 additions & 4 deletions backend/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,34 @@ services:
mongodb-test:
image: mongo:4.2.15
container_name: mongo-pwndoc-test
command: --wiredTigerCacheSizeGB 1 # 50% of (max RAM - 1GB) - minimum 0.25 (Modify it depending on defined RAM limits)
deploy:
resources:
limits:
memory: 3G # Maximum memory to allocate (Modify it depending on host ressources - leave at least 1GB free for host)
reservations:
memory: 1G # Minimum memory required
volumes:
- ./mongo-data-test:/data/db
restart: always
environment:
- MONGO_DB:pwndoc
network_mode: host

backend-test:
image: yeln4ts/pwndoc:backend-test
build:
context: .
dockerfile: Dockerfile.test
container_name: pwndoc-backend-test
environment:
- DB_SERVER=mongo-pwndoc-test
- DB_NAME=pwndoc
volumes:
- ./tests:/app/tests
- ./src:/app/src
- ./jest.config.js:/app/jest.config.js
environment:
API_URL: https://localhost:4242
depends_on:
- mongodb-test
network_mode: host

volumes:
mongo-data-test:
Loading