|
109 | 109 | //! With the default configuration you will need to create the `storage` directory:
|
110 | 110 | //!
|
111 | 111 | //! ```text
|
112 |
| -//! storage/ |
113 |
| -//! ├── database |
114 |
| -//! │ └── data.db |
115 |
| -//! └── tls |
116 |
| -//! ├── localhost.crt |
117 |
| -//! └── localhost.key |
| 112 | +//! ./storage/ |
| 113 | +//! └── tracker |
| 114 | +//! ├── etc |
| 115 | +//! ├── lib |
| 116 | +//! │ ├── database |
| 117 | +//! │ │ └── sqlite3.db |
| 118 | +//! │ └── tls |
| 119 | +//! └── log |
118 | 120 | //! ```
|
119 | 121 | //!
|
120 | 122 | //! The default configuration expects a directory `./storage/tracker/lib/database` to be writable by the tracker process.
|
121 | 123 | //!
|
122 |
| -//! By default the tracker uses `SQLite` and the database file name `data.db`. |
| 124 | +//! By default the tracker uses `SQLite` and the database file name `sqlite3.db`. |
123 | 125 | //!
|
124 | 126 | //! You only need the `tls` directory in case you are setting up SSL for the HTTP tracker or the tracker API.
|
125 | 127 | //! Visit [`HTTP`](crate::servers::http) or [`API`](crate::servers::apis) if you want to know how you can use HTTPS.
|
126 | 128 | //!
|
127 | 129 | //! ## Install from sources
|
128 | 130 | //!
|
| 131 | +//! First, you need to create a folder to clone the repository. |
| 132 | +//! |
| 133 | +//! ```text |
| 134 | +//! cd /tmp |
| 135 | +//! mkdir torrust |
| 136 | +//! ``` |
| 137 | +//! |
129 | 138 | //! ```text
|
130 | 139 | //! git clone https://github.com/torrust/torrust-tracker.git \
|
131 | 140 | //! && cd torrust-tracker \
|
132 | 141 | //! && cargo build --release \
|
| 142 | +//! && mkdir -p ./storage/tracker/etc \ |
133 | 143 | //! && mkdir -p ./storage/tracker/lib/database \
|
134 |
| -//! && mkdir -p ./storage/tracker/lib/tls |
| 144 | +//! && mkdir -p ./storage/tracker/lib/tls \ |
| 145 | +//! && mkdir -p ./storage/tracker/log |
| 146 | +//! ``` |
| 147 | +//! |
| 148 | +//! To run the tracker we will have to use the command "cargo run" this will |
| 149 | +//! compile and after being compiled it will start running the tracker. |
| 150 | +//! |
| 151 | +//! ```text |
| 152 | +//! cargo run |
135 | 153 | //! ```
|
136 | 154 | //!
|
137 | 155 | //! ## Run with docker
|
|
141 | 159 | //!
|
142 | 160 | //! # Configuration
|
143 | 161 | //!
|
144 |
| -//! In order to run the tracker you need to provide the configuration. If you run the tracker without providing the configuration, |
145 |
| -//! the tracker will generate the default configuration the first time you run it. It will generate a `tracker.toml` file with |
146 |
| -//! in the root directory. |
| 162 | +//! In order to run the tracker you need to provide the configuration. If you |
| 163 | +//! run the tracker without providing the configuration, the tracker will |
| 164 | +//! generate the default configuration the first time you run it. It will |
| 165 | +//! generate a `tracker.toml` file with in the root directory. |
147 | 166 | //!
|
148 | 167 | //! The default configuration is:
|
149 | 168 | //!
|
|
187 | 206 | //! bind_address = "127.0.0.1:1313"
|
188 | 207 | //!```
|
189 | 208 | //!
|
190 |
| -//! The default configuration includes one disabled UDP server, one disabled HTTP server and the enabled API. |
| 209 | +//! The default configuration includes one disabled UDP server, one disabled |
| 210 | +//! HTTP server and the enabled API. |
191 | 211 | //!
|
192 |
| -//! For more information about each service and options you can visit the documentation for the [torrust-tracker-configuration crate](https://docs.rs/torrust-tracker-configuration). |
| 212 | +//! For more information about each service and options you can visit the |
| 213 | +//! documentation for the [torrust-tracker-configuration crate](https://docs.rs/torrust-tracker-configuration). |
193 | 214 | //!
|
194 |
| -//! Alternatively to the `tracker.toml` file you can use one environment variable `TORRUST_TRACKER_CONFIG` to pass the configuration to the tracker: |
| 215 | +//! Alternatively to the `tracker.toml` file you can use one environment |
| 216 | +//! variable `TORRUST_TRACKER_CONFIG` to pass the configuration to the tracker: |
195 | 217 | //!
|
196 | 218 | //! ```text
|
197 |
| -//! TORRUST_TRACKER_CONFIG=$(cat tracker.toml) |
198 |
| -//! cargo run |
| 219 | +//! TORRUST_TRACKER_CONFIG=$(cat ./share/default/config/tracker.development.sqlite3.toml) ./target/release/torrust-tracker |
199 | 220 | //! ```
|
200 | 221 | //!
|
201 |
| -//! In the previous example you are just setting the env var with the contents of the `tracker.toml` file. |
| 222 | +//! In the previous example you are just setting the env var with the contents |
| 223 | +//! of the `tracker.toml` file. |
| 224 | +//! |
| 225 | +//! The env var contains the same data as the `tracker.toml`. It's particularly |
| 226 | +//! useful in you are [running the tracker with docker](https://github.com/torrust/torrust-tracker/tree/develop/docker). |
| 227 | +//! |
| 228 | +//! > NOTICE: The `TORRUST_TRACKER_CONFIG` env var has priority over the `tracker.toml` file. |
202 | 229 | //!
|
203 |
| -//! The env var contains the same data as the `tracker.toml`. It's particularly useful in you are [running the tracker with docker](https://github.com/torrust/torrust-tracker/tree/develop/docker). |
| 230 | +//! By default, if you don’t specify any `tracker.toml` file, the application |
| 231 | +//! will use `./share/default/config/tracker.development.sqlite3.toml`. |
204 | 232 | //!
|
205 |
| -//! > NOTE: The `TORRUST_TRACKER_CONFIG` env var has priority over the `tracker.toml` file. |
| 233 | +//! > IMPORTANT: Every time you change the configuration you need to restart the |
| 234 | +//! service. |
206 | 235 | //!
|
207 | 236 | //! # Usage
|
208 | 237 | //!
|
209 |
| -//! Running the tracker with the default configuration and enabling the UDP and HTTP trackers will expose the services on these URLs: |
| 238 | +//! Running the tracker with the default configuration and enabling the UDP and |
| 239 | +//! HTTP trackers will expose the services on these URLs: |
210 | 240 | //!
|
211 | 241 | //! - REST API: <http://localhost:1212>
|
212 | 242 | //! - UDP tracker: <http://localhost:6969>
|
|
0 commit comments