spior 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e99a81242d64a4764fe159a89b0da69b2920e6a23669289e47c929c30aa9fb05
4
- data.tar.gz: 2b747268e80b4fe1925cd951943bf062f09ac17707ff97f6ae536ad4585af44d
3
+ metadata.gz: 9f1f4458f99b3d0d4f7aba4c35efab6dff475f11577b3b046b566321c584ea33
4
+ data.tar.gz: c66a056ab44299ec68cbb1878d5d3036281bf43f94aaa149ebc7c9e7b4490951
5
5
  SHA512:
6
- metadata.gz: e2db8f8b6f8af9627c74857a306e7b2bad22b95791b2cc6bcdf35e4d91be9b430aebc110bfc2372b3dbebd954c1429e2470995cff806d452aa92cf2fc5838f33
7
- data.tar.gz: 1547dadc53b9bb3ee702a39a6c801a2b5591a08324da4936c7b7debba1bc8a7f8619f107c24826a6294fdb3f4f97cf5a665bc70370cb5286a2e10ee57e0720c4
6
+ metadata.gz: ac80151ddbf3922be49e5c5d710aee4724c8730d781f00bd8c5fe550135d00389a2a92f04af89f32f102ac06c508f52631fa237206a4b1cff618f03e10f55791
7
+ data.tar.gz: 17137326682492dbdb896718ad78fe75cd99d65d97fc7ffd1baf4dd0c2ddb3ccdb67bc7cf6530c7b69175770ebd3faed70d94942993f4080ce2ca21d5df0fd9a
checksums.yaml.gz.sig CHANGED
Binary file
data/.gitignore CHANGED
@@ -10,7 +10,6 @@
10
10
  /test/tmp/
11
11
  /test/version_tmp/
12
12
  /tmp/
13
- Makefile
14
13
 
15
14
  # Used by dotenv library to load environment variables.
16
15
  # .env
data/README.md CHANGED
@@ -2,14 +2,6 @@
2
2
  (Spider|Tor). A tool to make TOR your default gateway and randomize your hardware (MAC).
3
3
  **Still under development !**
4
4
 
5
- ## Prerequisite
6
- Just a little tool for change the mac address in POSIX shell.
7
-
8
- $ curl -s -L -o deceitmac.tar.gz https://github.com/szorfein/deceitmac/archive/master.tar.gz
9
- $ tar xvf deceitmac-master
10
- $ cd deceitmac-master
11
- $ sudo make install
12
-
13
5
  ## Install
14
6
  Spior is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
15
7
 
@@ -19,10 +11,21 @@ And install the gem
19
11
 
20
12
  $ gem install spior -P MediumSecurity
21
13
 
14
+ ## Dependencies
15
+ You can install all the dependencies with:
16
+
17
+ $ spior --install
18
+
19
+ Please, post an issue if your linux distribution fail.
20
+
22
21
  ## Usage
23
22
 
24
23
  $ spior -h
25
- $ spior --install
24
+
25
+ ## Left Over
26
+
27
+ ### Issues
28
+ For any questions, comments, feedback or issues, submit a [new issue](https://github.com/szorfein/spior/issues/new).
26
29
 
27
30
  ### links
28
31
  + https://rubyreferences.github.io/rubyref
data/lib/spior/copy.rb ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+ require 'date'
5
+ require 'digest'
6
+ require_relative 'msg'
7
+
8
+ module Spior
9
+ class Copy
10
+
11
+ def self.config_files
12
+ copy_file("torrc", "/etc/tor/torrc")
13
+ copy_file("resolv.conf", "/etc/resolv.conf")
14
+ copy_file("ipt_mod.conf", "/etc/modules-load.d/ipt_mod.conf")
15
+ end
16
+
17
+ private
18
+
19
+ def self.copy_file(conf, target)
20
+ @config_file = "conf/#{conf}"
21
+ return if check_hash(target)
22
+ if File.exist? target then
23
+ print "Target #{target} exist, backup and replace? [N/y] "
24
+ choice = gets.chomp
25
+ if choice =~ /y|Y/ then
26
+ backup_file(target)
27
+ add_file target
28
+ end
29
+ else
30
+ add_file target
31
+ end
32
+ end
33
+
34
+ def self.check_hash(target)
35
+ return unless File.exist? target
36
+ sha256conf = Digest::SHA256.file @config_file
37
+ sha256target = Digest::SHA256.file target
38
+ if sha256conf === sha256target then
39
+ Msg.p "File #{target} alrealy exist, skip"
40
+ return true
41
+ end
42
+ return false
43
+ end
44
+
45
+ def self.backup_file(target)
46
+ d = DateTime.now
47
+ backup = target + ".backup-" + d.strftime('%b-%d_%I-%M')
48
+ system("sudo cp -a #{target} #{backup}")
49
+ puts "Renamed file #{backup}"
50
+ end
51
+
52
+ def self.add_file(target)
53
+ system("sudo cp -a #{@config_file} #{target}")
54
+ Msg.p "File #{@config_file} has been successfully copied at #{target}"
55
+ end
56
+ end
57
+ end
data/lib/spior/install.rb CHANGED
@@ -1,14 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'pathname'
4
- require 'date'
5
- require 'digest'
6
4
  require_relative 'msg'
7
5
 
8
6
  module Spior
9
7
  class Install
10
8
 
11
9
  def self.dependencies
10
+ base_packages
11
+ pkg_mac
12
+ end
13
+
14
+ private
15
+
16
+ def self.base_packages
12
17
  if Pathname.new("/usr/bin/emerge")
13
18
  puts "Install with emerge..."
14
19
  system('sudo emerge -av --changed-use tor iptables')
@@ -23,50 +28,32 @@ module Spior
23
28
  end
24
29
  end
25
30
 
26
- def self.config_files
27
- copy_file("torrc", "/etc/tor/torrc")
28
- copy_file("resolv.conf", "/etc/resolv.conf")
29
- copy_file("ipt_mod.conf", "/etc/modules-load.d/ipt_mod.conf")
30
- end
31
-
32
- private
33
-
34
- def self.copy_file(conf, target)
35
- @config_file = "conf/#{conf}"
36
- return if check_hash(target)
37
- if File.exist? target then
38
- print "Target #{target} exist, backup and replace? [N/y] "
31
+ def self.pkg_mac
32
+ pkg_name="deceitmac"
33
+ if File.exist?("/usr/local/bin/#{pkg_name}")
34
+ print "Target #{pkg_name} exist, update? [N/y] "
39
35
  choice = gets.chomp
40
36
  if choice =~ /y|Y/ then
41
- backup_file(target)
42
- add_file target
37
+ puts "Update #{pkg_name}..."
38
+ build_pkg(pkg_name)
43
39
  end
44
40
  else
45
- add_file target
46
- end
47
- end
48
-
49
- def self.check_hash(target)
50
- return unless File.exist? target
51
- sha256conf = Digest::SHA256.file @config_file
52
- sha256target = Digest::SHA256.file target
53
- if sha256conf === sha256target then
54
- Msg.p "File #{target} alrealy exist, skip"
55
- return true
41
+ puts "Install #{pkg_name}..."
42
+ build_pkg(pkg_name)
56
43
  end
57
- return false
58
44
  end
59
45
 
60
- def self.backup_file(target)
61
- d = DateTime.now
62
- backup = target + ".backup-" + d.strftime('%b-%d_%I-%M')
63
- system("sudo cp -a #{target} #{backup}")
64
- puts "Renamed file #{backup}"
46
+ def self.build_pkg(name)
47
+ system("rm -rf /tmp/#{name}*")
48
+ system("curl -L -o /tmp/#{name}.tar.gz https://github.com/szorfein/#{name}/archive/master.tar.gz")
49
+ Dir.chdir("/tmp")
50
+ system("tar xvf #{name}.tar.gz")
51
+ Dir.chdir("#{name}-master")
52
+ system("sudo make install")
53
+ Msg.p "pkg #{name} installed"
54
+ rescue => e
55
+ Msg.err e
65
56
  end
66
57
 
67
- def self.add_file(target)
68
- system("sudo cp -a #{@config_file} #{target}")
69
- Msg.p "File #{@config_file} has been successfully copied at #{target}"
70
- end
71
58
  end
72
59
  end
data/lib/spior/runner.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require_relative 'options'
2
2
  require_relative 'install'
3
+ require_relative 'copy'
3
4
  require_relative 'msg'
4
5
 
5
6
  module Spior
@@ -15,7 +16,7 @@ module Spior
15
16
  end
16
17
  if @options.copy then
17
18
  Msg.head
18
- Spior::Install::config_files
19
+ Spior::Copy::config_files
19
20
  end
20
21
  end
21
22
  end
data/spior.gemspec CHANGED
@@ -1,11 +1,14 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "spior"
3
- s.summary = "A tool to make TOR your default gateway"
4
- s.description = File.read(File.join(File.dirname(__FILE__), "README.md"))
5
- s.version = "0.0.2"
3
+
4
+ s.summary = "A tool to make TOR your default gateway and randomize your hardware"
5
+ s.description = "Status: not yet functionnal, please wait for the next releases !"
6
+
7
+ s.version = "0.0.3"
6
8
  s.requirements << 'tor'
7
9
  s.requirements << 'sudo'
8
10
  s.requirements << 'iptables'
11
+ s.requirements << 'deceitmac'
9
12
  s.platform = Gem::Platform::RUBY
10
13
  s.author = ['szorfein']
11
14
  s.homepage = 'https://github.com/szorfein/spior'
@@ -13,6 +16,7 @@ Gem::Specification.new do |s|
13
16
  s.required_ruby_version = '>=2.4'
14
17
  s.files = `git ls-files`.split(" ")
15
18
  s.files.reject! { |fn| fn.include? "certs" }
19
+ s.files.reject! { |fn| fn.include? "Makefile" }
16
20
  s.executables = [ 'spior' ]
17
21
  s.test_files = Dir["test/test_*.rb"]
18
22
  s.licenses = ['MIT']
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spior
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
@@ -35,7 +35,7 @@ cert_chain:
35
35
  J/zT/q2Ac7BWpSLbv6p9lChBiEnD9j24x463LR5QQjDNS5SsjzRQfFuprsa9Nqf2
36
36
  Tw==
37
37
  -----END CERTIFICATE-----
38
- date: 2020-05-02 00:00:00.000000000 Z
38
+ date: 2020-05-03 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rainbow
@@ -51,16 +51,7 @@ dependencies:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
53
  version: 3.0.0
54
- description: "# spior\n(Spider|Tor). A tool to make TOR your default gateway and randomize
55
- your hardware (MAC). \n**Still under development !**\n\n## Prerequisite\nJust a
56
- little tool for change the mac address in POSIX shell.\n\n $ curl -s -L -o deceitmac.tar.gz
57
- https://github.com/szorfein/deceitmac/archive/master.tar.gz\n $ tar xvf deceitmac-master\n
58
- \ $ cd deceitmac-master\n $ sudo make install\n\n## Install\nSpior is cryptographically
59
- signed, so add my public key (if you haven’t already) as a trusted certificate.\n\n
60
- \ $ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/spior/master/certs/szorfein.pem)\n\nAnd
61
- install the gem\n\n $ gem install spior -P MediumSecurity\n\n## Usage\n\n $
62
- spior -h\n $ spior --install\n\n### links\n+ https://rubyreferences.github.io/rubyref\n+
63
- https://rubystyle.guide/"
54
+ description: 'Status: not yet functionnal, please wait for the next releases !'
64
55
  email: szorfein@protonmail.com
65
56
  executables:
66
57
  - spior
@@ -78,6 +69,7 @@ files:
78
69
  - conf/sshd.conf
79
70
  - conf/sshuttle.service
80
71
  - conf/torrc
72
+ - lib/spior/copy.rb
81
73
  - lib/spior/install.rb
82
74
  - lib/spior/msg.rb
83
75
  - lib/spior/options.rb
@@ -108,10 +100,11 @@ requirements:
108
100
  - tor
109
101
  - sudo
110
102
  - iptables
103
+ - deceitmac
111
104
  rubygems_version: 3.1.2
112
105
  signing_key:
113
106
  specification_version: 4
114
- summary: A tool to make TOR your default gateway
107
+ summary: A tool to make TOR your default gateway and randomize your hardware
115
108
  test_files:
116
109
  - test/test_options.rb
117
110
  - test/test_install.rb
metadata.gz.sig CHANGED
Binary file