Synopsis

ipguard [-hV] [-l=<logFile>] [--log-level=<logLevel>] (--get-yaml-schema | --get-json-schema | --get-example-configuration | (-c=<configurationFile> [--overwrite] [--no-progress]))

Description

ipguard is a CLI tool that allows users to download IP-address lists, aggregate and deduplicate all of the IP addresses and write the result to one big file. Contribute at Codeberg: https://codeberg.org/GustavVirtualMachine/ipguard4j

Options

-c, --config=<configurationFile>

The configuration file that determines the behaviour of the application.

--get-example-configuration

Prints an example configuration file in YAML format.

--get-json-schema

Prints the JSON schema for configuration files.

--get-yaml-schema

Prints the YAML schema for configuration files.

-h, --help

Show this help message and exit.

-l, --log-file=<logFile>

The file which the debug log shall be written to.

--log-level=<logLevel>

The log level to use. Possible values are (from most to least verbose): TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. Default is WARN.

--no-progress

No continuously updated progress bars indicating the current status will be printed to the console.

--overwrite

Will overwrite any IP list files that already exist.

-V, --version

Print version information and exit.

Exit status

0

The program terminated successfully.

10

The given command-line arguments were invalid.

11

The given logging level was invalid.

20

The given configuration file is invalid.

21

The given configuration file does not exist.

22

The given configuration file is not a file.

23

The given configuration file does not match the expected format.

30

An input/output error occurred.

31

An input/output error occurred while reading the configuration file.

32

An input/output error occurred while downloading the IP list(s).

33

An input/output error occurred while writing the output file(s).

34

An input/output error occurred while reading a file in the application’s resources folder (inside the JAR file).

40

The program was interrupted unexpectedly.

Environment

JDK_JAVA_OPTIONS

Additional JVM options, as recognised by the Java launcher. This can be used to set various system properties that influence ipguard’s behaviour. These system properties are formatted like this: [-Dproperty=value], and they are separated from each other by whitespace.

ipguard.parallel.configparsing.threshold.lists (integer ≥ 1, default: 5)

Parallel processing of the configuration shall be enabled if it contains at least this many different IP-list formats.

ipguard.parallel.configparsing.threshold.files (integer ≥ 1, default: 5)

Parallel processing of the configuration shall be enabled if it contains at least this many different target-file formats.

ipguard.parallel.lists.windowsize (integer ≥ 0, default: 0)

Controls how IP parsing is distributed across virtual threads:

0

Per IP list, all IPs shall be parsed in the same virtual thread.

1

Per IP list, each IP shall be parsed in its own virtual thread.

n

Per IP list, one virtual thread per n IPs shall be spawned.

Example:

JDK_JAVA_OPTIONS="-Dipguard.parallel.configparsing.threshold.lists=1 -Dipguard.parallel.lists.windowsize=10"

See man:java[1] for the general syntax and semantics of JDK_JAVA_OPTIONS.

Caveats

Do not supply the system properties as command-line arguments to ipguard, as they will be ignored.

Bugs

Examples

Run with a configuration file

ipguard --config ipguard.yaml

Overwrite existing output files and suppress progress bars

ipguard -c config.yaml --overwrite --no-progress

Enable verbose logging to a file

ipguard -c config.yaml --log-file debug.log --log-level TRACE

Author

See also

man:java[1]