You've already forked ipfilter
29 lines
1.6 KiB
Markdown
29 lines
1.6 KiB
Markdown
# IP Filter
|
|
|
|
A set of crates for the construction and use of optimized IP filtering mechanisms.
|
|
|
|
### Setup
|
|
|
|
1. Create `private/secret.sh` containing `export IP2LOCATION_TOKEN=''`
|
|
1. Run `./private/dl.sh DB1LITECSV DB1LITECSVIPV6`
|
|
1. List available countries using `cargo run -- -i private/DB1-LITE-V4.CSV list`
|
|
1. Generate a filter using `cargo run -- -i ./private/DB1-LITE-V4.CSV merge -c BD,BR,CN,HK,IL,IN,IQ,IR,KP,PK,QA,RO,RS,RU,SA,SG,SO,SS,SY,TR,TW,UA,DZ -o ./private/filter4.bin`
|
|
1. Generate a filter using `cargo run -- -i ./private/DB1-LITE-V6.CSV merge -c BD,BR,CN,HK,IL,IN,IQ,IR,KP,PK,QA,RO,RS,RU,SA,SG,SO,SS,SY,TR,TW,UA,DZ -6 -o ./private/filter6.bin`
|
|
1. Verify IP ranges using `cargo run -- -i ./private/filter4.bin load` or `cargo run -- -i ./private/filter6.bin load -6`
|
|
|
|
###### Round trip checks
|
|
1. `diff <(cargo run -- -i ./private/DB1-LITE-V4.CSV merge -c BD,BR,CN,HK,IL,IN,IQ,IR,KP,PK,QA,RO,RS,RU,SA,SG,SO,SS,SY,TR,TW,UA,DZ) <(cargo run -- -i ./private/filter4.bin load)`
|
|
1. `diff <(cargo run -- -i ./private/DB1-LITE-V6.CSV merge -c BD,BR,CN,HK,IL,IN,IQ,IR,KP,PK,QA,RO,RS,RU,SA,SG,SO,SS,SY,TR,TW,UA,DZ -6) <(cargo run -- -i ./private/filter6.bin load -6)`
|
|
|
|
## Various builds
|
|
|
|
- build: `cargo hack --feature-powerset build`
|
|
- clippy: `cargo hack --feature-powerset clippy -- -D warnings`
|
|
- test: `cargo hack --feature-powerset test`
|
|
- test old: `cargo +1.85 hack --feature-powerset test`
|
|
- miri: `cargo +nightly hack --feature-powerset miri test`
|
|
- fmt: `cargo fmt --check`
|
|
- docs: `RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features`
|
|
- semver: `cargo semver-checks --all-features`
|
|
- publish: `cargo publish --dry-run -p ipfilter`
|