Skip to content

Commit 528eb62

Browse files
authored
Merge pull request #1405 from HXSecurity/beta
Release 1.10.0
2 parents 5e332de + 635c0cb commit 528eb62

Some content is hidden

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

64 files changed

+14954
-1034
lines changed

.github/workflows/nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
python3 manage.py updatedepartmenttoken
7070
python3 manage.py runserver 0.0.0.0:8000 &
7171
sleep 60
72-
schemathesis run --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,return_value,large_base_example,not_a_test_method,function_scoped_fixture --validate-schema=false --hypothesis-verbosity normal
72+
schemathesis run --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,large_base_example,function_scoped_fixture --validate-schema=false --hypothesis-verbosity normal
7373
7474
Run-BuildCheck:
7575
if: ${{ github.repository_owner == 'HXSecurity' }}

.github/workflows/release_dongtai.yml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ name: Release DongTai-Server
33
on:
44
release:
55
types: [ created, edited ]
6+
workflow_dispatch:
7+
inputs:
8+
agent_version:
9+
required: true
10+
type: string
11+
server_version:
12+
required: true
13+
type: string
614

715
jobs:
816
build:
@@ -26,15 +34,22 @@ jobs:
2634
- name: Checkout
2735
uses: actions/checkout@v2
2836

29-
- id: release
37+
- name: Set the value
38+
id: release
3039
run: |
3140
TAG_NAME=${{ github.event.release.tag_name }}
3241
ID=`echo ${TAG_NAME##v}`
33-
echo "::set-output name=VERSION::$ID"
42+
if [ -z "${{ inputs.server_version }}" ]
43+
then
44+
echo "variable is empty"
45+
else
46+
ID=${{ inputs.server_version }}
47+
fi
48+
echo "iast_version=$ID" >> $GITHUB_ENV
3449
3550
- name: Generate version file
3651
run: |
37-
bash .github/workflows/version_update.sh "${{ steps.release.outputs.VERSION }}"
52+
bash .github/workflows/version_update.sh "${{ env.iast_version }}"
3853
3954
- name: Login to DockerHub
4055
uses: docker/login-action@v1
@@ -56,17 +71,17 @@ jobs:
5671
access-key-id: ${{ secrets.ALIYUN_OSS_KEY_ID }}
5772
access-key-secret: ${{ secrets.ALIYUN_OSS_KEY_SECRET }}
5873
- run: |
59-
echo "${{ github.event.repository.name }},version,${{ steps.release.outputs.version }}" >> version.txt && \
74+
echo "${{ github.event.repository.name }},version,${{ env.iast_version }}" >> version.txt && \
6075
echo "${{ github.event.repository.name }},commit_hash,${GITHUB_SHA}" >> version.txt && \
6176
cat version.txt
62-
ossutil cp -rf version.txt oss://huoqi-public/iast/release-version/${{ github.event.repository.name }}/${{ steps.release.outputs.version }}/version.txt
63-
ossutil cp oss://dongtai/agent/java/${{ steps.release.outputs.VERSION }}/ ./ --include "*.jar" -r
77+
ossutil cp -rf version.txt oss://huoqi-public/iast/release-version/${{ github.event.repository.name }}/${{ env.iast_version }}/version.txt
78+
ossutil cp oss://dongtai/agent/java/${{ inputs.agent_version }}/ ./ --include "*.jar" -r
6479
[ ! -f ./dongtai-agent.jar ] && echo "$FILE does not exist."
6580
[ ! -f ./dongtai-agent.jar ] && ossutil cp oss://dongtai/agent/java/latest/ ./ --include "*.jar" -r
6681
[ ! -f ./dongtai-agent.jar ] && echo "$FILE does not exist."
6782
ossutil cp oss://dongtai/agent/python/ ./ --include "*.tar.gz" -r
6883
ossutil cp oss://dongtai/agent/php/ ./ --include "*.tar.gz" -r
69-
echo "REPLACE INTO project_version_control (version, component_name, component_version_hash) VALUES('${{ steps.release.outputs.version }}', '${{ github.event.repository.name }}', '${GITHUB_SHA}');" >> ./deploy/docker/version.sql
84+
echo "REPLACE INTO project_version_control (version, component_name, component_version_hash) VALUES('${{ env.iast_version }}', '${{ github.event.repository.name }}', '${GITHUB_SHA}');" >> ./deploy/docker/version.sql
7085
7186
- name: Setup QEMU
7287
uses: docker/setup-qemu-action@v2
@@ -81,7 +96,7 @@ jobs:
8196
push: true
8297
tags: |
8398
dongtai/dongtai-server:latest
84-
dongtai/dongtai-server:${{ steps.release.outputs.version }}
99+
dongtai/dongtai-server:${{ env.iast_version }}
85100
86101
- name: finish build
87102
uses: joelwmale/webhook-action@master
@@ -99,11 +114,18 @@ jobs:
99114
- name: Checkout
100115
uses: actions/checkout@v2
101116

102-
- id: release
117+
- name: Set the value
118+
id: release
103119
run: |
104120
TAG_NAME=${{ github.event.release.tag_name }}
105121
ID=`echo ${TAG_NAME##v}`
106-
echo "::set-output name=VERSION::$ID"
122+
if [ -z "${{ inputs.server_version }}" ]
123+
then
124+
echo "variable is empty"
125+
else
126+
ID=${{ inputs.server_version }}
127+
fi
128+
echo "iast_version=$ID" >> $GITHUB_ENV
107129
108130
- uses: azure/setup-helm@v1
109131
with:
@@ -123,15 +145,15 @@ jobs:
123145

124146
- name: Download existed repo files
125147
run: |
126-
sed -i "s#tag: latest#tag: ${{ steps.release.outputs.VERSION }}#g" deploy/kubernetes/helm/values.yaml
148+
sed -i "s#tag: latest#tag: ${{ env.iast_version }}#g" deploy/kubernetes/helm/values.yaml
127149
ossutil cp -rf oss://dongtai-helm-charts/iast/ ~/helm/repo/ --include dongtai-iast-*.tgz --exclude "index.yaml"
128150
129151
- name: Create helm package
130152
run: |
131-
helm package deploy/kubernetes/helm -d ~/helm/repo --app-version ${{ steps.get_version.outputs.VERSION }} --version ${{ steps.get_version.outputs.VERSION }}
153+
helm package deploy/kubernetes/helm -d ~/helm/repo --app-version ${{ env.iast_version }} --version ${{ env.iast_version }}
132154
helm repo index ~/helm/repo/ --url ${{ secrets.DONGTAI_IAST_CHART_REPO_URL }}
133155
134156
- name: Push helm chart to repo
135157
run: |
136-
ossutil cp -rf ~/helm/repo/dongtai-iast-${{ steps.get_version.outputs.VERSION }}.tgz oss://dongtai-helm-charts/iast/
158+
ossutil cp -rf ~/helm/repo/dongtai-iast-${{ env.iast_version }}.tgz oss://dongtai-helm-charts/iast/
137159
ossutil cp -rf ~/helm/repo/index.yaml oss://dongtai-helm-charts/iast/

.github/workflows/teststate.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
python3 manage.py updatedepartmenttoken
6767
python3 manage.py runserver 0.0.0.0:8000 > webapi.log &
6868
sleep 15
69-
schemathesis run --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,return_value,large_base_example,not_a_test_method,function_scoped_fixture --validate-schema=false --hypothesis-verbosity normal
69+
schemathesis run --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,large_base_example,function_scoped_fixture --validate-schema=false --hypothesis-verbosity normal
7070
7171
Run-BuildCheck:
7272
runs-on: ubuntu-latest
@@ -235,14 +235,16 @@ jobs:
235235
sudo apt-get install build-essential cmake ninja-build python3-dev cython3 pybind11-dev libre2-dev -y
236236
python -m pip install --upgrade pip
237237
pip install wheel
238+
pip install coverage
238239
pip install -r requirements.txt
239240
240241
- name: Django Unit Testing
241242
run: |
242243
cp dongtai_conf/conf/config.ini.test dongtai_conf/conf/config.ini
243244
mkdir -p /tmp/logstash/report/{img,word,pdf,excel} && mkdir -p /tmp/iast_cache/package && mkdir -p /tmp/logstash/batchagent
244245
python3 ./deploy/docker/version_update.py || true
245-
python manage.py test
246+
coverage run --source='.' manage.py test
247+
coverage report
246248
247249
Run-Unit-TEST-In-Cython:
248250
runs-on: ubuntu-latest
@@ -282,6 +284,7 @@ jobs:
282284
sudo apt-get install build-essential cmake ninja-build python3-dev cython3 pybind11-dev libre2-dev -y
283285
python -m pip install --upgrade pip
284286
pip install wheel
287+
pip install coverage
285288
pip install -r requirements.txt
286289
287290
- name: Django Unit Testing
@@ -292,7 +295,8 @@ jobs:
292295
pip install Cython==3.0.0a11
293296
python setup.py build_ext --inplace
294297
find . -name "*.so" | grep test | xargs rm
295-
python manage.py test
298+
coverage run --source='.' manage.py test
299+
coverage report
296300
297301
Run-API-TEST-With-Cython:
298302
runs-on: ubuntu-latest
@@ -348,7 +352,7 @@ jobs:
348352
python3 manage.py updatedepartmenttoken
349353
python3 manage.py runserver 0.0.0.0:8000 > webapi.log &
350354
sleep 15
351-
schemathesis run --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,return_value,large_base_example,not_a_test_method,function_scoped_fixture --validate-schema=false --hypothesis-verbosity normal
355+
schemathesis run --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,large_base_example,function_scoped_fixture --validate-schema=false --hypothesis-verbosity normal
352356
353357
analyze:
354358
name: Analyze

Pipfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ name = "pypi"
55

66
[packages]
77
asgiref = "*"
8-
certifi = "==2022.12.7"
9-
cffi = "==1.15.1"
10-
chardet = "==3.0.4"
8+
certifi = ">=2022.12.7"
9+
cffi = ">=1.15.1"
10+
chardet = ">=3.0.4"
1111
django = "~=3.2.18"
12-
django-cors-headers = "==3.7.0"
13-
django-filter = "==2.4.0"
14-
django-ranged-response = "==0.2.0"
15-
django-xff = "==1.3.0"
12+
django-cors-headers = ">=3.7.0"
13+
django-filter = ">=2.4.0"
14+
django-ranged-response = ">=0.2.0"
15+
django-xff = ">=1.3.0"
1616
djangorestframework = "~=3.12.4"
17-
django-rest-framework-proxy = "==1.6.0"
17+
django-rest-framework-proxy = ">=1.6.0"
1818
django-utils = "==0.0.2"
1919
django-utils-six = "==2.0"
20-
django-simple-captcha = "==0.5.14"
20+
django-simple-captcha = "~=0.5.14"
2121
django-import-export = "==2.5.0"
2222
oss2 = "==2.13.1"
2323
idna = "==2.10"
@@ -30,7 +30,7 @@ urllib3 = "==1.26.5"
3030
xlwt = "==1.3.0"
3131
pyre2 = "~=0.3.6"
3232
celery = "==5.2.7"
33-
redis = "==3.5.3"
33+
redis = "==4.4.4"
3434
openpyxl = "==3.0.9"
3535
id-validator = "==1.0.20"
3636
jq = "==1.3.0"

0 commit comments

Comments
 (0)