Skip to content

Commit 8f93ede

Browse files
authored
Merge pull request #326 from devGregA/master
Fixes #325 and a bug in dedupe
2 parents 56bfa31 + 13bc355 commit 8f93ede

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ before_install:
2424
- docker run -e DOJO_ADMIN_USER=$DOJO_ADMIN_USER -e DOJO_ADMIN_PASSWORD=$DOJO_ADMIN_PASSWORD --name dojo -d -p 127.0.0.1:8000:8000 $REPO:${TRAVIS_COMMIT::8} bash /django-DefectDojo/docker/docker-startup.bash
2525
- sleep 15 #allow dojo time to startup
2626
- docker logs dojo
27-
- docker run -d --name zap --link dojo -p 127.0.0.1:8080:8080 -daemon -host 0.0.0.0 -port 8080 -config api.disablekey=true
27+
- docker run -d --name zap --link dojo -p 127.0.0.1:8080:8080 -i owasp/zap2docker-stable zap.sh -daemon -host 0.0.0.0 -port 8080 -config api.disablekey=true
2828
- docker ps -a
2929
- docker logs dojo
3030
- echo "Checking to see if dojo is running"

dojo/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def add_comment_task(find, note):
207207
add_comment(find, note)
208208

209209
@app.task(name='async_dedupe')
210-
def async_dedupe(self, new_finding, *args, **kwargs):
210+
def async_dedupe(new_finding, *args, **kwargs):
211211
logger.info("running deduplication")
212212
eng_findings_cwe = Finding.objects.filter(test__engagement__product=new_finding.test.engagement.product,
213213
cwe=new_finding.cwe).exclude(id=new_finding.id).exclude(cwe=None).exclude(endpoints=None)

run_dojo.bash

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
function control_c()
4+
# run if user hits control-c
5+
{
6+
kill -15 $cpid $bpid $ppid
7+
exit $?
8+
}
9+
10+
trap 'control_c' SIGINT
11+
12+
celery -A dojo worker -l info --concurrency 3 &
13+
cpid=$!
14+
15+
celery beat -A dojo -l info &
16+
bpid=$!
17+
18+
python manage.py runserver
19+
ppid=$!
20+
21+
tail -f /dev/null

setup.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ else
141141
sudo python manage.py makemigrations dojo
142142
sudo python manage.py makemigrations
143143
sudo python manage.py migrate
144-
sudo python manage.py syncdb
144+
echo -e "${GREEN}${BOLD}Create Dojo superuser:"
145+
tput sgr0
146+
sudo python manage.py createsuperuser
145147
sudo python manage.py loaddata product_type
146148
sudo python manage.py loaddata test_type
147149
sudo python manage.py loaddata development_environment

0 commit comments

Comments
 (0)