Skip to content

Commit e6911e3

Browse files
authored
Merge branch 'master' into fix/2631-play-card-lifecycle-guard
2 parents 6283b56 + 32ce289 commit e6911e3

162 files changed

Lines changed: 1974 additions & 1137 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.

.github/workflows/build-website-staging.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,10 @@
4242
pnpm install # Install dependencies
4343
npm run build-stage # Build staging version
4444
npm run coverage
45-
- name: Install smoke test tools
45+
- name: Smoke Test - Application Verification
4646
working-directory: cornucopia.owasp.org
4747
run: |
48-
pnpm add -D serve wait-on
49-
50-
- name: Smoke test
51-
working-directory: cornucopia.owasp.org
52-
run: |
53-
pnpm exec serve build -l 3000 &
54-
sleep 2
55-
pnpm exec wait-on http://localhost:3000
56-
57-
- name: Smoke test
58-
working-directory: cornucopia.owasp.org
59-
run: |
60-
pnpm exec serve build &
48+
pnpm exec serve build -l 3000 &
6149
pnpm exec wait-on http://localhost:3000
6250
npm run smoke-test
6351
kill $(jobs -p) || true

.github/workflows/build-website.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464
echo "Max retries reached, skipping audit due to transient registry errors"
6565
exit 0
6666
67-
- name: Smoke test
67+
- name: Smoke Test - Application Verification
6868
working-directory: cornucopia.owasp.org
6969
run: |
70-
pnpm exec serve build &
70+
pnpm exec serve build -l 3000 &
7171
pnpm exec wait-on http://localhost:3000
7272
npm run smoke-test
7373
@@ -80,5 +80,3 @@
8080
total-parts-count: 3
8181
add-prefix: cornucopia.owasp.org
8282
files: cornucopia.owasp.org/coverage/lcov.info
83-
kill $(jobs -p) || true
84-

.github/workflows/run-tests-generate-output.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
- name: Checkout repository
3636
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3737
with:
38-
ref: ${{ github.event.pull_request.head.sha }}
38+
# use the commit that triggered this workflow to avoid any wildcard fetch
39+
ref: ${{ github.sha }}
3940
repository: ${{ github.event.pull_request.head.repo.full_name }}
4041
persist-credentials: false
4142
# Set the pip environment up
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
name: "ZAP Nightly Scan - Cornucopia Website"
3+
4+
on:
5+
schedule:
6+
- cron: '30 0 * * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
zap-scan:
14+
name: "OWASP ZAP DAST Scan - Website"
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
21+
- name: Build website Docker image
22+
working-directory: cornucopia.owasp.org
23+
run: docker build -t cornucopia-website .
24+
25+
- name: Start website container
26+
run: |
27+
docker run -d --name cornucopia-website -p 8080:80 cornucopia-website
28+
timeout 60 bash -c 'until curl -f http://localhost:8080 > /dev/null 2>&1; do sleep 2; done'
29+
30+
- name: Run ZAP Full Scan with AJAX Spider
31+
run: |
32+
mkdir -p zap-reports
33+
sudo chown 1000:1000 zap-reports
34+
docker run --network="host" \
35+
--user 1000:1000 \
36+
-v $(pwd)/zap-reports:/zap/wrk/:rw \
37+
-t ghcr.io/zaproxy/zaproxy:2.16.1 \
38+
zap-full-scan.py \
39+
-t http://localhost:8080 \
40+
-j \
41+
-r website_dast_report.html \
42+
-w website_dast_report.md \
43+
-J website_dast_report.json \
44+
-x website_dast_report.xml \
45+
-a \
46+
-d \
47+
-z "-config ajaxSpider.maxDuration=10 -config scanner.maxScanDurationInMins=180" \
48+
|| true
49+
50+
- name: Stop website container
51+
if: always()
52+
run: |
53+
docker stop cornucopia-website || true
54+
docker rm cornucopia-website || true
55+
56+
- name: Upload ZAP reports as artifacts
57+
if: always()
58+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
59+
with:
60+
name: zap-website-dast-reports
61+
path: zap-reports/
62+
retention-days: 30
63+
64+
- name: Check for high-risk vulnerabilities
65+
if: always()
66+
run: |
67+
if [ -f zap-reports/website_dast_report.json ]; then
68+
HIGH_RISK=$(jq '[.site[].alerts[] | select(.riskcode == "3")] | length' zap-reports/website_dast_report.json || echo "0")
69+
MEDIUM_RISK=$(jq '[.site[].alerts[] | select(.riskcode == "2")] | length' zap-reports/website_dast_report.json || echo "0")
70+
71+
echo "High Risk Vulnerabilities: $HIGH_RISK"
72+
echo "Medium Risk Vulnerabilities: $MEDIUM_RISK"
73+
74+
if [ "$HIGH_RISK" -gt "0" ]; then
75+
echo "⚠️ WARNING: $HIGH_RISK high-risk vulnerabilities detected!"
76+
echo "Please review the ZAP report for details."
77+
fi
78+
else
79+
echo "ZAP report not found, skipping vulnerability check"
80+
fi
81+
82+
- name: Upload reports to pre-release
83+
if: always()
84+
run: |
85+
for f in \
86+
zap-reports/website_dast_report.html \
87+
zap-reports/website_dast_report.json \
88+
zap-reports/website_dast_report.xml \
89+
zap-reports/website_dast_report.md; do
90+
if [ -f "$f" ]; then
91+
gh release upload "pre-release" "$f" --clobber
92+
fi
93+
done
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ COPY --chown=builder:union Pipfile Pipfile.lock ./
3434
RUN pipenv --python "$(which python)" install --ignore-pipfile --dev
3535
ENTRYPOINT ["/usr/local/bin/pipenv"]
3636

37-
FROM mvdan/shfmt@sha256:be41bc426ec3f723d1dd9b4755630ad4d6680a2801fe62fbc2739207fc5f3a6c AS shfmt
37+
FROM mvdan/shfmt@sha256:550a52385774f68823bbe7bfbb74a249c4f28c8c118cc48c2b54df981b527d71 AS shfmt
3838
ENTRYPOINT ["/bin/shfmt"]

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ types-pyyaml = "==6.0.12.20250915"
1919
idna = "==3.11"
2020
pypng = "==0.20220715.0"
2121
qrcode = "==8.2"
22-
requests = "==2.32.5"
23-
types-requests = "==2.32.4.20260107"
22+
requests = "==2.33.0"
23+
types-requests = "==2.32.4.20260324"
2424
typing_extensions = "==4.8.0"
2525
urllib3 = "==2.6.3"
2626
charset-normalizer = "==3.4.6"

Pipfile.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

copi.owasp.org/lib/copi_web/live/player_live/index.html.heex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
<%= if @player do %>
23
<.live_component
34
module={CopiWeb.PlayerLive.FormComponent}
45
id={:new}
@@ -8,6 +9,7 @@
89
client_ip={@client_ip}
910
patch={~p"/games/#{@game.id}"}
1011
/>
12+
<% end %>
1113

1214

1315
<!--

0 commit comments

Comments
 (0)