Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: simplify index and tracker config files #571

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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