Skip to content

Commit b0d563b

Browse files
committed
refactored builder
1 parent 9856cc8 commit b0d563b

Some content is hidden

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

49 files changed

+2894
-909
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
- name: Install dependencies
3838
run: |
3939
pip install -r requirements_lint.txt
40-
pip install -r src/builder/requirements.txt
41-
pip install -r src/api/requirements.txt
40+
pip install -r src/riskdb/builder/requirements.txt
41+
pip install -r src/riskdb/api/requirements.txt
4242
sudo apt install shellcheck
4343
shell: bash
4444

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
3+
name: Test
4+
5+
on:
6+
push:
7+
branches: [latest, main]
8+
paths:
9+
- '**.py'
10+
- '.github/workflows/test.yml'
11+
# - 'requirements_lint.txt'
12+
pull_request:
13+
branches: [latest, main]
14+
paths:
15+
- '**.py'
16+
- '.github/workflows/test.yml'
17+
# - 'requirements_lint.txt'
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 1
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
with:
28+
ref: ${{ github.ref }}
29+
30+
- name: Install python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.10'
34+
35+
- name: Install dependencies
36+
run: |
37+
pip install -r src/riskdb/builder/requirements.txt
38+
pip install -r src/riskdb/api/requirements.txt
39+
sudo apt install curl
40+
shell: bash
41+
42+
- name: Preparing testdata
43+
run: |
44+
unzip testdata/*
45+
mkdir -p $HOME/Downloads
46+
mv testdata/*.json $HOME/Downloads/
47+
mv testdata/*.mmdb $HOME/Downloads/
48+
shell: bash
49+
50+
- name: Running Builder
51+
run: |
52+
python3 src/riskdb/builder/main.py
53+
shell: bash
54+
55+
- name: Starting API
56+
run: |
57+
timeout 10 python3 src/riskdb/api/main.py &
58+
59+
curl --fail -v http://localhost:8000/api/asn/398324
60+
curl --fail -v http://localhost:8000/api/ip/51.158.160.67
61+
curl --fail -v http://localhost:8000/api/net/162.142.125.44
62+
curl --fail -v http://localhost:8000/api/list/asn/vpn
63+
curl --fail -v http://localhost:8000/api/list/asn/hosting >/dev/null
64+
65+
exit 0
66+
shell: bash

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
visualization/*.json
22
visualization/*.png
33
visualization/*.zip
4-
visualization/LICENSE.txt
4+
visualization/LICENSE.txt
5+
src/riskdb/builder/build/*.json
6+
src/riskdb/builder/build/*.mmdb

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ disable=raw-checker-failed,
442442
C0114, C0115, C0116, # inline docs
443443
W0401, W0614, # wildcard import for config
444444
W0511, # todos
445+
R0801, R0903, # objects
445446

446447
# Enable the message, report, category or checker with the given id(s). You can
447448
# either give multiple identifier separated by comma (,) or put this option

src/builder/build.py

Lines changed: 0 additions & 161 deletions
This file was deleted.

src/builder/config.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)