Skip to content

Commit

Permalink
Merge branch 'master' into issue/148-exclusion-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
battleoverflow authored Nov 1, 2023
2 parents 1ed237e + 4ffe115 commit 1c6e467
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ docs/_build/
# Local
.DS_Store
.vscode/
build.sh
7 changes: 4 additions & 3 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ python3 scripts/<script> -v

A quick list of all available scripts:

| Script | Example | Description |
|-----------------------|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `scripts/validate.py` | `python3 validate.py config.yml` | This script validates your YAML syntax and checks that you have the minimum required (`config.yml`) by ThreatIngestor to operate properly. |
| Script | Example | Description |
|-----------------------|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `scripts/validate.py` | `python3 validate.py config.yml` | This script validates your YAML syntax and checks that you have the minimum required (`config.yml`) by ThreatIngestor to operate properly. |
| `scripts/build.sh` | `chmod +x build.sh && ./build.sh` | Basic script to build a fresh installation of ThreatIngestor locally. |
31 changes: 31 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Basic script to build a fresh installation of ThreatIngestor locally.
# NOTE: This wipes all data from state.db and artifacts.* from the local directory. This is only here to quickly build and install a fresh version locally outside of Docker.

function does_pip_exist() {
if type "pip3" > /dev/null
then
return 0
else
return 1
fi
}

function build() {
if does_pip_exist
then
pip3 uninstall threatingestor -y

rm -r dist/ threatingestor.egg-info/
rm artifacts.csv output.csv artifacts.db output.db state.db

python3 -m build
pip3 install dist/threatingestor-*.whl
else
echo "Missing pip"
exit 1
fi
}

build

0 comments on commit 1c6e467

Please sign in to comment.