TaskPipe/TorManager/Settings.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 20 / 20 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
__ANON__
1.0
__ANON__
1.0
CRAP 1.0
« TaskPipe/ThreadManager/Settings.pm ↑ Summary TaskPipe/UserAgentManager/CheckIPSettings.pm »
1 package TaskPipe::TorManager::Settings;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 with 'MooseX::ConfigCascade';
5  
6 =head1 NAME
7  
8 TaskPipe::TorManager::Settings - settings for L<TaskPipe::TorManager>
9  
10 =head1 METHODS
11  
12 =over
13  
14 =item exec_name
15  
16 The name of the tor executable (usually 'tor')
17  
18 =cut
19  
20 1 has exec_name => (is => 'ro', isa => 'Str', default => 'tor');
21  
22  
23 =item process_name
24  
25 The name to identify tor processes on the database
26  
27 =cut
28  
29 1 has process_name => (is => 'ro', isa => 'Str', default => 'tor');
30  
31  
32 =item exec_opts
33  
34 A hash describing which tor option to get from which command line parameter
35  
36 =cut
37  
38 has exec_opts => (is => 'ro', isa => 'HashRef', default => sub{{
39 1 ▶ f => '-f',
Subroutine __ANON__: called CC=1 SCAR=0.0
40 ControlPort => "--ControlPort",
41 SocksPort => "--SocksPort",
42 DataDirectory => "--DataDirectory",
43 HashedControlPassword => "--HashedControlPassword",
44 "hash-password" => "--hash-password"
45 1 }});
46  
47  
48 =item kill_cmd
49  
50 The command used to kill tor processes
51  
52 =cut
53  
54 1 has kill_cmd => (is => 'ro', isa => 'Str', default => 'kill <pid>');
55  
56  
57 =item scheme
58  
59 The scheme to use to connect to tor
60  
61 =cut
62  
63 1 has scheme => (is => 'ro', isa => 'Str', default => 'socks');
64  
65  
66 =item ip
67  
68 The ip to use to connect to tor
69  
70 =cut
71  
72 1 has ip => (is => 'ro', isa => 'Str', default => '127.0.0.1');
73  
74  
75 =item base_port
76  
77 The lowest port number to use to connect to tor
78  
79 =cut
80  
81 1 has base_port => (is => 'ro', isa => 'Str', default => '9050');
82  
83  
84 =item config_path
85  
86 The path to the tor config (normally 'torrc')
87  
88 =cut
89  
90 1 has config_path => (is => 'ro', isa => 'Str', default => '/etc/tor/torrc');
91  
92  
93 =item protocols
94  
95 The protocols to proxy with tor
96  
97 =back
98  
99 =cut
100  
101 1 ▶has protocols => (is => 'ro', isa => 'ArrayRef', default => sub{['http','https']});
Subroutine __ANON__: called CC=1 SCAR=0.0
102  
103  
104 =head1 AUTHOR
105  
106 Tom Gracey <tomgracey@gmail.com>
107  
108 =head1 COPYRIGHT AND LICENSE
109  
110 Copyright (c) Tom Gracey 2018
111  
112 TaskPipe is free software, licensed under
113  
114 The GNU Public License Version 3
115  
116 =cut
117  
118  
119 1 __PACKAGE__->meta->make_immutable;
120 1 1;
« TaskPipe/ThreadManager/Settings.pm ↑ Summary TaskPipe/UserAgentManager/CheckIPSettings.pm »