Define version 2 for toml configuration file #853
Closed
josecelano
started this conversation in
Proposals
Replies: 2 comments 1 reply
-
Proposal 1The example contains:
TOML: [core]
mode = "public"
log_level = "info"
# BitTorrent protocols
announce_interval = 120
min_announce_interval = 120
# database
db_driver = "Sqlite3"
db_path = "./storage/tracker/lib/database/sqlite3.db"
# network
on_reverse_proxy = false
external_ip = "0.0.0.0"
# torrents cleanup job
inactive_peer_cleanup_interval = 600
max_peer_timeout = 900
remove_peerless_torrents = true
# persistence
persistent_torrent_completed_stat = false
# feature flags
tracker_usage_statistics = true
[[udp_trackers]]
bind_address = "0.0.0.0:6969"
[[http_trackers]]
bind_address = "0.0.0.0:7070"
[[http_trackers]]
bind_address = "0.0.0.0:7071"
[[http_trackers.tsl_config]]
ssl_cert_path = ""
ssl_key_path = ""
[http_api]
bind_address = "127.0.0.1:1212"
[http_api.tsl_config]
ssl_cert_path = "./storage/tracker/lib/tls/localhost.crt"
ssl_key_path = "./storage/tracker/lib/tls/localhost.key"
[http_api.access_tokens]
admin = "MyAccessToken"
[health_check_api]
bind_address = "127.0.0.1:1313" JSON: {
"core": {
"mode": "public",
"log_level": "info",
"announce_interval": 120,
"min_announce_interval": 120,
"db_driver": "Sqlite3",
"db_path": "./storage/tracker/lib/database/sqlite3.db",
"on_reverse_proxy": false,
"external_ip": "0.0.0.0",
"inactive_peer_cleanup_interval": 600,
"max_peer_timeout": 900,
"remove_peerless_torrents": true,
"persistent_torrent_completed_stat": false,
"tracker_usage_statistics": true
},
"udp_trackers": [
{
"bind_address": "0.0.0.0:6969"
}
],
"http_trackers": [
{
"bind_address": "0.0.0.0:7070"
},
{
"bind_address": "0.0.0.0:7071",
"tsl_config": [
{
"ssl_cert_path": "./storage/tracker/lib/tls/localhost.crt",
"ssl_key_path": "./storage/tracker/lib/tls/localhost.key"
}
]
}
],
"http_api": {
"bind_address": "127.0.0.1:1212",
"tsl_config": {
"ssl_cert_path": "",
"ssl_key_path": ""
},
"access_tokens": {
"admin": "MyAccessToken"
}
},
"health_check_api": {
"bind_address": "127.0.0.1:1313"
}
} Commented subsections in the cc @da2ce7 |
Beta Was this translation helpful? Give feedback.
1 reply
-
This was moved to an issue: #878 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Relates to:
The final configuration overhaul step would be defining a new config file structure.
An extra validation could be needed like the one described here. For example, if you enable TSL for the tracker API you must provide both the certificate path and the certificate key path:
I think that type of validation could be implemented after parsing the injected configuration or maybe just by reorganising the toml file structure. For example:
No API enabled:
# No section [http_api]
API enabled but no TSL enabled:
API enabled with TSL enabled:
We would not need the
enabled
field. If the section is present the feature is enabled. If it's not it means that feature is disabled.These breaking changes will be added in a new
v2
configuration in a new PR.I would like to discuss the final version 2 for the config file before implementing it.
Current Configuration
Beta Was this translation helpful? Give feedback.
All reactions