Class: Spior::Tor::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/spior/tor/data.rb

Overview

Data Fill Spior::CONFIG with data found on ‘/etc/tor/torrc` or set default.

Attributes

  • user - Username used by Tor on your distro, e.g ‘tor’ on Archlinux

  • dns_port - Open this port to listen for UDP DNS requests, and resolve them anonymously

  • uid - The uid value from the user attribute.

  • trans_port - Port to open to listen for transparent proxy connections.

  • virt_addr - Default use ‘10.192.0.0/10’.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeData

Returns a new instance of Data.



22
23
24
25
26
27
28
# File 'lib/spior/tor/data.rb', line 22

def initialize
  @user = search('User') || 'tor'
  @dns_port = search('DNSPort') || '9061'
  @trans_port = search('TransPort') || '9040'
  @virt_addr = search('VirtualAddrNetworkIPv4') || '10.192.0.0/10'
  @uid = search_uid || 0
end

Instance Attribute Details

#dns_portObject

Returns the value of attribute dns_port.



20
21
22
# File 'lib/spior/tor/data.rb', line 20

def dns_port
  @dns_port
end

#trans_portObject

Returns the value of attribute trans_port.



20
21
22
# File 'lib/spior/tor/data.rb', line 20

def trans_port
  @trans_port
end

#uidObject

Returns the value of attribute uid.



20
21
22
# File 'lib/spior/tor/data.rb', line 20

def uid
  @uid
end

#userObject

Returns the value of attribute user.



20
21
22
# File 'lib/spior/tor/data.rb', line 20

def user
  @user
end

#virt_addrObject

Returns the value of attribute virt_addr.



20
21
22
# File 'lib/spior/tor/data.rb', line 20

def virt_addr
  @virt_addr
end