frontend: add yaml tags to UDP and HTTP configs

This change also adds the missing fields to the example config.

Fixes #228.
This commit is contained in:
Jimmy Zelinskie 2016-09-27 22:02:26 -04:00
parent 05b42f379c
commit fcfe5a2c2d
3 changed files with 13 additions and 10 deletions

View file

@ -13,6 +13,9 @@ chihaya:
udp: udp:
addr: 0.0.0.0:6881 addr: 0.0.0.0:6881
allow_ip_spoofing: false allow_ip_spoofing: false
max_clock_skew: 10s
private_key: |
paste a random string here that will be used to hmac connection IDs
storage: storage:
gc_interval: 14m gc_interval: 14m

View file

@ -47,12 +47,12 @@ func recordResponseDuration(action string, err error, duration time.Duration) {
// Config represents all of the configurable options for an HTTP BitTorrent // Config represents all of the configurable options for an HTTP BitTorrent
// Frontend. // Frontend.
type Config struct { type Config struct {
Addr string Addr string `yaml:"addr"`
ReadTimeout time.Duration ReadTimeout time.Duration `yaml:"read_timeout"`
WriteTimeout time.Duration WriteTimeout time.Duration `yaml:"write_timeout"`
RequestTimeout time.Duration RequestTimeout time.Duration `yaml:"request_timeout"`
AllowIPSpoofing bool AllowIPSpoofing bool `yaml:"allow_ip_spoofing"`
RealIPHeader string RealIPHeader string `yaml:"real_ip_header"`
} }
// Frontend holds the state of an HTTP BitTorrent Frontend. // Frontend holds the state of an HTTP BitTorrent Frontend.

View file

@ -48,10 +48,10 @@ func recordResponseDuration(action string, err error, duration time.Duration) {
// Config represents all of the configurable options for a UDP BitTorrent // Config represents all of the configurable options for a UDP BitTorrent
// Tracker. // Tracker.
type Config struct { type Config struct {
Addr string Addr string `yaml:"addr"`
PrivateKey string PrivateKey string `yaml:"private_key"`
MaxClockSkew time.Duration MaxClockSkew time.Duration `yaml:"max_clock_skew"`
AllowIPSpoofing bool AllowIPSpoofing bool `yaml:"allow_ip_spoofing"`
} }
// Frontend holds the state of a UDP BitTorrent Frontend. // Frontend holds the state of a UDP BitTorrent Frontend.