Skip to content

Commit 22685f0

Browse files
author
Diego Nadares
committed
Merge branch 'white/staging' into white/master
2 parents 4b68145 + 5283411 commit 22685f0

81 files changed

Lines changed: 2072 additions & 1290 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.

.gitlab-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ include:
3838
- local: .gitlab/ci/testing/.nix-testing-gitlab-ci.yml
3939
- local: .gitlab/ci/testing/.venv-testing-gitlab-ci.yml
4040
- local: .gitlab/ci/testing/.hypothesis-nix-gitlab-ci.yml
41-
- local: .gitlab/ci/testing/.posttesting-gitlab-ci.yml
41+
# - local: .gitlab/ci/testing/.posttesting-gitlab-ci.yml
4242

4343
- local: .gitlab/ci/build-ci/.prebuild-gitlab-ci.yml
4444
- local: .gitlab/ci/build-ci/.build-gitlab-ci.yml
@@ -57,7 +57,7 @@ include:
5757
stages:
5858
- pre_testing
5959
- test
60-
- post_testing
60+
# - post_testing
6161
- pre_build
6262
- build
6363
- build_testing
@@ -68,3 +68,4 @@ stages:
6868

6969
services:
7070
- postgres:latest
71+
- redis:latest

.gitlab/ci/build-ci/.build-gitlab-ci.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ generate_deb_dev:
33
stage: build
44
before_script:
55
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/faradaysec/faraday-linux-installers-builder.git
6+
- cd faraday-linux-installers-builder
7+
- "if ! [ -z $INSTALLER_BRANCH ]; then git checkout $INSTALLER_BRANCH; fi"
8+
- cd ..
69
- mv py3.tar /
710
- cd /; tar xf py3.tar; cd -
811

@@ -26,7 +29,7 @@ generate_deb_dev:
2629
- gem install --no-document fpm-1.11.0.gem
2730
- cd ../../
2831
- POSTFIX=$(echo "$CI_COMMIT_BRANCH" | awk '{split($1,a,"_");split($1,b,"/"); if (a[3]!="y2k") if (b[2]=="dev"||b[2]=="master") print ""; else print "~"a[3]; else exit 1;}')
29-
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG)~$((`date '+%s%N'`/1000))$POSTFIX server deb
32+
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG)~$((`date '+%s%N'`/1000))$POSTFIX server deb white
3033
- mv faraday-server_amd64.deb ../../faraday-server_amd64.deb
3134
needs:
3235
- job: generate_build_file_dev
@@ -50,6 +53,9 @@ generate_deb_staging:
5053
stage: build
5154
before_script:
5255
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/faradaysec/faraday-linux-installers-builder.git
56+
- cd faraday-linux-installers-builder
57+
- "if ! [ -z $INSTALLER_BRANCH ]; then git checkout $INSTALLER_BRANCH; fi"
58+
- cd ..
5359
- mv py3.tar /
5460
- cd /; tar xf py3.tar; cd -
5561

@@ -73,7 +79,7 @@ generate_deb_staging:
7379
- gem install --no-document fpm-1.11.0.gem
7480
- cd ../../
7581
- POSTFIX=$(echo "$CI_COMMIT_BRANCH" | awk '{split($1,a,"_");split($1,b,"/"); if (a[3]!="y2k") if (b[2]=="dev"||b[2]=="master") print ""; else print "~"a[3]; else exit 1;}')
76-
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG)~$((`date '+%s%N'`/1000))$POSTFIX server deb
82+
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG)~$((`date '+%s%N'`/1000))$POSTFIX server deb white
7783
- mv faraday-server_amd64.deb ../../faraday-server_amd64.deb
7884
needs:
7985
- job: generate_build_file_staging
@@ -94,6 +100,9 @@ generate_deb_master:
94100
stage: build
95101
before_script:
96102
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/faradaysec/faraday-linux-installers-builder.git
103+
- cd faraday-linux-installers-builder
104+
- "if ! [ -z $INSTALLER_BRANCH ]; then git checkout $INSTALLER_BRANCH; fi"
105+
- cd ..
97106
- mv py3.tar /
98107
- cd /; tar xf py3.tar; cd -
99108

@@ -117,7 +126,7 @@ generate_deb_master:
117126
- gem install --no-document fpm-1.11.0.gem
118127
- cd ../../
119128
- POSTFIX=$(echo "$CI_COMMIT_BRANCH" | awk '{split($1,a,"_");split($1,b,"/"); if (a[3]!="y2k") if (b[2]=="dev"||b[2]=="master") print ""; else print "~"a[3]; else exit 1;}')
120-
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG)~$((`date '+%s%N'`/1000))$POSTFIX server deb
129+
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG)~$((`date '+%s%N'`/1000))$POSTFIX server deb white
121130
- mv faraday-server_amd64.deb ../../faraday-server_amd64.deb
122131
needs:
123132
- job: generate_build_file_master
@@ -141,6 +150,9 @@ generate_rpm_dev:
141150
- yum -y upgrade
142151
- yum -y install which git epel-release centos-release-scl
143152
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/faradaysec/faraday-linux-installers-builder.git
153+
- cd faraday-linux-installers-builder
154+
- "if ! [ -z $INSTALLER_BRANCH ]; then git checkout $INSTALLER_BRANCH; fi"
155+
- cd ..
144156
- mv py3.tar /
145157
- cd /; tar xf py3.tar; cd -
146158
- yum -y install curl zsh mailcap libffi-devel openssl-devel openldap-devel libjpeg-devel postgresql-devel
@@ -170,7 +182,7 @@ generate_rpm_dev:
170182
- gem install --no-document public_suffix -v 4.0.7
171183
- gem install --no-document fpm-1.11.0.gem
172184
- cd ../../
173-
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG) server rpm
185+
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG) server rpm white
174186
- mv faraday-server_amd64.rpm ../../faraday-server_amd64.rpm
175187
needs:
176188
- job: generate_build_file_dev
@@ -196,6 +208,9 @@ generate_rpm_staging:
196208
- yum -y upgrade
197209
- yum -y install which git epel-release centos-release-scl
198210
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/faradaysec/faraday-linux-installers-builder.git
211+
- cd faraday-linux-installers-builder
212+
- "if ! [ -z $INSTALLER_BRANCH ]; then git checkout $INSTALLER_BRANCH; fi"
213+
- cd ..
199214
- mv py3.tar /
200215
- cd /; tar xf py3.tar; cd -
201216
- yum -y install curl zsh mailcap libffi-devel openssl-devel openldap-devel libjpeg-devel postgresql-devel
@@ -225,7 +240,7 @@ generate_rpm_staging:
225240
- gem install --no-document public_suffix -v 4.0.7
226241
- gem install --no-document fpm-1.11.0.gem
227242
- cd ../../
228-
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG) server rpm
243+
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG) server rpm white
229244
- mv faraday-server_amd64.rpm ../../faraday-server_amd64.rpm
230245
needs:
231246
- job: generate_build_file_staging
@@ -248,6 +263,9 @@ generate_rpm_master:
248263
- yum -y upgrade
249264
- yum -y install which git epel-release centos-release-scl
250265
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/faradaysec/faraday-linux-installers-builder.git
266+
- cd faraday-linux-installers-builder
267+
- "if ! [ -z $INSTALLER_BRANCH ]; then git checkout $INSTALLER_BRANCH; fi"
268+
- cd ..
251269
- mv py3.tar /
252270
- cd /; tar xf py3.tar; cd -
253271
- yum -y install curl zsh mailcap libffi-devel openssl-devel openldap-devel libjpeg-devel postgresql-devel
@@ -277,7 +295,7 @@ generate_rpm_master:
277295
- gem install --no-document public_suffix -v 4.0.7
278296
- gem install --no-document fpm-1.11.0.gem
279297
- cd ../../
280-
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG) server rpm
298+
- sh faraday-linux-installers-builder/build.sh $(eval $IMAGE_TAG) server rpm white
281299
- mv faraday-server_amd64.rpm ../../faraday-server_amd64.rpm
282300
needs:
283301
- job: generate_build_file_master

.gitlab/ci/testing/.nix-testing-gitlab-ci.yml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pylint:
4444
- export LANG=C.UTF-8
4545
- mkdir -p ~/.faraday/config
4646
- cp tests/data/server.ini ~/.faraday/config
47+
- mkdir -p faraday/frontend/www && touch faraday/frontend/www/index.html
4748
- mkdir run_from
4849
- nix-shell --command "cd run_from && pytest ../tests -v --capture=sys --cov=../faraday/server --color=yes --disable-warnings --connection-string=postgresql+psycopg2://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB"
4950
artifacts:
@@ -60,43 +61,6 @@ pylint:
6061
- !reference [.pipeline-control-test, rules]
6162
- when: on_success
6263

63-
.sqlite_test_nix_base:
64-
tags:
65-
- faradaytests
66-
stage: test
67-
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
68-
script:
69-
- nix-env -if pynixify/nixpkgs.nix -A vault
70-
- !reference [ .get_secrets, script ]
71-
- nix-env -if pynixify/nixpkgs.nix -A cachix
72-
- mkdir -p ~/.config/cachix
73-
- export USER=$(whoami)
74-
- echo "$CACHIX_CONFG" >~/.config/cachix/cachix.dhall
75-
- cachix use faradaysec
76-
- "echo 'hosts: files dns' >/etc/nsswitch.conf"
77-
- export LC_ALL=C.UTF-8
78-
- export LANG=C.UTF-8
79-
- mkdir -p ~/.faraday/config
80-
- cp tests/data/server.ini ~/.faraday/config
81-
- mkdir run_from
82-
- nix-shell --command "cd run_from && pytest ../tests --capture=sys -v --cov=../faraday/server --color=yes --disable-warnings"
83-
artifacts:
84-
when: on_failure
85-
paths:
86-
- dist/*
87-
needs:
88-
- job: build_and_push_to_cachix
89-
artifacts: false
90-
rules:
91-
- !reference [.ignore-on-build, rules]
92-
- !reference [.ignore-on-tag, rules]
93-
- !reference [.pipeline-control-test, rules]
94-
- when: on_success
95-
96-
sqlite_test_nix:
97-
extends: .sqlite_test_nix_base
98-
image: nixos/nix:2.16.0
99-
10064
postgresql_test_nix:
10165
extends: .postgresql_test_nix_base
10266
image: nixos/nix:2.16.0
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
agent_integration_and_db_regression:
2-
stage: post_testing
3-
variables:
4-
FARADAY_REF: $CI_COMMIT_REF_NAME
5-
FARADAY_REGRESSION: "True"
6-
trigger:
7-
project: faradaysec/devops
8-
strategy: depend
9-
rules:
10-
- if: '$CI_COMMIT_REF_NAME =~ /^.*\/(master)$/'
11-
variables:
12-
DISPATCHER_REF: master
13-
when: on_success
14-
- if: '$CI_COMMIT_REF_NAME =~ /^.*\/(staging)$/'
15-
variables:
16-
DISPATCHER_REF: staging
17-
when: on_success
18-
- if: '$INTEGRATION || $FULL_TEST || $DAILY_TEST'
19-
variables:
20-
DISPATCHER_REF: staging
21-
when: on_success
22-
- when: never
1+
#agent_integration_and_db_regression:
2+
# stage: post_testing
3+
# variables:
4+
# FARADAY_REF: $CI_COMMIT_REF_NAME
5+
# FARADAY_REGRESSION: "True"
6+
# trigger:
7+
# project: faradaysec/devops
8+
# strategy: depend
9+
# rules:
10+
# - if: '$CI_COMMIT_REF_NAME =~ /^.*\/(master)$/'
11+
# variables:
12+
# DISPATCHER_REF: master
13+
# when: on_success
14+
# - if: '$CI_COMMIT_REF_NAME =~ /^.*\/(staging)$/'
15+
# variables:
16+
# DISPATCHER_REF: staging
17+
# when: on_success
18+
# - if: '$INTEGRATION || $FULL_TEST || $DAILY_TEST'
19+
# variables:
20+
# DISPATCHER_REF: staging
21+
# when: on_success
22+
# - when: never

CHANGELOG/5.0.0/community.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* [ADD] **Breaking change** We now use Celery as the main way to import reports. In addition, we have removed twisted and replaced raw websockets with socket.io. #7352
2+
* [ADD] Added option to faraday-server to run workers. #7623

CHANGELOG/5.0.0/date.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dec 13th, 2023

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ RUN mkdir -p /home/faraday/.faraday/storage
2525

2626
ENV PYTHONUNBUFFERED 1
2727
ENV FARADAY_HOME /home/faraday
28-
29-
ENTRYPOINT ["/entrypoint.sh"]

RELEASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
New features in the latest update
22
=====================================
33

4+
5.0.0 [Dec 13th, 2023]:
5+
---
6+
* [ADD] **Breaking change** We now use Celery as the main way to import reports. In addition, we have removed twisted and replaced raw websockets with socket.io. #7352
7+
* [ADD] Added option to faraday-server to run workers. #7623
8+
49
4.6.2 [Nov 10th, 2023]:
510
---
611
* [ADD] Exclude unnecessary fields from VulnerabilitySchema in filter endpoint. #7608

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
image: index.docker.io/faradaysec/faraday
2222
restart: always
2323
container_name: faraday_app
24+
entrypoint: "/entrypoint.sh"
2425
volumes:
2526
- "$HOME/.faraday:/home/faraday/.faraday:rw"
2627
environment:

docker/entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ if [ $CREATE_ADMIN -eq 1 ]; then
4848
echo "Admin user created with username: faraday password: $FARADAY_PASSWORD"
4949
fi
5050

51+
echo "Update swagger..."
52+
faraday-manage openapi-swagger --server https://$FQDN
53+
5154
echo "$(date) Running migrations ..."
5255
faraday-manage migrate
5356

54-
echo "$(date) Starting application..."
55-
faraday-server
57+
echo "$(date) Starting Faraday server with workers..."
58+
faraday-server --with-workers --bind 0.0.0.0

0 commit comments

Comments
 (0)