|
1 | 1 | --- |
2 | | -sidebar_position: 3 |
3 | | -title: Configuration |
| 2 | +title: Setup Configurations |
4 | 3 | --- |
5 | 4 |
|
6 | | -import Tabs from '@theme/Tabs'; |
7 | | -import TabItem from '@theme/TabItem'; |
8 | | - |
9 | | -# Configuration |
10 | | - |
11 | | -ServerRawler relies on a `config.toml` file to manage all settings in a file. |
12 | | -Create a file named `config.toml` in the root directory of your project (or [use a custom path](#using-a-custom-configuration-file-path)). |
13 | | - |
14 | | -## Database |
15 | | - |
16 | | -ServerRawler is designed to store collected data in a PostgreSQL database. You'll need to provide your PostgreSQL connection details. |
17 | | -[Setup database](./database-setup) |
18 | | - |
19 | | -:::tip |
20 | | -Ensure your PostgreSQL database is running and accessible from where you run ServerRawler. |
| 5 | +:::info[Configuration System] |
| 6 | +ServerRawler uses a folder where all configuration files are stored. The folder is named `config`. |
21 | 7 | ::: |
22 | 8 |
|
| 9 | +## Using a Custom Configuration File path |
23 | 10 |
|
24 | | -<Tabs queryString="configstyle"> |
25 | | - <TabItem value="stepbystep" label="Step by Step" default> |
26 | | - ## Step by Step Configuration |
27 | | - Here is a breakdown of the sections of the `config.toml` file: |
28 | | - |
29 | | - ### Database Section |
30 | | - The `[database]` section contains the connection details for your PostgreSQL database. Fill in the `host`, `port`, `user`, `password`, and `database` fields with your database credentials. |
31 | | - ```toml showLineNumbers=5 title="config.toml" |
32 | | - [database] |
33 | | - # Database configuration |
34 | | - |
35 | | - host = "localhost" |
36 | | - port = 5432 |
37 | | - user = "postgres" # Don't use superuser in production |
38 | | - password = "your_strong_password" |
39 | | - database = "serverrawler" |
40 | | - ``` |
41 | | - |
42 | | - ### Crawler Section |
43 | | - The `[crawler]` section allows you to configure the crawling behavior, including how many IPs to process per iteration, the number of concurrent tasks, and the ports to scan. |
44 | | - ```toml showLineNumbers=14 title="config.toml" |
45 | | - [crawler] |
46 | | - # Configuration specific to the crawling operations. |
47 | | - # Number of IP addresses to generate and process per crawling iteration. |
48 | | - ips_per_iteration = 1000000 |
49 | | - |
50 | | - # Maximum concurrent tasks the crawler will execute. |
51 | | - # Use 0 to use the value max_tasks from [network]. |
52 | | - max_tasks = 0 |
53 | | - |
54 | | - # Number of loops. Use 0 to run infinitly. |
55 | | - runs = 0 |
56 | | - |
57 | | - # Time in seconds to wait between each crawling iteration. |
58 | | - # Use 0 to disable the cooldown (maybe is this comment here useless). |
59 | | - time_between_runs = 0 |
60 | | - |
61 | | - # List of Minecraft server ports to scan. |
62 | | - ports = [25565] |
63 | | - ``` |
64 | | - |
65 | | - ### Scanner Section |
66 | | - The `[scanner]` section configures the scanning operations, including concurrent tasks and default ports to scan. |
67 | | - ```toml showLineNumbers=34 title="config.toml" |
68 | | - [scanner] |
69 | | - # Configuration specific to the scanning operations. |
70 | | - |
71 | | - # Maximum concurrent tasks the scanner will execute. |
72 | | - # Use 0 to use the value max_tasks from [network]. |
73 | | - max_tasks = 0 |
74 | | - |
75 | | - # List of Minecraft server ports to scan. |
76 | | - # The port in the IP list file will have the highst priority |
77 | | - # (This is called default btw.) |
78 | | - default_ports = [25565] |
79 | | - ``` |
80 | | - |
81 | | - ### Network Section |
82 | | - The `[network]` section defines the network connection settings, such as maximum concurrent tasks and connection timeout. |
83 | | - ```toml showLineNumbers=46 title="config.toml" |
84 | | - [network] |
85 | | - # Network connection configuration |
86 | | - |
87 | | - # Maximum concurrent network tasks (e.g., pings, queries). |
88 | | - # Recommended values: 1000 - 5000. |
89 | | - # Value must be between 10 and 20000. |
90 | | - max_tasks = 2000 |
91 | | - |
92 | | - # Timeout in milliseconds for server connections. |
93 | | - # Value must be between 80 and 15000 |
94 | | - timeout = 3000 |
95 | | - ``` |
96 | | - </TabItem> |
97 | | - <TabItem value="everything" label="Complete Example"> |
98 | | - ## Complete Example |
99 | | - |
100 | | - Here is a complete example of a `config.toml` file with both the `[database]` and `[crawler]` sections configured: |
101 | | - |
102 | | - ```toml showLineNumbers title="config.toml" |
103 | | - # ServerRawler configuration file |
104 | | - # Github: https://github.com/Cyberdolfi/ServerRawler |
105 | | - # Read the docs here: https://cyberdolfi.github.io/ServerRawler/docs/getting-started/configuration |
106 | | - |
107 | | - [database] |
108 | | - # Database configuration |
109 | | - |
110 | | - host = "localhost" |
111 | | - port = 5432 |
112 | | - user = "postgres" # Don't use superuser in production |
113 | | - password = "your_strong_password" |
114 | | - database = "serverrawler" |
115 | | - |
116 | | - [crawler] |
117 | | - # Configuration specific to the crawling operations. |
118 | | - |
119 | | - # Number of IP addresses to generate and process per crawling iteration. |
120 | | - ips_per_iteration = 1000000 |
121 | | - |
122 | | - # Maximum concurrent tasks the crawler will execute. |
123 | | - # Use 0 to use the value max_tasks from [network]. |
124 | | - max_tasks = 0 |
125 | | - |
126 | | - # Number of loops. Use 0 to run infinitly. |
127 | | - runs = 0 |
128 | | - |
129 | | - # Time in seconds to wait between each crawling iteration. |
130 | | - # Use 0 to disable the cooldown (maybe is this comment here useless). |
131 | | - time_between_runs = 0 |
132 | | - |
133 | | - # List of Minecraft server ports to scan. |
134 | | - ports = [25565] |
135 | | - |
136 | | - [scanner] |
137 | | - # Configuration specific to the scanning operations. |
138 | | - |
139 | | - # Maximum concurrent tasks the scanner will execute. |
140 | | - # Use 0 to use the value max_tasks from [network]. |
141 | | - max_tasks = 0 |
142 | | - |
143 | | - # List of Minecraft server ports to scan. |
144 | | - # The port in the IP list file will have the highst priority |
145 | | - # (This is called default btw.) |
146 | | - default_ports = [25565] |
147 | | - |
148 | | - [network] |
149 | | - # Network connection configuration |
150 | | - |
151 | | - # Maximum concurrent network tasks (e.g., pings, queries). |
152 | | - # Recommended values: 1000 - 5000. |
153 | | - # Value must be between 10 and 20000. |
154 | | - max_tasks = 2000 |
155 | | - |
156 | | - # Timeout in milliseconds for server connections. |
157 | | - # Value must be between 80 and 15000 |
158 | | - timeout = 3000 |
159 | | - ``` |
160 | | - </TabItem> |
161 | | -</Tabs> |
| 11 | +To teach ServerRawler to use your custom `path/to/your/custom_config_folder` directory, specify its path using the [`--config` argument](../usage/arguments/config). |
162 | 12 |
|
163 | | -## Using a Custom Configuration File path |
| 13 | +:::warning[Important] |
| 14 | +The path you specify with the `--config` argument is the directory wher the folder `config` is located, not the path to the configuration files itself. |
| 15 | +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. |
| 16 | +::: |
164 | 17 |
|
165 | | -To instruct ServerRawler to use your custom `config.toml` file, specify its path using the [`--config`](../usage/arguments/config) command-line argument: |
| 18 | +## Configuration Files |
| 19 | +ServerRawler uses two configuration files at the moment: |
| 20 | +- `config/` |
| 21 | + - `config.toml`: This file contains the main configuration settings for the crawler and scanner. [Details here](../configuration/config). |
| 22 | + - `database.toml`: This file contains the database connection details for PostgreSQL. [Details here](../configuration/database). |
166 | 23 |
|
167 | | -```bash |
168 | | -./ServerRawler --config /path/to/your/custom_config.toml |
169 | | -``` |
| 24 | +Click on the links above to learn how to set up each configuration file correctly. |
0 commit comments