Skip to content

Commit a1408ad

Browse files
committed
Merge #843: Update installation docs
3dee03e docs: udpate installation docs (Jose Celano) Pull request description: Update installation docs. ACKs for top commit: josecelano: ACK 3dee03e Tree-SHA512: 2bce1719680d8aaceac3c1b72929fd67d3a1b664af3dbb324c7afcc98581768f64e8415e2735366b49a6ababf77df37f12f8dbb074953ce3c5a18be654fc476d
2 parents 690d1d2 + 3dee03e commit a1408ad

File tree

2 files changed

+54
-20
lines changed

2 files changed

+54
-20
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ The following services are provided by the default configuration:
122122

123123
## Documentation
124124

125+
You can read the [latest documentation][docs] from <https://docs.rs/>.
126+
127+
Some specific sections:
128+
125129
- [Management API (Version 1)][API]
126130
- [Tracker (HTTP/TLS)][HTTP]
127131
- [Tracker (UDP)][UDP]

src/lib.rs

+50-20
Original file line numberDiff line numberDiff line change
@@ -109,29 +109,47 @@
109109
//! With the default configuration you will need to create the `storage` directory:
110110
//!
111111
//! ```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
118120
//! ```
119121
//!
120122
//! The default configuration expects a directory `./storage/tracker/lib/database` to be writable by the tracker process.
121123
//!
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`.
123125
//!
124126
//! You only need the `tls` directory in case you are setting up SSL for the HTTP tracker or the tracker API.
125127
//! Visit [`HTTP`](crate::servers::http) or [`API`](crate::servers::apis) if you want to know how you can use HTTPS.
126128
//!
127129
//! ## Install from sources
128130
//!
131+
//! First, you need to create a folder to clone the repository.
132+
//!
133+
//! ```text
134+
//! cd /tmp
135+
//! mkdir torrust
136+
//! ```
137+
//!
129138
//! ```text
130139
//! git clone https://github.com/torrust/torrust-tracker.git \
131140
//! && cd torrust-tracker \
132141
//! && cargo build --release \
142+
//! && mkdir -p ./storage/tracker/etc \
133143
//! && 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
135153
//! ```
136154
//!
137155
//! ## Run with docker
@@ -141,9 +159,10 @@
141159
//!
142160
//! # Configuration
143161
//!
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.
147166
//!
148167
//! The default configuration is:
149168
//!
@@ -187,26 +206,37 @@
187206
//! bind_address = "127.0.0.1:1313"
188207
//!```
189208
//!
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.
191211
//!
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).
193214
//!
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:
195217
//!
196218
//! ```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
199220
//! ```
200221
//!
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.
202229
//!
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`.
204232
//!
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.
206235
//!
207236
//! # Usage
208237
//!
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:
210240
//!
211241
//! - REST API: <http://localhost:1212>
212242
//! - UDP tracker: <http://localhost:6969>

0 commit comments

Comments
 (0)