Skip to content

Commit e9251c4

Browse files
authored
Merge pull request #1432 from yogeshojha/hotfix/2.2.0_release
2.2.0 Hotfix
2 parents 08a9af2 + 101b9be commit e9251c4

15 files changed

+161
-66
lines changed

docker-compose.dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ services:
5858
command: celery -A reNgine beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
5959
depends_on:
6060
- celery
61+
- db
6162
environment:
6263
- DEBUG=1
6364
- CELERY_BROKER=redis://redis:6379/0

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ services:
6868
- POSTGRES_HOST=${POSTGRES_HOST}
6969
depends_on:
7070
- celery
71+
- db
7172
volumes:
7273
- ./web:/usr/src/app
7374
- github_repos:/usr/src/github

scripts/uninstall.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ fi
3838
print_status "${INFO}Proceeding with uninstalling reNgine${RESET}"
3939

4040
print_status "Stopping all containers related to reNgine..."
41-
docker stop $(docker ps -a -q --filter name=rengine-) 2>/dev/null
41+
docker stop $(docker ps -a -q --filter name=rengine) 2>/dev/null
4242

4343
print_status "Removing all containers related to reNgine..."
44-
docker rm $(docker ps -a -q --filter name=rengine-) 2>/dev/null
44+
docker rm $(docker ps -a -q --filter name=rengine) 2>/dev/null
4545

4646
print_status "Removing all volumes related to reNgine..."
47-
docker volume rm $(docker volume ls -q --filter name=rengine-) 2>/dev/null
47+
docker volume rm $(docker volume ls -q --filter name=rengine) 2>/dev/null
4848

4949
print_status "Removing all networks related to reNgine..."
50-
docker network rm $(docker network ls -q --filter name=rengine-) 2>/dev/null
50+
docker network rm $(docker network ls -q --filter name=rengine) 2>/dev/null
5151

5252
print_status "Removing all images related to reNgine..."
53-
docker rmi $(docker images -q --filter reference=rengine-) 2>/dev/null
53+
docker rmi $(docker images -q --filter reference=rengine) 2>/dev/null
5454

5555
print_status "Performing final cleanup"
5656
docker system prune -f --volumes --filter "label=com.docker.compose.project=rengine"

web/celery-entrypoint.sh

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
#!/bin/bash
22

3-
python3 manage.py makemigrations
3+
# apply existing migrations
44
python3 manage.py migrate
5+
6+
# make migrations for specific apps
7+
apps=(
8+
"targetApp"
9+
"scanEngine"
10+
"startScan"
11+
"dashboard"
12+
"recon_note"
13+
)
14+
15+
create_migrations() {
16+
local app=$1
17+
echo "Creating migrations for $app..."
18+
python3 manage.py makemigrations $app
19+
echo "Finished creating migrations for $app"
20+
echo "----------------------------------------"
21+
}
22+
23+
echo "Starting migration creation process..."
24+
25+
for app in "${apps[@]}"
26+
do
27+
create_migrations $app
28+
done
29+
30+
echo "Migration creation process completed."
31+
32+
# apply migrations again
33+
echo "Applying migrations..."
34+
python3 manage.py migrate
35+
echo "Migration process completed."
36+
37+
538
python3 manage.py collectstatic --no-input --clear
639

740
# Load default engines, keywords, and external tools
@@ -172,7 +205,7 @@ generate_worker_command() {
172205
local app=${4:-"reNgine.tasks"}
173206
local directory=${5:-"/usr/src/app/reNgine/"}
174207

175-
local base_command="celery -A $app worker --pool=gevent --autoscale=$concurrency,1 --loglevel=$loglevel -Q $queue -n $worker_name" --optimization=fair
208+
local base_command="celery -A $app worker --pool=gevent --optimization=fair --autoscale=$concurrency,1 --loglevel=$loglevel -Q $queue -n $worker_name"
176209

177210
if [ "$DEBUG" == "1" ]; then
178211
echo "watchmedo auto-restart --recursive --pattern=\"*.py\" --directory=\"$directory\" -- $base_command &"
+1-46
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
1-
# Generated by Django 3.2.23 on 2024-09-06 01:47
1+
# Generated by Django 3.2.23 on 2024-06-19 02:43
22

3-
from django.conf import settings
43
from django.db import migrations, models
5-
import django.db.models.deletion
64

75

86
class Migration(migrations.Migration):
97

108
initial = True
119

1210
dependencies = [
13-
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
1411
]
1512

1613
operations = [
17-
migrations.CreateModel(
18-
name='ChaosAPIKey',
19-
fields=[
20-
('id', models.AutoField(primary_key=True, serialize=False)),
21-
('key', models.CharField(max_length=500)),
22-
],
23-
),
24-
migrations.CreateModel(
25-
name='HackerOneAPIKey',
26-
fields=[
27-
('id', models.AutoField(primary_key=True, serialize=False)),
28-
('username', models.CharField(max_length=500)),
29-
('key', models.CharField(max_length=500)),
30-
],
31-
),
3214
migrations.CreateModel(
3315
name='NetlasAPIKey',
3416
fields=[
@@ -67,31 +49,4 @@ class Migration(migrations.Migration):
6749
('query', models.CharField(max_length=1000)),
6850
],
6951
),
70-
migrations.CreateModel(
71-
name='UserPreferences',
72-
fields=[
73-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
74-
('bug_bounty_mode', models.BooleanField(default=True)),
75-
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
76-
],
77-
),
78-
migrations.CreateModel(
79-
name='InAppNotification',
80-
fields=[
81-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
82-
('notification_type', models.CharField(choices=[('system', 'system'), ('project', 'project')], default='system', max_length=10)),
83-
('status', models.CharField(choices=[('success', 'Success'), ('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], default='info', max_length=10)),
84-
('title', models.CharField(max_length=255)),
85-
('description', models.TextField()),
86-
('icon', models.CharField(max_length=50)),
87-
('is_read', models.BooleanField(default=False)),
88-
('created_at', models.DateTimeField(auto_now_add=True)),
89-
('redirect_link', models.URLField(blank=True, max_length=255, null=True)),
90-
('open_in_new_tab', models.BooleanField(default=False)),
91-
('project', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dashboard.project')),
92-
],
93-
options={
94-
'ordering': ['-created_at'],
95-
},
96-
),
9752
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Generated by Django 3.2.23 on 2024-09-11 01:46
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('dashboard', '0001_initial'),
13+
]
14+
15+
operations = [
16+
migrations.CreateModel(
17+
name='ChaosAPIKey',
18+
fields=[
19+
('id', models.AutoField(primary_key=True, serialize=False)),
20+
('key', models.CharField(max_length=500)),
21+
],
22+
),
23+
migrations.CreateModel(
24+
name='HackerOneAPIKey',
25+
fields=[
26+
('id', models.AutoField(primary_key=True, serialize=False)),
27+
('username', models.CharField(max_length=500)),
28+
('key', models.CharField(max_length=500)),
29+
],
30+
),
31+
migrations.CreateModel(
32+
name='UserPreferences',
33+
fields=[
34+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
35+
('bug_bounty_mode', models.BooleanField(default=True)),
36+
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
37+
],
38+
),
39+
migrations.CreateModel(
40+
name='InAppNotification',
41+
fields=[
42+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
43+
('notification_type', models.CharField(choices=[('system', 'system'), ('project', 'project')], default='system', max_length=10)),
44+
('status', models.CharField(choices=[('success', 'Success'), ('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], default='info', max_length=10)),
45+
('title', models.CharField(max_length=255)),
46+
('description', models.TextField()),
47+
('icon', models.CharField(max_length=50)),
48+
('is_read', models.BooleanField(default=False)),
49+
('created_at', models.DateTimeField(auto_now_add=True)),
50+
('redirect_link', models.URLField(blank=True, max_length=255, null=True)),
51+
('open_in_new_tab', models.BooleanField(default=False)),
52+
('project', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dashboard.project')),
53+
],
54+
options={
55+
'ordering': ['-created_at'],
56+
},
57+
),
58+
]

web/dashboard/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ class UserPreferences(models.Model):
9494
bug_bounty_mode = models.BooleanField(default=True)
9595

9696
def __str__(self):
97-
return f"{self.user.username}'s preferences"
97+
return f"{self.user.username}'s preferences"

web/recon_note/migrations/0001_initial.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 3.2.23 on 2024-09-06 01:47
1+
# Generated by Django 3.2.23 on 2024-06-19 02:43
22

33
from django.db import migrations, models
44
import django.db.models.deletion
@@ -9,8 +9,8 @@ class Migration(migrations.Migration):
99
initial = True
1010

1111
dependencies = [
12-
('dashboard', '0001_initial'),
1312
('startScan', '0001_initial'),
13+
('dashboard', '0001_initial'),
1414
]
1515

1616
operations = [

web/scanEngine/migrations/0001_initial.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 3.2.23 on 2024-09-06 01:47
1+
# Generated by Django 3.2.23 on 2024-06-19 02:43
22

33
from django.db import migrations, models
44

@@ -35,7 +35,6 @@ class Migration(migrations.Migration):
3535
('id', models.AutoField(primary_key=True, serialize=False)),
3636
('username', models.CharField(blank=True, max_length=100, null=True)),
3737
('api_key', models.CharField(blank=True, max_length=200, null=True)),
38-
('send_report', models.BooleanField(blank=True, default=False, null=True)),
3938
('send_critical', models.BooleanField(default=True)),
4039
('send_high', models.BooleanField(default=True)),
4140
('send_medium', models.BooleanField(default=False)),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.2.23 on 2024-09-11 01:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('scanEngine', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='hackerone',
15+
name='send_report',
16+
field=models.BooleanField(blank=True, default=False, null=True),
17+
),
18+
]

web/scanEngine/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ class InstalledExternalTool(models.Model):
140140
subdomain_gathering_command = models.CharField(max_length=300, null=True, blank=True)
141141

142142
def __str__(self):
143-
return self.name
143+
return self.name

web/startScan/migrations/0001_initial.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 3.2.23 on 2024-09-06 01:47
1+
# Generated by Django 3.2.23 on 2024-06-19 02:43
22

33
from django.conf import settings
44
import django.contrib.postgres.fields
@@ -158,10 +158,6 @@ class Migration(migrations.Migration):
158158
('stop_scan_date', models.DateTimeField(blank=True, null=True)),
159159
('used_gf_patterns', models.CharField(blank=True, max_length=500, null=True)),
160160
('error_message', models.CharField(blank=True, max_length=300, null=True)),
161-
('cfg_out_of_scope_subdomains', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, null=True, size=None)),
162-
('cfg_starting_point_path', models.CharField(blank=True, max_length=200, null=True)),
163-
('cfg_excluded_paths', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, null=True, size=None)),
164-
('cfg_imported_subdomains', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, null=True, size=None)),
165161
('aborted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='aborted_scans', to=settings.AUTH_USER_MODEL)),
166162
('buckets', models.ManyToManyField(blank=True, related_name='buckets', to='startScan.S3Bucket')),
167163
('domain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='targetApp.domain')),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Generated by Django 3.2.23 on 2024-09-11 01:45
2+
3+
import django.contrib.postgres.fields
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('startScan', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='scanhistory',
16+
name='cfg_excluded_paths',
17+
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, null=True, size=None),
18+
),
19+
migrations.AddField(
20+
model_name='scanhistory',
21+
name='cfg_imported_subdomains',
22+
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, null=True, size=None),
23+
),
24+
migrations.AddField(
25+
model_name='scanhistory',
26+
name='cfg_out_of_scope_subdomains',
27+
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=list, null=True, size=None),
28+
),
29+
migrations.AddField(
30+
model_name='scanhistory',
31+
name='cfg_starting_point_path',
32+
field=models.CharField(blank=True, max_length=200, null=True),
33+
),
34+
]

web/startScan/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,4 +678,4 @@ class S3Bucket(models.Model):
678678
perm_all_users_write_acl = models.IntegerField(default=0)
679679
perm_all_users_full_control = models.IntegerField(default=0)
680680
num_objects = models.IntegerField(default=0)
681-
size = models.IntegerField(default=0)
681+
size = models.IntegerField(default=0)

web/targetApp/migrations/0001_initial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 3.2.23 on 2024-09-06 01:47
1+
# Generated by Django 3.2.23 on 2024-06-19 02:43
22

33
from django.db import migrations, models
44
import django.db.models.deletion

0 commit comments

Comments
 (0)