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

Update droplet example #16

Merged
merged 1 commit into from
May 29, 2024
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
37 changes: 0 additions & 37 deletions demo/config-index.local.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,10 @@
log_level = "info"

[website]
name = "Torrust"

[tracker]
url = "udp://localhost: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/torrust_index_demo.db?mode=rwc" # SQLite
#connect_url = "mysql://root:root_secret_password@mysql:3306/torrust_index_demo" # MySQL

[mail]
email_verification_enabled = false
from = "[email protected]"
reply_to = "[email protected]"
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
26 changes: 0 additions & 26 deletions demo/config-tracker.local.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
log_level = "info"
mode = "public"
db_driver = "Sqlite3"
db_path = "/var/lib/torrust/tracker/database/torrust_tracker_demo.db" # SQLite
#db_path = "mysql://root:root_secret_password@mysql:3306/torrust_tracker_demo" # MySQL
announce_interval = 120
min_announce_interval = 120
max_peer_timeout = 900
on_reverse_proxy = false
external_ip = "0.0.0.0"
tracker_usage_statistics = true
persistent_torrent_completed_stat = false
inactive_peer_cleanup_interval = 600
remove_peerless_torrents = true

[[udp_trackers]]
enabled = true
bind_address = "0.0.0.0:6969"

[[http_trackers]]
enabled = false
bind_address = "0.0.0.0:7070"
ssl_enabled = false
ssl_cert_path = ""
ssl_key_path = ""

[http_api]
enabled = true
bind_address = "0.0.0.0:1212"
ssl_enabled = false
ssl_cert_path = ""
ssl_key_path = ""

[http_api.access_tokens]
admin = "MyAccessToken"
5 changes: 3 additions & 2 deletions droplet/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ NITRO_HOST="0.0.0.0"
NITRO_PORT=3000

# Index
TORRUST_INDEX_CONFIG=
TORRUST_INDEX_TRACKER_API_TOKEN='MyAccessToken'
TORRUST_INDEX_CONFIG_TOML=
TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN='MyAccessToken'
TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY='MyAccessToken'
TORRUST_INDEX_API_CORS_PERMISSIVE=false

# Tracker
Expand Down
2 changes: 1 addition & 1 deletion droplet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cd torrust-compose/droplet
Edit the `.env` file to change the default Tracker API token:

```console
TORRUST_INDEX_TRACKER_API_TOKEN="your_secret_token"
TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN="your_secret_token"
TORRUST_TRACKER_CONFIG_OVERRIDE_HTTP_API__ACCESS_TOKENS__ADMIN="your_secret_token"
```

Expand Down
12 changes: 10 additions & 2 deletions droplet/bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ mkdir -p ./storage/certbot/lib

## Index

# Generate the Index sqlite database directory and file if it does not exist
mkdir -p ./storage/index/etc
mkdir -p ./storage/index/lib/database
mkdir -p ./storage/index/lib/tls
mkdir -p ./storage/index/log

# Generate the Index sqlite database directory and file if it does not exist

if ! [ -f "./storage/index/lib/database/sqlite3.db" ]; then
echo "Creating index database: './storage/index/lib/database/sqlite3.db'"
Expand All @@ -40,8 +44,12 @@ fi

## Tracker

# Generate the Tracker sqlite database directory and file if it does not exist
mkdir -p ./storage/tracker/etc
mkdir -p ./storage/tracker/lib/database
mkdir -p ./storage/tracker/lib/tls
mkdir -p ./storage/tracker/lib/log

# Generate the Tracker sqlite database directory and file if it does not exist

if ! [ -f "./storage/tracker/lib/database/sqlite3.db" ]; then
echo "Creating tracker database: './storage/tracker/lib/database/sqlite3.db'"
Expand Down
2 changes: 1 addition & 1 deletion droplet/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ services:
- USER_ID=${USER_ID}
- TORRUST_INDEX_DATABASE=${TORRUST_INDEX_DATABASE:-sqlite3}
- TORRUST_INDEX_DATABASE_DRIVER=${TORRUST_INDEX_DATABASE_DRIVER:-sqlite3}
- TORRUST_INDEX_TRACKER_API_TOKEN=${TORRUST_INDEX_TRACKER_API_TOKEN:-MyAccessToken}
- TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN=${TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN:-MyAccessToken}
- TORRUST_INDEX_API_CORS_PERMISSIVE=${TORRUST_INDEX_API_CORS_PERMISSIVE:-true}
networks:
- backend_network
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,16 @@
log_level = "info"

[website]
name = "Torrust"

# Please override the tracker token setting the
# `TORRUST_INDEX_TRACKER_API_TOKEN`
# environmental variable!
# Please override the tracker token:
# `TORRUST_INDEX_CONFIG_OVERRIDE_TRACKER__TOKEN`
# And the auth screte key:
# `TORRUST_INDEX_CONFIG_OVERRIDE_AUTH__SECRET_KEY`
# environmental variables!

[tracker]
url = "udp://tracker.torrust-demo.com: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/sqlite3.db?mode=rwc"

[mail]
email_verification_enabled = false
from = "[email protected]"
reply_to = "[email protected]"
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
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
announce_interval = 300
db_driver = "Sqlite3"
# Please override the admin token setting the
# `TORRUST_TRACKER_CONFIG_OVERRIDE_HTTP_API__ACCESS_TOKENS__ADMIN`
# environmental variable!

db_path = "/var/lib/torrust/tracker/database/sqlite3.db"
external_ip = "0.0.0.0"
inactive_peer_cleanup_interval = 600
log_level = "info"
max_peer_timeout = 900
min_announce_interval = 300
mode = "public"
on_reverse_proxy = true
persistent_torrent_completed_stat = true
remove_peerless_torrents = true
tracker_usage_statistics = true

[[udp_trackers]]
bind_address = "0.0.0.0:6969"
enabled = true

[[http_trackers]]
bind_address = "0.0.0.0:7070"
enabled = true
ssl_cert_path = "/var/lib/torrust/tracker/tls/localhost.crt"
ssl_enabled = false
ssl_key_path = "/var/lib/torrust/tracker/tls/localhost.key"

[http_api]
bind_address = "0.0.0.0:1212"
enabled = true
ssl_cert_path = "/var/lib/torrust/tracker/tls/localhost.crt"
ssl_enabled = false
ssl_key_path = "/var/lib/torrust/tracker/tls/localhost.key"

# Please override the admin token setting the
# `TORRUST_TRACKER_CONFIG_OVERRIDE_HTTP_API__ACCESS_TOKENS__ADMIN`
# environmental variable!

[http_api.access_tokens]
admin = "MyAccessToken"

[health_check_api]
bind_address = "127.0.0.1:1313"
Loading