Skip to content

Commit 5d84617

Browse files
committed
feat(docs): add new argument parser system
1 parent f2100c6 commit 5d84617

20 files changed

Lines changed: 326 additions & 406 deletions

docs/docs/usage.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,38 @@ sidebar_position: 3
44

55
# Usage Overview
66

7-
ServerRawler is a powerful tool for scanning Minecraft servers, designed for efficiency and flexibility. This section provides a comprehensive guide on how to operate ServerRawler, from starting the crawler to understanding its command-line arguments and interpreting its output.
8-
9-
## Starting ServerRawler
10-
11-
Once ServerRawler is installed and configured, you can initiate its operations. Navigate to the project's root directory in your terminal.
12-
13-
If you prefer to use a custom configuration file, look at the [--config](./usage/arguments/scan) argument.
7+
This page gives you an overview about all commands and arguments of ServerRawler in the terminal.
8+
For detailed information about each command and argument, click on the links to navigate to their documentation pages.
149

1510
## Command Line Arguments
1611

17-
ServerRawler's behavior can be customized using a variety of command-line arguments. Each argument provides granular control over logging, scanning, IP generation, and more. Click on any argument below for detailed information and examples.
18-
1912
:::tip
20-
For a quick overview of all available commands directly in your terminal, run `ServerRawler --help`.
13+
For a quick overview of all available commands directly in your terminal, run `./ServerRawler --help`.
2114
:::
2215

2316
### General Arguments
2417

25-
* [**`--log`**](./usage/arguments/log): Set the threshold for console output.
26-
* [**`--no-database`**](./usage/arguments/no-database): Prevent data from being saved to the database.
27-
* [**`--max-network-tasks`**](./usage/arguments/max-network-tasks): Define the maximum concurrent network operations.
28-
* [**`--config`**](./usage/arguments/config): Specify a custom configuration file.
29-
30-
### Utility & Debugging Arguments
31-
32-
* [**`--ping`**](./usage/arguments/ping): Perform a Server List Ping (SLP) check.
33-
* [**`--query`**](./usage/arguments/query): Retrieve detailed server info via Query protocol.
34-
* [**`--join`**](./usage/arguments/join): Simulate a player login for authentication/whitelist checks.
35-
* [**`--convert-image`**](./usage/arguments/convert-image): Convert Base64 strings to image files.
36-
* [**`--generate-ips`**](./usage/arguments/generate-ips): Generate random IPv4 addresses and save them to a file.
37-
* [**`--cidr`**](./usage/arguments/cidr): Configure an IP range for generation or scanning.
18+
- [**`--log`**](./usage/arguments/log): Set the threshold for console output.
19+
- [**`--no-database`**](./usage/arguments/no-database): Prevent data from being saved to the database.
20+
- [**`--config`**](./usage/arguments/config): Specify a custom configuration file.
21+
- [**`--cidr`**](./usage/arguments/cidr): Configure an IP range for IP generation.
3822

39-
### Scanning & Crawling Arguments
23+
### Commands
4024

41-
* [**`--crawl`**](./usage/arguments/crawl): Start a continuous crawling loop for discovering servers.
42-
* [**`--scan`**](./usage/arguments/scan): Scan IP addresses from a text file.
25+
- [**`ping`**](./usage/commands/ping): Perform a Server List Ping (SLP) check.
26+
- [**`query`**](./usage/commands/query): Retrieve detailed server info via Query protocol.
27+
- [**`join`**](./usage/commands/join): Simulate a player login for authentication/whitelist checks.
28+
- [**`convert-img`**](./usage/commands/convert-image): Convert Base64 strings to image files.
29+
- [**`generate`**](./usage/commands/generate-ips): Generate random IPv4 addresses and save them to a file.
30+
- [**`crawl`**](./usage/commands/crawl): Start a continuous crawling loop for discovering servers.
31+
- [**`scan`**](./usage/commands/scan): Scan IP addresses from a text file.
4332

4433
## Output
4534

4635
ServerRawler provides real-time feedback through console logs, indicating its progress, any discovered servers, and errors encountered.
4736

48-
* Successfully discovered server data, if database saving is enabled, will be stored in your configured PostgreSQL database.
49-
* Logs are color-coded to easily distinguish between information, warnings, errors, and successes.
37+
- Successfully discovered server data, if database saving is enabled, will be stored in your configured PostgreSQL database.
38+
- Logs are color-coded to easily distinguish between information, warnings, errors, and successes.
5039

5140
## Usage Examples
5241

docs/docs/usage/arguments/cidr.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
---
2-
sidebar_position: 9
2+
title: --cidr - Argument
33
---
44

5-
# `--cidr`
5+
# `--cidr` - Argument
66

7-
**Long**: `--cidr`
7+
- **Long**: `--cidr`
88

9-
Configures an IP range in CIDR (Classless Inter-Domain Routing) format to restrict the scope of IP generation (`--generate-ips`) or crawling (`--crawl`) operations. This allows focusing on specific networks or segments.
9+
## Description
1010

11-
:::info
12-
CIDR notation specifies an IP address and a prefix length, indicating the number of bits in the IP address that represent the network prefix. For example, `192.168.1.0/24` covers all IP addresses from `192.168.1.0` to `192.168.1.255`.
11+
Configures an IP range in CIDR (Classless Inter-Domain Routing) format to restrict the scope of IP generation oprations. This allows focusing on specific networks or segments.
12+
13+
:::info[What is CIDR?]
14+
CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing Internet Protocol packets. It replaces the older system based on classes A, B, and C. CIDR notation is a compact representation of an IP address and its associated network mask. It consists of an IP address, followed by a slash (`/`), and then a number that indicates the length of the network prefix in bits. For example, `192.168.1.0/24` covers all IP addresses from `192.168.1.0` to `192.168.1.255`.
1315
:::
1416

1517
## Usage
1618

1719
```bash
18-
ServerRawler --cidr <IP_RANGE>
20+
./ServerRawler <Command> --cidr <IP_RANGE>
1921
```
2022

21-
* `<IP_RANGE>`: The IP range in CIDR format (e.g., `192.168.1.0/24`, `10.0.0.0/8`).
23+
- `<Command>`: Any command that uses IP generation
24+
- [`generate`](/usage/commands/generate.md)
25+
- [`crawl`](/usage/commands/crawl.md)
26+
- `<IP_RANGE>`: The IP range in CIDR format (e.g., `192.168.1.0/24`, `10.0.0.0/8`).
2227

2328
## Examples
2429

25-
To generate random IPs exclusively within the `172.16.0.0/16` range:
30+
To generate random IPs exclusively within the `1.1.1.0/16` range:
2631

2732
```bash
28-
ServerRawler --generate-ips private_network.txt 1000 --cidr 172.16.0.0/16
33+
./ServerRawler generate cloudflare_network.txt 1000 --cidr 1.1.1.0/16
2934
```
3035

3136
To start a crawling loop that only targets servers within the `8.8.8.0/29` range:
3237

3338
```bash
34-
ServerRawler --crawl --cidr 8.8.8.0/29
39+
./ServerRawler crawl --cidr 8.8.8.0/29
3540
```
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
---
2-
sidebar_position: 12
2+
title: --config - Argument
33
---
44

5-
# `--config`
5+
# `--config` - Argument
66

7-
**Short**: `-c`
7+
- **Short**: `-c`
8+
- **Long**: `--config`
89

9-
**Long**: `--config`
10+
## Description
1011

11-
Specifies the path to a custom configuration file (e.g., `config.toml`). This allows users to manage settings such as database connections and crawler parameters separately from environment variables or default settings.
12+
Specifies the path to custom configuration files for ServerRawler. This allows you to use your own configuration settings instead of the config/ folder in the root directory of your project. (Where you run ServerRawler from)
1213

13-
:::info
14-
Using a dedicated configuration file is recommended for managing complex deployments or specific operational profiles.
14+
:::warning[Important]
15+
The path you specify with the `--config` argument is the directory where the folder `config` is located, not the path to the configuration files itself.
16+
For example, if your configuration files are located in `path/to/your/custom_config_folder/config`, you should specify `--config path/to/your/custom_config_folder` as the argument.
1517
:::
1618

1719
## Usage
1820

1921
```bash
20-
ServerRawler --config <PATH_TO_CONFIG_FILE>
21-
ServerRawler -c <PATH_TO_CONFIG_FILE>
22+
ServerRawler --config <PATH_TO_CONFIG_FOLDER>
23+
ServerRawler -c <PATH_TO_CONFIG_FOLDER>
2224
```
2325

24-
* `<PATH_TO_CONFIG_FILE>`: The absolute or relative path to your `config.toml` file.
26+
- `<PATH_TO_CONFIG_FOLDER>`: The absolute or relative path to your custom configuration folder.
27+
2528

2629
## Examples
2730

28-
To run ServerRawler using a configuration file named `my_custom_config.toml` located in the current directory:
31+
To run ServerRawler using a custom configuration folder located at `my_custom_config_folder` in the current directory:
2932

3033
```bash
31-
ServerRawler --config my_custom_config.toml
34+
./ServerRawler --config my_custom_config_folder
3235
```
3336

34-
To run ServerRawler with a configuration file located at a specific absolute path:
37+
To run ServerRawler with a configuration folder located at a specific absolute path:
3538

3639
```bash
37-
ServerRawler -c /etc/serverrawler/production.toml
40+
./ServerRawler -c /etc/serverrawler/production_config_folder
3841
```

docs/docs/usage/arguments/convert-image.md

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

docs/docs/usage/arguments/crawl.md

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

docs/docs/usage/arguments/generate-ips.md

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

docs/docs/usage/arguments/join.md

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

0 commit comments

Comments
 (0)