Skip to content

Commit ae1b896

Browse files
authored
Merge pull request #453 from intelowlproject/develop
1.4.2
2 parents eaa7d67 + bfd7283 commit ae1b896

File tree

10 files changed

+53
-9
lines changed

10 files changed

+53
-9
lines changed

.dockerignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.gitignore
2+
.git
3+
.vscode
4+
.lgtm.yml
5+
__pycache__
6+
venv/
7+
**/build
8+
.env
9+
docker/env_file_*
10+
docker/custom.override.yml
11+
**/docker-compose.*
12+
docs/
13+
frontend/node_modules
14+
frontend/dist
15+
frontend/build
16+
docker-compose*
17+
.pre-commit-config.yaml
18+
.ipython/

configuration/nginx/http.conf

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ upstream django {
55

66
uwsgi_cache_path /var/cache/nginx/feeds keys_zone=feeds_cache:10m max_size=10g
77
inactive=10m use_temp_path=off;
8-
limit_req_zone $binary_remote_addr zone=adminlimit:10m rate=5r/m;
98

109
server {
1110
listen 80;
@@ -21,8 +20,6 @@ server {
2120
}
2221

2322
location ^~/admin {
24-
limit_req zone=adminlimit;
25-
2623
uwsgi_pass django;
2724
uwsgi_pass_header Authorization;
2825
uwsgi_pass_request_headers on;
@@ -32,7 +29,6 @@ server {
3229
}
3330

3431
location ~^/api/feeds {
35-
limit_req zone=adminlimit;
3632
uwsgi_pass django;
3733
uwsgi_pass_header Authorization;
3834
uwsgi_pass_request_headers on;

docker/.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_GREEDYBEAR_VERSION="1.4.1"
1+
REACT_APP_GREEDYBEAR_VERSION="1.4.2"

docker/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,22 @@ RUN mkdir -p ${LOG_PATH} \
2929
&& apk --no-cache -U add bash py3-psycopg2 gcc python3-dev alpine-sdk linux-headers \
3030
&& pip3 install --no-cache-dir --upgrade pip
3131

32+
COPY requirements/project-requirements.txt $PYTHONPATH/project-requirements.txt
3233
WORKDIR $PYTHONPATH
34+
RUN pip3 install --no-cache-dir --compile -r $PYTHONPATH/project-requirements.txt
35+
3336
COPY . $PYTHONPATH
3437
COPY --from=frontend-build /build /var/www/reactapp
3538

3639
# separation is required to avoid to re-execute os installation in case of change of python requirements
37-
RUN pip3 install --no-cache-dir --compile -r $PYTHONPATH/requirements/project-requirements.txt \
38-
&& touch ${LOG_PATH}/django/api.log ${LOG_PATH}/django/api_errors.log \
40+
RUN touch ${LOG_PATH}/django/api.log ${LOG_PATH}/django/api_errors.log \
3941
&& touch ${LOG_PATH}/django/greedybear.log ${LOG_PATH}/django/greedybear_errors.log \
4042
&& touch ${LOG_PATH}/django/celery.log ${LOG_PATH}/django/celery_errors.log \
4143
&& touch ${LOG_PATH}/django/django_errors.log ${LOG_PATH}/django/elasticsearch.log\
4244
&& touch ${LOG_PATH}/django/authentication.log ${LOG_PATH}/django/authentication_errors.log \
4345
&& adduser -S -H -u 2000 -D -g www-data www-data \
4446
&& chown -R www-data:www-data ${LOG_PATH} /opt/deploy/ \
45-
&& rm -rf docs/ frontend/ tests/ .github/ \
47+
&& rm -rf docs/ frontend/ tests/ .github/ docker/hooks/ \
4648
&& /bin/bash ./docker/watchman_install.sh \
4749
&& apk del gcc python3-dev alpine-sdk linux-headers
4850

docker/hooks/build

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
echo "display path"
4+
echo "$(pwd)"
5+
echo "display dockerfile path"
6+
echo $DOCKERFILE_PATH
7+
cd ..
8+
echo "display path"
9+
echo "$(pwd)"
10+
echo "current branch"
11+
echo "$SOURCE_BRANCH"
12+
13+
if [[ "$SOURCE_BRANCH" == "main" ]]; then
14+
echo "The branch is main, proceeding with multi-arch build"
15+
docker buildx create --name multiarch --use
16+
docker buildx build -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" --platform linux/arm64,linux/amd64,windows-amd64 --push .
17+
else
18+
echo "The branch is not main, proceeding with classic build"
19+
docker buildx build -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" --push .
20+
fi

docker/hooks/post_push

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
if [[ "$SOURCE_BRANCH" == "main" ]]; then
4+
curl -d "text=A new production image has been pushed to Docker Hub" -d "channel=$SLACK_CHANNEL" -H "Authorization: Bearer $SLACK_TOKEN" -X POST https://slack.com/api/chat.postMessage
5+
fi

docker/logrotate/application

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
daily
33
missingok
44
rotate 2
5+
size 10M
56
compress
67
delaycompress
78
notifempty

docker/logrotate/docker

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
daily
33
missingok
44
rotate 2
5+
size 10M
56
compress
67
delaycompress
78
notifempty

docker/logrotate/nginx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
daily
33
missingok
44
rotate 8
5+
size 1M
56
compress
67
delaycompress
78
notifempty

greedybear/admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@admin.register(CowrieSession)
1919
class CowrieSessionModelAdmin(admin.ModelAdmin):
2020
list_display = ["session_id", "start_time", "duration", "login_attempt", "credentials", "command_execution", "interaction_count", "source"]
21-
search_fields = ["source"]
21+
search_fields = ["source__name"]
2222
raw_id_fields = ["source"]
2323

2424

0 commit comments

Comments
 (0)