1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# -*- mode: python; coding: utf-8 -*-
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software distributed under the License is distributed on an AS IS basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
from lxml import etree
from twisted.python import usage
class NohgooeeOptions(usage.Options):
optFlags = [
['allowed_controls',
None,
_("allow special keys in torrents in the allowed_dir to affect "
"tracker access")],
['allow_get', None,
_("use with allowed_dir; adds a /file?hash={hash} url that "
"allows users to download the torrent file"),
],
['close_with_rst', None,
_("close connections with RST and avoid the TCP TIME_WAIT state")],
['keep_dead', None,
_("keep dead torrents after they expire (so they still show up on your "
"/scrape and web page). Only matters if allowed_dir is not set")],
['log_nat_checks', None,
_("whether to add entries to the log for nat-check results")],
]
optParameters = [
['allowed_dir',
None,
'',
_("only allow downloads for .torrents in this dir (and recursively in "
"subdirectories of directories that have no .torrent files "
"themselves). If set, torrents in this directory show up on "
"infopage/scrape whether they have peers or not")],
['bind', None,
'',
_("ip to bind to locally")],
['dfile', None,
'/tmp/dfile.txt',
_("file to store recent downloader info in")],
['favicon', None,
'',
_("file containing x-icon data to return when browser requests "
"favicon.ico")],
['infopage_redirect', None,
'',
_("a URL to redirect the info page to")],
['max_give', None,
200,
_("maximum number of peers to give with any one request")],
['min_time_between_cache_refreshes', None,
600.0,
_("minimum time in seconds before a cache is considered stale "
"and is flushed")],
['min_time_between_log_flushes', None,
3.0,
_("minimum time it must have been since the last flush to do "
"another one")],
['nat_check', None,
3,
_("how many times to check if a downloader is behind a NAT "
"(0 = don't check)")],
['only_local_override_ip', None,
2,
_("ignore the ip GET parameter from machines which aren't on "
"local network IPs (0 = never, 1 = always, 2 = ignore if NAT "
"checking is not enabled). HTTP proxy headers giving address "
"of original client are treated the same as --ip.")],
['parse_dir_interval', None,
60,
_("how often to rescan the torrent directory, in seconds")],
['port', None,
6969,
_("Port to listen on.")],
['reannounce_interval', None,
30 * 60,
_("seconds downloaders should wait between reannouncements")],
['response_size', None,
50,
_("default number of peers to send an info message to if the "
"client does not specify a number")],
['save_dfile_interval', None,
5 * 60,
_("seconds between saving dfile")],
['scrape_allowed', None,
'full',
_("scrape access allowed (can be none, specific or full)")],
['show_infopage', None,
True,
_("whether to display an info page when the tracker's root dir "
"is loaded")],
['show_names', None,
True,
_("whether to display names from allowed dir")],
['socket_timeout', None,
15,
_("timeout for closing connections")],
['timeout_check_interval', None,
5,
_("time to wait between checking if any connections have timed out")],
['timeout_downloaders_interval', None,
45 * 60,
_("seconds between expiring downloaders")]
]
|