-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (52 loc) · 1.98 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
default: help
## help : Show this help
help: Makefile
@printf "\n 🎼 Partoche helpers\n\n"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@printf ""
## demo : Start Partoche with a demo dataset
demo:
./venv/bin/python ./partoche.py --demo
## check : Check if everything is setup correctly
check:
ifeq ($(shell which asciiworld),)
@echo "[><] Missing required 'asciiworld' binary. Please refer to the instruction at 'https://www.uninformativ.de/git/asciiworld/file/README.html' to install asciiworld"
else
@echo "[OK] asciiworld found"
endif
ifeq ($(shell which virtualenv),)
@echo "[><] 'virtualenv' binary not found. Although not required, we recommend to use a virtualenv to properly isolate python projects requirements. Note that this script will use 'virtualenv' to automate setup and run"
else
@echo "[OK] virtualenv found"
endif
ifeq ($(wildcard data/listbot/live/iprep.yaml),)
@echo "[><] Missing IP reputation file ('data/listbot/live/iprep.yaml')"
else
@echo "[OK] IP reputation file found (last updated $(shell date --date='$(stat --format '%y' data/listbot/live/iprep.yaml)' +'%Y-%m-%d'))"
endif
ifeq ($(wildcard data/geoip/GeoLite2-City.mmdb),)
@echo "[><] Missing required GeoLite2-City database"
else
@echo "[OK] GeoLite2-City found"
endif
ifeq ($(wildcard data/geoip/GeoLite2-ASN.mmdb),)
@echo "[><] Missing required GeoLite2-ASN database"
else
@echo "[OK] GeoLite2-ASN found"
endif
ifeq ($(wildcard config/config.yml),)
@echo "[><] Missing configuration file (config/config.yml)"
else
@echo "[OK] Config file found"
endif
## install : Setup Partoche environment
install: venv reqs
## reqs : Install required dependencies
reqs:
./venv/bin/pip install -r requirements.txt
venv:
virtualenv ./venv --python=$(shell which python3)
## iprep : Pull IP reputation data
iprep:
@echo "[!!] This can take several minutes to build, please be patient"
cd ./data/listbot/ && bash listbot.sh