Skip to content

Commit

Permalink
Merge #571: Refactor: simplify index and tracker config files
Browse files Browse the repository at this point in the history
59cd566 docs: [#570] udpate development guide (Jose Celano)
a9b13f0 refactor: [#570] remove default options from config files (Jose Celano)
4f86343 chore: remove unused config files (Jose Celano)

Pull request description:

  Refactor: simplify index and tracker config files.

ACKs for top commit:
  josecelano:
    ACK 59cd566

Tree-SHA512: 3d805021fe795ccbd99b9b0e06f9e6504cca6039af6a0a095915e99298f3bf3e57c259d94feaa76a1c753e684231664371fc697ef9af57836c953a9554651f68
  • Loading branch information
josecelano committed Jun 11, 2024
2 parents a22dae8 + 59cd566 commit 1093e61
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 389 deletions.
50 changes: 9 additions & 41 deletions docs/development_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,48 +106,11 @@ Please refer to their respective documentation for more information.

## Run the tracker

For the requirements please refer to the [Tracker documentation][tracker].

```s
git clone git@github.com:torrust/torrust-tracker.git
cd torrust-tracker
./contrib/dev-tools/init/install-local.sh
cargo run
```

```s
Loading default configuration file: `./share/default/config/tracker.development.sqlite3.toml` ...
2023-11-29T16:27:04.662938414+00:00 [torrust_tracker::bootstrap::logging][INFO] logging initialized.
2023-11-29T16:27:04.667771053+00:00 [torrust_tracker::bootstrap::jobs::tracker_apis][INFO] Starting Torrust APIs server on: http://127.0.0.1:1212
2023-11-29T16:27:04.667933262+00:00 [torrust_tracker::bootstrap::jobs::tracker_apis][INFO] Torrust APIs server started
2023-11-29T16:27:04.667946602+00:00 [torrust_tracker::bootstrap::jobs::health_check_api][INFO] Starting Health Check API server: http://127.0.0.1:1313
2023-11-29T16:27:04.667998942+00:00 [torrust_tracker::servers::health_check_api::server][INFO] Health Check API server listening on http://127.0.0.1:1313
2023-11-29T16:27:04.668007992+00:00 [torrust_tracker::bootstrap::jobs::health_check_api][INFO] Torrust Health Check API server started
```

Please refer to the [Tracker documentation][tracker] for more information.
Please refer to the [Tracker documentation][tracker].

## Run the Index

For the requirements please refer to the [Index documentation][index].

```s
git clone git@github.com:torrust/torrust-index.git
cd torrust-index/
./contrib/dev-tools/init/install-local.sh
TORRUST_INDEX_API_CORS_PERMISSIVE=true cargo run
```

```s
Loading default configuration file: `./share/default/config/index.development.sqlite3.toml` ...
2023-11-29T16:32:56.657072410+00:00 [torrust_index::bootstrap::logging][INFO] logging initialized.
...
2023-11-29T16:32:56.811232959+00:00 [torrust_index::web::api::server][INFO] Starting API server with net config: 0.0.0.0:3001 ...
2023-11-29T16:32:56.811209440+00:00 [torrust_index::console::tracker_statistics_importer][INFO] Tracker statistics importer launcher started
2023-11-29T16:32:56.811322268+00:00 [torrust_index::web::api::server][INFO] API server listening on http://0.0.0.0:3001
2023-11-29T16:32:56.811342498+00:00 [torrust_index::console::tracker_statistics_importer][INFO] Tracker statistics importer cronjob starting ...
2023-11-29T16:32:56.811527765+00:00 [torrust_index::console::tracker_statistics_importer][INFO] Tracker statistics importer API server listening on http://127.0.0.1:3002
```
Please refer to the [Index documentation][index].

By default, the Index API has the most restrictive CORS policy. This means that the Index GUI cannot access the Index API, because they are running on different ports. If you run the backend as it is, you will see the following error in the browser console.

Expand All @@ -157,8 +120,6 @@ Access to fetch at 'http://localhost:3001/v1/torrents?page_size=50&page=0&sort=U

You need to enable the Cors layer with the permissive option setting the environment variable `TORRUST_INDEX_API_CORS_PERMISSIVE` to `true`.

Please refer to the [Index documentation][index] for more information.

## Run the Index GUI

Requirements:
Expand Down Expand Up @@ -250,6 +211,13 @@ export default defineConfig({
addCategory: ({ name }) => {
return addCategory(name, databaseConfig(config));
},
// Tag context
deleteTags: () => {
return deleteTags(databaseConfig(config));
},
addTag: ({ name }) => {
return addTag(name, databaseConfig(config));
},
// Torrent context
deleteTorrent: ({ infohash }) => {
return deleteTorrent(infohash, databaseConfig(config));
Expand Down
3 changes: 3 additions & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
caniuse
codecov
composables
Containerfile
daisyui
Expand All @@ -11,6 +13,7 @@ infohash
lintfix
mailcatcher
notiwind
Nuxi
Nuxt
nuxtjs
proxied
Expand Down
51 changes: 0 additions & 51 deletions share/default/config/index.container.mysql.toml

This file was deleted.

51 changes: 0 additions & 51 deletions share/default/config/index.container.sqlite3.toml

This file was deleted.

47 changes: 0 additions & 47 deletions share/default/config/index.development.sqlite3.toml

This file was deleted.

51 changes: 0 additions & 51 deletions share/default/config/index.e2e.container.mysql.toml

This file was deleted.

41 changes: 0 additions & 41 deletions share/default/config/index.e2e.container.sqlite3.toml
Original file line number Diff line number Diff line change
@@ -1,51 +1,10 @@
log_level = "info"

[website]
name = "Torrust"

# Please override the tracker token setting the
# `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`
# environmental variable!

[tracker]
url = "udp://tracker:6969"
mode = "Public"
api_url = "http://tracker:1212"
token = "MyAccessToken"
token_valid_seconds = 7257600

[net]
port = 3001

[auth]
email_on_signup = "Optional"
min_password_length = 6
max_password_length = 64
secret_key = "MaxVerstappenWC2021"

[database]
connect_url = "sqlite:///var/lib/torrust/index/database/e2e_testing_sqlite3.db?mode=rwc"

[mail]
email_verification_enabled = false
from = "example@email.com"
reply_to = "noreply@email.com"
username = ""
password = ""
server = "mailcatcher"
port = 1025

[image_cache]
max_request_timeout_ms = 1000
capacity = 128000000
entry_size_limit = 4000000
user_quota_period_seconds = 3600
user_quota_bytes = 64000000

[api]
default_torrent_page_size = 10
max_torrent_page_size = 30

[tracker_statistics_importer]
torrent_info_update_interval = 3600
port = 3002
37 changes: 0 additions & 37 deletions share/default/config/tracker.container.mysql.toml

This file was deleted.

Loading

0 comments on commit 1093e61

Please sign in to comment.