Skip to content

Commit 75c0008

Browse files
authored
Merge pull request #8 from ctrlsam/v2
V2
2 parents b01cfb3 + 3cd4437 commit 75c0008

299 files changed

Lines changed: 45185 additions & 7788 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.

.example.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Crawler Settings
2+
CRAWLER_CIDR=0.0.0.0/0 # Warning: This is a broad range; adjust as needed
3+
CRAWLER_DISCOVERY_TOP_PORTS=1000 # Options: number (e.g., 100, 1000) or 'full'
4+
CRAWLER_FINGERPRINT_FAST_MODE=false # true to only scan services default ports
5+
6+
# MAXMIND for GeoIP and ASN lookups
7+
MAXMIND_ACCOUNT_ID=your_user_id_here
8+
MAXMIND_LICENSE_KEY=your_license_key_here

.github/workflows/ci.yml

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,92 @@
1-
name: pre-commit checks
1+
name: Go Tests
22

33
on:
4-
pull_request:
54
push:
6-
branches:
7-
- main
5+
branches: [ main, develop ]
6+
paths:
7+
- 'rigour/**'
8+
- '.github/workflows/go-tests.yml'
9+
pull_request:
10+
branches: [ main, develop ]
11+
paths:
12+
- 'rigour/**'
813

914
jobs:
10-
pre-commit:
15+
test:
16+
name: Test Go Services
1117
runs-on: ubuntu-latest
1218

19+
strategy:
20+
matrix:
21+
go-version: ['1.25.5']
22+
1323
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v3
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version: ${{ matrix.go-version }}
31+
cache-dependency-path: rigour/go.sum
32+
33+
- name: Install libpcap-dev
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y libpcap-dev
37+
38+
- name: Verify dependencies
39+
working-directory: ./rigour
40+
run: |
41+
go mod verify
42+
go mod download
43+
44+
- name: Run go vet
45+
working-directory: ./rigour
46+
run: |
47+
# Exclude third_party directory which contains code with testing.T/B calls from goroutines
48+
go vet ./cmd/...
49+
go vet ./internal/...
50+
go vet ./pkg/...
1651
17-
- name: Set up Python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: '3.12'
52+
- name: Run go fmt check
53+
working-directory: ./rigour
54+
run: |
55+
fmt_output=$(gofmt -l .)
56+
if [ -n "$fmt_output" ]; then
57+
echo "The following files are not formatted:"
58+
echo "$fmt_output"
59+
exit 1
60+
fi
2161
22-
- name: Install pre-commit
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install pre-commit
62+
- name: Run tests
63+
working-directory: ./rigour
64+
run: |
65+
go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
2666
27-
- name: Run pre-commit
28-
run: pre-commit run --all-files
67+
- name: Generate coverage report
68+
working-directory: ./rigour
69+
run: go tool cover -html=coverage.out -o coverage.html
70+
71+
- name: Upload coverage to Codecov
72+
uses: codecov/codecov-action@v4
73+
with:
74+
files: ./rigour/coverage.out
75+
flags: unittests
76+
name: codecov-rigour
77+
fail_ci_if_error: false
78+
79+
- name: Upload coverage artifact
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: coverage-report-go${{ matrix.go-version }}
83+
path: rigour/coverage.html
84+
85+
build:
86+
name: Build Docker Images
87+
runs-on: ubuntu-latest
88+
needs: [test]
89+
90+
steps:
91+
- name: Checkout code
92+
uses: actions/checkout@v4

.gitignore

Lines changed: 22 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,33 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
1+
# MacOS filesysem files
2+
.DS_Store
53

6-
# C extensions
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
78
*.so
9+
*.dylib
810

9-
# Distribution / packaging
10-
.Python
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
11+
# Test binary, built with `go test -c`
12+
*.test
2813

29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
3416

35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
17+
# Dependency directories (remove the comment below to include it)
18+
# vendor/
3819

39-
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
43-
.coverage
44-
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
20+
# Go workspace file
21+
go.work
5322

54-
# Translations
55-
*.mo
56-
*.pot
23+
# Dev folders
24+
.vscode
25+
.idea
5726

58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
27+
# rigour binary
28+
rigour/rigour
6329

64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# poetry
98-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
103-
104-
# pdm
105-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106-
#pdm.lock
107-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108-
# in version control.
109-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110-
.pdm.toml
111-
.pdm-python
112-
.pdm-build/
113-
114-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115-
__pypackages__/
116-
117-
# Celery stuff
118-
celerybeat-schedule
119-
celerybeat.pid
120-
121-
# SageMath parsed files
122-
*.sage.py
123-
124-
# Environments
30+
# env
12531
.env
126-
.venv
127-
env/
128-
venv/
129-
ENV/
130-
env.bak/
131-
venv.bak/
132-
133-
# Spyder project settings
134-
.spyderproject
135-
.spyproject
136-
137-
# Rope project settings
138-
.ropeproject
139-
140-
# mkdocs documentation
141-
/site
142-
143-
# mypy
144-
.mypy_cache/
145-
.dmypy.json
146-
dmypy.json
147-
148-
# Pyre type checker
149-
.pyre/
150-
151-
# pytype static type analyzer
152-
.pytype/
153-
154-
# Cython debug symbols
155-
cython_debug/
15632

157-
# PyCharm
158-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160-
# and can be added to the global gitignore or merged into this file. For a more nuclear
161-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162-
#.idea/
33+
/data

.pre-commit-config.yaml

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

.vscode/settings.json

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

0 commit comments

Comments
 (0)